Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.39 KB | None | 0 0
  1. program Mikebot_v8; // by Thehispanic/Gangstamikey - April 11, 2011
  2. var x, y, MageKey, HealKey, Monster, HitCount, AntiF, Monsters, Direction, TargetDirection, MoveDirection, PotsUsed:Integer;
  3. //Key Codes
  4. var F1, F2, F3, F4, F5, F6, F7, F8, Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9, ArrowLeft, ArrowDown, ArrowRight, ArrowUp, Ctrl:Integer;
  5. var KsDirection:String;
  6. const
  7. //Relog settings
  8. Username = 'your username';
  9. Password = 'your password';
  10. CharacterNum = '1';
  11. DelayUserInput = 'true'; // Wait extra at login, for lag
  12.  
  13. //General Settings
  14. HitCountReset = 30; //Time between checking if hitting in wrong direction(Do not set too low or your char will jump around trying to turn too fast)
  15. AntiFReset = 60; //Time before reloging if still attacking a single monster
  16. Archer = 'false'; //Not added yet, but will use range if true
  17.  
  18. //Healing settings
  19. Pots = 'normal'; // herbs, normal
  20. HealType = 'none'; // self, clickheal (none = off/no healing)
  21. //HeartsToPot = 5; // When hp is down to selected heart, Mikebot will pot.(cannot be 9, only 1-8)
  22. HerbsForFull = 50; // Amount of herbs to use when potting
  23.  
  24. //Mage settings
  25. MageEnabled = 'true'; // Fire/Thunder etc. (Also depends on what you have in the F key you set for "MageFKey")
  26.  
  27. //Spell Hotkey settings
  28. HealFKey = 'F2'; //F1-F8
  29. MageFKey = 'F3'; //F1-F8
  30.  
  31. {#####Mini-Guide#####
  32. 1. Put your account details in the "Username" and "Password" single-quotes.(')
  33. 1.b. Make sure you have your color set to 32-bit for XP, 16-bit for Vista/Win7.(Found in Control Panel)
  34. 2. Put the number of the character to auto with.('1', '2', '3')
  35. 3. Select the type of pots to use, you must have them in inv or it will log out.('herbs', 'small', 'med', 'large')
  36. 4. Set heal and mage to true/false if you want them on: true, off: false.
  37. 5. Set the Mage-F-Key and Heal-F-Key to a F key(F1-F8, "F" must be capital!)
  38.  
  39. Enjoy! All credits go to Thehispanic/Gangstamikey}
  40. Procedure ReadString(str: String);
  41. var i,strLength :Integer; goer: Boolean;
  42. begin
  43. i:=1
  44. strLength:=Length(str)
  45. goer:=False
  46. while(i<strLength+1) do
  47. begin
  48. if(GetKeyCode(StrGet(str,i))=191)then
  49. begin
  50. KeyDown(16)
  51. goer:=True
  52. i:=i+1
  53. end;
  54. KeyDown(GetKeyCode(StrGet(str,i)))
  55. wait(25)
  56. KeyUp(GetKeyCode(StrGet(str,i)))
  57. wait(50)
  58. KeyUp(GetKeyCode(StrGet(str,i)))
  59. wait(25)
  60. i:=i+1
  61. if(goer=True)then
  62. begin
  63. KeyUp(16)
  64. wait(300)
  65. end;
  66. end;
  67. end;
  68. Procedure SetMageKey;
  69. begin
  70. if(MageFKey = 'F1') then begin MageKey := F1; end
  71. else if(MageFKey = 'F2') then begin MageKey := F2; end
  72. else if(MageFKey = 'F3') then begin MageKey := F3; end
  73. else if(MageFKey = 'F4') then begin MageKey := F4; end
  74. else if(MageFKey = 'F5') then begin MageKey := F5; end
  75. else if(MageFKey = 'F6') then begin MageKey := F6; end
  76. else if(MageFKey = 'F7') then begin MageKey := F7; end
  77. else if(MageFKey = 'F8') then begin MageKey := F8; end
  78. writeln('Mage key set.');
  79. end;
  80. Procedure SetHealKey;
  81. begin
  82. if(HealFKey = 'F1') then begin HealKey := F1; end
  83. else if(HealFKey = 'F2') then begin HealKey := F2; end
  84. else if(HealFKey = 'F3') then begin HealKey := F3; end
  85. else if(HealFKey = 'F4') then begin HealKey := F4; end
  86. else if(HealFKey = 'F5') then begin HealKey := F5; end
  87. else if(HealFKey = 'F6') then begin HealKey := F6; end
  88. else if(HealFKey = 'F7') then begin HealKey := F7; end
  89. else if(HealFKey = 'F8') then begin HealKey := F8; end
  90. writeln('Heal key set.');
  91. end;
  92.  
  93. Procedure Click(x, y :Integer);
  94. begin
  95. Movemouse(x, y);
  96. ClickMouse(x, y, true);
  97. end;
  98.  
  99. Procedure KeyDUp(Key :Byte);
  100. begin
  101. KeyDown(Key);
  102. Wait(10);
  103. KeyUp(Key);
  104. end;
  105.  
  106. Procedure Turn;
  107. begin
  108. KeyUp(Ctrl);
  109. Wait(100);
  110. KeyDown(Direction);
  111. Wait(100);
  112. KeyUp(Direction);
  113. end;
  114.  
  115. Procedure Login;
  116. begin
  117. writeln('Logging in.');
  118. if(FindColor(x, y, 10276608, 362, 314, 437, 332)) then begin // Check for "Login request denied", "Connection not found", "D/C" to retry
  119. ClickMouse(399, 322, true);
  120. Wait(100); Login;
  121. end
  122. ClickMouse(109, 368, true); // Click "Play Game"
  123. repeat
  124. Wait(100);
  125. until(FindColor(x, y, 255, 470, 328, 545, 340) or FindColor(x, y, 10276608, 362, 314, 437, 332))
  126. if(DelayUserInput = 'true') then begin Wait(1200); end else begin Wait(300); end
  127. ReadString(Username);
  128. ClickMouse(416, 388, true); // Click password textbox
  129. Wait(50); ReadString(Password);
  130. ClickMouse(403, 431, true); // Click "Connect"
  131. Wait(500);
  132. if(FindColor(x, y, 10276608, 362, 314, 437, 332)) then begin // Check for "Login request denied", "Connection not found", "D/C" to retry
  133. ClickMouse(399, 322, true);
  134. Wait(100); Login;
  135. end
  136. //Pause till login screen
  137. repeat
  138. Wait(500);
  139. until(FindColor(x, y, 255, 338, 168, 353, 185) or FindColor(x, y, 10276608, 362, 314, 437, 332))
  140. // Click login on the character
  141. repeat
  142. KeyDown(GetKeyCode(CharacterNum));
  143. Wait(10);
  144. KeyUp(GetKeyCode(CharacterNum));
  145. Wait(10);
  146. until(FindColor(x, y, 255, 338, 168, 353, 185) = false)
  147. Wait(500);
  148. ClickMouse(79, 366, true);
  149. // Check if stuck at login screen(Not needed until a problem)
  150. end;
  151.  
  152. Procedure CheckDc;
  153. begin
  154. if(FindColor(x, y, 10276608, 357, 217, 437, 239)) then begin
  155. KeyUp(Ctrl);
  156. Click(x, y);
  157. Login;
  158. end
  159. if(FindColor(x, y, 10276608, 413, 301, 492, 321)) then begin // Paperdoll
  160. Click(451, 311);
  161. end
  162. if(FindColor(x, y, 6514175, 355, 215, 440, 239)) then begin // Exit game box
  163. Click(396, 228);
  164. end
  165. end;
  166.  
  167. Procedure Relog;
  168. begin
  169. Click(599, 48);
  170. Click(323, 225);// Logout
  171. Login;
  172. AntiF := AntiFReset;
  173. HitCount := HitCountReset;
  174. end;
  175.  
  176. Procedure Mage;
  177. begin
  178. if((MageEnabled = 'true') and (FindColor(x, y, 6500574, 235, 38, 236, 38) = false)) then begin
  179. if(FindColor(x, y, Monster, 12, 49, 626, 336)) then begin
  180. writeln('Engaging Mage on monster at '+ inttostr(x) +', '+ inttostr(y) +'.');
  181. KeyDown(MageKey);
  182. Wait(20);
  183. KeyUp(MageKey);
  184. Wait(10);
  185. MoveMouseSmooth(x, y); Wait(1); ClickMouse(x, y, true);
  186. Wait(2000); //1700
  187. end
  188. end
  189. end;
  190.  
  191. Procedure Heal;
  192. begin
  193. if((FindColor(x, y, 16236180, 202, 38, 203, 39)) and (FindColor(x, y, 6500574, 235, 38, 236, 38) = false) and (FindColor(x, y, Monster, 12, 49, 626, 336) = false)) then begin
  194. if(HealType = 'self') then begin
  195. KeyDown(HealKey);
  196. Wait(30);
  197. KeyUp(HealKey);
  198. Wait(1000);
  199. end
  200. else if(HealType = 'clickheal') then begin
  201. KeyDown(HealKey);
  202. Wait(30);
  203. KeyUp(HealKey);
  204. Wait(10);
  205. MoveMouseSmooth(317, 188); Wait(1); ClickMouse(317, 188, true);
  206. Wait(2000); //1700
  207. end
  208. end
  209. end;
  210.  
  211. Procedure AutoPot;
  212. var herbers, Xhp, TimesBy, Herts:Integer;
  213. begin
  214. herbers := HerbsForFull;
  215. //Herts := HeartsToPot;
  216. ///TimesBy := 8 * Herts;
  217. //Xhp := 128 + TimesBy;
  218. if(FindColor(x, y, 16236180, 163, 38, 164, 39)) then begin
  219. Click(81, 366);
  220. Wait(200);
  221. if((Pots = 'herbs') and FindColor(x, y, 33792, 115, 365, 476, 467)) then begin
  222. repeat
  223. herbers := herbers -1;
  224. Click(x, y);
  225. Wait(8);
  226. Click(x, y);
  227. Wait(10);
  228. CheckDc;
  229. until(herbers <= 0)
  230. end
  231. else if((Pots = 'normal') and FindColor(x, y, 33412, 115, 365, 476, 467)) then begin
  232. Click(x, y);
  233. Wait(8);
  234. Click(x, y);
  235. Wait(200);
  236. Potsused := PotsUsed + 1;
  237. end
  238. if(FindColor(x, y, 657930, 238, 34, 239, 35)) then begin // check TP
  239. Click(81, 366);
  240. Wait(100);
  241. if(FindColor(x, y, 16711812, 115, 365, 476, 467)) then begin
  242. Click(x, y);
  243. Wait(8);
  244. Click(x, y);
  245. Wait(10);
  246. end
  247. end
  248. end
  249. end;
  250. Procedure Status;
  251. begin
  252. if(FindWindowTitlePart('endless online', false)) then begin
  253. activateclient;
  254. end
  255. cleardebug;
  256. writeln('');
  257. writeln('');
  258. writeln('');
  259. writeln('');
  260. writeln('');
  261. writeln('');
  262. writeln('Monsters killed: '+ inttostr(Monsters) +' | HitCount: '+ inttostr(HitCount) + ' | AntiFreeze: ' + inttostr(AntiF) +' | Pots Used: '+ inttostr(PotsUsed));
  263. end;
  264.  
  265. Procedure AntiFreeze;
  266. begin
  267. AntiF := AntiF - 1;
  268. Status;
  269. if(AntiF <= 0) then begin
  270. writeln('Frozen or some shit, time to relog.');
  271. KeyUp(Ctrl);
  272. Wait(10);
  273. Relog;
  274. Wait(20);
  275. keyDown(17);
  276. Wait(20);
  277. end
  278. end;
  279. Procedure DoHitCount;
  280. begin
  281. HitCount := HitCount - 1;
  282. if(HitCount <= 0) then begin
  283. KeyUp(Ctrl); Wait(50); Direction := TargetDirection;
  284. Wait(500);
  285. if(((Direction = ArrowLeft) and FindColor(x, y, Monster, 274, 163, 298, 178)) or ((Direction = ArrowDown) and FindColor(x, y, Monster, 272, 188, 295, 197)) or ((Direction = ArrowRight) and FindColor(x, y, Monster, 332, 187, 360, 200)) or ((Direction = ArrowUp) and FindColor(x, y, Monster, 330, 160, 358, 176))) then begin
  286. writeln('Turning to monster again, maybe I''m hitting in the wrong direction.');
  287. Turn;
  288. HitCount := HitCountReset;
  289. KeyDown(17);
  290. end
  291. end
  292. end;
  293.  
  294. Procedure Left;
  295. begin
  296. If (FindColor(x, y, Monster, 274, 163, 298, 178)) then begin
  297. writeln('Engaging Melee on monster on the Left');
  298. TargetDirection := ArrowLeft;
  299. if((Direction = TargetDirection) = false) then begin
  300. Direction := ArrowLeft;
  301. Turn;
  302. end
  303. Wait(50);
  304. KeyDown(17);
  305. Wait(200);
  306. repeat
  307. AutoPot;
  308. AntiFreeze;
  309. DoHitCount;
  310. Wait(500);
  311. until((FindColor(x, y, Monster, 274, 163, 298, 178) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  312. HitCount := HitCountReset;
  313. AntiF := AntiFReset;
  314. KeyUp(Ctrl);
  315. Wait(500);
  316. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  317. KsDirection := 'Left';
  318. end
  319. else begin
  320. Monsters := Monsters + 1;
  321. end
  322. end
  323. end;
  324. Procedure Down;
  325. begin
  326. If (FindColor(x, y, Monster, 271, 189, 305, 195)) then begin
  327. writeln('Engaging Melee on monster on the Bottom');
  328. TargetDirection := ArrowDown;
  329. if((Direction = TargetDirection) = false) then begin
  330. Direction := ArrowDown;
  331. Turn;
  332. end
  333. Wait(50);
  334. KeyDown(17);
  335. Wait(200);
  336. repeat
  337. AutoPot;
  338. AntiFreeze;
  339. DoHitCount;
  340. Wait(500);
  341. until((FindColor(x, y, Monster, 271, 189, 305, 195) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  342. HitCount := HitCountReset;
  343. AntiF := AntiFReset;
  344. KeyUp(Ctrl);
  345. Wait(500);
  346. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  347. KsDirection := 'Down';
  348. end
  349. else begin
  350. Monsters := Monsters + 1;
  351. end
  352. end
  353. end;
  354. Procedure Right;
  355. begin
  356. If (FindColor(x, y, Monster, 332, 187, 360, 200)) then begin
  357. writeln('Engaging Melee on monster on the Right');
  358. TargetDirection := ArrowRight;
  359. if((Direction = TargetDirection) = false) then begin
  360. Direction := ArrowRight;
  361. Turn;
  362. end
  363. Wait(50);
  364. KeyDown(17);
  365. Wait(200);
  366. repeat
  367. AutoPot;
  368. AntiFreeze;
  369. DoHitCount;
  370. Wait(500);
  371. until((FindColor(x, y, Monster, 332, 187, 360, 200) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  372. HitCount := HitCountReset;
  373. AntiF := AntiFReset;
  374. KeyUp(Ctrl);
  375. Wait(500);
  376. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  377. KsDirection := 'Right';
  378. end
  379. else begin
  380. Monsters := Monsters + 1;
  381. end
  382. end
  383. end;
  384. Procedure Up;
  385. begin
  386. If (FindColor(x, y, Monster, 335, 164, 358, 176)) then begin
  387. writeln('Engaging Melee on monster on the Top');
  388. TargetDirection := ArrowUp;
  389. if((Direction = TargetDirection) = false) then begin
  390. Direction := ArrowUp;
  391. Turn;
  392. end
  393. Wait(50);
  394. KeyDown(17);
  395. Wait(200);
  396. repeat
  397. AutoPot;
  398. AntiFreeze;
  399. DoHitCount;
  400. Wait(500);
  401. until((FindColor(x, y, Monster, 335, 164, 358, 176) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  402. HitCount := HitCountReset;
  403. AntiF := AntiFReset;
  404. KeyUp(Ctrl);
  405. Wait(500);
  406. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  407. KsDirection := 'Up';
  408. end
  409. else begin
  410. Monsters := Monsters + 1;
  411. end
  412. end
  413. end;
  414. Procedure CheckSides;
  415. begin
  416. if(KsDirection = 'Left') then begin
  417. Down;
  418. Right;
  419. Up;
  420. Left;
  421. end
  422. else if(KsDirection = 'Down') then begin
  423. Left;
  424. Right;
  425. Up;
  426. Down;
  427. end
  428. else if(KsDirection = 'Right') then begin
  429. Left;
  430. Down;
  431. Up;
  432. Right;
  433. end
  434. else begin
  435. Left;
  436. Down;
  437. Right;
  438. Up;
  439. end
  440. end;
  441.  
  442. Procedure MoveHome;
  443. var waits:Integer;
  444. begin
  445. if(MoveDirection = ArrowLeft) then begin
  446. CheckSides;
  447. Wait(800);
  448. Direction := ArrowRight;
  449. KeyDown(Direction);
  450. Wait(440);
  451. KeyUp(Direction);
  452. Wait(700); AutoPot;
  453. KeyDUp(123); //Refresh
  454. Wait(600); AutoPot;
  455. MoveDirection := 0;
  456. end
  457. else if(MoveDirection = ArrowDown) then begin
  458. CheckSides;
  459. Wait(800);
  460. Direction := ArrowUp;
  461. KeyDown(Direction);
  462. Wait(440);
  463. KeyUp(Direction);
  464. Wait(700); AutoPot;
  465. KeyDUp(123); //Refresh
  466. Wait(1000); AutoPot;
  467. MoveDirection := 0;
  468. end
  469. else if(MoveDirection = ArrowRight) then begin
  470. CheckSides;
  471. Wait(800);
  472. Direction := ArrowLeft;
  473. KeyDown(Direction);
  474. Wait(440);
  475. KeyUp(Direction);
  476. Wait(700); AutoPot;
  477. KeyDUp(123); //Refresh
  478. Wait(1000); AutoPot;
  479. MoveDirection := 0;
  480. end
  481. else if(MoveDirection = ArrowUp) then begin
  482. CheckSides;
  483. Wait(800);
  484. Direction := ArrowDown;
  485. KeyDown(Direction);
  486. Wait(440);
  487. KeyUp(Direction);
  488. Wait(700); AutoPot;
  489. KeyDUp(123); //Refresh
  490. Wait(600); AutoPot;
  491. MoveDirection := 0;
  492. end
  493. end;
  494.  
  495. Procedure CheckTop;
  496. begin
  497. if(FindColor(x, y, Monster, 309, 174, 330, 185)) then begin
  498. KeyDown(Direction);
  499. Wait(440);
  500. KeyUp(Direction);
  501. Wait(700); AutoPot;
  502. KeyDUp(123);
  503. Wait(1000); AutoPot;
  504. KeyDUp(123);
  505. MoveDirection := Direction;
  506. CheckSides;
  507. end
  508. end;
  509.  
  510. Procedure CheckLoggedOut;
  511. begin
  512. if(FindColor(x, y, 16776960, 27, 342, 50, 349)) then begin
  513. Login;
  514. end
  515. end;
  516.  
  517. Procedure CheckDrop;
  518. begin
  519. if(FindColor(x, y, 8716032, 274, 205, 297, 210)) then begin
  520. MoveMouse(286, 205);
  521. Wait(200);
  522. ClickMouse(286, 205, true);
  523. Wait(2000);
  524. end
  525. else if(FindColor(x, y, 8716032, 340, 173, 361, 178)) then begin
  526. MoveMouse(349, 173);
  527. Wait(200);
  528. ClickMouse(349, 173, true);
  529. Wait(2000);
  530. end
  531. else if(FindColor(x, y, 8716032, 338, 205, 361, 210)) then begin
  532. MoveMouse(350, 204);
  533. Wait(200);
  534. ClickMouse(350, 204, true);
  535. Wait(2000);
  536. end
  537. else if(FindColor(x, y, 8716032, 274, 173, 297, 178)) then begin
  538. MoveMouse(286, 172);
  539. Wait(200);
  540. ClickMouse(286, 172, true);
  541. Wait(2000);
  542. end
  543. else if(FindColor(x, y, 8716032, 242, 189, 260, 194)) then begin
  544. MoveMouse(254, 188);
  545. Wait(200);
  546. ClickMouse(254, 188, true);
  547. Wait(2000);
  548. end
  549. else if(FindColor(x, y, 8716032, 306, 221, 329, 226)) then begin
  550. MoveMouse(318, 220);
  551. Wait(200);
  552. ClickMouse(318, 220, true);
  553. Wait(2000);
  554. end
  555. else if(FindColor(x, y, 8716032, 370, 189, 393, 194)) then begin
  556. MoveMouse(382, 189);
  557. Wait(200);
  558. ClickMouse(382, 189, true);
  559. Wait(2000);
  560. end
  561. else if(FindColor(x, y, 8716032, 306, 157, 329, 162)) then begin
  562. MoveMouse(317, 155);
  563. Wait(200);
  564. ClickMouse(317, 155, true);
  565. Wait(2000);
  566. end
  567. else if(FindColor(x, y, 8716032, 306, 189, 329, 194)) then begin
  568. MoveMouse(317, 188);
  569. Wait(200);
  570. ClickMouse(317, 188, true);
  571. Wait(2000);
  572. end
  573. end;
  574.  
  575. Procedure Settings;
  576. begin
  577. //Do not touch anything below unless you know what you're doing
  578. HitCount := HitCountReset;
  579. AntiF := AntiFReset;
  580. Direction := 0;
  581. MoveDirection := 0;
  582. Monster := 1638350;
  583. PotsUsed := 0;
  584. F1 := 112; F2 := 113; F3 := 114; F4 := 115; F5 := 116; F6 := 117; F7 := 118; F8 := 119;
  585. Num0 := 96; Num1 := 97; Num2 := 98; Num3 := 99; Num4 := 100; Num5 := 101; Num6 := 102; Num7 := 103; Num8 := 104; Num9 := 105;
  586. ArrowLeft := 37; ArrowDown := 40; ArrowRight := 39; ArrowUp := 38; Ctrl := 17;
  587. SetMageKey;
  588. SetHealKey;
  589. end;
  590.  
  591. // Begin Main Loop
  592. begin
  593. Settings;
  594. if(FindWindowTitlePart('endless online', false)) then begin
  595. activateclient;
  596. end
  597. else begin
  598. Writeln('Endless Online isn''t open or is minimized, please check and try again.');
  599. end
  600. ClearDebug;
  601. Writeln('Mikebot v8 - By Thehispanic/Gangstamikey');
  602. Wait(1000);
  603. CheckLoggedOut;
  604.  
  605. repeat
  606. CheckDc;
  607. AutoPot;
  608. CheckSides;
  609. Mage;
  610. Heal;
  611. CheckTop;
  612. MoveHome;
  613. CheckLoggedOut;
  614. Status;
  615. CheckDrop;
  616. Wait(100);
  617. until((false) or (isfkeydown(9)))
  618. KeyUp(Ctrl);
  619. end.
  620. //Relog settings
  621. Username = 'no-name';
  622. Password = 'No-Name';
  623. CharacterNum = '1';
  624. DelayUserInput = 'true'; // Wait extra at login, for lag
  625.  
  626. //General Settings
  627. HitCountReset = 30; //Time between checking if hitting in wrong direction(Do not set too low or your char will jump around trying to turn too fast)
  628. AntiFReset = 60; //Time before reloging if still attacking a single monster
  629. Archer = 'false'; //Not added yet, but will use range if true
  630.  
  631. //Healing settings
  632. Pots = 'normal'; // herbs, normal
  633. HealType = 'none'; // self, clickheal (none = off/no healing)
  634. //HeartsToPot = 5; // When hp is down to selected heart, Mikebot will pot.(cannot be 9, only 1-8)
  635. HerbsForFull = 50; // Amount of herbs to use when potting
  636.  
  637. //Mage settings
  638. MageEnabled = 'true'; // Fire/Thunder etc. (Also depends on what you have in the F key you set for "MageFKey")
  639.  
  640. //Spell Hotkey settings
  641. HealFKey = 'F2'; //F1-F8
  642. MageFKey = 'F3'; //F1-F8
  643.  
  644. {#####Mini-Guide#####
  645. 1. Put your account details in the "Username" and "Password" single-quotes.(')
  646. 1.b. Make sure you have your color set to 32-bit for XP, 16-bit for Vista/Win7.(Found in Control Panel)
  647. 2. Put the number of the character to auto with.('1', '2', '3')
  648. 3. Select the type of pots to use, you must have them in inv or it will log out.('herbs', 'small', 'med', 'large')
  649. 4. Set heal and mage to true/false if you want them on: true, off: false.
  650. 5. Set the Mage-F-Key and Heal-F-Key to a F key(F1-F8, "F" must be capital!)
  651.  
  652. Enjoy! All credits go to Thehispanic/Gangstamikey}
  653. Procedure ReadString(str: String);
  654. var i,strLength :Integer; goer: Boolean;
  655. begin
  656. i:=1
  657. strLength:=Length(str)
  658. goer:=False
  659. while(i<strLength+1) do
  660. begin
  661. if(GetKeyCode(StrGet(str,i))=191)then
  662. begin
  663. KeyDown(16)
  664. goer:=True
  665. i:=i+1
  666. end;
  667. KeyDown(GetKeyCode(StrGet(str,i)))
  668. wait(25)
  669. KeyUp(GetKeyCode(StrGet(str,i)))
  670. wait(50)
  671. KeyUp(GetKeyCode(StrGet(str,i)))
  672. wait(25)
  673. i:=i+1
  674. if(goer=True)then
  675. begin
  676. KeyUp(16)
  677. wait(300)
  678. end;
  679. end;
  680. end;
  681. Procedure SetMageKey;
  682. begin
  683. if(MageFKey = 'F1') then begin MageKey := F1; end
  684. else if(MageFKey = 'F2') then begin MageKey := F2; end
  685. else if(MageFKey = 'F3') then begin MageKey := F3; end
  686. else if(MageFKey = 'F4') then begin MageKey := F4; end
  687. else if(MageFKey = 'F5') then begin MageKey := F5; end
  688. else if(MageFKey = 'F6') then begin MageKey := F6; end
  689. else if(MageFKey = 'F7') then begin MageKey := F7; end
  690. else if(MageFKey = 'F8') then begin MageKey := F8; end
  691. writeln('Mage key set.');
  692. end;
  693. Procedure SetHealKey;
  694. begin
  695. if(HealFKey = 'F1') then begin HealKey := F1; end
  696. else if(HealFKey = 'F2') then begin HealKey := F2; end
  697. else if(HealFKey = 'F3') then begin HealKey := F3; end
  698. else if(HealFKey = 'F4') then begin HealKey := F4; end
  699. else if(HealFKey = 'F5') then begin HealKey := F5; end
  700. else if(HealFKey = 'F6') then begin HealKey := F6; end
  701. else if(HealFKey = 'F7') then begin HealKey := F7; end
  702. else if(HealFKey = 'F8') then begin HealKey := F8; end
  703. writeln('Heal key set.');
  704. end;
  705.  
  706. Procedure Click(x, y :Integer);
  707. begin
  708. Movemouse(x, y);
  709. ClickMouse(x, y, true);
  710. end;
  711.  
  712. Procedure KeyDUp(Key :Byte);
  713. begin
  714. KeyDown(Key);
  715. Wait(10);
  716. KeyUp(Key);
  717. end;
  718.  
  719. Procedure Turn;
  720. begin
  721. KeyUp(Ctrl);
  722. Wait(100);
  723. KeyDown(Direction);
  724. Wait(100);
  725. KeyUp(Direction);
  726. end;
  727.  
  728. Procedure Login;
  729. begin
  730. writeln('Logging in.');
  731. if(FindColor(x, y, 10276608, 362, 314, 437, 332)) then begin // Check for "Login request denied", "Connection not found", "D/C" to retry
  732. ClickMouse(399, 322, true);
  733. Wait(100); Login;
  734. end
  735. ClickMouse(109, 368, true); // Click "Play Game"
  736. repeat
  737. Wait(100);
  738. until(FindColor(x, y, 255, 470, 328, 545, 340) or FindColor(x, y, 10276608, 362, 314, 437, 332))
  739. if(DelayUserInput = 'true') then begin Wait(1200); end else begin Wait(300); end
  740. ReadString(Username);
  741. ClickMouse(416, 388, true); // Click password textbox
  742. Wait(50); ReadString(Password);
  743. ClickMouse(403, 431, true); // Click "Connect"
  744. Wait(500);
  745. if(FindColor(x, y, 10276608, 362, 314, 437, 332)) then begin // Check for "Login request denied", "Connection not found", "D/C" to retry
  746. ClickMouse(399, 322, true);
  747. Wait(100); Login;
  748. end
  749. //Pause till login screen
  750. repeat
  751. Wait(500);
  752. until(FindColor(x, y, 255, 338, 168, 353, 185) or FindColor(x, y, 10276608, 362, 314, 437, 332))
  753. // Click login on the character
  754. repeat
  755. KeyDown(GetKeyCode(CharacterNum));
  756. Wait(10);
  757. KeyUp(GetKeyCode(CharacterNum));
  758. Wait(10);
  759. until(FindColor(x, y, 255, 338, 168, 353, 185) = false)
  760. Wait(500);
  761. ClickMouse(79, 366, true);
  762. // Check if stuck at login screen(Not needed until a problem)
  763. end;
  764.  
  765. Procedure CheckDc;
  766. begin
  767. if(FindColor(x, y, 10276608, 357, 217, 437, 239)) then begin
  768. KeyUp(Ctrl);
  769. Click(x, y);
  770. Login;
  771. end
  772. if(FindColor(x, y, 10276608, 413, 301, 492, 321)) then begin // Paperdoll
  773. Click(451, 311);
  774. end
  775. if(FindColor(x, y, 6514175, 355, 215, 440, 239)) then begin // Exit game box
  776. Click(396, 228);
  777. end
  778. end;
  779.  
  780. Procedure Relog;
  781. begin
  782. Click(599, 48);
  783. Click(323, 225);// Logout
  784. Login;
  785. AntiF := AntiFReset;
  786. HitCount := HitCountReset;
  787. end;
  788.  
  789. Procedure Mage;
  790. begin
  791. if((MageEnabled = 'true') and (FindColor(x, y, 6500574, 235, 38, 236, 38) = false)) then begin
  792. if(FindColor(x, y, Monster, 12, 49, 626, 336)) then begin
  793. writeln('Engaging Mage on monster at '+ inttostr(x) +', '+ inttostr(y) +'.');
  794. KeyDown(MageKey);
  795. Wait(20);
  796. KeyUp(MageKey);
  797. Wait(10);
  798. MoveMouseSmooth(x, y); Wait(1); ClickMouse(x, y, true);
  799. Wait(2000); //1700
  800. end
  801. end
  802. end;
  803.  
  804. Procedure Heal;
  805. begin
  806. if((FindColor(x, y, 16236180, 202, 38, 203, 39)) and (FindColor(x, y, 6500574, 235, 38, 236, 38) = false) and (FindColor(x, y, Monster, 12, 49, 626, 336) = false)) then begin
  807. if(HealType = 'self') then begin
  808. KeyDown(HealKey);
  809. Wait(30);
  810. KeyUp(HealKey);
  811. Wait(1000);
  812. end
  813. else if(HealType = 'clickheal') then begin
  814. KeyDown(HealKey);
  815. Wait(30);
  816. KeyUp(HealKey);
  817. Wait(10);
  818. MoveMouseSmooth(317, 188); Wait(1); ClickMouse(317, 188, true);
  819. Wait(2000); //1700
  820. end
  821. end
  822. end;
  823.  
  824. Procedure AutoPot;
  825. var herbers, Xhp, TimesBy, Herts:Integer;
  826. begin
  827. herbers := HerbsForFull;
  828. //Herts := HeartsToPot;
  829. ///TimesBy := 8 * Herts;
  830. //Xhp := 128 + TimesBy;
  831. if(FindColor(x, y, 16236180, 163, 38, 164, 39)) then begin
  832. Click(81, 366);
  833. Wait(200);
  834. if((Pots = 'herbs') and FindColor(x, y, 33792, 115, 365, 476, 467)) then begin
  835. repeat
  836. herbers := herbers -1;
  837. Click(x, y);
  838. Wait(8);
  839. Click(x, y);
  840. Wait(10);
  841. CheckDc;
  842. until(herbers <= 0)
  843. end
  844. else if((Pots = 'normal') and FindColor(x, y, 33412, 115, 365, 476, 467)) then begin
  845. Click(x, y);
  846. Wait(8);
  847. Click(x, y);
  848. Wait(200);
  849. Potsused := PotsUsed + 1;
  850. end
  851. if(FindColor(x, y, 657930, 238, 34, 239, 35)) then begin // check TP
  852. Click(81, 366);
  853. Wait(100);
  854. if(FindColor(x, y, 16711812, 115, 365, 476, 467)) then begin
  855. Click(x, y);
  856. Wait(8);
  857. Click(x, y);
  858. Wait(10);
  859. end
  860. end
  861. end
  862. end;
  863. Procedure Status;
  864. begin
  865. if(FindWindowTitlePart('endless online', false)) then begin
  866. activateclient;
  867. end
  868. cleardebug;
  869. writeln('');
  870. writeln('');
  871. writeln('');
  872. writeln('');
  873. writeln('');
  874. writeln('');
  875. writeln('Monsters killed: '+ inttostr(Monsters) +' | HitCount: '+ inttostr(HitCount) + ' | AntiFreeze: ' + inttostr(AntiF) +' | Pots Used: '+ inttostr(PotsUsed));
  876. end;
  877.  
  878. Procedure AntiFreeze;
  879. begin
  880. AntiF := AntiF - 1;
  881. Status;
  882. if(AntiF <= 0) then begin
  883. writeln('Frozen or some shit, time to relog.');
  884. KeyUp(Ctrl);
  885. Wait(10);
  886. Relog;
  887. Wait(20);
  888. keyDown(17);
  889. Wait(20);
  890. end
  891. end;
  892. Procedure DoHitCount;
  893. begin
  894. HitCount := HitCount - 1;
  895. if(HitCount <= 0) then begin
  896. KeyUp(Ctrl); Wait(50); Direction := TargetDirection;
  897. Wait(500);
  898. if(((Direction = ArrowLeft) and FindColor(x, y, Monster, 274, 163, 298, 178)) or ((Direction = ArrowDown) and FindColor(x, y, Monster, 272, 188, 295, 197)) or ((Direction = ArrowRight) and FindColor(x, y, Monster, 332, 187, 360, 200)) or ((Direction = ArrowUp) and FindColor(x, y, Monster, 330, 160, 358, 176))) then begin
  899. writeln('Turning to monster again, maybe I''m hitting in the wrong direction.');
  900. Turn;
  901. HitCount := HitCountReset;
  902. KeyDown(17);
  903. end
  904. end
  905. end;
  906.  
  907. Procedure Left;
  908. begin
  909. If (FindColor(x, y, Monster, 274, 163, 298, 178)) then begin
  910. writeln('Engaging Melee on monster on the Left');
  911. TargetDirection := ArrowLeft;
  912. if((Direction = TargetDirection) = false) then begin
  913. Direction := ArrowLeft;
  914. Turn;
  915. end
  916. Wait(50);
  917. KeyDown(17);
  918. Wait(200);
  919. repeat
  920. AutoPot;
  921. AntiFreeze;
  922. DoHitCount;
  923. Wait(500);
  924. until((FindColor(x, y, Monster, 274, 163, 298, 178) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  925. HitCount := HitCountReset;
  926. AntiF := AntiFReset;
  927. KeyUp(Ctrl);
  928. Wait(500);
  929. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  930. KsDirection := 'Left';
  931. end
  932. else begin
  933. Monsters := Monsters + 1;
  934. end
  935. end
  936. end;
  937. Procedure Down;
  938. begin
  939. If (FindColor(x, y, Monster, 271, 189, 305, 195)) then begin
  940. writeln('Engaging Melee on monster on the Bottom');
  941. TargetDirection := ArrowDown;
  942. if((Direction = TargetDirection) = false) then begin
  943. Direction := ArrowDown;
  944. Turn;
  945. end
  946. Wait(50);
  947. KeyDown(17);
  948. Wait(200);
  949. repeat
  950. AutoPot;
  951. AntiFreeze;
  952. DoHitCount;
  953. Wait(500);
  954. until((FindColor(x, y, Monster, 271, 189, 305, 195) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  955. HitCount := HitCountReset;
  956. AntiF := AntiFReset;
  957. KeyUp(Ctrl);
  958. Wait(500);
  959. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  960. KsDirection := 'Down';
  961. end
  962. else begin
  963. Monsters := Monsters + 1;
  964. end
  965. end
  966. end;
  967. Procedure Right;
  968. begin
  969. If (FindColor(x, y, Monster, 332, 187, 360, 200)) then begin
  970. writeln('Engaging Melee on monster on the Right');
  971. TargetDirection := ArrowRight;
  972. if((Direction = TargetDirection) = false) then begin
  973. Direction := ArrowRight;
  974. Turn;
  975. end
  976. Wait(50);
  977. KeyDown(17);
  978. Wait(200);
  979. repeat
  980. AutoPot;
  981. AntiFreeze;
  982. DoHitCount;
  983. Wait(500);
  984. until((FindColor(x, y, Monster, 332, 187, 360, 200) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  985. HitCount := HitCountReset;
  986. AntiF := AntiFReset;
  987. KeyUp(Ctrl);
  988. Wait(500);
  989. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  990. KsDirection := 'Right';
  991. end
  992. else begin
  993. Monsters := Monsters + 1;
  994. end
  995. end
  996. end;
  997. Procedure Up;
  998. begin
  999. If (FindColor(x, y, Monster, 335, 164, 358, 176)) then begin
  1000. writeln('Engaging Melee on monster on the Top');
  1001. TargetDirection := ArrowUp;
  1002. if((Direction = TargetDirection) = false) then begin
  1003. Direction := ArrowUp;
  1004. Turn;
  1005. end
  1006. Wait(50);
  1007. KeyDown(17);
  1008. Wait(200);
  1009. repeat
  1010. AutoPot;
  1011. AntiFreeze;
  1012. DoHitCount;
  1013. Wait(500);
  1014. until((FindColor(x, y, Monster, 335, 164, 358, 176) = false) or (FindColor(x, y, 0, 313, 490, 313, 490)))
  1015. HitCount := HitCountReset;
  1016. AntiF := AntiFReset;
  1017. KeyUp(Ctrl);
  1018. Wait(500);
  1019. if(FindColor(x, y, 0, 313, 490, 313, 490)) then begin // if find Not your battle! = false, begin
  1020. KsDirection := 'Up';
  1021. end
  1022. else begin
  1023. Monsters := Monsters + 1;
  1024. end
  1025. end
  1026. end;
  1027. Procedure CheckSides;
  1028. begin
  1029. if(KsDirection = 'Left') then begin
  1030. Down;
  1031. Right;
  1032. Up;
  1033. Left;
  1034. end
  1035. else if(KsDirection = 'Down') then begin
  1036. Left;
  1037. Right;
  1038. Up;
  1039. Down;
  1040. end
  1041. else if(KsDirection = 'Right') then begin
  1042. Left;
  1043. Down;
  1044. Up;
  1045. Right;
  1046. end
  1047. else begin
  1048. Left;
  1049. Down;
  1050. Right;
  1051. Up;
  1052. end
  1053. end;
  1054.  
  1055. Procedure MoveHome;
  1056. var waits:Integer;
  1057. begin
  1058. if(MoveDirection = ArrowLeft) then begin
  1059. CheckSides;
  1060. Wait(800);
  1061. Direction := ArrowRight;
  1062. KeyDown(Direction);
  1063. Wait(440);
  1064. KeyUp(Direction);
  1065. Wait(700); AutoPot;
  1066. KeyDUp(123); //Refresh
  1067. Wait(600); AutoPot;
  1068. MoveDirection := 0;
  1069. end
  1070. else if(MoveDirection = ArrowDown) then begin
  1071. CheckSides;
  1072. Wait(800);
  1073. Direction := ArrowUp;
  1074. KeyDown(Direction);
  1075. Wait(440);
  1076. KeyUp(Direction);
  1077. Wait(700); AutoPot;
  1078. KeyDUp(123); //Refresh
  1079. Wait(1000); AutoPot;
  1080. MoveDirection := 0;
  1081. end
  1082. else if(MoveDirection = ArrowRight) then begin
  1083. CheckSides;
  1084. Wait(800);
  1085. Direction := ArrowLeft;
  1086. KeyDown(Direction);
  1087. Wait(440);
  1088. KeyUp(Direction);
  1089. Wait(700); AutoPot;
  1090. KeyDUp(123); //Refresh
  1091. Wait(1000); AutoPot;
  1092. MoveDirection := 0;
  1093. end
  1094. else if(MoveDirection = ArrowUp) then begin
  1095. CheckSides;
  1096. Wait(800);
  1097. Direction := ArrowDown;
  1098. KeyDown(Direction);
  1099. Wait(440);
  1100. KeyUp(Direction);
  1101. Wait(700); AutoPot;
  1102. KeyDUp(123); //Refresh
  1103. Wait(600); AutoPot;
  1104. MoveDirection := 0;
  1105. end
  1106. end;
  1107.  
  1108. Procedure CheckTop;
  1109. begin
  1110. if(FindColor(x, y, Monster, 309, 174, 330, 185)) then begin
  1111. KeyDown(Direction);
  1112. Wait(440);
  1113. KeyUp(Direction);
  1114. Wait(700); AutoPot;
  1115. KeyDUp(123);
  1116. Wait(1000); AutoPot;
  1117. KeyDUp(123);
  1118. MoveDirection := Direction;
  1119. CheckSides;
  1120. end
  1121. end;
  1122.  
  1123. Procedure CheckLoggedOut;
  1124. begin
  1125. if(FindColor(x, y, 16776960, 27, 342, 50, 349)) then begin
  1126. Login;
  1127. end
  1128. end;
  1129.  
  1130. Procedure CheckDrop;
  1131. begin
  1132. if(FindColor(x, y, 8716032, 274, 205, 297, 210)) then begin
  1133. MoveMouse(286, 205);
  1134. Wait(200);
  1135. ClickMouse(286, 205, true);
  1136. Wait(2000);
  1137. end
  1138. else if(FindColor(x, y, 8716032, 340, 173, 361, 178)) then begin
  1139. MoveMouse(349, 173);
  1140. Wait(200);
  1141. ClickMouse(349, 173, true);
  1142. Wait(2000);
  1143. end
  1144. else if(FindColor(x, y, 8716032, 338, 205, 361, 210)) then begin
  1145. MoveMouse(350, 204);
  1146. Wait(200);
  1147. ClickMouse(350, 204, true);
  1148. Wait(2000);
  1149. end
  1150. else if(FindColor(x, y, 8716032, 274, 173, 297, 178)) then begin
  1151. MoveMouse(286, 172);
  1152. Wait(200);
  1153. ClickMouse(286, 172, true);
  1154. Wait(2000);
  1155. end
  1156. else if(FindColor(x, y, 8716032, 242, 189, 260, 194)) then begin
  1157. MoveMouse(254, 188);
  1158. Wait(200);
  1159. ClickMouse(254, 188, true);
  1160. Wait(2000);
  1161. end
  1162. else if(FindColor(x, y, 8716032, 306, 221, 329, 226)) then begin
  1163. MoveMouse(318, 220);
  1164. Wait(200);
  1165. ClickMouse(318, 220, true);
  1166. Wait(2000);
  1167. end
  1168. else if(FindColor(x, y, 8716032, 370, 189, 393, 194)) then begin
  1169. MoveMouse(382, 189);
  1170. Wait(200);
  1171. ClickMouse(382, 189, true);
  1172. Wait(2000);
  1173. end
  1174. else if(FindColor(x, y, 8716032, 306, 157, 329, 162)) then begin
  1175. MoveMouse(317, 155);
  1176. Wait(200);
  1177. ClickMouse(317, 155, true);
  1178. Wait(2000);
  1179. end
  1180. else if(FindColor(x, y, 8716032, 306, 189, 329, 194)) then begin
  1181. MoveMouse(317, 188);
  1182. Wait(200);
  1183. ClickMouse(317, 188, true);
  1184. Wait(2000);
  1185. end
  1186. end;
  1187.  
  1188. Procedure Settings;
  1189. begin
  1190. //Do not touch anything below unless you know what you're doing
  1191. HitCount := HitCountReset;
  1192. AntiF := AntiFReset;
  1193. Direction := 0;
  1194. MoveDirection := 0;
  1195. Monster := 1638350;
  1196. PotsUsed := 0;
  1197. F1 := 112; F2 := 113; F3 := 114; F4 := 115; F5 := 116; F6 := 117; F7 := 118; F8 := 119;
  1198. Num0 := 96; Num1 := 97; Num2 := 98; Num3 := 99; Num4 := 100; Num5 := 101; Num6 := 102; Num7 := 103; Num8 := 104; Num9 := 105;
  1199. ArrowLeft := 37; ArrowDown := 40; ArrowRight := 39; ArrowUp := 38; Ctrl := 17;
  1200. SetMageKey;
  1201. SetHealKey;
  1202. end;
  1203.  
  1204. // Begin Main Loop
  1205. begin
  1206. Settings;
  1207. if(FindWindowTitlePart('endless online', false)) then begin
  1208. activateclient;
  1209. end
  1210. else begin
  1211. Writeln('Endless Online isn''t open or is minimized, please check and try again.');
  1212. end
  1213. ClearDebug;
  1214. Writeln('Mikebot v8 - By Thehispanic/Gangstamikey');
  1215. Wait(1000);
  1216. CheckLoggedOut;
  1217.  
  1218. repeat
  1219. CheckDc;
  1220. AutoPot;
  1221. CheckSides;
  1222. Mage;
  1223. Heal;
  1224. CheckTop;
  1225. MoveHome;
  1226. CheckLoggedOut;
  1227. Status;
  1228. CheckDrop;
  1229. Wait(100);
  1230. until((false) or (isfkeydown(9)))
  1231. KeyUp(Ctrl);
  1232. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement