Guest User

Untitled

a guest
Jun 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.37 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3. import java.util.Map;
  4.  
  5. import com.speljohan.rsbot.bot.Bot;
  6. import com.speljohan.rsbot.event.listeners.PaintListener;
  7. import com.speljohan.rsbot.script.Constants;
  8. import com.speljohan.rsbot.script.Script;
  9. import com.speljohan.rsbot.script.wrappers.RSNPC;
  10. import com.speljohan.rsbot.script.wrappers.RSObject;
  11.  
  12. public class btpmakerpro extends Script implements PaintListener {
  13.  
  14. public int lectern = 13648;
  15. public int softclay = 1761;
  16. public int studyAnimation = 3652;
  17. public int dButler = 4243;
  18. public int materials[] = {561, 995};
  19. public int tabs = 8015;
  20.  
  21. Color BG = new Color(123, 123, 123, 100);
  22.  
  23. Color GREEN = new Color(0, 255, 0, 255);
  24.  
  25. Color RED = new Color(255, 0, 0, 255);
  26.  
  27. Color BLACK = new Color(0, 0, 0, 255);
  28.  
  29. int startingxp = -1;
  30.  
  31. int startingtabs = -1;
  32.  
  33. long startTime = -1;
  34.  
  35.  
  36. public String getName(){
  37. return "Peach Boner";
  38. }
  39.  
  40. public String getAuthor(){
  41. return "Jope";
  42. }
  43.  
  44. public String getScriptCategory(){
  45. return "Money";
  46. }
  47.  
  48. public double getVersion(){
  49. return 1.1;
  50. }
  51. public String getScriptDescription() {
  52.  
  53. String send = " <html> <head> <style> body {text-align:center; } i {color: blue;} h2 {text-align:right; color: red;} </style> </head> <body> <h2>" + getName() + " v"+getVersion()+"</h2> <br/>";
  54.  
  55. send += " Setup at start: <br/> ";
  56.  
  57. send += " Stand in front of the lectern with coins, nats and 26 clays in inventory. <br/> ";
  58.  
  59. send += " Have 25 clays on Demon butler next to you and move camera behind you as high as it goes. <br/>";
  60.  
  61. send += " Close all the doors so the butler spawns in the room. <br/>";
  62. return send;
  63.  
  64. }
  65.  
  66. @Override
  67. public boolean onStart(final Map<String, String> args) {
  68. startingxp = -1;
  69. startTime = -1;
  70. return true;
  71. }
  72.  
  73. @Override
  74. public void onFinish() {
  75. Bot.getEventManager().removeListener(PaintListener.class, this);
  76. }
  77.  
  78. public int loop() {
  79. if(getMyPlayer().isMoving()){
  80. if(getInventoryCount(softclay) >= 1)
  81. wait(random(4000, 5000));
  82. RSObject molo2 = findObject(lectern);
  83. if(molo2 == null) return 800;
  84.  
  85. atObject(molo2, null);
  86. clickMouse(true);
  87. wait(random(4500, 5000));
  88. moveMouse(random(501, 506), random(17, 20));
  89. wait(random(50, 150));
  90. clickMouse(true);
  91. wait(random(250, 500));
  92. return 800;
  93. }
  94.  
  95. if(getMyPlayer().getAnimation() == studyAnimation){
  96. return 800;
  97. }
  98. if(getInventoryCount(materials) < 10){
  99. log("outta materials, logging out");
  100. logout();
  101. stopAllScripts();
  102. return 800;
  103. }
  104.  
  105. RSObject molo = findObject(lectern);
  106. if(molo == null) return 800;
  107.  
  108. atObject(molo, null);
  109. wait(random(20, 50));
  110. clickMouse(true);
  111. wait(random(1550, 1650));
  112.  
  113. moveMouse(random(402, 418), random(268, 253));
  114. wait(random(150, 200));
  115. clickMouse(true);
  116. if(getInventoryCount(softclay) == 1){
  117. wait(random(500, 1000));
  118. RSNPC butler = getNearestFreeNPCByID(dButler);
  119. if(butler == null) return 800;
  120.  
  121. atNPC(butler, null);
  122. clickMouse(true);
  123. wait(random(3250, 3500));
  124. RSNPC butler2 = getNearestFreeNPCByID(dButler);
  125. if(butler2 == null) return 800;
  126.  
  127. atNPC(butler2, null);
  128. clickMouse(true);
  129. wait(random(800, 1100));
  130. if(getInventoryCount(softclay) == 0){
  131. moveMouse(random(274, 336), random(455, 457));
  132. clickMouse(true);
  133. moveMouse(random(225, 301), random(397, 396));
  134. wait(random(1200, 1500));
  135. clickMouse(true);
  136. RSNPC butler3 = getNearestFreeNPCByID(dButler);
  137. if(butler3 == null) return 800;
  138.  
  139. atNPC(butler3, null);
  140. clickMouse(true);
  141. wait(random(800, 950));
  142. RSNPC butler4 = getNearestFreeNPCByID(dButler);
  143. if(butler4 == null) return 800;
  144.  
  145. atNPC(butler4, null);
  146. clickMouse(true);
  147. wait(random(20, 150));
  148. moveMouse(random(275, 337), random(456, 458));
  149. wait(random(900, 1200));
  150. clickMouse(true);
  151. wait(random(900, 1300));
  152. moveMouse(random(240, 273), random(406, 407));
  153. clickMouse(true);
  154. wait(random(900, 1300));
  155. moveMouse(random(214, 302), random(434, 436));
  156. clickMouse(true);
  157. wait(random(900, 1300));
  158. moveMouse(random(186, 243), random(456, 455));
  159. clickMouse(true);
  160. wait(random(900, 1300));
  161. moveMouse(random(266, 336), random(456, 457));
  162. clickMouse(true);
  163. wait(random(900, 1300));
  164. moveMouse(random(246, 271), random(458, 457));
  165. clickMouse(true);
  166. wait(random(900, 1300));
  167. moveMouse(random(241, 274), random(390, 391));
  168. clickMouse(true);
  169. wait(random(1200, 1500));
  170. input.sendKeys("25", true);
  171. wait(random(1300, 1600));
  172. moveMouse(random(257, 340), random(456, 455));
  173. clickMouse(true);
  174. wait(random(200, 300));
  175. RSObject molo2 = findObject(lectern);
  176. if(molo2 == null) return 800;
  177.  
  178. atObject(molo2, null);
  179. clickMouse(true);
  180. wait(random(4500, 5000));
  181. moveMouse(random(501, 506), random(17, 20));
  182. wait(random(50, 150));
  183. clickMouse(true);
  184. wait(random(2750, 3250));
  185. } else {
  186. moveMouse(random(275, 337), random(456, 458));
  187. wait(random(300, 400));
  188. clickMouse(true);
  189. wait(random(900, 1300));
  190. moveMouse(random(240, 273), random(406, 407));
  191. clickMouse(true);
  192. wait(random(900, 1300));
  193. moveMouse(random(214, 302), random(434, 436));
  194. clickMouse(true);
  195. wait(random(900, 1300));
  196. moveMouse(random(186, 243), random(456, 455));
  197. clickMouse(true);
  198. wait(random(900, 1300));
  199. moveMouse(random(266, 336), random(456, 457));
  200. clickMouse(true);
  201. wait(random(900, 1300));
  202. moveMouse(random(246, 271), random(458, 457));
  203. clickMouse(true);
  204. wait(random(900, 1300));
  205. moveMouse(random(241, 274), random(390, 391));
  206. clickMouse(true);
  207. wait(random(1300, 1600));
  208. input.sendKeys("25", true);
  209. wait(random(1400, 1700));
  210. moveMouse(random(257, 340), random(456, 455));
  211. clickMouse(true);
  212. wait(random(100, 200));
  213. RSObject molo3 = findObject(lectern);
  214. if(molo3 == null) return 800;
  215.  
  216. atObject(molo3, null);
  217. clickMouse(true);
  218. wait(random(100, 300));
  219. moveMouse(random(501, 506), random(17, 20));
  220. wait(random(4500, 5000));
  221. clickMouse(true);
  222. wait(random(2750, 3250));
  223. }
  224. }
  225. return 700;
  226. }
  227.  
  228. public void onRepaint(final Graphics g) {
  229. if (isLoggedIn()) {
  230. if (startingxp == -1) {
  231. startingxp = skills.getCurrentSkillExp(Constants.STAT_MAGIC);
  232. startTime = System.currentTimeMillis();
  233. }
  234. if (startingtabs == -1) {
  235. startingtabs = getInventoryCount(tabs);
  236. startTime = System.currentTimeMillis();
  237. }
  238.  
  239. long millis = System.currentTimeMillis() - startTime;
  240. final long seconds2 = millis / 1000;
  241. final long hours = millis / (1000 * 60 * 60);
  242. millis -= hours * 1000 * 60 * 60;
  243. final long minutes = millis / (1000 * 60);
  244. millis -= minutes * 1000 * 60;
  245. final long seconds = millis / 1000;
  246. String hoursString = "";
  247. String minutesString = "";
  248. String secondsString = seconds + "";
  249. String type = "seconds";
  250. if (minutes > 0) {
  251. minutesString = minutes + ":";
  252. type = "minutes";
  253. }
  254. if (hours > 0) {
  255. hoursString = hours + ":";
  256. type = "hours";
  257. }
  258. if (minutesString.length() == 1) {
  259. minutesString = "0" + minutesString;
  260. }
  261. if (hoursString.length() == 1) {
  262. hoursString = "0" + hoursString;
  263. }
  264. if (secondsString.length() == 1) {
  265. secondsString = "0" + secondsString;
  266. }
  267. final int x = 18;
  268. int y = 18;
  269. g.setColor(BG);
  270. g.fill3DRect(14, 25, 210, 140, true);
  271. g.setColor(BLACK);
  272. g.drawString(
  273. getName() + " v" + getVersion() + " by " + getAuthor(), x,
  274. y += 20);
  275. g.drawString("Running for " + hoursString + minutesString
  276. + secondsString + " " + type + ".", x, y += 20);
  277. g.setColor(BLACK);
  278. g
  279. .drawString(
  280. "Gained "
  281. + (skills
  282. .getCurrentSkillExp(Constants.STAT_MAGIC) - startingxp)
  283. + " experience.", x, y += 20);
  284. g.setColor(RED);
  285. if (seconds2 != 0) {
  286. g
  287. .drawString(
  288. "Averaging "
  289. + (skills
  290. .getCurrentSkillExp(Constants.STAT_MAGIC) - startingxp)
  291. * 3600 / seconds2
  292. + " experience per hour.", x, y += 20);
  293. }
  294. g.setColor(RED);
  295. g
  296. .drawString(
  297. "Averaging "
  298. + (getInventoryCount(tabs) - startingtabs)
  299. * 3600 / seconds2
  300. + " tabs per hour.", x, y += 20);
  301.  
  302. g.setColor(RED);
  303. g
  304. .drawString(
  305. "Averaging "
  306. + (getInventoryCount(tabs) - startingtabs) * 417
  307. * 3600 / seconds2
  308. + " gps per hour.", x, y += 20);
  309.  
  310. g.setColor(BLACK);
  311. g.drawString("Tabs: " + (getInventoryCount(tabs) - startingtabs) + (" | Profit: ") + (getInventoryCount(tabs) - startingtabs) * 417 + " gps.", x, y += 20);
  312.  
  313. }
  314.  
  315. }
  316. }
Add Comment
Please, Sign In to add comment