Guest User

Untitled

a guest
Jul 16th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.00 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3. import java.util.Map;
  4.  
  5. import org.rsbot.event.events.ServerMessageEvent;
  6. import org.rsbot.event.listeners.PaintListener;
  7. import org.rsbot.event.listeners.ServerMessageListener;
  8. import org.rsbot.script.Script;
  9. import org.rsbot.script.ScriptManifest;
  10. import org.rsbot.script.wrappers.RSObject;
  11. import org.rsbot.script.wrappers.RSTile;
  12.  
  13. @ScriptManifest(authors = { "Espz" }, category = "Other", name = "Espz's Gilded Boner", version = 1.0, description = "<html><head><style type='text/css'> hr {color: white} p {margin-left: 20px}</style></head><body><center><b><font size='6' color='red'>Gilded Boner v1.0</font></b><br><b><font size='4' color='red'>Written by Espz</font></b><br></center><center><table border='0'><tr><td colspan='2'><center><font size='4'><b>:: Script Settings ::</b></font></center></td></tr><br><center>Start this at the Yanille bank with the chosen bones in your inventory.<br><br><tr><td><b>Name of player with altar: </b></td><td><tr><td><br><input type=\"text\" name=\"nameOfUser\" value=\"\">What bones should we use? </td><br><td width=156 align=left class=style1><select name=bone><option>Normal Bones</option><option>Wolf Bones</option><option>Burnt Bones</option><option>Monkey Bones</option><option>Bat Bones</option><option>Big Bones</option><option>Jogre Bones</option><option>Zogre Bones</option><option>Shaikahan Bones</option><option>Babydragon Bones</option><option>Wyvern Bones</option><option>Dragon Bones</option><option>Fayrg Bones</option><option>Raurg Bones</option><option>Dagannoth Bones</option><option>Ourg Bones</option></select></center></body></html>")
  14. public class GildedBoner extends Script implements PaintListener,
  15. ServerMessageListener {
  16.  
  17. // SCRIPT MANIFEST:
  18. ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
  19.  
  20. // TILES:
  21. public RSTile[] BankToAltar = {new RSTile(2611, 3094), new RSTile(2596, 3099), new RSTile(2579, 3100), new RSTile(2565, 3091), new RSTile(2548, 3094), new RSTile(2544, 3096)};
  22. public RSTile[] AltarToBank = (reversePath(BankToAltar));
  23.  
  24. //BONES:
  25. public int BoneID;
  26. public String BoneCommand = "";
  27.  
  28. //BANK:
  29. public int B = 2213;
  30. public RSObject Bank = getNearestObjectByName("Bank booth");
  31.  
  32. //PORTAL:
  33. public int P = 15482;
  34. public RSObject Portal = getNearestObjectByID(P);
  35.  
  36. //USER WITH ALTAR:
  37. public String userWithAltar = "";
  38.  
  39. //ALTAR:
  40. public int[] GildedAltar = {13197};
  41.  
  42. //STATUS:
  43. public String Status = "";
  44.  
  45. //TIMERS:
  46. public long startTime = System.currentTimeMillis();
  47.  
  48. //COUNTERS:
  49. public int origExp = 0;
  50. public int origLvl = 0;
  51. public int bonesDone = 0;
  52.  
  53. public boolean onStart(Map<String, String> args) {
  54. userWithAltar = args.get("nameOfUser");
  55.  
  56. if (args.get("bone").equals("Normal Bones")) {
  57. BoneID = 526;
  58. BoneCommand = "Normal bones";
  59. }
  60. if (args.get("bone").equals("Wolf Bones")) {
  61. BoneID = 2859;
  62. BoneCommand = "Wolf bones";
  63. }
  64. if (args.get("bone").equals("Burnt Bones")) {
  65. BoneID = 528;
  66. BoneCommand = "Burnt bones";
  67. }
  68. if (args.get("bone").equals("Monkey Bones")) {
  69. BoneID = 3183;
  70. BoneCommand = "Monkey bones";
  71. }
  72. if (args.get("bone").equals("Bat Bones")) {
  73. BoneID = 530;
  74. BoneCommand = "Bat bones";
  75. }
  76. if (args.get("bone").equals("Big Bones")) {
  77. BoneID = 532;
  78. BoneCommand = "Big bones";
  79. }
  80. if (args.get("bone").equals("Jogre Bones")) {
  81. BoneID = 3125;
  82. BoneCommand = "Jogre bones";
  83. }
  84. if (args.get("bone").equals("Zogre Bones")) {
  85. BoneID = 4812;
  86. BoneCommand = "Zogre bones";
  87. }
  88. if (args.get("bone").equals("Shaikahan Bones")) {
  89. BoneID = 3123;
  90. BoneCommand = "Shaikahan bones";
  91. }
  92. if (args.get("bone").equals("Babydragon Bones")) {
  93. BoneID = 534;
  94. BoneCommand = "Babydragon bones";
  95. }
  96. if (args.get("bone").equals("Wvyern Bones")) {
  97. BoneID = 6812;
  98. BoneCommand = "Wvyern bones";
  99. }
  100. if (args.get("bone").equals("Dragon Bones")) {
  101. BoneID = 536;
  102. BoneCommand = "Dragon bones";
  103. }
  104. if (args.get("bone").equals("Fayrg Bones")) {
  105. BoneID = 4830;
  106. BoneCommand = "Fayrg bones";
  107. }
  108. if (args.get("bone").equals("Raurg Bones")) {
  109. BoneID = 4832;
  110. BoneCommand = "Raurg bones";
  111. }
  112. if (args.get("bone").equals("Dagannoth Bones")) {
  113. BoneID = 6729;
  114. BoneCommand = "Dagannoth bones";
  115. }
  116. if (args.get("bone").equals("Ourg Bones")) {
  117. BoneID = 4834;
  118. BoneCommand = "Ourg bones";
  119. }
  120.  
  121. startTime = System.currentTimeMillis();
  122. origExp = skills.getCurrentSkillExp(STAT_PRAYER);
  123. origLvl = skills.getCurrentSkillLevel(STAT_PRAYER);
  124.  
  125. return true;
  126. }
  127.  
  128. public void deposit() {
  129. if (getInventoryCountExcept(BoneID) > 0) {
  130. bank.depositAllExcept(BoneID);
  131. }
  132. wait(random(200, 400));
  133. }
  134.  
  135. public void withdraw() {
  136. if (bank.getCount(BoneID) == 0) {
  137. log("You have no bones in your bank.");
  138. Status = "Closing script.";
  139. bank.close();
  140. logout();
  141. stopAllScripts();
  142. }
  143. bank.withdraw(BoneID, 0);
  144. wait(random(800, 1000));
  145. if (getInventoryCount(BoneID) > 0) {
  146. bank.close();
  147. }
  148. }
  149.  
  150. public void bank() {
  151. if (!bank.isOpen()) {
  152. if (getMyPlayer().getAnimation() == -1) {
  153. atObject(Bank, "Use-Quickly");
  154. } else {
  155. bank.open();
  156. }
  157. wait(random(600, 800));
  158. } else {
  159. deposit();
  160. withdraw();
  161. }
  162. }
  163.  
  164. @Override
  165. public int loop() {
  166. if(isInventoryFull()){
  167. if(getNearestObjectByID(P) != null){
  168. Status = "Entering Portal";
  169. atObject(Portal, "Enter");
  170. wait(random(50, 200));
  171. moveMouse(random(182, 341), random(423, 438));
  172. wait(random(50, 200));
  173. clickMouse(true);
  174. wait(random(1000, 4500));
  175. Status = "Entering name";
  176. sendText(userWithAltar, true);
  177.  
  178. } else {
  179. walkPathMM(BankToAltar);
  180. }
  181.  
  182. } else if(!isInventoryFull()) {
  183. if(getNearestObjectByID(B) != null){
  184. Status = "Banking";
  185. bank();
  186.  
  187. } else {
  188. atObject(Portal, "Enter");
  189. Status = "Banking";
  190. walkPathMM(AltarToBank);
  191. }
  192.  
  193. } else if(getNearestObjectByID(GildedAltar) != null){
  194. atInventoryItem(BoneID, "Use");
  195. Status = "Boning";
  196. wait(random(10, 70));
  197. atObject(findObject(GildedAltar), BoneCommand);
  198. }
  199. return random(500, 800);
  200. }
  201.  
  202. public void onRepaint(Graphics Espz) {
  203.  
  204. long runTime = System.currentTimeMillis() - startTime;
  205. int secs = ((int) ((runTime / 1000) % 60));
  206. int mins = ((int) (((runTime / 1000) / 60) % 60));
  207. int hours = ((int) ((((runTime / 1000) / 60) / 60) % 60));
  208.  
  209. int x = 2;
  210. int y = 9;
  211.  
  212. Espz.setColor(Color.BLACK);
  213. Espz.fill3DRect(x, y, 180, 100, true);
  214. x += 5;
  215. y += 15;
  216. Espz.setColor(Color.WHITE);
  217. Espz.drawString(properties.name() + " v" + properties.version(), x, y);
  218. y += 30;
  219. Espz.drawString("Script run time: " + (hours < 10 ? "0" : "") + hours + ":" + (mins < 10 ? "0" : "") + mins + ":" + (secs < 10 ? "0" : "") + secs, x, y);
  220. y += 15;
  221. Espz.drawString("Status: " + Status, x, y);
  222. y += 15;
  223. Espz.drawString("Bones done: " + bonesDone, x, y);
  224. y += 15;
  225. x = 2;
  226. y = 129;
  227. Espz.setColor(Color.BLACK);
  228. Espz.fill3DRect(x, y, 180, 100, true);
  229. x += 5;
  230. y += 15;
  231. Espz.setColor(Color.CYAN);
  232. y += 20;
  233. Espz.drawString("Exp Gained: " + (skills.getCurrentSkillExp(STAT_PRAYER) - origExp), x, y);
  234. y += 15;
  235. Espz.drawString("Exp To Next Level: " + skills.getPercentToNextLevel(STAT_PRAYER), x, y);
  236. y += 15;
  237. Espz.drawString("Levels Gained: " + (skills.getCurrentSkillLevel(STAT_PRAYER) - origLvl), x, y);
  238. y += 15;
  239. }
  240.  
  241. @Override
  242. public void serverMessageRecieved(ServerMessageEvent Espz) {
  243. final String Text = Espz.getMessage().toLowerCase();
  244. if (Text.contains("The gods are very pleased with your offering.")) {
  245. bonesDone++;
  246. }
  247. }
  248. }
Add Comment
Please, Sign In to add comment