Advertisement
Guest User

Dragon bone prayer

a guest
Jul 8th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1.  
  2. import org.parabot.environment.api.utils.Time;
  3. import org.parabot.environment.scripts.Category;
  4. import org.parabot.environment.scripts.Script;
  5. import org.parabot.environment.scripts.ScriptManifest;
  6. import org.parabot.environment.scripts.framework.LoopTask;
  7. import org.rev317.min.Loader;
  8. import org.rev317.min.api.methods.Bank;
  9. import org.rev317.min.api.methods.Inventory;
  10. import org.rev317.min.api.methods.Menu;
  11. import org.rev317.min.api.methods.SceneObjects;
  12. import org.rev317.min.api.wrappers.Item;
  13. import org.rev317.min.api.wrappers.SceneObject;
  14.  
  15. import ethan45.scripts.impopener.Timer;
  16.  
  17. @ScriptManifest(author = "Unknown User", category = Category.PRAYER, description = "Uses dragon bones", name = "Prayer", servers = { "Pkhonor" }, version = 1.0)
  18. public class Prayer extends Script implements LoopTask {
  19.  
  20. int DRAGON_BONES = 537;
  21.  
  22. Timer time = new Timer(2000);
  23.  
  24. public int loop() {
  25. Item[] Bone = Inventory.getItems(DRAGON_BONES);
  26. if (Bone.length > 0) {
  27. if(isBankOpen()) {
  28. Bank.close();
  29. Time.sleep(400);
  30. }
  31. System.out.println("Using bones on alter");
  32. // [index: 3, action1: 536, action2: 0, action3: 3214, id: 447]
  33. Menu.sendAction(447, 536, 0, 3214);
  34. Time.sleep(400);
  35. //[index: 1, action1: 1080449077, action2: 53, action3: 48, id: 62]
  36.  
  37. Menu.sendAction(62, 1080449077, 53, 48);
  38. Time.sleep(400);
  39. // [index: 1, action1: 6701056, action2: 261, action3: 2498, id: 315]
  40.  
  41. Menu.sendAction(315, 6701056, 261, 2498);
  42. Time.sleep(20000);
  43. }
  44. else {
  45.  
  46. if (Inventory.getCount() < 1) {
  47. // Banking
  48. if(isBankOpen()) {
  49. System.out.println("WithDrawing Bones");
  50. // [index: 1, action1: 17292, action2: 0, action3: 23412, id: 646]
  51. Menu.sendAction(646, DRAGON_BONES - 1, 0, 23412);
  52.  
  53. Time.sleep(400);
  54. Menu.sendAction(53, DRAGON_BONES - 1, 0, 5382);
  55. Time.sleep(400);
  56. // [index: 1, action1: 20905984, action2: 50, action3: 5384, id: 200]
  57. Menu.sendAction(200, 20905984, 50, 5384);
  58. Time.sleep(400);
  59. } else {
  60. System.out.println("Trying to open the bank.");
  61. SceneObject[] bank = SceneObjects.getNearest(2213);
  62. if(bank.length > 0) {
  63. bank[0].interact(0);
  64. time.reset();
  65. while(time.isRunning() && !isBankOpen()) {
  66. Time.sleep(50);
  67. }
  68. }
  69. }
  70. }
  71. }
  72.  
  73. return 50;
  74. }
  75.  
  76. public boolean isBankOpen() {
  77. return Loader.getClient().getOpenInterfaceId() == 23350;
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement