Advertisement
Guest User

DClay.java

a guest
Jul 4th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 71.08 KB | None | 0 0
  1. package scripts;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Color;
  5. import java.awt.Container;
  6. import java.awt.Desktop;
  7. import java.awt.Font;
  8. import java.awt.Graphics;
  9. import java.awt.Graphics2D;
  10. import java.awt.GridBagConstraints;
  11. import java.awt.GridBagLayout;
  12. import java.awt.Image;
  13. import java.awt.Insets;
  14. import java.awt.RenderingHints;
  15.  
  16. import org.tribot.api.DynamicClicking;
  17. import org.tribot.api.General;
  18. import org.tribot.api.input.Mouse;
  19. import org.tribot.api2007.Banking;
  20. import org.tribot.api2007.Camera;
  21. import org.tribot.api2007.Combat;
  22. import org.tribot.api2007.Equipment;
  23. import org.tribot.api2007.GameTab;
  24. import org.tribot.api2007.GroundItems;
  25. import org.tribot.api2007.Interfaces;
  26. import org.tribot.api2007.Inventory;
  27. import org.tribot.api2007.Login;
  28. import org.tribot.api2007.NPCs;
  29. import org.tribot.api2007.Objects;
  30. import org.tribot.api2007.Player;
  31. import org.tribot.api2007.Skills;
  32. import org.tribot.api2007.Walking;
  33. import org.tribot.api2007.WorldHopper;
  34. import org.tribot.api2007.ext.Doors;
  35. import org.tribot.api2007.GameTab.TABS;
  36. import org.tribot.api2007.Skills.SKILLS;
  37. import org.tribot.api2007.types.RSGroundItem;
  38. import org.tribot.api2007.types.RSItem;
  39. import org.tribot.api2007.types.RSNPC;
  40. import org.tribot.api2007.types.RSObject;
  41. import org.tribot.api2007.types.RSTile;
  42. import org.tribot.script.Script;
  43. import org.tribot.script.ScriptManifest;
  44. import org.tribot.script.interfaces.MessageListening07;
  45. import org.tribot.script.interfaces.Painting;
  46.  
  47. import scripts.DTools.DAntiban;
  48. import scripts.DTools.Newsloader;
  49.  
  50. import java.awt.event.*;
  51. import java.io.IOException;
  52. import java.net.MalformedURLException;
  53. import java.net.URI;
  54. import java.net.URISyntaxException;
  55. import java.net.URL;
  56. import java.util.ArrayList;
  57.  
  58. import javax.imageio.ImageIO;
  59. import javax.swing.*;
  60. import javax.swing.border.EmptyBorder;
  61. @ScriptManifest(authors = { "TheD" }, category = "TheDScripts", name = "DClay", description = "DScripting - Settings in GUI")
  62. public class DClay extends Script implements Painting, MessageListening07
  63. {
  64. private int taskToDo = 0;
  65. RSTile[] pos = {
  66. new RSTile(3180,3371,0), new RSTile(3183,3378,0)
  67. , new RSTile(2631,3139,0), new RSTile(3054,9818,0)} ;
  68. RSTile[] ore_locations = {
  69. new RSTile(3180,3372,0), new RSTile(3179,3371,0), new RSTile(3183,3377,0), new RSTile(0000,0000,0),
  70. new RSTile(3054,9819,0), new RSTile(3053,9818,0)};
  71. private int ore_nr = 0;
  72. private int locUsing = 0;
  73. private int softClayMade = 0;
  74. private boolean stopinteraction = false;
  75. private int dangerousRock = 0;
  76. private int randomState = 0;
  77. private boolean can_kill_mugger = false;
  78. private String debug = "Debug";
  79. private int pathLocation;
  80. private State scriptState = State.MINE;
  81. private WettingState wState = WettingState.W_WAIT;
  82. private int tactiCal = 0;
  83. private final long startTime = System.currentTimeMillis();
  84. private long startTime_switch = System.currentTimeMillis();
  85. private long startTime_switch2 = System.currentTimeMillis();
  86. private long Start_XP = Skills.getXP(SKILLS.MINING);
  87. private long Current_XP = Skills.getXP(SKILLS.MINING);
  88. private int[] pickaxes = {1265,1267,1269,1271,1273,1275,12297};
  89. private int Mypickaxe = 0;
  90. private long startNewsTime = System.currentTimeMillis();
  91. //Paint variable start
  92. private int xpGot = 0;
  93. private int clayMined = 0;
  94. private int timeRan = 0;
  95. private double multiplier = 0;
  96. private int hours = 0;
  97. private int minutes = 0;
  98. private int seconds = 0;
  99. private int clayPH = 0;
  100. private int softclayPH = 0;
  101. //Paint variable end
  102. private int hop_when = 0;
  103. private boolean isMember = false;
  104.  
  105. private final Font font2 = new Font("Arial", Font.BOLD, 14);
  106. private final Font font3 = new Font("Arial", 1, 16);
  107. private boolean GUIWait = true;
  108. private GUI g = new GUI();
  109. private ArrayList<String> latestNews = new ArrayList<String>();
  110. private boolean useMajorAB = false;
  111. ArrayList<String> thechat = new ArrayList<String>();
  112. private int softenloc = 0;
  113. private String locuse = "";
  114. private boolean count_incr = true;
  115. private int curr_count = 0;
  116. private boolean can_mine = false;
  117. private boolean skipWait = false;
  118. private boolean is_in_respawn = false;
  119. private boolean is_in_spawn = false;
  120. private int start_clay = 0;
  121. private boolean first_time_set_clay = false;
  122. private boolean isInLumby = false;
  123. private boolean isAtReSpawn = false;
  124. private boolean pickeq = false;
  125.  
  126. private boolean end_after_time = false;
  127. private int end_hour = 0;
  128. private int end_minute = 0;
  129. private int end_second = General.random(1, 59);
  130. private boolean equippick = false;
  131.  
  132.  
  133. private final RSTile[] PATH_TO_BANK = {
  134. new RSTile(3184,3376,0), new RSTile(3178,3381,0),
  135. new RSTile(3173,3388,0), new RSTile(3168,3396,0),
  136. new RSTile(3168,3406,0), new RSTile(3170,3415,0),
  137. new RSTile(3170,3423,0), new RSTile(3178,3429,0),
  138. new RSTile(3183,3439,0)};
  139.  
  140. private final RSTile[] PATH_TO_BANK2 = {
  141. new RSTile(3175,3387,0), new RSTile(3170,3399,0),
  142. new RSTile(3170,3412,0), new RSTile(3171,3426,0),
  143. new RSTile(3179,3428,0), new RSTile(3183,3439,0)};
  144.  
  145. private final RSTile[] PATH_TO_MINE = {
  146. new RSTile(3175,3428,0), new RSTile(3171,3415,0),
  147. new RSTile(3169,3402,0), new RSTile(3174,3390,0),
  148. new RSTile(3178,3383,0), new RSTile(3182,3370,0)};
  149.  
  150. private final RSTile[] PATH_TO_MINE2 = {
  151. new RSTile(3178,3428,0), new RSTile(3170,3422,0),
  152. new RSTile(3170,3408,0), new RSTile(3172,3394,0),
  153. new RSTile(3177,3383,0), new RSTile(3183,3378,0)};
  154.  
  155. private final RSTile[] W_PATH_TO_WELL = {
  156. new RSTile(3024,3359,0), new RSTile(3032,3358,0),
  157. new RSTile(3038,3352,0)};
  158.  
  159. private final RSTile[] W_PATH_TO_BANK = {
  160. new RSTile(3030,3357,0), new RSTile(3022,3360,0),
  161. new RSTile(3013,3356,0)};
  162.  
  163. private final RSTile[] YAN_PATH_TO_BANK = {
  164. new RSTile(2628,3129,0), new RSTile(2629,3122,0),
  165. new RSTile(2621,3115,0), new RSTile(2617,3105,0),
  166. new RSTile(2608,3099,0), new RSTile(2610,3094,0)};
  167.  
  168. private final RSTile[] YAN_PATH_TO_MINE = {
  169. new RSTile(2615,3104,0), new RSTile(2616,3111,0),
  170. new RSTile(2621,3116,0), new RSTile(2625,3123,0),
  171. new RSTile(2629,3129,0), new RSTile(2629,3136,0)};
  172.  
  173. private final RSTile[] PATH_TO_STAIRS = {
  174. new RSTile(3045,9813,0), new RSTile(3043,9803,0),
  175. new RSTile(3043,9791,0), new RSTile(3049,9781,0),
  176. new RSTile(3057,9777,0)};
  177.  
  178. private final RSTile[] PATH_TO_FALLY_BANK = {
  179. new RSTile(3053,3365,0), new RSTile(3044,3358,0),
  180. new RSTile(3032,3357,0), new RSTile(3022,3360,0),
  181. new RSTile(3013,3356,0)};
  182.  
  183. private final RSTile[] PATH_TO_HOUSE = {
  184. new RSTile(3021,3361,0), new RSTile(3030,3365,0),
  185. new RSTile(3043,3369,0), new RSTile(3055,3368,0),
  186. new RSTile(3061,3372,0)};
  187.  
  188. private final RSTile[] FAL_PATH_TO_MINE = {
  189. new RSTile(3051,9781,0), new RSTile(3046,9788,0),
  190. new RSTile(3043,9797,0), new RSTile(3044,9806,0),
  191. new RSTile(3048,9815,0), new RSTile(3054,9818,0)};
  192.  
  193. private final RSTile[] PATH_TO_SPAWN = {
  194. new RSTile(3226,3218,0), new RSTile(3235,3220,0),
  195. new RSTile(3233,3231,0)};
  196.  
  197. private final RSTile[] PATH_TO_FALADOR_BANK = {
  198. new RSTile(3225,3235,0), new RSTile(3216,3240,0),
  199. new RSTile(3203,3243,0), new RSTile(3192,3245,0),
  200. new RSTile(3181,3247,0), new RSTile(3172,3251,0),
  201. new RSTile(3160,3254,0), new RSTile(3149,3253,0),
  202. new RSTile(3141,3259,0), new RSTile(3134,3263,0),
  203. new RSTile(3122,3262,0), new RSTile(3112,3262,0),
  204. new RSTile(3106,3267,0), new RSTile(3095,3272,0),
  205. new RSTile(3084,3279,0), new RSTile(3072,3277,0),
  206. new RSTile(3060,3276,0), new RSTile(3049,3275,0),
  207. new RSTile(3040,3276,0), new RSTile(3032,3278,0),
  208. new RSTile(3023,3277,0), new RSTile(3013,3277,0),
  209. new RSTile(3007,3285,0), new RSTile(3007,3296,0),
  210. new RSTile(3006,3307,0), new RSTile(3007,3317,0),
  211. new RSTile(3006,3329,0), new RSTile(3007,3339,0),
  212. new RSTile(3006,3349,0), new RSTile(3013,3356,0)};
  213.  
  214. private final RSTile[] PATH_TO_VARROCK_MINE = {
  215. new RSTile(3234,3241,0), new RSTile(3232,3251,0),
  216. new RSTile(3240,3261,0), new RSTile(3241,3272,0),
  217. new RSTile(3239,3281,0), new RSTile(3240,3292,0),
  218. new RSTile(3238,3302,0), new RSTile(3228,3308,0),
  219. new RSTile(3224,3319,0), new RSTile(3217,3325,0),
  220. new RSTile(3210,3333,0), new RSTile(3205,3341,0),
  221. new RSTile(3200,3349,0), new RSTile(3201,3360,0),
  222. new RSTile(3194,3366,0), new RSTile(3187,3370,0),
  223. new RSTile(3181,3371,0)};
  224.  
  225.  
  226.  
  227. public enum State
  228. {
  229. STARTUP_WALKING_SPAWN,START_UP_WALKING,MINE,WALK_TO_BANK,OPEN_BANK,DEPOSIT,WALK_TO_MINE,GET_ON_POSITION,FLEE,GO_MINE,TRAMP,WALK_TO_STAIRS,GET_OUT_OF_HOUSE,CLIMB_STAIRS,WALK_TO_HOUSE,GET_IN_HOUSE,CLIMB_DOWN_STAIRS,GET_IN_BANK,DWARF_COMBAT,NOTHING
  230. }
  231.  
  232. public enum WettingState{
  233. W_TO_WELL,W_FILL,W_USE,W_MAKE_ALL,W_TO_BANK,W_START_WITHDRAW,W_WAIT, W_OPEN_BANK, W_DEPOSIT, W_TAKE_CLAY, W_FAILSAFE1, W_FAILSAFE2
  234. }
  235.  
  236. private State getState()
  237. {
  238. if(isInFallyBank(Player.getRSPlayer().getPosition()) && pathLocation > 0) pathLocation = 0;
  239. if(checkHop()) return State.NOTHING;
  240. //Check if we lost to many resources. If we did, we should think about hopping...
  241. RSNPC[] mugger = NPCs.findNearest(175);
  242. int inventorySize = Inventory.getAll().length;
  243. if(mugger.length > 0)
  244. {
  245. if(mugger[0].isInteractingWithMe() && can_kill_mugger)
  246. {
  247. return State.TRAMP;
  248. }
  249. }
  250. if(isUnderFallyBank(Player.getRSPlayer().getPosition()))
  251. return State.GET_IN_BANK;
  252. if(isInRespawn(Player.getRSPlayer().getPosition())) { is_in_respawn = true; return State.STARTUP_WALKING_SPAWN; }
  253. if(isInSpawn(Player.getRSPlayer().getPosition())) { is_in_spawn = true; return State.START_UP_WALKING; }
  254. if(isOnPos(pos[locUsing].getX(),pos[locUsing].getY()) && Player.getRSPlayer().isInCombat()) return State.DWARF_COMBAT;
  255. if(locUsing < 3 && !isInHouse(Player.getRSPlayer().getPosition()) && Player.getRSPlayer().isInCombat() && scriptState != State.WALK_TO_STAIRS && scriptState != State.CLIMB_STAIRS && scriptState != State.WALK_TO_MINE && scriptState != State.GET_ON_POSITION && Player.getRSPlayer().getPosition().getY() < 5000)
  256. return State.FLEE;
  257. if(Player.getPosition().getY() < 3362 && Player.getPosition().getX() < 3170 && locUsing != 2 && locUsing != 3)
  258. return State.GO_MINE;
  259. if(isOnPos(pos[locUsing].getX(),pos[locUsing].getY()) && !Inventory.isFull() && (Player.getAnimation() == -1 || can_mine == true))
  260. return State.MINE;
  261. if(Inventory.isFull() && Interfaces.get(12, 90) == null && Player.getPosition().getY() < 3433)
  262. {
  263. if(locUsing < 2 && !isInVarrockBank(Player.getRSPlayer().getPosition())) return State.WALK_TO_BANK;
  264. if(locUsing == 2 && Player.getPosition().getY() > 3098) return State.WALK_TO_BANK;
  265. }
  266. if(locUsing == 3 && Inventory.isFull() && !Banking.isBankScreenOpen() && Player.getRSPlayer().getPosition().getY() > 9000 && !isAtStairs(Player.getRSPlayer().getPosition())) return State.WALK_TO_STAIRS;
  267. if(locUsing == 3 && isInHouse(Player.getRSPlayer().getPosition()) && Inventory.isFull()) return State.GET_OUT_OF_HOUSE;
  268. if(locUsing == 3 && isNearHouse(Player.getRSPlayer().getPosition()) && !isInHouse(Player.getRSPlayer().getPosition()) && !Inventory.isFull()) return State.GET_IN_HOUSE;
  269. if(locUsing == 3 && isInHouse(Player.getRSPlayer().getPosition()) && !Inventory.isFull()) return State.CLIMB_DOWN_STAIRS;
  270. if(locUsing == 3 && !Player.getRSPlayer().isMoving() && !isInFallyBank(Player.getRSPlayer().getPosition()) && pathLocation == 4 && isAroundFallyBank(Player.getRSPlayer().getPosition())) return State.GET_IN_BANK;
  271. if(locUsing == 3 && !isInHouse(Player.getRSPlayer().getPosition()) && Inventory.isFull() && !isInFallyBank(Player.getRSPlayer().getPosition()) && Player.getRSPlayer().getPosition().getX() > 3008 && Player.getRSPlayer().getPosition().getY() < 9000) return State.WALK_TO_BANK;
  272. if(locUsing == 3 && isAtStairs(Player.getRSPlayer().getPosition()) && Inventory.isFull()) return State.CLIMB_STAIRS;
  273. if(locUsing == 3 && Inventory.isFull() && isInFallyBank(Player.getRSPlayer().getPosition()) && !Banking.isBankScreenOpen()) return State.OPEN_BANK;
  274. if(Inventory.isFull() && !Banking.isBankScreenOpen())
  275. {
  276. if(locUsing < 2 && isInVarrockBank(Player.getRSPlayer().getPosition())) return State.OPEN_BANK;
  277. if(locUsing == 2 && Player.getPosition().getY() < 3098) return State.OPEN_BANK;
  278. }
  279. if((Inventory.isFull() || inventorySize > 1) && Banking.isBankScreenOpen())
  280. return State.DEPOSIT;
  281. if(!Inventory.isFull())
  282. {
  283. if(locUsing < 2 && Player.getPosition().getY() > 3384) return State.WALK_TO_MINE;
  284. if(locUsing == 2 && Player.getPosition().getY() < 3132) return State.WALK_TO_MINE;
  285. if(locUsing == 3 && Player.getPosition().getX() < 3057 && Player.getPosition().getY() < 3374) return State.WALK_TO_HOUSE;
  286. if(locUsing == 3 && Player.getPosition().getY() < 9812) return State.WALK_TO_MINE;
  287. }
  288. if(!Inventory.isFull() && !isOnPos(pos[locUsing].getX(),pos[locUsing].getY()))
  289. return State.GET_ON_POSITION;
  290. return State.NOTHING;
  291. }
  292.  
  293. private WettingState getWstate()
  294. {
  295. RSItem[] clay = Inventory.find("Clay");
  296. RSItem[] emptyBucket = Inventory.find("Bucket");
  297. RSItem[] waterBucket = Inventory.find("Bucket of water");
  298. RSItem[] softClay = Inventory.find("Soft clay");
  299. RSTile pos = Player.getRSPlayer().getPosition();
  300. if(Interfaces.get(241, 1) != null && Interfaces.get(230, 1) == null)
  301. {
  302. if(Interfaces.get(241, 1).getText().startsWith("Bank")) return WettingState.W_FAILSAFE1;
  303. }
  304. if(Interfaces.get(230, 1) != null)
  305. {
  306. if(Interfaces.get(230, 1).getText().startsWith("I'd like to ac")) return WettingState.W_FAILSAFE2;
  307. }
  308. if(Player.getRSPlayer().isInCombat())
  309. return WettingState.W_TO_BANK;
  310. if(clay.length < 1 && emptyBucket.length < 1 && waterBucket.length < 1 && softClay.length < 1)
  311. return WettingState.W_START_WITHDRAW;
  312. if(clay.length == 14 && emptyBucket.length == 14)
  313. {
  314. if(softenloc == 1 && pos.getX() < 3035) return WettingState.W_TO_WELL;
  315. if(softenloc == 2 && (pos.getY() < 3499 || pos.getX() > 3090)) return WettingState.W_TO_WELL;
  316. }
  317. if(emptyBucket.length > 0)
  318. {
  319. if(softenloc == 1 && pos.getX() > 3034) return WettingState.W_FILL;
  320. if(softenloc == 2 && pos.getY() > 3495 && pos.getX() < 3090) return WettingState.W_FILL;
  321. }
  322. if(Interfaces.get(309,6) != null)
  323. return WettingState.W_MAKE_ALL;
  324. if(Banking.isBankScreenOpen() && waterBucket.length == 14 && clay.length == 14)
  325. Banking.close();
  326. if(!Banking.isBankScreenOpen() && waterBucket.length > 0 && clay.length > 0)
  327. return WettingState.W_USE;
  328. if(softClay.length == 14 && waterBucket.length == 14)
  329. {
  330. if(softenloc == 1 && (pos.getX() > 3019 || pos.getY() > 3360))
  331. return WettingState.W_TO_BANK;
  332. if(softenloc == 2 && (pos.getX() < 3089 || pos.getY() > 3498))
  333. return WettingState.W_TO_BANK;
  334. }
  335. if(!Banking.isBankScreenOpen() && softClay.length == 14 && (waterBucket.length == 14 || emptyBucket.length == 14))
  336. {
  337. if(softenloc == 1 && pos.getX() < 3019) return WettingState.W_OPEN_BANK;
  338. if(softenloc == 2 && pos.getX() > 3090 && pos.getY() < 3499) return WettingState.W_OPEN_BANK;
  339. }
  340. if(Banking.isBankScreenOpen() && softClay.length > 0)
  341. return WettingState.W_DEPOSIT;
  342. if(Banking.isBankScreenOpen() && softClay.length < 1 && clay.length < 1)
  343. return WettingState.W_TAKE_CLAY;
  344.  
  345. return WettingState.W_WAIT;
  346. }
  347.  
  348. private boolean isUnderFallyBank(RSTile p)
  349. {
  350. if(p.getX() > 3005 && p.getX() < 3025 && p.getY() < 3354 && p.getY() > 3345)
  351. return true;
  352.  
  353. return false;
  354. }
  355. private boolean isInSpawn(RSTile p)
  356. {
  357. if(p.getX() < 3237 && p.getX() > 3228 && p.getY() > 3225 && p.getY() < 3236)
  358. return true;
  359.  
  360. return false;
  361. }
  362.  
  363. private boolean isInRespawn(RSTile p)
  364. {
  365. if(p.getX() < 3230 && p.getX() > 3216 && p.getY() > 3210 && p.getY() < 3225)
  366. return true;
  367.  
  368. return false;
  369. }
  370.  
  371. private boolean isInVarrockBank(RSTile p)
  372. {
  373. if(p.getX() < 3191 && p.getX() > 3179 && p.getY() > 3432 && p.getY() < 3448)
  374. return true;
  375.  
  376. return false;
  377. }
  378.  
  379. private boolean isAroundFallyBank(RSTile p)
  380. {
  381. if(p.getX() < 3030 && p.getX() > 3000 && p.getY() > 3358 && p.getY() < 3380)
  382. return true;
  383.  
  384. return false;
  385. }
  386.  
  387. private boolean isInHouse(RSTile p)
  388. {
  389. if(p.getX() < 3063 && p.getX() > 3057 && p.getY() > 3374 && p.getY() < 3382)
  390. return true;
  391.  
  392. return false;
  393. }
  394.  
  395. private boolean isNearHouse(RSTile p)
  396. {
  397. if(p.getX() < 3066 && p.getX() > 3052 && p.getY() > 3362 && p.getY() < 3386)
  398. return true;
  399.  
  400. return false;
  401. }
  402.  
  403. private boolean isAtStairs(RSTile p)
  404. {
  405. if(p.getX() < 3062 && p.getX() > 3052 && p.getY() > 9770 && p.getY() < 9781)
  406. return true;
  407.  
  408. return false;
  409. }
  410.  
  411. private boolean isInFallyBank(RSTile p)
  412. {
  413. if(p.getX() < 3020 && p.getX() > 3008 && p.getY() > 3354 && p.getY() < 3359)
  414. return true;
  415.  
  416. return false;
  417. }
  418.  
  419. private boolean isAtVarrockMine(RSTile p)
  420. {
  421. if(p.getX() < 3187 && p.getX() > 3170 && p.getY() > 3363 && p.getY() < 3380)
  422. return true;
  423.  
  424. return false;
  425. }
  426.  
  427. private boolean isOnPos(int xxxx, int yyyy)
  428. {
  429. if(Player.getPosition().getX() == xxxx && Player.getPosition().getY() == yyyy)
  430. return true;
  431. return false;
  432. }
  433. @Override
  434. public void run() {
  435. hop_when = General.random(15, 30);
  436. latestNews = Newsloader.getNews();
  437. General.useAntiBanCompliance(true);
  438. g.setVisible(true);
  439. while(GUIWait == true)
  440. {
  441. sleep(500);
  442. if(!GUIWait) continue;
  443. }
  444.  
  445. if(taskToDo == 1)
  446. {
  447. if(locUsing == 0 || locUsing == 1)
  448. {
  449. locuse = "Varrock west";
  450. }
  451. if(locUsing == 2)
  452. {
  453. locuse = "Yanille";
  454. }
  455. if(locUsing == 3)
  456. {
  457. locuse = "Falador East";
  458. }
  459. }
  460. else if(taskToDo == 2)
  461. {
  462. if(softenloc == 1)
  463. {
  464. locuse = "Falador East";
  465. }
  466. if(softenloc == 2)
  467. {
  468. locuse = "Edgeville";
  469. }
  470. }
  471.  
  472. if(taskToDo == 1)
  473. {
  474. if(!skipWait)
  475. {
  476. log("Welcome to DScripts... Starting in: 13");
  477. sleep(1000);
  478. log("Welcome to DScripts... Starting in: 12");
  479. sleep(1000);
  480. log("If running in Varrock, we recommend lvl 15+ CB Use DChickens to get there fast!... Starting in: 11");
  481. sleep(1000);
  482. log("If running in Varrock, we recommend lvl 15+ CB Use DChickens to get there fast!... Starting in: 10");
  483. sleep(1000);
  484. log("You are currently using: "+this.getScriptName()+"... Starting in: 9");
  485. sleep(1000);
  486. log("You are currently using: "+this.getScriptName()+"... Starting in: 8");
  487. sleep(1000);
  488. log("You are running the script at: "+locuse+"... Starting in: 7");
  489. sleep(1000);
  490. log("You are running the script at: "+locuse+"... Starting in: 6");
  491. sleep(1000);
  492. log("Either Equip your pickaxe, or have it in your inventory... Starting in: 5");
  493. sleep(1000);
  494. log("Either Equip your pickaxe, or have it in your inventory... Starting in: 4");
  495. sleep(1000);
  496. log("Either Equip your pickaxe, or have it in your inventory... Starting in: 3");
  497. sleep(1000);
  498. log("Either Equip your pickaxe, or have it in your inventory... Starting in: 2");
  499. sleep(1000);
  500. log("Either Equip your pickaxe, or have it in your inventory... Starting in: 1");
  501. sleep(1000);
  502. log("Enjoy DScripting's DClay!");
  503. }
  504. curr_count = Inventory.getCount("Clay");
  505. count_incr = true;
  506. for(int i=0; i< pickaxes.length; i++)
  507. {
  508. if(Inventory.find(pickaxes[i]).length > 0)
  509. {
  510. System.out.println("We found an inventory pickaxe!");
  511. Mypickaxe = pickaxes[i];
  512. break;
  513. }
  514. }
  515. for(int j=0; j< pickaxes.length; j++)
  516. {
  517. if(Equipment.isEquipped(pickaxes[j]))
  518. {
  519. System.out.println("We found an equipped pickaxe!");
  520. Mypickaxe = pickaxes[j];
  521. pickeq = true;
  522. break;
  523. }
  524. }
  525. }
  526.  
  527. else if(taskToDo == 2)
  528. {
  529. if(!skipWait)
  530. {
  531. log("Welcome to DScripts");
  532. sleep(2500);
  533. log("You are currently using: "+this.getScriptName()+"Wetter");
  534. sleep(2500);
  535. log("HAVE CLAY & BUCKETS IN TOP OF THE BANK!");
  536. sleep(5000);
  537. }
  538. }
  539. while(true)
  540. {
  541. DAntiban.activateRun();
  542. if(taskToDo == 1)
  543. {
  544. if(end_after_time)
  545. {
  546. if((hours == end_hour && minutes >= end_minute && seconds >= end_second) || (hours > end_hour))
  547. {
  548. System.out.println("Ending script...");
  549. log("Ending script...");
  550. while(Login.getLoginState() == Login.STATE.INGAME)
  551. {
  552. Login.logout();
  553. sleep(500,5000);
  554. if(Login.getLoginState() != Login.STATE.INGAME) break;
  555. }
  556. log("Logged out & Ended script...");
  557. System.out.println("Logged out & Ended script...");
  558. this.stopScript();
  559. }
  560. }
  561. checkIncr();
  562. checkGas();
  563. if(scriptState != State.OPEN_BANK)
  564. {
  565. DAntiban.timedActions();
  566. }
  567. if(tactiCal == 4) switchStates();
  568. if(checkStumpy())
  569. {
  570. repairStumpy();
  571. }
  572. else if(Interfaces.get(229, 0) != null)
  573. {
  574. if(Interfaces.get(229, 0).getText().startsWith("You need a"))
  575. {
  576. if(Interfaces.get(229,0).getText().contains("Your inventory is too full"))
  577. {
  578. System.out.println("inventory is full");
  579. }
  580. else
  581. {
  582. System.out.println("Pickaxe broke - please repair at bob.");
  583. this.stopScript();
  584. }
  585.  
  586. }
  587.  
  588. }
  589. else
  590. if(loop() > 0)
  591. {
  592. log("Main Loop found an error.");
  593. }
  594. } else
  595. if(taskToDo == 2)
  596. {
  597. if(end_after_time)
  598. {
  599. if((hours == end_hour && minutes >= end_minute && seconds >= end_second) || (hours >= end_hour && minutes > end_minute))
  600. {
  601. System.out.println("Ending script...");
  602. log("Ending script...");
  603. while(Login.getLoginState() == Login.STATE.INGAME)
  604. {
  605. Login.logout();
  606. sleep(500,5000);
  607. if(Login.getLoginState() != Login.STATE.INGAME) break;
  608. }
  609. log("Logged out & Ended script...");
  610. System.out.println("Logged out & Ended script...");
  611. this.stopScript();
  612. }
  613. }
  614. DAntiban.timedActions();
  615. if(wettingLoop() > 0)
  616. {
  617. log("Main Loop found an error.");
  618. }
  619. }
  620. }
  621.  
  622. }
  623.  
  624. private boolean checkHop()
  625. {
  626. if(DAntiban.getResourcesLost() > hop_when)
  627. {
  628. log("We are losing to many resources in this world, we are hopping!");
  629. DAntiban.smartSleep(1000);
  630. log("Resetting resources lost");
  631. DAntiban.setResourcesLost(0);
  632. DAntiban.smartSleep(300);
  633. hop_when = General.random(15, 30);
  634. log("We will hop again when we lost "+hop_when+" resources!");
  635. WorldHopper.changeWorld(WorldHopper.getRandomWorld(isMember, false));
  636. sleep(6000,10000);
  637. return true;
  638. }
  639. return false;
  640. }
  641.  
  642. private void checkIncr()
  643. {
  644. if(count_incr = true)
  645. {
  646. int last_count = curr_count;
  647. curr_count = Inventory.getCount("Clay");
  648. if(last_count < curr_count)
  649. {
  650. DAntiban.incrementResourcesWon();
  651. count_incr = false;
  652. }
  653. }
  654. }
  655. private int wettingLoop()
  656. {
  657. wState = getWstate();
  658. switch(wState)
  659. {
  660. case W_START_WITHDRAW:
  661. log("Start withdraw items!");
  662. if(softenloc == 1)
  663. {
  664. DAntiban.openPreferedBank();
  665. }
  666. else
  667. {
  668. DAntiban.openPreferedBank();
  669. }
  670. if(Banking.isBankScreenOpen())
  671. {
  672. if(Inventory.find(434).length < 14) Banking.withdraw(14, 434);
  673. if(Inventory.find(1925).length < 14) Banking.withdraw(14, 1925);
  674. }
  675. break;
  676.  
  677. case W_TO_WELL:
  678. if(softenloc == 1) walk(W_PATH_TO_WELL);
  679. if(softenloc == 2)
  680. {
  681. if(Player.isMoving()) break;
  682. DAntiban.goToAnticipated(new RSTile(3087,3502,0));
  683. DAntiban.smartSleep(1500);
  684. }
  685. break;
  686.  
  687. case W_FILL:
  688. log("Filling buckets...");
  689. RSItem[] emptyBucket = Inventory.find("Bucket");
  690. if(softenloc == 1)
  691. {
  692. RSObject[] well = Objects.getAt(new RSTile(3038,3353,0));
  693.  
  694. if(well.length > 0 && emptyBucket.length > 0)
  695. {
  696. emptyBucket[0].click("Use");
  697. DAntiban.smartSleep(700,900);
  698. DynamicClicking.clickRSObject(well[0], "Use");
  699. DAntiban.smartSleep(1750,2250);
  700.  
  701. int bamt = emptyBucket.length;
  702.  
  703. while(emptyBucket.length < 15)
  704. {
  705. bamt = emptyBucket.length;
  706. DAntiban.timedActions();
  707. DAntiban.generateTrackers(2000);
  708. DAntiban.sleepReactionTime();
  709. emptyBucket = Inventory.find("Bucket");
  710. if(bamt == emptyBucket.length)
  711. {
  712. DAntiban.smartSleep(500);
  713. break;
  714. }
  715. }
  716. }
  717. }
  718. else
  719. {
  720. if(Camera.getCameraAngle() < 50) Camera.setCameraAngle(General.random(50, 100));
  721. if(Camera.getCameraRotation() < 120 || Camera.getCameraRotation() > 200) Camera.setCameraRotation(General.random(120,200));
  722. RSObject[] well = Objects.find(50, 884);
  723.  
  724. if(well.length > 0 && emptyBucket.length > 0)
  725. {
  726. if(!well[0].getPosition().isOnScreen()) { DAntiban.goToAnticipated(new RSTile(well[0].getPosition().getX(),well[0].getPosition().getY() - 3, 0)); DAntiban.smartSleep(1250); break; }
  727. emptyBucket[0].click("Use");
  728. DAntiban.smartSleep(800,1000);
  729. DynamicClicking.clickRSObject(well[0], "Use");
  730. DAntiban.smartSleep(2250);
  731.  
  732. int bamt = emptyBucket.length;
  733.  
  734. while(emptyBucket.length < 15)
  735. {
  736. bamt = emptyBucket.length;
  737. DAntiban.smartSleep(1200);
  738. emptyBucket = Inventory.find(1925);
  739. if(bamt == emptyBucket.length)
  740. {
  741. DAntiban.smartSleep(500);
  742. break;
  743. }
  744. }
  745. }
  746. }
  747. break;
  748.  
  749. case W_USE:
  750. log("Using clay on bucket...");
  751. RSItem[] clay = Inventory.find(434);
  752. RSItem[] waterBucket = Inventory.find(1929);
  753.  
  754. if(clay.length > 0 && waterBucket.length > 0)
  755. {
  756. int method = General.random(1, 2);
  757. if(method == 1)
  758. {
  759. clay[0].click("Use");
  760. DAntiban.smartSleep(700,900);
  761. waterBucket[0].click("Use");
  762. DAntiban.smartSleep(1800,2200);
  763. } else {
  764. waterBucket[0].click("Use");
  765. DAntiban.smartSleep(800,1000);
  766. clay[0].click("Use");
  767. DAntiban.smartSleep(1800,2200);
  768. }
  769. }
  770. break;
  771.  
  772. case W_MAKE_ALL:
  773. log("Making soft clay...");
  774. RSItem[] ssoftClay = Inventory.find("Soft clay");
  775. if(Interfaces.get(309, 6) != null)
  776. {
  777. Interfaces.get(309, 6).click("Make All");
  778. DAntiban.smartSleep(2000);
  779. }
  780. int cursClay = ssoftClay.length;
  781. while(ssoftClay.length < 14)
  782. {
  783. cursClay = ssoftClay.length;
  784. DAntiban.timedActions();
  785. DAntiban.generateTrackers(2000);
  786. DAntiban.sleepReactionTime();
  787. ssoftClay = Inventory.find("Soft clay");
  788. if(cursClay == ssoftClay.length)
  789. {
  790.  
  791. DAntiban.smartSleep(400);
  792. break;
  793. }
  794. }
  795. break;
  796.  
  797. case W_TO_BANK:
  798. log("Walking to bank");
  799. if(softenloc == 1) walk(W_PATH_TO_BANK);
  800. if(softenloc == 2)
  801. {
  802. if(Player.isMoving()) break;
  803. DAntiban.goToAnticipated(new RSTile(3095,3495,0));
  804. }
  805. break;
  806.  
  807. case W_OPEN_BANK:
  808. log("Opening bank...");
  809. GameTab.open(TABS.INVENTORY);
  810. DAntiban.openPreferedBank();
  811. DAntiban.generateTrackers(1000);
  812. DAntiban.sleepReactionTime();
  813. break;
  814.  
  815. case W_DEPOSIT:
  816. log("Depositing...");
  817. RSItem[] softClay = Inventory.find("Soft clay");
  818. if(softClay.length > 0)
  819. {
  820. Banking.depositAllExcept("Bucket of water", "Bucket");
  821. }
  822. if(!first_time_set_clay)
  823. {
  824. first_time_set_clay = true;
  825. if(Banking.find("Soft clay") != null && Banking.find("Soft clay").length > 0)
  826. {
  827. start_clay = Banking.find("Soft clay")[0].getStack();
  828. }
  829. else
  830. {
  831. start_clay = 0;
  832. }
  833. }
  834.  
  835. DAntiban.generateTrackers(500);
  836. DAntiban.sleepReactionTime();
  837. break;
  838.  
  839. case W_TAKE_CLAY:
  840. log("Withdrawing clay...");
  841.  
  842. if(Banking.find("Soft clay").length > 0)
  843. {
  844. softClayMade = (Banking.find("Soft clay")[0].getStack() - start_clay);
  845. }
  846. RSItem[] invclay = Inventory.find("Clay");
  847. if(invclay.length < 1) Banking.withdraw(14, "Clay");
  848. DAntiban.generateTrackers(500);
  849. DAntiban.sleepReactionTime();
  850. break;
  851.  
  852. case W_FAILSAFE1:
  853. log("Fail-safe opening bank");
  854. if(Interfaces.get(241, 3) != null) Interfaces.get(241, 3).click("Continue");
  855. DAntiban.smartSleep(1250);
  856. break;
  857.  
  858. case W_FAILSAFE2:
  859. log("Fail-safe opening bank");
  860. if(Interfaces.get(230, 1) != null) {
  861. if(Interfaces.get(230, 1).getText().startsWith("I'd like to ac"))
  862. Interfaces.get(230, 1).click("Continue");
  863. }
  864. DAntiban.smartSleep(1200,1400);
  865. break;
  866.  
  867. }
  868.  
  869. return 0;
  870. }
  871.  
  872. private boolean checkStumpy()
  873. {
  874. RSItem[] stumpy = Inventory.find(466);
  875. if(stumpy.length > 0)
  876. {
  877. return true;
  878. }
  879. return false;
  880. }
  881.  
  882. private void repairStumpy()
  883. {
  884. RSItem[] stumpy = Inventory.find(466);
  885. RSItem[] runePheadInv = Inventory.find(490);
  886. RSItem[] addyPheadInv = Inventory.find(488);
  887. RSItem[] mithPheadInv = Inventory.find(486);
  888. RSItem[] steelPheadInv = Inventory.find(484);
  889. RSItem[] ironPheadInv = Inventory.find(482);
  890. RSItem[] bronzePheadInv = Inventory.find(480);
  891. if(stumpy.length > 0)
  892. {
  893.  
  894. RSGroundItem[] runePhead = GroundItems.findNearest(490);
  895. if(runePhead.length > 0)
  896. {
  897. if(!runePhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(runePhead[0].getPosition());
  898. if(runePhead[0].getPosition().isOnScreen()) runePhead[0].click("Take");
  899. }
  900.  
  901. RSGroundItem[] addyPhead = GroundItems.findNearest(488);
  902. if(addyPhead.length > 0)
  903. {
  904. if(!addyPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(addyPhead[0].getPosition());
  905. if(addyPhead[0].getPosition().isOnScreen()) addyPhead[0].click("Take");
  906. }
  907.  
  908. RSGroundItem[] mithPhead = GroundItems.findNearest(486);
  909. if(mithPhead.length > 0)
  910. {
  911. if(!mithPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(mithPhead[0].getPosition());
  912. if(mithPhead[0].getPosition().isOnScreen()) mithPhead[0].click("Take");
  913. }
  914.  
  915. RSGroundItem[] steelPhead = GroundItems.findNearest(484);
  916. if(steelPhead.length > 0)
  917. {
  918. if(!steelPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(steelPhead[0].getPosition());
  919. if(steelPhead[0].getPosition().isOnScreen()) steelPhead[0].click("Take");
  920. }
  921.  
  922. RSGroundItem[] ironPhead = GroundItems.findNearest(482);
  923. if(ironPhead.length > 0)
  924. {
  925. if(!ironPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(ironPhead[0].getPosition());
  926. if(ironPhead[0].getPosition().isOnScreen()) ironPhead[0].click("Take");
  927. }
  928.  
  929. RSGroundItem[] bronzePhead = GroundItems.findNearest(480);
  930. if(bronzePhead.length > 0)
  931. {
  932. if(!bronzePhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(bronzePhead[0].getPosition());
  933. if(bronzePhead[0].getPosition().isOnScreen()) bronzePhead[0].click("Take");
  934. }
  935. }
  936.  
  937. if(runePheadInv.length>0)
  938. {
  939. runePheadInv[0].click("Use");
  940. DAntiban.smartSleep(1600,1900);
  941. stumpy[0].click("Use");
  942. }
  943.  
  944. if(addyPheadInv.length>0)
  945. {
  946. addyPheadInv[0].click("Use");
  947. DAntiban.smartSleep(1600,1900);
  948. stumpy[0].click("Use");
  949. }
  950.  
  951. if(mithPheadInv.length>0)
  952. {
  953. mithPheadInv[0].click("Use");
  954. DAntiban.smartSleep(1600,1900);
  955. stumpy[0].click("Use");
  956. }
  957.  
  958. if(steelPheadInv.length>0)
  959. {
  960. steelPheadInv[0].click("Use");
  961. DAntiban.smartSleep(1600,1900);
  962. stumpy[0].click("Use");
  963. }
  964.  
  965. if(ironPheadInv.length>0)
  966. {
  967. ironPheadInv[0].click("Use");
  968. DAntiban.smartSleep(1600,1900);
  969. stumpy[0].click("Use");
  970. }
  971.  
  972. if(bronzePheadInv.length>0)
  973. {
  974. bronzePheadInv[0].click("Use");
  975. DAntiban.smartSleep(1600,1900);
  976. stumpy[0].click("Use");
  977. }
  978. }
  979.  
  980. private void checkGas()
  981. {
  982. RSObject[] gasRock = Objects.find(10, 15491);
  983. RSObject[] gasRock2 = Objects.find(10, 15493);
  984. RSObject[] gasRock3 = Objects.find(10, 15492);
  985. RSObject[] gasRock4 = Objects.find(10, 15492);//falador ore 1
  986. RSObject[] gasRock5 = Objects.find(10, 15492);//falador ore 2
  987. if(gasRock.length > 0)
  988. {
  989. if(gasRock[0].getPosition().getX() == 3180 && gasRock[0].getPosition().getY() == 3372)
  990. dangerousRock = 2;
  991. if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
  992. }
  993. else if(gasRock2.length > 0)
  994. {
  995. if(gasRock2[0].getPosition().getX() == 3179 && gasRock2[0].getPosition().getY() == 3371)
  996. dangerousRock = 1;
  997. if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
  998. }
  999. else if(gasRock3.length > 0)
  1000. {
  1001. if(gasRock3[0].getPosition().getX() == 3179 && gasRock3[0].getPosition().getY() == 3371)
  1002. dangerousRock = 3;
  1003. if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
  1004. }
  1005. else if(gasRock4.length > 0)
  1006. {
  1007. if(gasRock4[0].getPosition().getX() == 3054 && gasRock4[0].getPosition().getY() == 9819)
  1008. dangerousRock = 3;
  1009. if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
  1010. }
  1011. else if(gasRock5.length > 0)
  1012. {
  1013. if(gasRock5[0].getPosition().getX() == 3053 && gasRock5[0].getPosition().getY() == 9818)
  1014. dangerousRock = 3;
  1015. if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
  1016. }
  1017. else
  1018. {
  1019. dangerousRock = 0;
  1020. stopinteraction = false;
  1021. }
  1022. }
  1023.  
  1024. int myTimer = 0;
  1025. int myTimer2 = 0;
  1026. int waitTimer = 15;
  1027. private void switchStates()
  1028. {
  1029. myTimer = (int) (((System.currentTimeMillis()) - (startTime_switch))/1000);
  1030. myTimer2 = (int) ((System.currentTimeMillis() - (startTime_switch2))/1000);
  1031. if(myTimer2 > 5) { waitTimer = General.random(5, 30); startTime_switch2 = System.currentTimeMillis();}
  1032. if(myTimer > waitTimer)
  1033. {
  1034. randomState = General.random(1, 2);
  1035. startTime_switch = System.currentTimeMillis();
  1036. }
  1037. }
  1038.  
  1039. private int loop()
  1040. {
  1041. if(!Combat.isAutoRetaliateOn())
  1042. {
  1043. Combat.setAutoRetaliate(true);
  1044. DAntiban.smartSleep(1500);
  1045. }
  1046. if(equippick)
  1047. {
  1048. RSItem[] pick = Inventory.find(Mypickaxe);
  1049. if(pick.length > 0)
  1050. {
  1051. if(pick[0] != null)
  1052. {
  1053. pick[0].click("Wield");
  1054. DAntiban.sleep(General.random(2, 14));
  1055. }
  1056. }
  1057. }
  1058. scriptState = getState();
  1059. switch(scriptState)
  1060. {
  1061. case TRAMP:
  1062. log("Mugger is attacking us..");
  1063. RSNPC[] mugger = NPCs.findNearest("Mugger");
  1064. if(mugger.length > 0)
  1065. {
  1066. if(mugger[0] != null)
  1067. {
  1068. if(!mugger[0].isInCombat())
  1069. mugger[0].click("Attack");
  1070. }
  1071. }
  1072. break;
  1073.  
  1074. case DWARF_COMBAT:
  1075. log("For some reason a Dwarf is or a Scorpion is attacking us, killing it!");
  1076. RSNPC[] Targetz = NPCs.getAll();
  1077. RSNPC monster_to_slay = null;
  1078. for(int z=0; z< Targetz.length; z++)
  1079. {
  1080. if(Targetz[z] != null && Targetz[z].isInteractingWithMe() == true && Player.getRSPlayer().getPosition().distanceTo(Targetz[z].getPosition()) < 3)
  1081. {
  1082. monster_to_slay = Targetz[z];
  1083. }
  1084. if(monster_to_slay != null && !monster_to_slay.isInCombat())
  1085. {
  1086. monster_to_slay.click("Attack");
  1087. DAntiban.setLastUnderAttackTime(System.currentTimeMillis());
  1088. DAntiban.generateTrackers(1500);
  1089. DAntiban.sleepReactionTime();
  1090. DAntiban.timedActions();
  1091. }
  1092. }
  1093. break;
  1094.  
  1095. case GO_MINE:
  1096. log("Running back to the mine!");
  1097. RSTile back = new RSTile((Player.getPosition().getX() + 5), (Player.getPosition().getY() + 5), 0);
  1098. DAntiban.goToAnticipated(back);
  1099. break;
  1100. case FLEE:
  1101. log("Running from combat!");
  1102. RSTile run = new RSTile((Player.getPosition().getX() - 5), (Player.getPosition().getY() - 5), 0);
  1103. DAntiban.goToAnticipated(run);
  1104. break;
  1105. case MINE:
  1106. pathLocation = 0;
  1107. log("Mining clay...");
  1108. RSObject[] mine1 = Objects.getAt(new RSTile(3180,3372,0)); //Varrock ore 1
  1109. RSObject[] mine2 = Objects.getAt(new RSTile(3179,3371,0)); //Varrock ore 2
  1110. RSObject[] mine3 = Objects.getAt(new RSTile(3183,3377,0)); // Varrock ore 3
  1111. RSObject[] mine4 = Objects.findNearest(8,2109); // Yanille ore 2
  1112. RSObject[] mine5 = Objects.getAt(new RSTile(3054,9819,0)); // Falador ore 1
  1113. RSObject[] mine6 = Objects.getAt(new RSTile(3053,9818,0)); // Falador ore 2
  1114. if(mine1.length > 0 && (tactiCal == 1 || tactiCal == 3 || randomState == 1) && dangerousRock != 1)
  1115. {
  1116. if(mine1[0].getID() != 7469 && mine1[0].getID() != 7468)
  1117. {
  1118. ore_nr = 0;
  1119. DynamicClicking.clickRSObject(mine1[0], "Mine");
  1120. generateTrackers();
  1121. DAntiban.sleepReactionTime();
  1122. count_incr = true;
  1123. can_mine = false;
  1124. }
  1125.  
  1126. }
  1127. else
  1128. if(mine2.length > 0 && (tactiCal == 2 || tactiCal == 3 || randomState == 2) && dangerousRock != 2)
  1129. {
  1130. if(mine2[0].getID() != 7469 && mine2[0].getID() != 7468)
  1131. {
  1132. ore_nr = 1;
  1133. DynamicClicking.clickRSObject(mine2[0], "Mine");
  1134. generateTrackers();
  1135. DAntiban.sleepReactionTime();
  1136. count_incr = true;
  1137. can_mine = false;
  1138. }
  1139.  
  1140. }
  1141. else
  1142. if(mine3.length > 0 && tactiCal == 5 && dangerousRock != 3)
  1143. {
  1144. if(mine3[0].getID() != 7469 && mine3[0].getID() != 7468)
  1145. {
  1146. ore_nr = 2;
  1147. DynamicClicking.clickRSObject(mine3[0], "Mine");
  1148. generateTrackers();
  1149. DAntiban.sleepReactionTime();
  1150. count_incr = true;
  1151. can_mine = false;
  1152. }
  1153. }
  1154. else
  1155. if(mine4.length > 0 && tactiCal == 6 && dangerousRock != 4)
  1156. {
  1157. if(mine4[0].getID() != 7469 && mine4[0].getID() != 7468)
  1158. {
  1159. ore_nr = 3;
  1160. DynamicClicking.clickRSObject(mine4[0], "Mine");
  1161. generateTrackers();
  1162. DAntiban.sleepReactionTime();
  1163. count_incr = true;
  1164. can_mine = false;
  1165. }
  1166. }
  1167. else
  1168. if(mine5.length > 0 && tactiCal == 7 && dangerousRock != 5)
  1169. {
  1170. if(mine5[0].getID() != 7469 && mine5[0].getID() != 7468)
  1171. {
  1172. ore_nr = 4;
  1173. DynamicClicking.clickRSObject(mine5[0], "Mine");
  1174. generateTrackers();
  1175. DAntiban.sleepReactionTime();
  1176. count_incr = true;
  1177. can_mine = false;
  1178. }
  1179. }
  1180. else
  1181. if(mine6.length > 0 && tactiCal == 8 && dangerousRock != 6)
  1182. {
  1183. if(mine6[0].getID() != 7469 && mine6[0].getID() != 7468)
  1184. {
  1185. ore_nr = 5;
  1186. DynamicClicking.clickRSObject(mine6[0], "Mine");
  1187. generateTrackers();
  1188. DAntiban.sleepReactionTime();
  1189. count_incr = true;
  1190. can_mine = false;
  1191. }
  1192. }
  1193. break;
  1194.  
  1195. case WALK_TO_BANK:
  1196. if(locUsing == 0) walk(PATH_TO_BANK);
  1197. if(locUsing == 1) walk(PATH_TO_BANK2);
  1198. if(locUsing == 2) walk(YAN_PATH_TO_BANK);
  1199. if(locUsing == 3) walk(PATH_TO_FALLY_BANK);
  1200. if(DAntiban.getResourcesLost() > 19)
  1201. {
  1202. System.out.println("Calming down... We lower resources lost a bit, so we won't hop to soon");
  1203. DAntiban.setResourcesLost(DAntiban.getResourcesLost() - (General.random(1, 14)));
  1204. }
  1205.  
  1206. break;
  1207.  
  1208. case WALK_TO_STAIRS:
  1209. if(locUsing == 3) walk(PATH_TO_STAIRS);
  1210. break;
  1211.  
  1212. case WALK_TO_HOUSE:
  1213. if(locUsing == 3) walk(PATH_TO_HOUSE);
  1214. break;
  1215.  
  1216. case GET_OUT_OF_HOUSE:
  1217. if(Doors.handleDoorAt(new RSTile(3061,3374,0), true))
  1218. {
  1219. DAntiban.goToAnticipated(new RSTile(3060,3369,0));
  1220. }
  1221. if(Doors.getDoorAt(new RSTile(3061,3375,0)) != null && !Player.getRSPlayer().isMoving())
  1222. DAntiban.goToAnticipated(new RSTile(3060,3369,0));
  1223. break;
  1224.  
  1225. case GET_IN_BANK:
  1226. if(locUsing == 3)
  1227. {
  1228. DAntiban.goToAnticipated(new RSTile(3013,3356,0));
  1229. pathLocation = 0;
  1230. }
  1231.  
  1232. break;
  1233.  
  1234. case GET_IN_HOUSE:
  1235. if(Doors.getDoorAt(new RSTile(3061,3374,0)) != null)
  1236. {
  1237. RSTile doorPos = new RSTile(3061,3374,0);
  1238. while(!doorPos.isOnScreen())
  1239. {
  1240. if(!Player.getRSPlayer().isMoving())
  1241. DAntiban.goToAnticipated(new RSTile(3061,3373,0));
  1242. DAntiban.smartSleep(800,1200);
  1243. if(doorPos.isOnScreen() || Doors.getDoorAt(new RSTile(3061,3374,0)) == null) break;
  1244. }
  1245. }
  1246. if(Doors.handleDoorAt(new RSTile(3061,3374,0), true))
  1247. {
  1248. DAntiban.generateTrackers(100);
  1249. DAntiban.sleepReactionTime();
  1250. if(Doors.getDoorAt(new RSTile(3061,3375,0)) != null && !Player.getRSPlayer().isMoving()) DAntiban.goToAnticipated(new RSTile(3061,3377,0));
  1251. }
  1252. if(Doors.getDoorAt(new RSTile(3061,3375,0)) != null && !Player.getRSPlayer().isMoving())
  1253. DAntiban.goToAnticipated(new RSTile(3061,3377,0));
  1254. break;
  1255.  
  1256. case CLIMB_DOWN_STAIRS:
  1257. RSObject[] a = Objects.find(5, "Staircase");
  1258. if(a !=null && a.length > 0)
  1259. {
  1260. DynamicClicking.clickRSObject(a[0], "Climb-down");
  1261. pathLocation = 0;
  1262. DAntiban.generateTrackers(250);
  1263. DAntiban.sleepReactionTime();
  1264. }
  1265. break;
  1266.  
  1267. case CLIMB_STAIRS:
  1268. RSObject[] b = Objects.find(5, "Staircase");
  1269. if(b !=null && b.length > 0)
  1270. {
  1271. DynamicClicking.clickRSObject(b[0], "Climb-up");
  1272. pathLocation = 0;
  1273. DAntiban.generateTrackers(250);
  1274. DAntiban.sleepReactionTime();
  1275. }
  1276. break;
  1277.  
  1278. case OPEN_BANK:
  1279. log("Opening bank...");
  1280. pathLocation = 0;
  1281. if(locUsing < 2)
  1282. {
  1283. if(Player.isMoving()) break;
  1284. DAntiban.openPreferedBank();
  1285. DAntiban.smartSleep(900,1200);
  1286. }
  1287. else
  1288. {
  1289. DAntiban.openPreferedBank();
  1290. DAntiban.smartSleep(700,1300);
  1291. }
  1292. break;
  1293.  
  1294. case DEPOSIT:
  1295. log("Depositing clay...");
  1296. pathLocation = 0;
  1297. RSItem[] clay = Inventory.find("Clay");
  1298. if(clay.length > 0)
  1299. {
  1300. Banking.depositAllExcept(Mypickaxe);
  1301. }
  1302. DAntiban.smartSleep(1400,1800);
  1303. if(Inventory.getAll().length > 1)
  1304. {
  1305. log("Depositing other stuff...");
  1306. Banking.depositAllExcept(Mypickaxe);
  1307. }
  1308. break;
  1309.  
  1310. case WALK_TO_MINE:
  1311. if(locUsing == 0) walk(PATH_TO_MINE);
  1312. if(locUsing == 1) walk(PATH_TO_MINE2);
  1313. if(locUsing == 2) walk(YAN_PATH_TO_MINE);
  1314. if(locUsing == 3) walk(FAL_PATH_TO_MINE);
  1315. break;
  1316.  
  1317. case GET_ON_POSITION:
  1318. pathLocation = 0;
  1319. log("Trying to get on the correct location.");
  1320. if(Player.getRSPlayer().isMoving()) break;
  1321. if(pos[locUsing].isOnScreen())
  1322. Walking.clickTileMS(pos[locUsing], "Walk here");
  1323. else
  1324. Walking.walkTo(pos[locUsing]);
  1325. while(Player.getRSPlayer().isMoving())
  1326. {
  1327. DAntiban.smartSleep(500,1500);
  1328. if(!Player.getRSPlayer().isMoving()) break;
  1329. }
  1330. DAntiban.generateTrackers(500);
  1331. DAntiban.sleepReactionTime();
  1332. break;
  1333.  
  1334. case STARTUP_WALKING_SPAWN:
  1335. log("Walking to spawn location");
  1336. while(is_in_respawn)
  1337. {
  1338. walk(PATH_TO_SPAWN);
  1339. if(isInSpawn(Player.getRSPlayer().getPosition())) { pathLocation = 0; is_in_respawn = false; break; }
  1340. }
  1341. break;
  1342.  
  1343. case START_UP_WALKING:
  1344. log("Walking to next location");
  1345. while(is_in_spawn)
  1346. {
  1347. if(locUsing == 0 || locUsing == 1)
  1348. {
  1349.  
  1350. walk(PATH_TO_VARROCK_MINE);
  1351. if(isAtVarrockMine(Player.getRSPlayer().getPosition()))
  1352. {
  1353. pathLocation = 0;
  1354. is_in_spawn = false;
  1355. break;
  1356. }
  1357. }
  1358. if(locUsing == 3)
  1359. {
  1360. walk(PATH_TO_FALADOR_BANK);
  1361. if(isInFallyBank(Player.getRSPlayer().getPosition()))
  1362. {
  1363. pathLocation = 0;
  1364. is_in_spawn = false;
  1365. break;
  1366. }
  1367. }
  1368.  
  1369. }
  1370. break;
  1371.  
  1372. case NOTHING:
  1373. //We are probably doing our mining emotion right now! :)
  1374. if(Player.getRSPlayer().getAnimation() > 0 && starvedMine() && can_mine == false)
  1375. {
  1376. DAntiban.incrementResourcesLost();
  1377. can_mine = true;
  1378. }
  1379. sleep(100,400);
  1380. break;
  1381. }
  1382.  
  1383.  
  1384.  
  1385. return 0;
  1386. }
  1387.  
  1388. private boolean starvedMine()
  1389. {
  1390. if(Objects.getAt(ore_locations[ore_nr]) != null && (Objects.getAt(ore_locations[ore_nr])[0].getID() == 7469 || Objects.getAt(ore_locations[ore_nr])[0].getID() == 7468) )
  1391. {
  1392. System.out.println(ore_nr+ " ore nr < pos: "+ore_locations[ore_nr]);
  1393. return true;
  1394. }
  1395.  
  1396.  
  1397. return false;
  1398. }
  1399.  
  1400. private void walk(RSTile[] path)
  1401. {
  1402. DAntiban.activateRun();
  1403. if(pathLocation == (path.length-1))
  1404. {
  1405. pathLocation = 0;
  1406. return;
  1407. }
  1408. boolean moving = Player.getRSPlayer().isMoving();
  1409. if((Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) > 24)) return;
  1410. if(pathLocation > (path.length -1)) return;
  1411. if(moving && Player.getPosition().distanceTo(path[pathLocation]) > 5) return;
  1412. if(Player.getPosition().distanceTo(path[pathLocation]) <= 6)
  1413.  
  1414. {
  1415. pathLocation++;
  1416. }
  1417. log("Walking location: "+pathLocation+"/"+(path.length-1));
  1418. while(Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) > 6)
  1419. {
  1420. DAntiban.goToAnticipated(path[pathLocation]);
  1421. DAntiban.smartSleep(700,1300);
  1422. if(Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) <= 6)
  1423. break;
  1424. if(Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) > 30) break;
  1425. }
  1426.  
  1427.  
  1428. }
  1429.  
  1430.  
  1431. private void generateTrackers()
  1432. {
  1433. int mine_lvl = Skills.getActualLevel(SKILLS.MINING);
  1434. if(mine_lvl < 31)
  1435. {
  1436. int minus = 31 - mine_lvl;
  1437. int trackers = 100*minus;
  1438. if(trackers < 201) trackers = 250;
  1439. DAntiban.generateTrackers(trackers);
  1440. DAntiban.timedActions();
  1441. }
  1442. else
  1443. {
  1444. DAntiban.generateTrackers(250);
  1445. DAntiban.timedActions();
  1446. }
  1447. }
  1448.  
  1449. int newsToShow = 0;
  1450.  
  1451. private void getnewsdata()
  1452. {
  1453. int newsTimer = (int) (System.currentTimeMillis() - startNewsTime) / 1000;
  1454. if(newsTimer > 8)
  1455. {
  1456. startNewsTime = System.currentTimeMillis();
  1457. if(newsToShow == (latestNews.size() -1)) newsToShow = 0;
  1458. else if(newsToShow < (latestNews.size())) newsToShow++;
  1459.  
  1460. }
  1461.  
  1462. }
  1463.  
  1464. private void Calculate()
  1465. {
  1466. Current_XP = Skills.getXP(SKILLS.MINING);
  1467. xpGot = DAntiban.getResourcesWon() * 5;
  1468. clayMined = DAntiban.getResourcesWon();
  1469. timeRan = (int) (System.currentTimeMillis() - startTime);
  1470. multiplier = timeRan / 3600000D;
  1471. hours = timeRan / 3600000;
  1472. timeRan = timeRan - (hours*3600000);
  1473. minutes = timeRan / 60000;
  1474. timeRan = timeRan - (minutes*60000);
  1475. seconds = timeRan / 1000;
  1476. clayPH = (int) (clayMined/multiplier);
  1477. softclayPH = (int) (softClayMade/multiplier);
  1478. timeRan = timeRan - (seconds*1000);
  1479. }
  1480.  
  1481. private Image getImage(String url)
  1482. {
  1483. try
  1484. {
  1485. return ImageIO.read(new URL(url));
  1486. }
  1487. catch(IOException e)
  1488. {
  1489. return null;
  1490. }
  1491. }
  1492.  
  1493. private final Image dclaypaintimg = getImage("http://d-scripting.com/DEssentials/paint/dclaypaint.png");
  1494. private final RenderingHints aa = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  1495. private final Color darkred = new Color(193,48,38);
  1496. private int paintOffset = 320;
  1497.  
  1498. @Override
  1499. public void onPaint(Graphics g)
  1500. {
  1501. getnewsdata();
  1502. Calculate();
  1503. Graphics2D g2 = (Graphics2D)g;
  1504. g2.setRenderingHints(aa);
  1505. g2.drawImage(dclaypaintimg, 0, paintOffset, null);
  1506. g.setColor(Color.CYAN);
  1507. g.setFont(font3);
  1508. if(newsToShow < (latestNews.size())) g.drawString("NEWS: "+ latestNews.get(newsToShow), 40,40);
  1509. g.setColor(darkred);
  1510. g.setFont(font2);
  1511. g.drawString("time ran: "+ hours + ":" + minutes + ":" + seconds, 5,paintOffset+60);
  1512. if(taskToDo == 1) g.drawString("XP gained: "+ xpGot, 5,paintOffset+75);
  1513. if(taskToDo == 1) g.drawString("Clay Mined: "+ clayMined+" Clay p/h: "+ clayPH , 5,paintOffset+90); if(taskToDo == 2) g.drawString("Soft clay banked: "+ softClayMade+" Soft clay P/H: "+softclayPH, 5,paintOffset+90);
  1514. if(taskToDo == 1) g.drawString("Script State: "+scriptState, 5,paintOffset+105);
  1515. if(taskToDo == 2) g.drawString("Script State: "+wState, 5,paintOffset+105);
  1516. g.drawString("Debug : "+debug, 5,paintOffset+120);
  1517. if(end_after_time) g.drawString("Ending script when we ran "+(end_hour)+":"+(end_minute)+":"+(end_second)+" (HH:MM:SS)", 5,paintOffset+135);
  1518. if(!end_after_time) g.drawString("Not using End-timer", 5,paintOffset+135);
  1519. g.drawString("Version: 1.0", 5,paintOffset+160);
  1520. }
  1521.  
  1522. public void shutDown()
  1523. {
  1524. this.stopScript();
  1525. }
  1526.  
  1527. private void log(String s)
  1528. {
  1529. debug = s;
  1530. }
  1531.  
  1532. public class GUI extends JFrame {
  1533. public GUI() {
  1534. initComponents();
  1535. }
  1536.  
  1537. private void thedtribotActionPerformed(ActionEvent e) {
  1538. openSite("http://tribot.org/forums/profile/8498-thed/");
  1539. }
  1540.  
  1541. private void dscriptingcomActionPerformed(ActionEvent e) {
  1542. openSite("http://d-scripting.com");
  1543. }
  1544.  
  1545. private void moredscriptsActionPerformed(ActionEvent e) {
  1546. openSite("http://d-scripting.com/more");
  1547. }
  1548.  
  1549. private void tacticToUseActionPerformed(ActionEvent e) {
  1550. String weChose = tacticToUse.getSelectedItem().toString();
  1551. if(weChose.startsWith("1.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
  1552. if(weChose.startsWith("2.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
  1553. if(weChose.startsWith("3.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
  1554. if(weChose.startsWith("4.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
  1555. if(weChose.startsWith("5.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
  1556. if(weChose.startsWith("6.")) message.setText("Message: Account is member, start in Yanille Bank");
  1557. if(weChose.startsWith("7.")) message.setText("Message: Recommendation = 28cb+ & equip pickaxe");
  1558. if(weChose.startsWith("8.")) message.setText("Message: Recommendation = 28cb+ & equip pickaxe");
  1559. }
  1560.  
  1561. private void StartScriptActionPerformed(ActionEvent e) {
  1562. String iChose = tacticToUse.getSelectedItem().toString();
  1563. String speed = mouseSpeed.getSelectedItem().toString();
  1564. String myTask = taskSelected.getSelectedItem().toString();
  1565. String soloc = softenlocation.getSelectedItem().toString();
  1566. String whenToQuit = endscriptTimer.getSelectedItem().toString();
  1567. if(iChose.startsWith("1.")) tactiCal = 1;
  1568. if(iChose.startsWith("2.")) tactiCal = 2;
  1569. if(iChose.startsWith("3.")) tactiCal = 3;
  1570. if(iChose.startsWith("4.")) tactiCal = 4;
  1571. if(iChose.startsWith("5.")) { tactiCal = 5; locUsing = 1;}
  1572. if(iChose.startsWith("6.")) { tactiCal = 6; locUsing = 2;}
  1573. if(iChose.startsWith("7.")) { tactiCal = 7; locUsing = 3;}
  1574. if(iChose.startsWith("8.")) { tactiCal = 8; locUsing = 3;}
  1575.  
  1576. if(whenToQuit.startsWith("0."))
  1577. {
  1578. end_after_time = false;
  1579. }
  1580. if(whenToQuit.startsWith("1."))
  1581. {
  1582. end_after_time = true;
  1583. end_hour = 1;
  1584. end_minute = General.random(1, 59);
  1585. }
  1586. if(whenToQuit.startsWith("2."))
  1587. {
  1588. end_after_time = true;
  1589. end_hour = 2;
  1590. end_minute = General.random(1, 59);
  1591. }
  1592. if(whenToQuit.startsWith("3."))
  1593. {
  1594. end_after_time = true;
  1595. end_hour = 3;
  1596. end_minute = General.random(1, 59);
  1597. }
  1598. if(whenToQuit.startsWith("4."))
  1599. {
  1600. end_after_time = true;
  1601. end_hour = 4;
  1602. end_minute = General.random(1, 59);
  1603. }
  1604. if(whenToQuit.startsWith("5."))
  1605. {
  1606. end_after_time = true;
  1607. end_hour = 5;
  1608. end_minute = General.random(1, 59);
  1609. }
  1610. if(whenToQuit.startsWith("6."))
  1611. {
  1612. end_after_time = true;
  1613. end_hour = 6;
  1614. end_minute = General.random(1, 59);
  1615. }
  1616. if(whenToQuit.startsWith("7."))
  1617. {
  1618. end_after_time = true;
  1619. end_hour = 7;
  1620. end_minute = General.random(1, 59);
  1621. }
  1622. if(whenToQuit.startsWith("8."))
  1623. {
  1624. end_after_time = true;
  1625. end_hour = 8;
  1626. end_minute = General.random(1, 59);
  1627. }
  1628. if(whenToQuit.startsWith("9."))
  1629. {
  1630. end_after_time = true;
  1631. end_hour = 9;
  1632. end_minute = General.random(1, 59);
  1633. }
  1634. if(whenToQuit.startsWith("10."))
  1635. {
  1636. end_after_time = true;
  1637. end_hour = 10;
  1638. end_minute = General.random(1, 59);
  1639. }
  1640. if(whenToQuit.startsWith("11."))
  1641. {
  1642. end_after_time = true;
  1643. end_hour = 11;
  1644. end_minute = General.random(1, 59);
  1645. }
  1646. if(whenToQuit.startsWith("12."))
  1647. {
  1648. end_after_time = true;
  1649. end_hour = 12;
  1650. end_minute = General.random(1, 59);
  1651. }
  1652.  
  1653. if(speed.startsWith("130")) Mouse.setSpeed(General.random(130, 140));
  1654. if(speed.startsWith("140")) Mouse.setSpeed(General.random(140, 150));
  1655. if(speed.startsWith("150")) Mouse.setSpeed(General.random(150, 160));
  1656. if(speed.startsWith("160")) Mouse.setSpeed(General.random(160, 170));
  1657. if(speed.startsWith("170")) Mouse.setSpeed(General.random(170, 200));
  1658. if(myTask.startsWith("1.")) taskToDo = 1;
  1659. if(myTask.startsWith("2.")) taskToDo = 2;
  1660. can_kill_mugger = canKillMugger.isSelected();
  1661. if(soloc.startsWith("1.")) softenloc = 1;
  1662. if(soloc.startsWith("2.")) softenloc = 2;
  1663. isMember = isaccmemb.isSelected();
  1664. skipWait = skip_intro.isSelected();
  1665. GUIWait = false;
  1666. g.dispose();
  1667. }
  1668.  
  1669. private void initComponents() {
  1670. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  1671. // Generated using JFormDesigner Evaluation license - TheD
  1672. menuBar1 = new JMenuBar();
  1673. menu1 = new JMenu();
  1674. thedtribot = new JMenuItem();
  1675. dscriptingcom = new JMenuItem();
  1676. moredscripts = new JMenuItem();
  1677. dialogPane = new JPanel();
  1678. contentPanel = new JPanel();
  1679. message = new JLabel();
  1680. tabbedPane1 = new JTabbedPane();
  1681. panel1 = new JPanel();
  1682. label1 = new JLabel();
  1683. label2 = new JLabel();
  1684. label3 = new JLabel();
  1685. taskSelected = new JComboBox<>();
  1686. mouseSpeed = new JComboBox<>();
  1687. label6 = new JLabel();
  1688. skip_intro = new JCheckBox();
  1689. isaccmemb = new JCheckBox();
  1690. label11 = new JLabel();
  1691. endscriptTimer = new JComboBox<>();
  1692. panel2 = new JPanel();
  1693. canKillMugger = new JCheckBox();
  1694. label5 = new JLabel();
  1695. tacticToUse = new JComboBox<>();
  1696. scrollPane1 = new JScrollPane();
  1697. MiningIntro = new JTextPane();
  1698. panel3 = new JPanel();
  1699. label9 = new JLabel();
  1700. softenlocation = new JComboBox<>();
  1701. SoftningIntro = new JTextPane();
  1702. buttonBar = new JPanel();
  1703. StartScript = new JButton();
  1704.  
  1705. //======== this ========
  1706. setAlwaysOnTop(true);
  1707. setResizable(false);
  1708. setTitle("DScripts by TheD");
  1709. Container contentPane = getContentPane();
  1710. contentPane.setLayout(new BorderLayout());
  1711.  
  1712. //======== menuBar1 ========
  1713. {
  1714.  
  1715. //======== menu1 ========
  1716. {
  1717. menu1.setText("General");
  1718.  
  1719. //---- thedtribot ----
  1720. thedtribot.setText("TheD TRiBot Profile");
  1721. thedtribot.addActionListener(e -> thedtribotActionPerformed(e));
  1722. menu1.add(thedtribot);
  1723.  
  1724. //---- dscriptingcom ----
  1725. dscriptingcom.setText("D-Scripting.com");
  1726. dscriptingcom.addActionListener(e -> dscriptingcomActionPerformed(e));
  1727. menu1.add(dscriptingcom);
  1728.  
  1729. //---- moredscripts ----
  1730. moredscripts.setText("More DScripts");
  1731. moredscripts.addActionListener(e -> moredscriptsActionPerformed(e));
  1732. menu1.add(moredscripts);
  1733. }
  1734. menuBar1.add(menu1);
  1735. }
  1736. setJMenuBar(menuBar1);
  1737.  
  1738. //======== dialogPane ========
  1739. {
  1740. dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
  1741.  
  1742. // JFormDesigner evaluation mark
  1743. dialogPane.setBorder(new javax.swing.border.CompoundBorder(
  1744. new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
  1745. "DScripting limited", javax.swing.border.TitledBorder.CENTER,
  1746. javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
  1747. java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});
  1748.  
  1749. dialogPane.setLayout(new BorderLayout());
  1750.  
  1751. //======== contentPanel ========
  1752. {
  1753.  
  1754. //---- message ----
  1755. message.setText("Message: ");
  1756. message.setFont(new Font("Tahoma", Font.PLAIN, 14));
  1757.  
  1758. //======== tabbedPane1 ========
  1759. {
  1760. tabbedPane1.setFont(new Font("Tahoma", Font.PLAIN, 14));
  1761.  
  1762. //======== panel1 ========
  1763. {
  1764.  
  1765. //---- label1 ----
  1766. label1.setText("DClay");
  1767. label1.setFont(new Font("Tahoma", Font.PLAIN, 48));
  1768.  
  1769. //---- label2 ----
  1770. label2.setText("Everything clay");
  1771. label2.setFont(new Font("Tahoma", Font.PLAIN, 24));
  1772.  
  1773. //---- label3 ----
  1774. label3.setText("What are we gonna do?");
  1775. label3.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1776.  
  1777. //---- taskSelected ----
  1778. taskSelected.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1779. taskSelected.setModel(new DefaultComboBoxModel<>(new String[] {
  1780. "1. Mine clay",
  1781. "2. Soften clay"
  1782. }));
  1783.  
  1784. //---- mouseSpeed ----
  1785. mouseSpeed.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1786. mouseSpeed.setModel(new DefaultComboBoxModel<>(new String[] {
  1787. "130 - 140 (Slow)",
  1788. "140 - 150 (Medium)",
  1789. "150 - 160 (Recommended)",
  1790. "160 - 170 (Fast)",
  1791. "170 - 200 (Very fast)"
  1792. }));
  1793. mouseSpeed.setSelectedIndex(2);
  1794.  
  1795. //---- label6 ----
  1796. label6.setText("Mouse speed:");
  1797. label6.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1798.  
  1799. //---- skip_intro ----
  1800. skip_intro.setText("Skip the 13 second instructions (Only recommended for advanced users)");
  1801. skip_intro.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1802.  
  1803. //---- isaccmemb ----
  1804. isaccmemb.setText("Account is member");
  1805. isaccmemb.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1806.  
  1807. //---- label11 ----
  1808. label11.setText("End script after:");
  1809. label11.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1810.  
  1811. //---- endscriptTimer ----
  1812. endscriptTimer.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1813. endscriptTimer.setModel(new DefaultComboBoxModel<>(new String[] {
  1814. "0. Never",
  1815. "1. +- 1 hour",
  1816. "2. +- 2 hours",
  1817. "3. +- 3 hours",
  1818. "4. +- 4 hours",
  1819. "5. +- 5 hours",
  1820. "6. +- 6 hours",
  1821. "7. +- 7 hours",
  1822. "8. +-8 hours",
  1823. "9. +- 9 hours",
  1824. "10. +- 10 hours",
  1825. "11. +- 11 hours",
  1826. "12. +- 12 hours"
  1827. }));
  1828.  
  1829. GroupLayout panel1Layout = new GroupLayout(panel1);
  1830. panel1.setLayout(panel1Layout);
  1831. panel1Layout.setHorizontalGroup(
  1832. panel1Layout.createParallelGroup()
  1833. .addGroup(panel1Layout.createSequentialGroup()
  1834. .addGroup(panel1Layout.createParallelGroup()
  1835. .addGroup(panel1Layout.createSequentialGroup()
  1836. .addComponent(label1)
  1837. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  1838. .addComponent(label2))
  1839. .addGroup(panel1Layout.createSequentialGroup()
  1840. .addGroup(panel1Layout.createParallelGroup()
  1841. .addComponent(label3)
  1842. .addComponent(label6)
  1843. .addComponent(label11))
  1844. .addGap(18, 18, 18)
  1845. .addGroup(panel1Layout.createParallelGroup()
  1846. .addComponent(endscriptTimer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  1847. .addComponent(mouseSpeed, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  1848. .addComponent(taskSelected, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
  1849. .addComponent(skip_intro)
  1850. .addComponent(isaccmemb))
  1851. .addGap(0, 95, Short.MAX_VALUE))
  1852. );
  1853. panel1Layout.setVerticalGroup(
  1854. panel1Layout.createParallelGroup()
  1855. .addGroup(panel1Layout.createSequentialGroup()
  1856. .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  1857. .addComponent(label2)
  1858. .addComponent(label1))
  1859. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  1860. .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  1861. .addComponent(label3)
  1862. .addComponent(taskSelected, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1863. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  1864. .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  1865. .addComponent(label6)
  1866. .addComponent(mouseSpeed, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1867. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  1868. .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  1869. .addComponent(label11)
  1870. .addComponent(endscriptTimer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1871. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  1872. .addComponent(skip_intro)
  1873. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  1874. .addComponent(isaccmemb)
  1875. .addContainerGap(177, Short.MAX_VALUE))
  1876. );
  1877. }
  1878. tabbedPane1.addTab("General", panel1);
  1879.  
  1880. //======== panel2 ========
  1881. {
  1882.  
  1883. //---- canKillMugger ----
  1884. canKillMugger.setText("My account can kill a mugger (lvl6) if unchecked, will run from mugger");
  1885. canKillMugger.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1886.  
  1887. //---- label5 ----
  1888. label5.setText("Tactic to use:");
  1889. label5.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1890.  
  1891. //---- tacticToUse ----
  1892. tacticToUse.setModel(new DefaultComboBoxModel<>(new String[] {
  1893. "1. Varrock ore 1 (Start Varrock west)",
  1894. "2. Varrock ore 2 (Start Varrock west)",
  1895. "3. Varrock ore 1 & 2 (Start Varrock west)",
  1896. "4. Varrock ore 1 & 2 randomized (Start Varrock west)",
  1897. "5. Varrock ore 3 (Start Varrock west)",
  1898. "6. (SOON)",
  1899. "7. Falador ore 1(Start East Falador bank)",
  1900. "8. Falador ore 2(Start East Falador bank)"
  1901. }));
  1902. tacticToUse.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1903. tacticToUse.setSelectedIndex(3);
  1904. tacticToUse.addActionListener(e -> tacticToUseActionPerformed(e));
  1905.  
  1906. //======== scrollPane1 ========
  1907. {
  1908.  
  1909. //---- MiningIntro ----
  1910. MiningIntro.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1911. MiningIntro.setText("Welcome to DClay - Mining.\n\nStart the script at spawn or Lumbridge. The script\ncurrently supports start-up walking for Varrock &\nFalador mining locations. ");
  1912. MiningIntro.setEditable(false);
  1913. scrollPane1.setViewportView(MiningIntro);
  1914. }
  1915.  
  1916. GroupLayout panel2Layout = new GroupLayout(panel2);
  1917. panel2.setLayout(panel2Layout);
  1918. panel2Layout.setHorizontalGroup(
  1919. panel2Layout.createParallelGroup()
  1920. .addGroup(panel2Layout.createSequentialGroup()
  1921. .addContainerGap()
  1922. .addGroup(panel2Layout.createParallelGroup()
  1923. .addComponent(canKillMugger)
  1924. .addGroup(panel2Layout.createSequentialGroup()
  1925. .addComponent(label5)
  1926. .addGap(18, 18, 18)
  1927. .addComponent(tacticToUse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1928. .addComponent(scrollPane1))
  1929. .addContainerGap(95, Short.MAX_VALUE))
  1930. );
  1931. panel2Layout.setVerticalGroup(
  1932. panel2Layout.createParallelGroup()
  1933. .addGroup(panel2Layout.createSequentialGroup()
  1934. .addContainerGap()
  1935. .addComponent(canKillMugger)
  1936. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  1937. .addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  1938. .addComponent(label5)
  1939. .addComponent(tacticToUse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1940. .addGap(18, 18, 18)
  1941. .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  1942. .addContainerGap(218, Short.MAX_VALUE))
  1943. );
  1944. }
  1945. tabbedPane1.addTab("Mining", panel2);
  1946.  
  1947. //======== panel3 ========
  1948. {
  1949.  
  1950. //---- label9 ----
  1951. label9.setText("Soften location:");
  1952. label9.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1953.  
  1954. //---- softenlocation ----
  1955. softenlocation.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1956. softenlocation.setModel(new DefaultComboBoxModel<>(new String[] {
  1957. "1. Falador - East bank",
  1958. "2. Edgeville"
  1959. }));
  1960.  
  1961. //---- SoftningIntro ----
  1962. SoftningIntro.setFont(new Font("Tahoma", Font.PLAIN, 12));
  1963. SoftningIntro.setText("Welcome to DClay - Softning.\n\nStart the script in the selected bank with atleast 14 buckets in the bank and 14 clay. Softning does not\nsupport start-up walking at this point.");
  1964. SoftningIntro.setEditable(false);
  1965.  
  1966. GroupLayout panel3Layout = new GroupLayout(panel3);
  1967. panel3.setLayout(panel3Layout);
  1968. panel3Layout.setHorizontalGroup(
  1969. panel3Layout.createParallelGroup()
  1970. .addGroup(panel3Layout.createSequentialGroup()
  1971. .addGroup(panel3Layout.createParallelGroup()
  1972. .addGroup(panel3Layout.createSequentialGroup()
  1973. .addComponent(label9)
  1974. .addGap(102, 102, 102)
  1975. .addComponent(softenlocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1976. .addComponent(SoftningIntro, GroupLayout.PREFERRED_SIZE, 413, GroupLayout.PREFERRED_SIZE))
  1977. .addGap(0, 107, Short.MAX_VALUE))
  1978. );
  1979. panel3Layout.setVerticalGroup(
  1980. panel3Layout.createParallelGroup()
  1981. .addGroup(panel3Layout.createSequentialGroup()
  1982. .addContainerGap()
  1983. .addGroup(panel3Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  1984. .addComponent(label9)
  1985. .addComponent(softenlocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  1986. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  1987. .addComponent(SoftningIntro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  1988. .addContainerGap(253, Short.MAX_VALUE))
  1989. );
  1990. }
  1991. tabbedPane1.addTab("Clay softning", panel3);
  1992. }
  1993.  
  1994. GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
  1995. contentPanel.setLayout(contentPanelLayout);
  1996. contentPanelLayout.setHorizontalGroup(
  1997. contentPanelLayout.createParallelGroup()
  1998. .addGroup(contentPanelLayout.createSequentialGroup()
  1999. .addContainerGap()
  2000. .addComponent(message, GroupLayout.PREFERRED_SIZE, 423, GroupLayout.PREFERRED_SIZE)
  2001. .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  2002. .addComponent(tabbedPane1)
  2003. );
  2004. contentPanelLayout.setVerticalGroup(
  2005. contentPanelLayout.createParallelGroup()
  2006. .addGroup(contentPanelLayout.createSequentialGroup()
  2007. .addComponent(tabbedPane1)
  2008. .addGap(18, 18, 18)
  2009. .addComponent(message, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE))
  2010. );
  2011. }
  2012. dialogPane.add(contentPanel, BorderLayout.CENTER);
  2013.  
  2014. //======== buttonBar ========
  2015. {
  2016. buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
  2017. buttonBar.setLayout(new GridBagLayout());
  2018. ((GridBagLayout)buttonBar.getLayout()).columnWidths = new int[] {0, 80};
  2019. ((GridBagLayout)buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0};
  2020.  
  2021. //---- StartScript ----
  2022. StartScript.setText("Start Script");
  2023. StartScript.setFont(new Font("Tahoma", Font.PLAIN, 14));
  2024. StartScript.addActionListener(e -> StartScriptActionPerformed(e));
  2025. buttonBar.add(StartScript, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
  2026. GridBagConstraints.CENTER, GridBagConstraints.BOTH,
  2027. new Insets(0, 0, 0, 0), 0, 0));
  2028. }
  2029. dialogPane.add(buttonBar, BorderLayout.SOUTH);
  2030. }
  2031. contentPane.add(dialogPane, BorderLayout.CENTER);
  2032. pack();
  2033. setLocationRelativeTo(getOwner());
  2034. // JFormDesigner - End of component initialization //GEN-END:initComponents
  2035. }
  2036.  
  2037. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  2038. // Generated using JFormDesigner Evaluation license - TheD
  2039. private JMenuBar menuBar1;
  2040. private JMenu menu1;
  2041. private JMenuItem thedtribot;
  2042. private JMenuItem dscriptingcom;
  2043. private JMenuItem moredscripts;
  2044. private JPanel dialogPane;
  2045. private JPanel contentPanel;
  2046. private JLabel message;
  2047. private JTabbedPane tabbedPane1;
  2048. private JPanel panel1;
  2049. private JLabel label1;
  2050. private JLabel label2;
  2051. private JLabel label3;
  2052. private JComboBox<String> taskSelected;
  2053. private JComboBox<String> mouseSpeed;
  2054. private JLabel label6;
  2055. private JCheckBox skip_intro;
  2056. private JCheckBox isaccmemb;
  2057. private JLabel label11;
  2058. private JComboBox<String> endscriptTimer;
  2059. private JPanel panel2;
  2060. private JCheckBox canKillMugger;
  2061. private JLabel label5;
  2062. private JComboBox<String> tacticToUse;
  2063. private JScrollPane scrollPane1;
  2064. private JTextPane MiningIntro;
  2065. private JPanel panel3;
  2066. private JLabel label9;
  2067. private JComboBox<String> softenlocation;
  2068. private JTextPane SoftningIntro;
  2069. private JPanel buttonBar;
  2070. private JButton StartScript;
  2071. // JFormDesigner - End of variables declaration //GEN-END:variables
  2072. }
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080. void openSite(String url)
  2081. {
  2082. URL a = null;
  2083. try {
  2084. a = new URL(url);
  2085. } catch (MalformedURLException e1) {
  2086. System.out.println("ERROR OPENING URL");
  2087. e1.printStackTrace();
  2088. }
  2089. openWebpage(a);
  2090. }
  2091.  
  2092. public void openWebpage(URI uri) {
  2093. Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
  2094. if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
  2095. try {
  2096. desktop.browse(uri);
  2097. } catch (Exception e) {
  2098. e.printStackTrace();
  2099. }
  2100. }
  2101. }
  2102.  
  2103. public void openWebpage(URL url) {
  2104. try {
  2105. openWebpage(url.toURI());
  2106. } catch (URISyntaxException e) {
  2107. e.printStackTrace();
  2108. }
  2109. }
  2110.  
  2111. @Override
  2112. public void clanMessageReceived(String arg0, String arg1) {
  2113. // TODO Auto-generated method stub
  2114.  
  2115. }
  2116.  
  2117. @Override
  2118. public void duelRequestReceived(String arg0, String arg1) {
  2119. // TODO Auto-generated method stub
  2120.  
  2121. }
  2122.  
  2123. @Override
  2124. public void personalMessageReceived(String arg0, String arg1) {
  2125. // TODO Auto-generated method stub
  2126.  
  2127. }
  2128.  
  2129. @Override
  2130. public void playerMessageReceived(String arg0, String arg1) {
  2131. // TODO Auto-generated method stub
  2132.  
  2133. }
  2134.  
  2135. @Override
  2136. public void serverMessageReceived(String s)
  2137. {
  2138. if(s.startsWith("Oh dear")) {
  2139. pathLocation = 0;
  2140. if(pickeq)
  2141. {
  2142. equippick = true;
  2143. }
  2144. System.out.println("We recieved a server message, we died... :(");
  2145. }
  2146.  
  2147. }
  2148.  
  2149. @Override
  2150. public void tradeRequestReceived(String arg0) {
  2151. // TODO Auto-generated method stub
  2152.  
  2153. }
  2154.  
  2155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement