mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-03 00:38:36 +00:00
Initial prayer
This commit is contained in:
@@ -80,6 +80,9 @@ public class Main extends Script implements MessageListener, Paintable {
|
|||||||
strategies.add(new Walk());
|
strategies.add(new Walk());
|
||||||
strategies.add(new PickupItems());
|
strategies.add(new PickupItems());
|
||||||
}
|
}
|
||||||
|
if(Variables.skill_to_train == Skill.PRAYER) {
|
||||||
|
strategies.add(new Prayer());
|
||||||
|
}
|
||||||
|
|
||||||
// These strategies should always be running
|
// These strategies should always be running
|
||||||
strategies.add(new Drop());
|
strategies.add(new Drop());
|
||||||
|
|||||||
@@ -228,4 +228,16 @@ public class Variables {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean shouldBuryBones(){
|
||||||
|
if (skill_to_train == null) return true;
|
||||||
|
switch (skill_to_train.getName()){
|
||||||
|
case "Prayer":
|
||||||
|
return true;
|
||||||
|
case "Attack":
|
||||||
|
return Variables.fighting_bury_bones;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,4 +121,8 @@ public class Bank implements Strategy {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void closeBank(){
|
||||||
|
Menu.sendAction(200, 440, 5, 5384, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ public class BuryBones implements Strategy {
|
|||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
if (Variables.running
|
if (Variables.running
|
||||||
&& Variables.fighting_bury_bones
|
|
||||||
&& hasBones()
|
&& hasBones()
|
||||||
|
&& Variables.shouldBuryBones()
|
||||||
// && !Players.getMyPlayer().isInCombat()
|
// && !Players.getMyPlayer().isInCombat()
|
||||||
// && Inventory.isFull()
|
// && Inventory.isFull()
|
||||||
) {
|
) {
|
||||||
@@ -25,10 +25,10 @@ public class BuryBones implements Strategy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
buryBones();
|
BuryBones.buryBones();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buryBones(){
|
public static void buryBones(){
|
||||||
try {
|
try {
|
||||||
getBones().interact(Items.Option.SECOND);
|
getBones().interact(Items.Option.SECOND);
|
||||||
Time.sleep(500);
|
Time.sleep(500);
|
||||||
@@ -38,12 +38,12 @@ public class BuryBones implements Strategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasBones(){
|
public static boolean hasBones(){
|
||||||
// Make sure we have bones
|
// Make sure we have bones
|
||||||
return getBones() != null;
|
return getBones() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Item getBones(){
|
public static Item getBones(){
|
||||||
// Make sure we have bones
|
// Make sure we have bones
|
||||||
for (int bone_id : getBoneIds()) {
|
for (int bone_id : getBoneIds()) {
|
||||||
if (Inventory.getItem(bone_id + 1) != null) {
|
if (Inventory.getItem(bone_id + 1) != null) {
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package ParaScript.strategies;
|
||||||
|
|
||||||
|
import ParaScript.data.Variables;
|
||||||
|
|
||||||
|
import org.parabot.environment.api.utils.Time;
|
||||||
|
import org.parabot.environment.scripts.framework.Strategy;
|
||||||
|
import org.rev317.min.api.methods.*;
|
||||||
|
|
||||||
|
public class Prayer implements Strategy {
|
||||||
|
// TODO: implement ectofuntus method
|
||||||
|
// TODO: check if player has ectophial in bank, make use of it
|
||||||
|
// TODO: check if agility level high enough, use shortcut
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean activate() {
|
||||||
|
if (Variables.running
|
||||||
|
&& Game.isLoggedIn()
|
||||||
|
&& (Variables.getStatus() == "none" || Variables.getStatus() == "withdrawing bones" || Variables.getStatus() == "closing bank" || Variables.getStatus() == "burying bones")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Variables.setStatus("none");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
Variables.setStatus("withdrawing bones");
|
||||||
|
Bank.openBank();
|
||||||
|
// TODO: allow player to select which bones they want to make use of
|
||||||
|
Bank.withdrawItem(536, -1);
|
||||||
|
Time.sleep(500);
|
||||||
|
Variables.setStatus("closing bank");
|
||||||
|
Bank.closeBank();
|
||||||
|
Time.sleep(500);
|
||||||
|
Variables.setStatus("burying bones");
|
||||||
|
BuryBones.buryBones();
|
||||||
|
Variables.setStatus("none");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ public class UpdateBank implements Strategy {
|
|||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
if (Bank.isOpen()) {
|
if (Bank.isOpen()) {
|
||||||
Variables.setStatus("Saving Bank");
|
// Variables.setStatus("Saving Bank");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -24,6 +24,7 @@ public class UpdateBank implements Strategy {
|
|||||||
Variables.bank_items = Bank.getBankItemIDs();
|
Variables.bank_items = Bank.getBankItemIDs();
|
||||||
Time.sleep(500);
|
Time.sleep(500);
|
||||||
saveBankFile();
|
saveBankFile();
|
||||||
|
// Variables.setStatus("none");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getfileName(){
|
private static String getfileName(){
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ public class UI extends JFrame {
|
|||||||
Skill.THIEVING.getName(),
|
Skill.THIEVING.getName(),
|
||||||
Skill.FISHING.getName(),
|
Skill.FISHING.getName(),
|
||||||
// Skill.CRAFTING.getName(),
|
// Skill.CRAFTING.getName(),
|
||||||
|
Skill.PRAYER.getName(),
|
||||||
"Bank Runner",
|
"Bank Runner",
|
||||||
}));
|
}));
|
||||||
skillSelect.setBounds(20, 40, 150, 20);
|
skillSelect.setBounds(20, 40, 150, 20);
|
||||||
|
|||||||
Reference in New Issue
Block a user