Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. package osbotOS;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Collections;
  5.  
  6. import org.osbot.rs07.script.Script;
  7. import org.osbot.rs07.script.ScriptManifest;
  8.  
  9. import Methods.Core;
  10.  
  11. //imports omitted
  12. @ScriptManifest(author = "Elliott", info = "shitty fire crafter", name = "Freaky Fast Abyss", version = 1.0, logo = "")
  13. public class MainCrafter extends Script {
  14.  
  15. public ArrayList<Node> nodes = new ArrayList<>();
  16. public Core coreMethods = new Core();
  17. public ActivityInBank inBankNode;
  18. public ActivityOutOfBank outOfBankNode;
  19.  
  20. @Override
  21. public void onStart() {
  22.  
  23. int eatAt = 60;
  24. boolean[] pouchesInUse = new boolean[] { true, true, true, false };
  25. int foodID = 7946; //monk
  26. int tabAmount = 10;
  27. int foodHeals = 16;
  28. boolean usingGlories = false;
  29. boolean usingPrayer = true;
  30. boolean usingStam = true;
  31. boolean usingTabs = true;
  32.  
  33. this.inBankNode = new ActivityInBank(this);
  34. this.outOfBankNode = new ActivityOutOfBank(this);
  35.  
  36. this.setSettings(eatAt, pouchesInUse, usingTabs, usingGlories,
  37. tabAmount, usingPrayer, usingStam, foodID, foodHeals);
  38. Collections.addAll(this.nodes, this.inBankNode, this.outOfBankNode); //add all nodes to the ArrayList
  39. }
  40.  
  41. private void setSettings(int eatAt, boolean[] pouchesInUse,
  42. boolean usingGlories, boolean usingTabs, int tabAmount,
  43. boolean usingPrayer, boolean usingStam, int foodID, int foodHeals) {
  44.  
  45. this.inBankNode.eatAt = eatAt; //user defined from UI eventually;
  46. this.inBankNode.usingGlory = usingGlories;
  47. this.inBankNode.usingTabs = usingTabs;
  48. this.inBankNode.tabAmount = tabAmount;
  49. this.inBankNode.usingStam = usingStam;
  50. this.inBankNode.foodID = foodID;
  51. this.inBankNode.foodHeals = foodHeals;
  52.  
  53. this.outOfBankNode.pouchesInUse[0] = pouchesInUse[0];
  54. this.outOfBankNode.pouchesInUse[1] = pouchesInUse[1];
  55. this.outOfBankNode.pouchesInUse[2] = pouchesInUse[2];
  56. this.outOfBankNode.pouchesInUse[3] = pouchesInUse[3];
  57. }
  58.  
  59. @Override
  60. public int onLoop() throws InterruptedException {
  61. for (final Node node : this.nodes) { //loop through the nodes
  62. if (node.validate()) { //validate each node
  63. node.execute(); //execute
  64. this.coreMethods.waitTime(this.coreMethods.rand(10, 50)); //prevents us from going through the logic as fast as we possibly can
  65. }
  66. }
  67. return this.coreMethods.rand(50, 100);
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement