Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.parabot.environment.api.utils.Time;
- import org.parabot.environment.scripts.Category;
- import org.parabot.environment.scripts.Script;
- import org.parabot.environment.scripts.ScriptManifest;
- import org.parabot.environment.scripts.framework.LoopTask;
- import org.rev317.min.Loader;
- import org.rev317.min.api.methods.Bank;
- import org.rev317.min.api.methods.Inventory;
- import org.rev317.min.api.methods.Menu;
- import org.rev317.min.api.methods.SceneObjects;
- import org.rev317.min.api.wrappers.Item;
- import org.rev317.min.api.wrappers.SceneObject;
- import ethan45.scripts.impopener.Timer;
- @ScriptManifest(author = "Unknown User", category = Category.PRAYER, description = "Uses dragon bones", name = "Prayer", servers = { "Pkhonor" }, version = 1.0)
- public class Prayer extends Script implements LoopTask {
- int DRAGON_BONES = 537;
- Timer time = new Timer(2000);
- public int loop() {
- Item[] Bone = Inventory.getItems(DRAGON_BONES);
- if (Bone.length > 0) {
- if(isBankOpen()) {
- Bank.close();
- Time.sleep(400);
- }
- System.out.println("Using bones on alter");
- // [index: 3, action1: 536, action2: 0, action3: 3214, id: 447]
- Menu.sendAction(447, 536, 0, 3214);
- Time.sleep(400);
- //[index: 1, action1: 1080449077, action2: 53, action3: 48, id: 62]
- Menu.sendAction(62, 1080449077, 53, 48);
- Time.sleep(400);
- // [index: 1, action1: 6701056, action2: 261, action3: 2498, id: 315]
- Menu.sendAction(315, 6701056, 261, 2498);
- Time.sleep(20000);
- }
- else {
- if (Inventory.getCount() < 1) {
- // Banking
- if(isBankOpen()) {
- System.out.println("WithDrawing Bones");
- // [index: 1, action1: 17292, action2: 0, action3: 23412, id: 646]
- Menu.sendAction(646, DRAGON_BONES - 1, 0, 23412);
- Time.sleep(400);
- Menu.sendAction(53, DRAGON_BONES - 1, 0, 5382);
- Time.sleep(400);
- // [index: 1, action1: 20905984, action2: 50, action3: 5384, id: 200]
- Menu.sendAction(200, 20905984, 50, 5384);
- Time.sleep(400);
- } else {
- System.out.println("Trying to open the bank.");
- SceneObject[] bank = SceneObjects.getNearest(2213);
- if(bank.length > 0) {
- bank[0].interact(0);
- time.reset();
- while(time.isRunning() && !isBankOpen()) {
- Time.sleep(50);
- }
- }
- }
- }
- }
- return 50;
- }
- public boolean isBankOpen() {
- return Loader.getClient().getOpenInterfaceId() == 23350;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement