Guest User

Untitled

a guest
Oct 28th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.94 KB | None | 0 0
  1. program RoguesDenCooker;
  2. {$DEFINE SMART}
  3. {$i SRL\SRL.scar}
  4. {$i Reflection\Reflection.simba}
  5. {$i SRL\SRL\Misc\Stats.Simba}
  6.  
  7.  
  8. const
  9. sWorld = 24; //smart world
  10. sSigned = True; //signed client
  11. MinABWait = 5000;//minimum wait between performing antiban (in miliseconds)
  12. Stats_User = ''; //SRL Stats username
  13. Stats_Pass = ''; //SRL Stats password
  14.  
  15. //NOTE: Before you start, make sure your inventory is *empty* or else the counting
  16. // Will be incorrect.
  17. procedure DeclarePlayers;
  18. begin
  19. HowManyPlayers := 1; //How many players will you be using?
  20. NumberOfPlayers(HowManyPlayers); //Don't touch
  21. CurrentPlayer := 0; //Which player to start off with?
  22.  
  23. with Players[0] do
  24. begin
  25. Name := ''; //rs username
  26. Pass := ''; //rs pass
  27. Nick := ''; //Nickname for progress report
  28. Pin := ''; //Bank pin
  29. Active := True; //use player?
  30. Integers[0] := 5; //What food to cook? 0 = Trout, 1 = Salmon, 2 = Tuna, 3 = Lobster, 4 = Swordfish, 5 = Monkfish, 6 = shark, 7 = rocktail
  31. Integers[1] := 0; //number of loads to cook. estimated 40 loads per hour. leave at 0 to run until it breaks
  32. Integers[2] := 0 * 60 * 1000; //change first number for minutes to run. leave at 0 to run until it breaks.
  33. Integers[6] := 0 * 1000; //Change first number for minimum number of seconds to wait between autoresponding {only applies if Booleans[0] is true}
  34. Arrays[0] := ['']; //if you're using the autoresponder, these are the text to look for to identify your name. so something like ['user', 'sern', 'erna', 'rnam', 'name'] would work awesome (for the name "username")
  35. Booleans[0] := False; //Respond when people ask about cooking levels or when it finds your name?
  36. //lines 509-518: If you know what you're doing, you can customize the autoresponder
  37. end;
  38. end;
  39. ////////////////////////////setup ends here////////////////////////////////////
  40.  
  41. procedure SetupNewPlayer;
  42. begin
  43. case Players[CurrentPlayer].Integers[0] of
  44. 0: //Trout
  45. begin
  46. with Players[CurrentPlayer] do
  47. begin
  48. Strings[0] := 'mggAAAHicY2NgYLBnYmDwAmJHILYAYjMgNgXiMEYGBn8gjgLiGCAOhbKXL5gP1MWEgXkYsANGHBgCAASCBZI=';//Raw DTM
  49. Strings[1] := 'mggAAAHicY2NgYMhiYmCIB+IEIM4E4lwgLgHiYEYGhjAgjgHiKCCOAGJ/IE6LigDqYsLAPAzYASMODAEAOpIFxg==';//Cooked DTM
  50. Strings[2] := 'w tr';//Raw uptext
  51. Strings[3] := 'Tro';//Cooked uptext
  52. Strings[4] := 'Trout';//Fish name
  53. Integers[3] := 70;//EXP
  54. Integers[4] := 335; //Raw ID (For reflection)
  55. Integers[5] := 333; //Cooked ID (For reflection)
  56. end;
  57. end;
  58. 1: //Salmon
  59. begin
  60. with Players[CurrentPlayer] do
  61. begin
  62. Strings[0] := 'mggAAAHicY2NgYOhlYmDoA+JOIF4AxFOYIGIRjAwMMYwQ2g+Io4A4CIhXTJ0E1MWEgbkYsANGHBgCAN+VB20=';//Raw DTM
  63. Strings[1] := 'mbQAAAHicY2VgYDjAxMCwB4g3A/E+ID4OxEGMDAz+QBwFxQFAvN1aGqiaCQXzMGACRiwYDAA1VgaU';//Cooked DTM
  64. Strings[2] := 'w sa';//Raw uptext
  65. Strings[3] := 'Sal';//Cooked uptext
  66. Strings[4] := 'Salmon';//Fish name
  67. Integers[3] := 90;//EXP
  68. Integers[4] := 331; //Raw ID (For reflection)
  69. Integers[5] := 329; //Cooked ID (For reflection)
  70. end;
  71. end;
  72. 2: //Tuna
  73. begin
  74. with Players[CurrentPlayer] do
  75. begin
  76. Strings[0] := 'mggAAAHicY2NgYPBggmBHILYCYlMoXcrIwFAFxA1A3AjEdUBcAsTtTY1AXUwYmIcBO2DEgSEAADy2Bhs=';//Raw DTM
  77. Strings[1] := 'mggAAAHicY2NgYEhjYmCIB+IUIC4C4kogzgbiMkYGhlogbgTiKkYIvwGIE0KDgbqYMDAPA3bAiANDAACKjQag';//Cooked DTM
  78. Strings[2] := 'w tu';//Raw uptext
  79. Strings[3] := 'Tun';//Cooked uptext
  80. Strings[4] := 'Tuna';//Fish name
  81. Integers[3] := 100;//EXP
  82. Integers[4] := 359; //Raw ID (For reflection)
  83. Integers[5] := 361; //Cooked ID (For reflection)
  84. end;
  85. end;
  86. 3: //Lobster
  87. begin
  88. with Players[CurrentPlayer] do
  89. begin
  90. Strings[0] := 'mggAAAHicY2NgYJjFxMDQC8SdTBD2PCDuAOIKRgaGWiAuAuImIC5jhIiFGkoBdTFhYB4G7IARB4YAANVHBxw=';//Raw DTM
  91. Strings[1] := 'mggAAAHicY2NgYDjExMCwD4iPAPEJIN4OxJuAuIyRgaEWiJuAuAaIq4C4FIhXhEoAdTFhYB4G7IARB4YAAHMQCJ8=';//Cooked DTM
  92. Strings[2] := 'w lo';//Raw uptext
  93. Strings[3] := 'Lob';//Cooked uptext
  94. Strings[4] := 'Lobster';//Fish name
  95. Integers[3] := 120;//EXP
  96. Integers[4] := 377; //Raw ID (For reflection)
  97. Integers[5] := 379; //Cooked ID (For reflection)
  98. end;
  99. end;
  100. 4: //Swordfish
  101. begin
  102. with Players[CurrentPlayer] do
  103. begin
  104. Strings[0] := 'mlwAAAHicY2dgYLBiYmAwA2IPIA4AYmsg9oaKzWFkYFgMxDOheAoQTwbi+UC8YuoaoG4mrJiHATdgxIOhAABzowgg';//Raw DTM
  105. Strings[1] := 'mlwAAAHicY2dgYMhjYmBIAeJkII4H4jggLgfiUiCezMjAMA2IZwHxQiBeCmXPA+Ly0DqgbiasmJUBN2DEg6EAANERCJ4=';//Cooked DTM
  106. Strings[2] := 'w sw';//Raw uptext
  107. Strings[3] := 'Swo';//Cooked uptext
  108. Strings[4] := 'Swordfish';//Fish name
  109. Integers[3] := 140;//EXP
  110. Integers[4] := 371; //Raw ID (For reflection)
  111. Integers[5] := 373; //Cooked ID (For reflection)
  112. end;
  113. end;
  114. 5: //Monkfish
  115. begin
  116. with Players[CurrentPlayer] do
  117. begin
  118. Strings[0] := 'mggAAAHicY2NgYFjGysCwAIhnAvFGIF4HxNOA+DFQ7iYQPwPiF0D8AIjvAXG0rRGQZMLAPAzYASMODAEA9bAKJw==';//Raw DTM
  119. Strings[1] := 'mggAAAHicY2NgYNjNzMBwBohPAPFWIN4MxPuB2I6JgcEGiF2A2BWIbYHYA4hjgtyBupgwMA8DdsCIA0MAAPHMBzQ=';//Cooked DTM
  120. Strings[2] := 'w mo';//Raw uptext
  121. Strings[3] := 'Mon';//Cooked uptext
  122. Strings[4] := 'Monkfish';//Fish name
  123. Integers[3] := 150;//EXP
  124. Integers[4] := 7944; //Raw ID (For reflection)
  125. Integers[5] := 7946; //Cooked ID (For reflection)
  126. end;
  127. end;
  128. 6: //Shark
  129. begin
  130. with Players[CurrentPlayer] do
  131. begin
  132. Strings[0] := 'mggAAAHicY2NgYHBgYmDwAeIAIDYBYnMgtgbi3YwMDDuA+BgQH2WE8I8DcVNNDVAXEwbmYcAOGHFgCAAAz7IHsQ==';//Raw DTM
  133. Strings[1] := 'mggAAAHicY2NgYMhhYmBIAOIkIC4D4iogLgDiXYwMDKeAeDsUHwfik0Ac7mQI1MWEgXkYsANGHBgCABNJCA8=';//Cooked DTM
  134. Strings[2] := 'w sh';//Raw uptext
  135. Strings[3] := 'Sha';//Cooked uptext
  136. Strings[4] := 'Shark';//Fish name
  137. Integers[3] := 210;//EXP
  138. Integers[4] := 383; //Raw ID (For reflection)
  139. Integers[5] := 385; //Cooked ID (For reflection)
  140. end;
  141. end;
  142. 7: //Rocktail
  143. begin
  144. with Players[CurrentPlayer] do
  145. begin
  146. Strings[0] := 'mlwAAAHicY2dgYJjIxMCwAIjnAvFMIJ4ExF1QvJ+RgWEnEB8E4uNAfAKIDwPxXiBOnrEeqJsJK+ZhwA0Y8WAoAAAEnQs7';//Raw DTM
  147. Strings[1] := 'mggAAAHicY2NgYNjDxMBwEoj3A/FmIN4JxGdAfEYIPgXEh4F4FxRvT88B6mLCwDwM2AEjDgwBAC2nCro=';//Cooked DTM
  148. Strings[2] := 'w ro';//Raw uptext
  149. Strings[3] := 'Roc';//Cooked uptext
  150. Strings[4] := 'Rocktail';//Fish name
  151. Integers[3] := 225;//EXP
  152. Integers[4] := 15270; //Raw ID (For reflection)
  153. Integers[5] := 15272; //Cooked ID (For reflection)
  154. end;
  155. end;
  156. end;
  157. end;
  158.  
  159. var
  160. ABMark, StatsTimer: Integer;
  161.  
  162.  
  163. procedure Antiban;
  164. begin
  165. if (not(LoggedIn) or (TimeFromMark(ABMark) < MinABWait)) then
  166. Exit;
  167. if (Random(9) > 0) then
  168. begin
  169. case Random(9) of
  170. 1: RandomMovement;
  171. 2: BoredHuman;
  172. 3: RandomMovement;
  173. 4: PickUpMouse;
  174. 5: HoverSkill('cooking', False);
  175. 6: RandomRClick;
  176. 7: PickUpMouse;
  177. 8: RandomAngle(1);
  178. 9: HoverSkill('cooking', False);
  179. 0: HoverSkill('random', False);
  180. end;
  181. MarkTime(ABMark);
  182. end;
  183. end;
  184.  
  185.  
  186. function AttemptAndSwivel(func: function: Boolean; Attempts, SwivelPer: Integer): Boolean;
  187. var
  188. i: Integer;
  189. begin
  190. for i := 1 to Attempts do
  191. begin
  192. if func() then
  193. begin
  194. Result := True;
  195. Exit;
  196. end;
  197. MakeCompass(rs_GetCompassAngleDegrees + (SwivelPer + Random(10) - Random(10)));
  198. Wait(800 + Random(80));
  199. end;
  200. end;
  201.  
  202.  
  203.  
  204. function AttemptFunct(Func: function: Boolean; Attempts: Integer): Boolean;
  205. var
  206. i: Integer;
  207. begin
  208. for i := 1 to Attempts do
  209. begin
  210. if func() then
  211. begin
  212. Result := True;
  213. Exit;
  214. end;
  215. Wait(800 + Random(80));
  216. end;
  217. end;
  218.  
  219.  
  220. const //Reflection constants
  221. FireTileX = 3043;
  222. FireTileY = 4973;
  223.  
  224.  
  225. function r_OpenBenedict: Boolean;
  226. var
  227. Benedict: TNPC;
  228. BenedictPoint: TPoint;
  229. T: Integer;
  230. begin
  231. R_FindRandoms;
  232. repeat
  233. Benedict := R_GetNPC('Emerald Benedict', False);
  234. if not(R_TileOnMS(Benedict.Tile, 0)) then
  235. R_WalkToTile(Benedict.Tile, 4, 0);
  236. Benedict := R_GetNPC('Emerald Benedict', False);
  237. until(R_TileOnMS(Benedict.Tile, 0));
  238. BenedictPoint := R_TileToMS(Benedict.Tile, 0);
  239. Mouse(BenedictPoint.x - 2, BenedictPoint.y - 2, 4, 4, False);
  240. if (r_WaitOption('ank', 1200)) then
  241. begin
  242. T := GetSystemTime + 4000;
  243. while (GetSystemTime < T) and not(Result) and LoggedIn do
  244. Result := BankScreen or PinScreen;
  245. end;
  246. end;
  247.  
  248.  
  249. function OpenBenedict: Boolean;
  250. var
  251. CTS, x, y, i, H, T: Integer;
  252. TPA: TPointArray;
  253. ATPA: array of TPointArray;
  254. R: Boolean;
  255. begin
  256. if not(LoggedIn) then
  257. Exit;
  258. R_FindRandoms;
  259. if BankScreen then
  260. begin
  261. Result := True;
  262. Exit;
  263. end;
  264. CTS := GetColorToleranceSpeed;
  265. SetColorToleranceSpeed(2);
  266. SetColorspeed2Modifiers(0.01374, 1.69810);
  267. FindColorsTolerance(TPA, 7444680, MSX1, MSY1, MSX2, MSY2, 4);
  268. SetColorToleranceSpeed(CTS);
  269. //DebugTPA(TPA, '');
  270. if (Length(TPA) > 0) then
  271. begin
  272. ATPA := TPAtoATPAEx(TPA, 20, 30);
  273. SortATPAFromFirstPoint(ATPA, IntToPoint(MSCX, MSCY));
  274. //DebugATPABounds(ATPA);
  275. H := High(ATPA);
  276. for i := 0 to H do
  277. begin
  278. MiddleTPAEx(ATPA[i], x, y);
  279. MMouse(x - 3, y - 3, 6, 6);
  280. if WaitUptext('ened', 1600) then
  281. begin
  282. ClickMouse2(False);
  283. Result := WaitOption('ank', 1600);
  284. end;
  285. if Result then
  286. Break;
  287. end;
  288. T := GetSystemTime + 4000;
  289. while (GetSystemTime < T) and not(Result) and LoggedIn do
  290. Result := BankScreen or PinScreen;
  291. end else
  292. begin
  293. R := True;
  294. Result := r_OpenBenedict;
  295. end;
  296. if (not(R) and not(Result)) then
  297. Result := r_OpenBenedict;
  298. if Result and PinScreen then
  299. Result := InPin(Players[CurrentPlayer].Pin);
  300. if Result then
  301. Wait(1800 + Random(240));
  302. end;
  303.  
  304.  
  305. function r_CountRaws: Integer;
  306. begin
  307. Result := R_CountItem(Players[CurrentPlayer].Integers[4]);
  308. end;
  309.  
  310.  
  311. function CountRaws: Integer;
  312. var
  313. RawDTM: Integer;
  314. begin
  315. if not(LoggedIn) then
  316. Exit;
  317. R_FindRandoms;
  318. RawDTM := DTMFromString(Players[CurrentPlayer].Strings[0]);
  319. Result := CountItems('dtm', RawDTM, []);
  320. FreeDTM(RawDTM);
  321. if ((Result < 1) or (Result < InvCount)) then
  322. Result := r_CountRaws;
  323. end;
  324.  
  325.  
  326. function r_CountCooked: Integer;
  327. begin
  328. Result := R_CountItem(Players[CurrentPlayer].Integers[5])
  329. end;
  330.  
  331.  
  332. function CountCooked: Integer;
  333. var
  334. CookedDTM: Integer;
  335. begin
  336. if not(LoggedIn) then
  337. Exit;
  338. R_FindRandoms;
  339. CookedDTM := DTMFromString(Players[CurrentPlayer].Strings[1]);
  340. Result := CountItems('dtm', CookedDTM, []);
  341. FreeDTM(CookedDTM);
  342. if ((Result < 1) or (Result < InvCount)) then
  343. Result := r_CountCooked;
  344. end;
  345.  
  346.  
  347. function DoBank: Boolean; //no reflection backup, if someone wants to teach me interfaces then yay.
  348. var
  349. RawDTM, x, y, M: Integer;
  350. begin
  351. if (not(LoggedIn) or not(BankScreen)) then
  352. Exit;
  353. R_FindRandoms;
  354. DepositAll;
  355. Wait(50 + Random(100));
  356. RawDTM := DTMFromString(Players[CurrentPlayer].Strings[0]);
  357. if FindDTM(RawDTM, x, y, MBX1, MBY1, MBX2, MBY2) then
  358. begin
  359. MMouse(x - 3, y - 3, 6, 6);
  360. Wait(50 + Random(100));
  361. if WaitUptext(Players[CurrentPlayer].Strings[2], 1600) then
  362. begin
  363. ClickMouse2(False);
  364. Wait(50 + Random(100));
  365. WaitOption('raw-A', 1600);
  366. end;
  367. end else
  368. Writeln('could not find raw food DTM in bank!');
  369. Closebank;
  370. M := GetSystemTime + 4000;
  371. while ((not(Result)) and (GetSystemTime < M)) do
  372. begin
  373. if (not(InvEmpty)) then
  374. begin
  375. Result := True;
  376. Break
  377. end;
  378. Wait(10 + Random(25));
  379. end;
  380. FreeDTM(RawDTM);
  381. if Result then
  382. begin
  383. Inc(Players[CurrentPlayer].Banked);
  384. IncEx(Players[CurrentPlayer].Integers[11], CountRaws);
  385. stats_IncVariable('Loads Done', 1);
  386. case Players[CurrentPlayer].Integers[0] of
  387. 0: stats_IncVariable('Trout Cooked', CountRaws);
  388. 1: stats_IncVariable('Salmon Cooked', CountRaws);
  389. 2: stats_IncVariable('Tuna Cooked', CountRaws);
  390. 3: stats_IncVariable('Lobster Cooked', CountRaws);
  391. 4: stats_IncVariable('Swordfish Cooked', CountRaws);
  392. 5: stats_IncVariable('Monkfish Cooked', CountRaws);
  393. 6: stats_IncVariable('Shark Cooked', CountRaws);
  394. 7: stats_IncVariable('Rocktail Cooked', CountRaws);
  395. end;
  396. end;
  397. end;
  398.  
  399.  
  400. function r_ClickRaw: Boolean;
  401. begin
  402. R_FindRandoms;
  403. Result := False
  404. end;
  405.  
  406.  
  407. function ClickRaw: Boolean;
  408. var
  409. RawDTM, x, y, T: Integer;
  410. begin
  411. if not(LoggedIn) then
  412. Exit;
  413. R_FindRandoms;
  414. RawDTM := DTMFromString(Players[CurrentPlayer].Strings[0]);
  415. if FindDTM(RawDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
  416. begin
  417. MMouse(x - 4, y - 4, 8, 8);
  418. if WaitUptext(Players[CurrentPlayer].Strings[2], 1600) then
  419. begin
  420. ClickMouse2(True);
  421. T := GetSystemTime + 6000;
  422. while ((not(Result)) and (GetSystemTime < T)) do
  423. begin
  424. Wait(200 + Random(20));
  425. Result := (ActivatedItem > 0);
  426. end;
  427. end;
  428. end else
  429. Writeln('could not find raw food DTM in inventory!');
  430. FreeDTM(RawDTM);
  431. if not(Result) then
  432. Result := r_ClickRaw;
  433. end;
  434.  
  435.  
  436. function r_ClickFire: Boolean;
  437. var
  438. FireTile: TTile;
  439. FirePoint: TPoint;
  440. begin
  441. if not(LoggedIn) then
  442. Exit;
  443. R_FindRandoms;
  444. FireTile := Point(FireTileX, FireTileY);
  445. if not(R_TileOnMS(FireTile, 0)) then
  446. begin
  447. R_WalkToTile(FireTile, 3, 0);
  448. ClickRaw;
  449. end;
  450. FirePoint := R_TileToMS(FireTile, 0);
  451. Mouse(FirePoint.x - 3, FirePoint.y - 3, 6, 6, false);
  452. Result := r_WaitOption('> Fi', 1200);
  453. end;
  454.  
  455.  
  456. function ActionScreen: Boolean;
  457. begin
  458. R_FindRandoms;
  459. Result := (CountColorTolerance(4477273, 85, 415, 95, 425, 10) > 65);
  460. end;
  461.  
  462.  
  463. function ClickFire: Boolean;
  464. var
  465. CTS, x, y, i, H: Integer;
  466. TPA: TPointArray;
  467. ATPA: array of TPointArray;
  468. R: Boolean;
  469. begin
  470. R_FindRandoms;
  471. if not(LoggedIn) then
  472. Exit;
  473. CTS := GetColorToleranceSpeed;
  474. SetColorToleranceSpeed(2);
  475. SetColorspeed2Modifiers(0.10167, 1.61841);
  476. FindColorsTolerance(TPA, 2730226, MSX1, MSY1, MSX2, MSY2, 5);
  477. SetColorToleranceSpeed(CTS);
  478. //Writeln(Length(TPA));
  479. if (Length(TPA) > 0) then
  480. begin
  481. ATPA := TPAtoATPAEx(TPA, 30, 30);
  482. //DebugATPABounds(ATPA);
  483. SortATPAFromFirstPoint(ATPA, IntToPoint(MSCX, MSCY));
  484. H := High(ATPA);
  485. for i := 0 to H do
  486. begin
  487. MiddleTPAEx(ATPA[i], x, y);
  488. MMouse(x - 2, y - 2, 4, 4);
  489. if WaitUptext('more', 800) then //there's always so many people, i'm just gonna check for "more" in "XX more options"
  490. begin
  491. ClickMouse2(False);
  492. Result := WaitOption('> Fire', 1600);
  493. end;
  494. if Result then
  495. Break;
  496. end;
  497. end else
  498. begin
  499. R := True;
  500. Result := r_ClickFire;
  501. end;
  502. if (not(R) and not(Result)) then
  503. Result := r_ClickFire;
  504. if Result then
  505. Result := WaitFunc(@ActionScreen, 10 + random(15), 7000);
  506. end;
  507.  
  508.  
  509. function OutlineFound: Boolean;
  510. begin
  511. R_FindRandoms;
  512. Result := (CountColorTolerance(10408935, 215, 387, 302, 400, 80) > 60);
  513. end;
  514.  
  515.  
  516. function ClickButton: Boolean;
  517. var
  518. CookedDTM, x, y: Integer;
  519. begin
  520. R_FindRandoms;
  521. if not(LoggedIn) then
  522. Exit;
  523. Result := False;
  524. R_FindRandoms;
  525. CookedDTM := DTMFromString(Players[CurrentPlayer].Strings[0]);
  526. if not(FindDTM(CookedDTM, x, y, MCX1, MCY1, MCX2, MCY2)) then
  527. begin
  528. FreeDTM(CookedDTM);
  529. Exit;
  530. end;
  531. FreeDTM(CookedDTM);
  532. MMouse(x - 4, y - 4, 8 , 8);
  533. if (WaitFunc(@OutlineFound, 10 + Random(15), 8000)) then
  534. begin
  535. ClickMouse2(True);
  536. Result := True;
  537. end else
  538. Writeln('didnt find the outline');
  539. end;
  540.  
  541.  
  542. procedure SayCookLVL;
  543. begin
  544. TypeByte(GetKeyCode(Chr(13)));
  545. Wait(50 + random(7));
  546. TypeSendEx('s', False);
  547. Wait(120 + Random(12));
  548. TypeSendEx('v', False);
  549. Wait(40 + random(8));
  550. TypeSendEx('2', False);
  551. end;
  552.  
  553.  
  554.  
  555. function RespondChat: Boolean; //reccomendation from hobbit
  556. var
  557. i: Integer;
  558. begin
  559. if not(Players[CurrentPlayer].Booleans[0]) then
  560. Exit;
  561. if (TimeFromMark(Players[CurrentPlayer].Integers[60]) <= Players[CurrentPlayer].Integers[6]) then
  562. Exit;
  563. if FindTextTpa(clYellow, 8, MSX1, MSY1, MSX2, MSY2, 'ooking le', 'SmallChars', Nothing) then
  564. begin
  565. Result := True;
  566. SayCookLVL;
  567. MarkTime(Players[CurrentPlayer].Integers[60]);
  568. Exit;
  569. end;
  570. for i := 0 to High(Players[CurrentPlayer].Arrays[0]) do
  571. if FindTextTpa(clYellow, 8, MSX1, MSY1, MSX2, MSY2, Players[CurrentPlayer].Arrays[0][i], 'SmallChars', Nothing) then
  572. begin
  573. Result := True;
  574. case Random(9) of
  575. 0: TypeSend('?');
  576. 1: TypeSend(AddMistakes('What?', 15));
  577. 2: TypeSend(AddMistakes('wtf do you want!?', 15));
  578. 3: TypeSend(AddMistakes('oh hey srry was watchin TV', 15));
  579. 4: TypeSend(AddMistakes('sup', 15));
  580. 5: TypeSend(AddMistakes('oh sup i was playin cod srry', 15));
  581. 6: TypeSend(AddMistakes('sup', 15));
  582. 7: TypeSend(AddMistakes('wat', 15));
  583. 8: TypeSend(AddMistakes('i dont talk to dumb people :P', 15));
  584. 9: TypeSend('?');
  585. end;
  586. MarkTime(Players[CurrentPlayer].Integers[60]);
  587. Break;
  588. end;
  589. end;
  590.  
  591.  
  592. function WaitCook: Boolean;
  593. var
  594. T, CookedDTM, RawCount: Integer;
  595. begin
  596. RawCount := CountRaws;
  597. MarkTime(T); //68 seconds = one inventory (4 game ticks (.6 seconds) per cook * 28 = 67.2 seconds
  598. while (TimeFromMark(T) < 68000 + Random(680)) do
  599. begin
  600. R_FindRandoms;
  601. Antiban;
  602. if RespondChat then
  603. Inc(Players[CurrentPlayer].Integers[61]);
  604. if LevelUp then
  605. begin
  606. Inc(Players[CurrentPlayer].Integers[12]);
  607. stats_IncVariable('Total Levels Gained', 1);
  608. end;
  609. Wait(850 + Random(85));
  610. end;
  611. CookedDTM := DTMFromString(Players[CurrentPlayer].Strings[1]);
  612. Result := (CountItems('dtm', CookedDTM, []) > 0); //randoms are a bitch.
  613. FreeDTM(CookedDTM);
  614. if Result then
  615. begin
  616. IncEx(Players[CurrentPlayer].Integers[10], CountCooked);
  617. stats_IncVariable('Total EXP Gained', Players[CurrentPlayer].Integers[3] * CountCooked);
  618. end;
  619. end;
  620.  
  621.  
  622. procedure Die(Status: string);
  623. begin
  624. if not(LoggedIn) then
  625. Exit;
  626. if BankScreen then
  627. CloseBank;
  628. R_FindRandoms;
  629. Logout;
  630. Players[CurrentPlayer].Status := Status;
  631. Writeln('Death because: ' + Players[CurrentPlayer].Status);
  632. end;
  633.  
  634.  
  635. procedure Report;
  636. var
  637. i, TotalCooked, TotalEXP, TotalLVLs, TotalSuccess, TotalBurnt: Integer;
  638. xpHR, foodHR, loadHR: Int64;
  639. begin
  640. for i := 0 to High(Players) do
  641. begin
  642. IncEx(TotalCooked, Players[i].Integers[11]);
  643. IncEx(TotalSuccess, Players[i].Integers[10]);
  644. IncEx(TotalBurnt, Players[i].Integers[11] - Players[i].Integers[10]);
  645. Players[i].Integers[13] := Players[i].Integers[10] * Players[i].Integers[3];
  646. IncEx(TotalEXP, Players[i].Integers[13]);
  647. IncEx(TotalLVLs, Players[i].Integers[12]);
  648. end; {123456789|123456789|123456789|123456789|123456789|123456789|12345678}
  649. Writeln('');
  650. Writeln('[====================================================================]');
  651. Writeln('[ TomTuff''s Rogue''s Den Cooker ]'); //2 extra spaces from ''s
  652. Writeln('[ Revision 10 ]');
  653. Writeln('[====================================================================]');
  654. Writeln('[ Overall Report ]');
  655. Writeln('[ Time Ran: ' + Padr(MsToTime(GetTimeRunning, Time_Formal), 54) + ']');
  656. Writeln('[ Fish attempted to cook: ' + padr(IntToStr(TotalCooked), 40) + ']');
  657. Writeln('[ Fish sucessfuly cooked: ' + Padr(IntToStr(TotalSuccess), 38) + ']');
  658. Writeln('[ Fish burnt: ' + Padr(IntToStr(TotalBurnt), 50) + ']');
  659. Writeln('[ Total EXP gained: ' + Padr(IntToStr(TotalExp), 46) + ']');
  660. Writeln('[====================================================================]');
  661. for i := 0 to High(Players) do
  662. begin
  663. Writeln('[ Player ' + Padl(IntToStr(i), 2) + ' (' + Padr(Players[i].Nick, 4) + '):' + Padr('', 49) + ']');
  664. Writeln('[ Fish type: ' + Padr(Players[i].Strings[4], 53) + ']');
  665. Writeln('[ Worked: ' + Padr(MSToTime(PlayerWorked(i), Time_Formal), 56) + ']');
  666. if ((Players[i].Status <> '') and (not(Players[i].Active))) then
  667. Writeln('[ Stopped Because: ' + Padr(Players[i].Status, 47) + ']');
  668. Writeln('[ Levels gained: ' + Padr(IntToStr(Players[i].Integers[12]), 49) + ']');
  669. Writeln('[ EXP gained: ' + Padr(IntToStr(Players[i].Integers[13]), 52) + ']');
  670. xpHR := Ceil((Players[i].Integers[13] * 60.0 * 60.0 * 1000.0) / PlayerWorked(i));
  671. Writeln('[ Exp/HR: ' + Padr(Int64ToStr(xpHR), 54) + ']');
  672. Writeln('[ Food attempted: ' + Padr(IntToStr(Players[i].Integers[11]), 48) + ']');
  673. foodHR := Ceil((Players[i].Integers[11] * 60.0 * 60.0 * 1000.0) / PlayerWorked(i));
  674. Writeln('[ Food cooked/HR: ' + Padr(Int64ToStr(foodHR), 46) + ']');
  675. Writeln('[ Successful: ' + Padr(IntToStr(Players[i].Integers[10]), 50) + ']');
  676. Writeln('[ Burnt: ' + Padr(IntToStr(Players[i].Integers[11] - Players[i].Integers[10]), 55) + ']');
  677. Writeln('[ Loads: ' + Padr(intToStr(Players[i].Banked), 57) + ']');
  678. loadHR := Ceil((Players[i].Banked * 60.0 * 60.0 * 1000.0) / PlayerWorked(i));
  679. Writeln('[ Loads/HR: ' + padr(Int64ToStr(loadHR), 52) + ']');
  680. if (Players[i].Integers[61] > 0) then
  681. Writeln('[ Times responded: ' + Padr(IntToStr(Players[i].Integers[61]), 47) + ']');
  682. Writeln('[====================================================================]');
  683. end;
  684. Writeln('');
  685. end;
  686.  
  687.  
  688. function CheckSums: Boolean;
  689. begin
  690. if (not(Players[CurrentPlayer].Integers[1] = 0)) then
  691. Result := (Players[CurrentPlayer].Banked >= Players[CurrentPlayer].Integers[1]);
  692. if Result then
  693. Exit;
  694. if (not(Players[CurrentPlayer].Integers[2] = 0)) then
  695. Result := (PlayerWorked(CurrentPlayer) > Players[CurrentPlayer].Integers[2])
  696. end;
  697.  
  698.  
  699. begin
  700. Smart_Members := True;
  701. Smart_Server := sWorld;
  702. Smart_Signed := sSigned;
  703. Smart_SuperDetail := False;
  704. SetupReflection;
  705. SetupSRLStats(32, Stats_User, Stats_Pass);
  706. DeclarePlayers;
  707. LoginPlayer;
  708. MarkTime(StatsTimer);
  709. repeat
  710. SetupNewPlayer;
  711. SetAngle(True);
  712. repeat
  713. if AttemptAndSwivel(@OpenBenedict, 16, 45) then
  714. begin
  715. if AttemptFunct(@DoBank, 4) then
  716. begin
  717. if AttemptFunct(@ClickRaw, 4) then
  718. begin
  719. if AttemptAndSwivel(@ClickFire, 16, 45) then
  720. begin
  721. if AttemptFunct(@ClickButton, 3) then
  722. begin
  723. if WaitCook then
  724. begin
  725. Report;
  726. end else Die('could not wait to cook');
  727. end else Die('could not click the cooking button');
  728. end else Die('could not click the fire');
  729. end else Die('could not click raw in inventory');
  730. end else Die('could not handle banking');
  731. end else Die('could not open Benedict');
  732. Report;
  733. if CheckSums then
  734. Die('goals met');
  735. if (TimeFromMark(StatsTimer) > 300000) then
  736. begin
  737. stats_Commit;
  738. MarkTime(StatsTimer);
  739. end;
  740. until(not(LoggedIn));
  741. NextPlayer(False);
  742. until(AllPlayersInactive);
  743. Report;
  744. end.
  745.  
  746.  
  747. {
  748. rev 02: Added r_ClickRaw
  749. rev 03: added MBX1, MBY1, MBX2, MBY2
  750. rev 04: added more R_FindRandom's :)
  751. rev 05: advanced counting
  752. rev 06: added autoresponder
  753. rev 07: patched up autoresponder
  754. rev 08: SRL Stats (stats.villavu.com)
  755. rev 09: Fixed for the removal R_ClickItemID and R_CountItemID (Now just R_ClickItem and R_CountItem)
  756. rev 10: Added AttemptAndSwivel and AttemptFunct. Now used in mainloop. This should extend runtime!
  757. rev 11: Added pin handling.
  758. }
Add Comment
Please, Sign In to add comment