Advertisement
zamaro

potato Buyer v2

Apr 8th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.66 KB | None | 0 0
  1. {*+++++++++++++*}
  2. {+ Insructions +}
  3. {+ To Hide The Instructions Press the Minus '-' on the first line +}
  4. {+ Be sure to do your setup correctly! +}
  5. {*+++++++++++++*}
  6.  
  7.  
  8. {*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
  9. ================================================================================
  10. A|(InGame-Setup)
  11.  
  12. A1) Brightness to highest.
  13. A2) Equip a ring of life.
  14. A3) Start either inside the bank or the Cook's shop.
  15. A4) Have Coins in your first inventory & bank slots.
  16. ______________________________________________________________________________
  17. B|(Script-Setup)
  18.  
  19.  
  20. B1) you need the SRL-OSR include, Smart8.3 & reflection.
  21. B2) If smart is already opened, pair it up before you launch the script.
  22. B3) Redefine your player settings to your choice.
  23. B4) If you launched and got an error, paste it at: http://ilya.xxx/ssf/
  24. ________________________________________________________________________________
  25. ================================================================================
  26. {Start of the script}
  27.  
  28.  
  29. program Pizbuyer;
  30. {$DEFINE SMART8}
  31. {$I SRL-OSR/SRL.Simba}
  32. {$I SRL-OSR/SRL/misc/al_functions.simba}
  33. {$I SRL-OSR/SRL/Reflection/Reflection.simba}
  34.  
  35. var
  36. BankCord, shopcord: tpointarray;
  37. Fails, cx, cy, pizzasbought, potatobought, WorldsHopped: integer;
  38. Myloc: tpoint;
  39.  
  40. const
  41. TermCheck = true; // Checks for Errors/Lost and terminates if they occur.
  42. UseReflection = true; // This is specific to NPC/Bank Booth finding only.
  43. BuysPizza = true; // Buy pizza?
  44. BuysPotato = true; // Buy Potato with cheese?
  45.  
  46. procedure playerSetup;
  47. begin
  48. HowManyPlayers := 1;
  49. NumberOfPlayers(HowManyPlayers);
  50. CurrentPlayer := 0;
  51. Players[0].Name := 'zezima'; // username
  52. Players[0].Pass := 'iscool'; // password
  53. Players[0].Nick := 'ezim'; // 4 leters no capital letters/first letter.
  54. Players[0].pin := '1234' // bankpin
  55. Players[0].Active := True;
  56. end;
  57.  
  58. procedure findallrandoms;
  59. begin
  60. if (UseReflection = true) then
  61. R_FindNormalRandoms;
  62. FindNormalRandoms;
  63. FindNonInventoryRandoms;
  64. end;
  65.  
  66. procedure MMouseRandom(x, y: integer);
  67. var
  68. Cx, Cy: Integer;
  69. begin
  70. GetMousePos(Cx, Cy);
  71. AL_SetMouseSpeed(20);
  72. case Random(5) of
  73. 0: AL_BrakeWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5, True);
  74. 1: AL_HumanWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 5);
  75. 2: AL_AccurateMMouse(IntToPoint(x, y), 2, 2);
  76. 3: AL_HumanMMouse(IntToPoint(x, y), 2, 2);
  77. 4: AL_ShiftWindMouse(Cx, Cy, x, y, 15 + Random(10), 5 + Random(15), 5, 10, 20, 5);
  78. 5: AL_MissMouse(IntToPoint(x, y), 2, 2);
  79. end;
  80. end;
  81.  
  82. procedure WaitHumanClick3;
  83. begin
  84. case random(600) of
  85. 1..450: Wait(RandomRange(3000, 5000));
  86. 451..570: Wait(RandomRange(5000, 5500));
  87. 571..590: Wait(RandomRange(6000, 6500));
  88. 591..600: Wait(RandomRange(7000, 7500));
  89. end;
  90. end;
  91.  
  92. procedure myvars;
  93. begin
  94. BankCord := [point(2843, 3542)];
  95. shopcord := [point(2838, 3549)];
  96. end;
  97.  
  98. procedure DebugPosition;
  99. begin
  100. repeat
  101. wait(400);
  102. Myloc := R_GetTileGlobal;
  103. writeln(Myloc);
  104. until (false);
  105. end;
  106.  
  107. function GetGreenUptext: string;
  108. var
  109. WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
  110. begin
  111. WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
  112. BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
  113. YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
  114. OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
  115. GreenT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 120577, 65, 'UpChars07');
  116. FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
  117. FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
  118. FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
  119. FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
  120. FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
  121. FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
  122. FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
  123. FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
  124. Result := FoundText;
  125. end;
  126.  
  127. function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
  128. var
  129. TheText: string;
  130. i, n: Integer;
  131. begin
  132. TheText := GetGreenUptext;
  133. n := High(Text);
  134. for i := 0 to n do
  135. if (Pos(Text[i], TheText) > 0) then
  136. begin
  137. Result := True;
  138. Exit;
  139. end;
  140. end;
  141.  
  142. function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
  143. var
  144. T: Integer;
  145. begin
  146. Result := false;
  147. T := GetSystemTime + Time;
  148. while (GetSystemTime < T) do
  149. begin
  150. if (IsUpTextMultiCustom2(S)) then
  151. begin
  152. Result := True;
  153. Exit;
  154. end;
  155. Wait(20 + Random(20));
  156. end;
  157. end;
  158.  
  159. procedure WaitHumanClick;
  160. begin
  161. case random(600) of
  162. 1..450: Wait(RandomRange(400, 600));
  163. 451..570: Wait(RandomRange(400, 600));
  164. 571..590: Wait(RandomRange(600, 800));
  165. 591..600: Wait(RandomRange(800, 1000));
  166. end;
  167. end;
  168.  
  169. procedure WaitHumanClick2;
  170. begin
  171. case random(600) of
  172. 1..450: Wait(RandomRange(1000, 1500));
  173. 451..570: Wait(RandomRange(1500, 2000));
  174. 571..590: Wait(RandomRange(2000, 2500));
  175. 591..600: Wait(RandomRange(2500, 3000));
  176. end;
  177. end;
  178.  
  179. function FindObjExX(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol, CTS: integer; Hue, Sat: Extended; Step, xs, ys, xe, ye: Integer): Boolean;
  180. var
  181. MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
  182. ColorFound: Boolean;
  183. SearchBoxes: array of array of TBox;
  184. p: TPointArray;
  185. begin
  186. if (not (loggedin)) then
  187. exit;
  188. Result := False;
  189. for i := 0 to (GetArrayLength(Color) - 1) do
  190. begin
  191. ColorToleranceSpeed(CTS);
  192. SetColorSpeed2Modifiers(Hue, sat);
  193. if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
  194. begin
  195. ColorToleranceSpeed(1);
  196. SetColorSpeed2Modifiers(0.2, 0.2);
  197. ColorFound := True;
  198. Break;
  199. end;
  200. end;
  201. ColorToleranceSpeed(1);
  202. SetColorSpeed2Modifiers(0.2, 0.2);
  203. if not (ColorFound) then
  204. Exit;
  205. MidX := Round((xe - xs) / 2);
  206. MidY := Round((ye - ys) / 2);
  207. Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
  208. Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
  209. SetLength(SearchBoxes, Width);
  210. HalfWidth := Floor(Width / 2);
  211. HalfHeight := Floor(Height / 2) for x := - 1 * HalfWidth to HalfWidth do
  212. begin
  213. SetLength(SearchBoxes[x + HalfWidth], Height);
  214. for y := - 1 * HalfHeight to HalfHeight do
  215. SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(Max(xs, xs + Round(MidX + ((x - 0.5) * Step))), Max(ys, ys + Round(MidY + ((y - 0.5) * Step))), Min(xe, xs + Round(MidX + ((x + 0.5) * Step))), Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
  216. end;
  217. p := TPAFromBox(IntToBox(0, 0, Width - 1, Height - 1));
  218. SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
  219. for k := 0 to High(Color) do
  220. for j := 0 to High(p) do
  221. begin
  222. ColorToleranceSpeed(CTS);
  223. SetColorSpeed2Modifiers(Hue, sat);
  224. if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1, SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2, SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
  225. begin
  226. ColorToleranceSpeed(1);
  227. SetColorSpeed2Modifiers(0.2, 0.2);
  228. MMouse(cx, cy, 3, 3);
  229. wait(randomrange(200, 300));
  230. if (WaitUptextMulti2(Text, 300)) then
  231. begin
  232. ColorToleranceSpeed(1);
  233. SetColorSpeed2Modifiers(0.2, 0.2);
  234. GetMousePos(cx, cy);
  235. Result := True;
  236. Exit;
  237. end;
  238. end;
  239. ColorToleranceSpeed(1);
  240. SetColorSpeed2Modifiers(0.2, 0.2);
  241. end;
  242. ColorToleranceSpeed(1);
  243. SetColorSpeed2Modifiers(0.2, 0.2);
  244. end;
  245.  
  246. procedure Termination(const Status: string);
  247. begin
  248. if (TermCheck = false) then
  249. exit;
  250. writeln(Status);
  251. if loggedin then
  252. begin
  253. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
  254. terminatescript
  255. else
  256. terminatescript;
  257. end
  258. else
  259. terminatescript;
  260. end;
  261.  
  262. function LogMeOut: boolean;
  263. begin
  264. writeln('Logging out..');
  265. if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
  266. begin
  267. writeln('We have managed to log out');
  268. result := true;
  269. end
  270. else
  271. termination('We have failed to log out, ending script');
  272. end;
  273.  
  274. function Clickobject(Objpoint: tpoint; OffSetRunX, OffSetRunY: integer; Uptext: TStringArray): Boolean;
  275. var
  276. Bp, Booth: TPoint;
  277. begin
  278. if (not LoggedIn) then
  279. Exit;
  280. if R_DistanceFromTile(Objpoint) > 3 then
  281. begin
  282. Bp.x := Objpoint.x + OffsetRunX;
  283. Bp.Y := Objpoint.y - OffsetRunY;
  284. R_WalkPath([Bp]);
  285. waithumanclick2;
  286. end;
  287. if R_DistanceFromTile(Objpoint) < 5 then
  288. begin
  289. Booth := R_TileToMS(ObjPoint);
  290. MMouse(Booth.X, Booth.Y, 2, 2);
  291. Sleep(100 + Random(100));
  292. if (R_IsUpTextMulti(Uptext)) then
  293. begin
  294. result := true;
  295. end;
  296. end;
  297. end;
  298.  
  299. function LocateNPC(Name, Uptext: string; RunOffSetX, RunOffSetY: integer): boolean;
  300. var
  301. Bp, Tp: Tpoint;
  302. NpcName: tnpc;
  303. begin
  304. if R_FindNpc(Name, NpcName) then
  305. begin
  306. if NpcName.InCombat then
  307. exit;
  308. Tp := NpcName.Tile;
  309. if R_DistanceFromTile(Tp) > 3 then
  310. begin
  311. Bp.x := Tp.x + RunOffSetX;
  312. Bp.Y := Tp.y + RunOffSetY;
  313. case random (10) of
  314. 0..5: R_WalkPath([Bp]);
  315. 6..10: R_WebWalk(bp);
  316. end;
  317. waithumanclick2;
  318. end;
  319. if R_DistanceFromTile(tp) < 5 then
  320. begin
  321. Tp := R_TileToMs(Tp);
  322. Mmouse(Tp.x, Tp.y, 0, 0);
  323. if R_WaitUptext(Uptext, 200) then
  324. begin
  325. result := true;
  326. end;
  327. end;
  328. end;
  329. end;
  330.  
  331. function R_FindObjects(ObjectID: integer): tpoint;
  332. var
  333. objects:trsobjectarray;
  334. i:integer;
  335. begin
  336. result:=point(0,0);
  337. objects:=R_GetAllObjects(0);
  338. for i:=0 to high(objects) do
  339. begin
  340. if (objects[i].ID = ObjectID) then
  341. begin
  342. result:=objects[i].tile;
  343. break;
  344. end;
  345. break;
  346. end;
  347. end;
  348.  
  349. function onshopscreen: boolean;
  350. var
  351. tpa: tpointarray;
  352. begin
  353. result := FindColorsTolerance(tpa, 65535, 254, 60, 292, 82, 0);
  354. end;
  355.  
  356. function ShopScreenS: Boolean;
  357. begin
  358. Result := (FindTextTPA(2070783, 10, 22, 30, 476, 52, 'Store', 'UpChars07', Nothing) or (GetColor(482, 36) = 65536));
  359. end;
  360.  
  361. procedure BuyPizza;
  362. var
  363. s: string;
  364. PizzaCount: integer;
  365. begin
  366. if InvFull then
  367. exit;
  368. wait(randomrange(200, 400));
  369. s := GetTextAtExWrap(160, 60, 200, 82, 0, 5, 1, 65535, 0, statchars07);
  370. PizzaCount := StrToIntDef(GetNumbers(s), - 1);
  371. writeln(PizzaCount);
  372. if (PizzaCount > 0) or (PizzaCount = -1) then
  373. begin
  374. IncEx(pizzasbought, pizzacount) mouse(randomrange(185, 190), randomrange(75, 83), 0, 0, mouse_right);
  375. wait(randomrange(200, 300));
  376. mouse(randomrange(145, 149), randomrange(150, 154), 0, 0, mouse_left);
  377. waithumanclick;
  378. end;
  379. end;
  380.  
  381. procedure BuyPotato;
  382. var
  383. s: string;
  384. PizzaCount: integer;
  385. begin
  386. if InvFull then
  387. exit;
  388. wait(randomrange(200, 400));
  389. s := GetTextAtExWrap(200, 60, 240, 82, 0, 5, 1, 65535, 0, statchars07);
  390. PizzaCount := StrToIntDef(GetNumbers(s), - 1);
  391. writeln(PizzaCount);
  392. if (PizzaCount > 0) or (PizzaCount = -1) then
  393. begin
  394. IncEx(potatobought, pizzacount) mouse(randomrange(235, 240), randomrange(75, 83), 0, 0, mouse_right);
  395. wait(randomrange(200, 300));
  396. mouse(randomrange(235, 240), randomrange(150, 154), 0, 0, mouse_left);
  397. waithumanclick;
  398. end;
  399. end;
  400.  
  401. procedure Getpizza;
  402. begin
  403. if shopscreens then
  404. begin
  405. waithumanclick2;
  406. if (buyspizza = true) then
  407. BuyPizza;
  408. if (Buyspotato = true) then
  409. BuyPotato;
  410. waithumanclick;
  411. mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_right);
  412. WaitOption('lose', 1000);
  413. waithumanclick2;
  414. if shopscreens then
  415. mouse(randomrange(486, 487), randomrange(40, 41), 0, 0, mouse_left);
  416. if InvFull then
  417. exit;
  418. if not (ExistsItem(28)) then
  419. begin
  420. if LogMeOut then
  421. writeln('we have managed to logout')
  422. else
  423. Termination('we have failed to log out, ending script');
  424. end;
  425. end;
  426. end;
  427.  
  428. procedure ProgressReport;
  429. begin
  430. if (not (loggedin)) then
  431. exit;
  432. ClearDebug;
  433. WriteLn('* Pizza buyer');
  434. WriteLn('* Runtime: ' + TimeRunning);
  435. Writeln('*');
  436. writeln('* Worlds Hopped: ' + IntToStr(WorldsHopped));
  437. writeln('* Pizzas Bought: ' + IntToStr(pizzasbought));
  438. Writeln('* Potato Bought: ' + IntToStr(pizzasbought));
  439. end;
  440.  
  441. procedure bankthings;
  442. begin
  443. if bankscreen then
  444. begin
  445. QuickDeposit('inv');
  446. waithumanclick2;
  447. MouseBankSlot(1, mouse_Right);
  448. waithumanclick;
  449. if (WaitOption('ut-one', 500)) then
  450. writeln('we did it');
  451. waithumanclick;
  452. R_WalkPath(shopcord);
  453. end;
  454. end;
  455.  
  456. function OpenWScreen: Boolean;
  457. begin
  458. Result := False;
  459. if WorldScreen then
  460. exit;
  461. if Loggedin then
  462. Exit;
  463. if not WorldScreen then
  464. begin
  465. Mmouse(54, 475, 1, 1);
  466. WaitHumanClick;
  467. ClickMouse2(Mouse_Left);
  468. waithumanclick;
  469. Result := True;
  470. end;
  471. end;
  472.  
  473. function whitecolor: boolean;
  474. var
  475. Monster: TpointArray;
  476. TmpCts: Integer;
  477. begin
  478. tmpcts := GetColorToleranceSpeed;
  479. ColorToleranceSpeed(2);
  480. SetColorSpeed2Modifiers(0.22, 1.69);
  481. result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469, 4);
  482. ColorToleranceSpeed(tmpcts);
  483. SetColorSpeed2Modifiers(0.2, 0.2);
  484. end;
  485.  
  486. procedure loginloop;
  487. var
  488. B,MyWorld1:integer;
  489. begin
  490. MyWorld1 := CurrentWorldLS;
  491. OpenWorldScreen;
  492. repeat
  493. if whitecolor then
  494. break;
  495. if whitecolor then
  496. writeln('we have the world select screen white color in sight');
  497. if not whitecolor then
  498. writeln('No world elect screen white color in sight, yet');
  499. case random(10) of
  500. 0..2: mouse(randomrange(397, 554), randomrange(78, 394), 1, 1, mouse_move);
  501. 3..4: mouse(randomrange(298, 462), randomrange(200, 392), 1, 1, mouse_move);
  502. 5..6: mouse(randomrange(205, 555), randomrange(80, 154), 1, 1, mouse_move);
  503. 7..10: mouse(randomrange(211, 555), randomrange(246, 367), 1, 1, mouse_move);
  504. end;
  505. until (whitecolor);
  506. if whitecolor then
  507. begin
  508. writeln('we have a world in selection!');
  509. clickmouse2(mouse_left);
  510. waithumanclick2;
  511. b := CurrentWorldLS;
  512. if (CurrentWorldLS = 365) or (CurrentWorldLS = myworld1) then
  513. exit;
  514. writeln('logging in..');
  515. loginplayer;
  516. exit;
  517. end;
  518. end;
  519.  
  520. procedure getfood;
  521. begin
  522. MakeCompass('N');
  523. if shopscreens then
  524. begin
  525. Getpizza;
  526. end;
  527. if (UseReflection = true) then
  528. begin
  529. writeln('we are using reflection to find the cook');
  530. if locatenpc('Lidio', 'Lidio', + 1, + 1) then
  531. begin
  532. clickmouse2(mouse_right);
  533. waitoption('rade', 1000);
  534. waithumanclick3;
  535. if shopscreens then
  536. begin
  537. Getpizza;
  538. end;
  539. end;
  540. end
  541. else
  542. begin
  543. writeln('we are using Color to find the cook');
  544. if not FindObjExX(cx, cy, ['Lidio', 'Lid', 'dio', 'idio', 'talk', 'talk-to', 'alk-t', 'alk-to', 'alk', 'to'], [6179915], 15, 2, 0.06, 0.09, 50, MSX1, MSY1, MSX2, MSY2) then
  545. begin
  546. R_WalkPath(shopcord);
  547. end;
  548. if FindObjExX(cx, cy, ['Lidio', 'Lid', 'dio', 'idio', 'talk', 'talk-to', 'alk-t', 'alk-to', 'alk', 'to'], [6179915], 15, 2, 0.06, 0.09, 50, MSX1, MSY1, MSX2, MSY2) then
  549. begin
  550. clickmouse2(mouse_right);
  551. waitoption('rade', 1000);
  552. waithumanclick3;
  553. if shopscreens then
  554. begin
  555. Getpizza;
  556. end;
  557. end;
  558. end;
  559. end;
  560.  
  561. function InsideArea: boolean;
  562. begin
  563. result := R_inPolygon([point(2834, 3536), point(2835, 3560), point(2850, 3560), point(2850, 3536)]);
  564. end;
  565.  
  566. //if Clickobject(point(2842, 3542), 1, 0, ['Bank', 'booth', 'Bank booth', 'ank', 'ooth']) then
  567.  
  568.  
  569. procedure bankstuff;
  570. begin
  571. writeln('entered banking mode...');
  572. SetAngle(0);
  573. MakeCompass('n');
  574. if not R_OnTile(point(2843, 3543)) then
  575. begin
  576. repeat
  577. waithumanclick;
  578. if R_OnTile(point(2843, 3543)) then
  579. exit;
  580. if not loggedin then
  581. exit;
  582. findallrandoms;
  583. case random(10) of
  584. 0..5: R_WalkPath(bankcord);
  585. 6..10: R_WebWalk(point(2843, 3542));
  586. end;
  587. until (R_OnTile(point(2843, 3543)));
  588. end;
  589. if R_OnTile(point(2843, 3543)) then
  590. begin
  591. if bankscreen then
  592. begin
  593. writeln('we are on shop screen..');
  594. bankthings;
  595. end;
  596. if (UseReflection = true) then
  597. begin
  598. writeln('using reflection to find the booth..');
  599. if LocateNPC('Jade', 'Jade', + 1, 0) then
  600. begin
  601. writeln('we have found the banker!!, banking!');
  602. ClickMouse2(mouse_right);
  603. waithumanclick;
  604. waitoption('ank', 1000);
  605. end;
  606. waithumanclick3;
  607. if pinscreen then
  608. InPin(Players[0].pin);
  609. if bankscreen then
  610. bankthings;
  611. end
  612. else
  613. begin
  614. writeln('we have failed to find the banker');
  615. IncEx(fails, 1);
  616. if (fails > 10) then
  617. termination('We have failed To find the bank booth 10 times, ending script');
  618. end;
  619. end
  620. else
  621. begin
  622. if not FindObjExX(cx, cy, ['jade', 'ade'], [6182999], 15, 2, 0.16, 0.06, 50, MSX1, MSY1, MSX2, MSY2) then
  623. begin
  624. writeln('we have failed to find the banker - Jade, error alert');
  625. IncEx(Fails, 1);
  626. if (fails > 20) then
  627. termination('we have failed to find the banker jade too many times, ending script');
  628. end;
  629. if FindObjExX(cx, cy, ['jade', 'ade'], [6182999], 15, 2, 0.16, 0.06, 50, MSX1, MSY1, MSX2, MSY2) then
  630. begin
  631. writeln('yes2');
  632. clickmouse2(mouse_right);
  633. waitoption('ank', 1000);
  634. waithumanclick3;
  635. end;
  636. if pinscreen then
  637. begin
  638. InPin(Players[0].pin);
  639. end;
  640. if bankscreen then
  641. bankthings;
  642. end;
  643. end;
  644.  
  645. procedure mainloop;
  646. begin
  647. if not loggedin then
  648. exit;
  649. findallrandoms;
  650. if InsideArea then
  651. begin
  652. findallrandoms;
  653. if (not (ExistsItem(28))) and (not (existsitem(1))) then
  654. bankstuff;
  655. if pinscreen then
  656. InPin(Players[0].pin);
  657. if (not (ExistsItem(28))) then
  658. getfood;
  659. if (ExistsItem(28)) then
  660. bankstuff;
  661. end else termination('we are NOT inside the warriors guild shop/bank area, ending script!');
  662. end;
  663.  
  664. begin
  665. playerSetup;
  666. setupsrl;
  667. SetupReflection;
  668. BankCord := [point(2843, 3542)];
  669. shopcord := [point(2838, 3549)];
  670. addonterminate('progressreport');
  671. repeat
  672. wait(400);
  673. if not loggedin then
  674. loginloop;
  675. wait(400);
  676. if loggedin then
  677. mainloop;
  678. until (false);
  679. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement