mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +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 PickupItems());
|
||||
}
|
||||
if(Variables.skill_to_train == Skill.PRAYER) {
|
||||
strategies.add(new Prayer());
|
||||
}
|
||||
|
||||
// These strategies should always be running
|
||||
strategies.add(new Drop());
|
||||
|
||||
@@ -228,4 +228,16 @@ public class Variables {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeBank(){
|
||||
Menu.sendAction(200, 440, 5, 5384, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ public class BuryBones implements Strategy {
|
||||
@Override
|
||||
public boolean activate() {
|
||||
if (Variables.running
|
||||
&& Variables.fighting_bury_bones
|
||||
&& hasBones()
|
||||
&& Variables.shouldBuryBones()
|
||||
// && !Players.getMyPlayer().isInCombat()
|
||||
// && Inventory.isFull()
|
||||
) {
|
||||
@@ -25,10 +25,10 @@ public class BuryBones implements Strategy {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
buryBones();
|
||||
BuryBones.buryBones();
|
||||
}
|
||||
|
||||
private void buryBones(){
|
||||
public static void buryBones(){
|
||||
try {
|
||||
getBones().interact(Items.Option.SECOND);
|
||||
Time.sleep(500);
|
||||
@@ -38,12 +38,12 @@ public class BuryBones implements Strategy {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasBones(){
|
||||
public static boolean hasBones(){
|
||||
// Make sure we have bones
|
||||
return getBones() != null;
|
||||
}
|
||||
|
||||
private Item getBones(){
|
||||
public static Item getBones(){
|
||||
// Make sure we have bones
|
||||
for (int bone_id : getBoneIds()) {
|
||||
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
|
||||
public boolean activate() {
|
||||
if (Bank.isOpen()) {
|
||||
Variables.setStatus("Saving Bank");
|
||||
// Variables.setStatus("Saving Bank");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -24,6 +24,7 @@ public class UpdateBank implements Strategy {
|
||||
Variables.bank_items = Bank.getBankItemIDs();
|
||||
Time.sleep(500);
|
||||
saveBankFile();
|
||||
// Variables.setStatus("none");
|
||||
}
|
||||
|
||||
private static String getfileName(){
|
||||
|
||||
@@ -141,6 +141,7 @@ public class UI extends JFrame {
|
||||
Skill.THIEVING.getName(),
|
||||
Skill.FISHING.getName(),
|
||||
// Skill.CRAFTING.getName(),
|
||||
Skill.PRAYER.getName(),
|
||||
"Bank Runner",
|
||||
}));
|
||||
skillSelect.setBounds(20, 40, 150, 20);
|
||||
|
||||
Reference in New Issue
Block a user