zamaro

Fcurser

Apr 1st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.23 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. A|(InGame-Setup)
  10.  
  11. A1) Brightness to highest | Auto retaliate on.
  12. A2) You can start either Logged-in or Logged-Out outside the cave.
  13. A3) Inside the cave you can only start either logged out - or at safe spot.
  14. A3.B) If you are using reflection then you must always start logged out!!!.
  15. A4) Equip the following: Ring of life, Magic staff or Mud battle staff.
  16. A5) Have body runes and teleport runes or teleport Tab in your inventory.
  17. A6) Have -65 Mage bonus for your magic attack; Full Metal Armor + Dragon Vambs.
  18. ______________________________________________________________________________
  19. B|(Script-Setup)
  20.  
  21.  
  22. B1) you need the SRL-OSR include and Smart8.
  23. B2) If smart is already opened, pair it up before you launch the script.
  24. B3) Redefine your player settings to your choice.
  25. B4) If you launched and got an error, paste it at: http://ilya.xxx/ssf/
  26. ________________________________________________________________________________
  27. ================================================================================
  28. {Start of the script}
  29.  
  30.  
  31. program FCurser;
  32.  
  33. {$DEFINE SMART8}
  34. {$I SRL-OSR/SRL.Simba}
  35. {$I SRL-OSR/SRL/Reflection/Reflection.simba}
  36. {$i SRL-OSR\SRL\misc\debug.simba}
  37. {$i SRL-OSR\SRL\misc\SmartGraphics.simba}
  38.  
  39. var
  40. caveEntranceWhite: TIntegerArray;
  41. Messedup,Failcast,Timer,cast,CaveEntrances: integer;
  42.  
  43. TimeTillBreak:string;
  44.  
  45. OutsideCaveSaftey,ABankMM,MBankMM,Memorywait2,MakeChatTabAll: boolean;
  46. SmartTprogress,ABankMM2,FindtheRandoms,SkillScreenFailSafe:boolean;
  47.  
  48.  
  49. const
  50.  
  51.  
  52. {
  53. ________________________________________________________________________________
  54. ================================================================================
  55. ________________________________________________________________________________
  56.  
  57. Section.1 : Player-Setup
  58. Section.2 : Advanced-Script-Setup
  59. ________________________________________________________________________________
  60.  
  61.  
  62. {++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
  63. |1. Prayer Setup |
  64. |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
  65.  
  66. UseReflection = false; // Do you want the script to use Reflection?
  67.  
  68.  
  69. debuginfo = false; //adds debug testing to script, stuff in text in debugger.
  70.  
  71. Username = '@gmail.com';// Your Username.
  72. Password = '';// Your Password. (Four letters, do not use first letters)
  73. Nickname = ''; // Your Nickname. (Important to set up proper nickname)
  74. // Script will detect talking randoms inside cave.
  75. //Review end of post:villavu.com/forum/showthread.php?t=5410
  76.  
  77. MainMouseSpeed = 11; // Script changes mouse speed, search MouseSpeedz
  78. // 10-15 should be good enough.
  79.  
  80. AttempSolvingRandoms = true; //If somehow you spawned outside the cave would you
  81. //Want the script to handle randoms if you get any?
  82. //Or just ignore them and re-enter cave?.
  83. //This also includes Detecting Jmods/PMods.
  84.  
  85.  
  86. Playermode = 1; // Three player modes: (1) is same as (2) in all features,
  87. // but it has random wait times after it does the click.
  88. // two is pretty much bot like, no major wait times after
  89. // clicking, no antiban either. Use (1) only.
  90.  
  91. Breakhandler = true; // Would you want to take breaks?
  92. BreakTime1 = 45; // Minimum Gameplay time before breaks.
  93. BreakTime2 = 120; // Maximum Gameplay Time before breaks.
  94. // Time is in Minutes, not MS.
  95.  
  96. BreakWait1 = 15; // For how long to take a break?
  97. BreakWait2 = 30; // Example 15, 30 will take a break for 15-30 minutes.
  98.  
  99.  
  100. TheMagicWord = 'ody'; // This is the WORD that confirms that you've ran out of
  101. // Runes, for example 'ody' refers to the word (Body)
  102. // Once said word appears in your chat box, the script
  103. // Will log out and terminate, this really depends on
  104. // What staff/runes your using, don't use first letters.
  105.  
  106.  
  107. DoSmartProgress = false; // This will Draw a Debugged GUI on the Smart-Screen.
  108. // Displaying Time Running and Spells Cast, more CPU!.
  109. // recommended to leave off, MORE CPU = more Missclicks
  110.  
  111. SkillFailsafe = True; // This will Close the Skill Screen and range enchant
  112. // Screens if they get opened.
  113.  
  114. CheckChatTabAll = True; // This will make sure your Chat Tab is always on (ALL)
  115. // In order to register that you ran out of runes
  116. // The script needs to read the sentence in the chabox.
  117. // Disable this if you use the script while talking to
  118. // your friends in Clanchat or PM.
  119.  
  120.  
  121. {++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
  122. |2. Advanced Setup |
  123. |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
  124.  
  125.  
  126. EntranceMode = 2; // This is the entrance mode for cave, choices: 1,2 and 3.
  127. // Recommended you use (2), mode (1)/(3) can lead to out of
  128. // range error, (1) won't hover players, (3) does, use (2).
  129.  
  130. MAttMode = 1; // This determines which attack mode you want to use for
  131. // Monsters, default is (1) but if it gives you out of range
  132. // Errors then use (2).
  133.  
  134. RunToNPC = true; // if enabled (helpful) it will run to the NPC, now pay
  135. // attention carefully, it wont click on the NPC dot its self
  136. // but it will run Midpath, so you have to determin how close
  137. // or far you want your character to run, continue reading..
  138. // i find this useful because if it fails to allign correctly
  139. // it will still attempt to at least run to the npc.
  140.  
  141. MinNPCdistance = 0; // This triggers the running, if the script cant find the
  142. MaxNPCdistance = 20;// NPC in this distance - default 0-15 which means 2 squares
  143. // in pixel distance on RS mainsscreen (2 character moves)
  144. // So.. If it can't find the Dot in the designated distance
  145. // it will run, using the distance you set up for NpcRadius.
  146.  
  147. MinNPCRadius = 10; // This will determin what distance range can an NPC dot
  148. MaxNPCRadius = 70; // be on the minimap screen for it to be valid as a dot.
  149. // 10-70 scans the hole minimap for NPC dots, now this wont
  150. // trigger the run. I repeat, this won't click on the dot
  151. // its self, it clicks midway, to the path.
  152.  
  153.  
  154.  
  155. MaxNpcTime = 8000; // Maximum amount of time the script will look for the 45.
  156. // while your at the safe spot and not in combat, if this
  157. // passes and it still cant find him, the script will log
  158. // out and then log back in (restarting safe spot process).
  159.  
  160.  
  161. AutoBankMM = true; // Detects Bank Symbol on the Mini-map using CTS2/Hue/Sat
  162. // This has been revised and no longer causes memory
  163. // leaks or CPU hogs (shouldn't if it does...)
  164. // if this fails then try other options, remember set your
  165. // brightness to HIGHEST!, also you can take the colors
  166. // i added then put them in AutoColorAid and add on the
  167. // new bankIcon colors to the existing color, i obtained
  168. // my color by starting/restarting RS about 34 times.
  169.  
  170. Autobankmm2 = false; // Not recommended, this uses about 30% CPU constantly
  171. // it searches using (Findsymbols) function = Bitmaps
  172.  
  173. ManualBankMM = false; // If AutoBankMM/2 fails to find Bank/Icons then enable
  174. // This action and set up your own bank MM colors.
  175. // This also looks for a bitmap i made.
  176.  
  177.  
  178. { Guide to setting up manual bank MM:
  179. http://villavu.com/forum/showthread.php?t=101113&page=4&p=1228404#post1228404 }
  180.  
  181. BankMMColor1 = 4046813;
  182. BankMMColor2 = 3378855; // If manualBankMM is true, then edit it here.
  183. BankMMColor3 = 86633;
  184. BankMMTolerance = 5;
  185.  
  186. BankMMCTS = 0; //
  187. BankMMHue = 0.2; // Only change these using AutoColorAid!
  188. BankMMSat = 0.2; //
  189.  
  190.  
  191.  
  192. WaitMemory1 = 150; // This is how fast/slow the script will go through
  193. WaitMemory2 = 155; // The main loop, this is great for Memory/CPU hogs.
  194. // you can set this maximum to 400-405, anything higher
  195. // Pretty much defeats the purpose of botting.
  196.  
  197.  
  198. UseLessMemory = false; // Well this adds even more wait time, instead of just
  199. WaitMemory3 = 40; // Adding it at the start of all loops, this is inbetween
  200. WaitMemory4 = 55; // Most procedures, so we're talking about X15~ commands.
  201. // Anything really higher than 50 will make it slow.
  202. // However, this can work magics for memory/cpu leaks.
  203.  
  204. OutFailSafe = true; // Enable this if you want Outside Cave Failsafes.
  205. // You will need lumbridge teleport runes, this failsafe
  206. // will teleport you to lumbridge if you Cant enter
  207. // Caves for the duration of HpBarOutside and in combat.
  208.  
  209. HpBarOutside = 20000; // For how long the script will try to enter the cave,
  210. // Once this passes the script will teleport you and end.
  211. // Do note, this counter only starts if you - or some one
  212. // right next to you is in combat outside the cave.
  213.  
  214. LowHpOutside = 50; // So at what HP should register that its time to tele?
  215. // Change this if you have Low Hp levels, script will
  216. // take it as if you got in combat, got stuck outside,
  217. // reached low hp and then it decided to teleport to save
  218. // your runes.
  219.  
  220.  
  221.  
  222. CaveCTS = 2; // These settings detect the cave entrance from every
  223. CaveColor = 9737631; // Every angle.
  224. Cavetol = 27; // Change them ONLY IF YOUR USING AUTO COLOR AID!
  225. CaveHue = 0.07; // IF YOU KNOW WHAT AUTO COLOR AID, then i need not
  226. CaveSat = 0.09; // explain any further!
  227.  
  228.  
  229. BankIconColor = 2138555;
  230. BankIconTol = 25;
  231. BankIconHue = 0.11;
  232. BankIconSat = 1.15;
  233.  
  234. version = '1.4';
  235. Curse = 29;
  236.  
  237.  
  238.  
  239. { END OF SET UP DO NOT CHANGE BELOW!
  240. \\___________________________________________________________________________//}
  241. procedure playerSetup;
  242. begin
  243. HowManyPlayers := 1;
  244. NumberOfPlayers(HowManyPlayers);
  245. CurrentPlayer := 0;
  246. Players[0].Name := username;
  247. Players[0].Pass := password;
  248. Players[0].Nick := nickname;
  249. Players[0].Active:=True;
  250. FindtheRandoms := AttempSolvingRandoms;
  251. caveEntranceWhite := [7763583, 8553356];
  252. MBankMM := ManualBankMM
  253. ABankMM := AutoBankMM
  254. ABankMM2 := Autobankmm2;
  255. Memorywait2 := UseLessMemory;
  256. SkillScreenFailSafe:= SkillFailsafe;
  257. MakeChatTabAll := CheckChatTabAll;
  258. SmartTprogress := DoSmartProgress;
  259. OutsideCaveSaftey := OutFailSafe;
  260.  
  261. end;
  262.  
  263. Function GetGreenUptext: String;
  264. Var
  265. WhiteT,BlueT,YellowT,OrangeT,GreenT,FoundText: String;
  266. Begin
  267. WhiteT:=GetTextAtExWrap(8, 8, 80, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
  268. BlueT:=GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
  269. YellowT:=GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
  270. OrangeT:=GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
  271. GreenT := GetTextAtExWrap(8, 8, 150, 21, 0, 5, 1, 120577, 65, 'UpChars07'); // i added this! :) this is really important to be honest!.
  272. FoundText:=WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
  273. FoundText:= ReplaceWrap(FoundText, '.', '',[rfReplaceAll]);
  274. FoundText:= ReplaceWrap(FoundText, '/', '',[rfReplaceAll]);
  275. FoundText:= ReplaceWrap(FoundText, '\', '',[rfReplaceAll]);
  276. FoundText:= ReplaceWrap(FoundText, ',', '',[rfReplaceAll]);
  277. FoundText:= ReplaceWrap(FoundText, '*', '',[rfReplaceAll]);
  278. FoundText:= ReplaceWrap(FoundText, '^', '',[rfReplaceAll]);
  279. FoundText:= ReplaceWrap(FoundText, '"', '',[rfReplaceAll]);
  280. Result:=FoundText;
  281. End;
  282.  
  283. function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
  284. var
  285. TheText: string;
  286. i, n: Integer;
  287. begin
  288. TheText := GetGreenUptext;
  289. n := High(Text);
  290. for i := 0 to n do
  291. if (Pos(Text[i], TheText) > 0) then
  292. begin
  293. Result := True;
  294. Exit;
  295. end;
  296. end;
  297.  
  298. function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
  299. var
  300. T: Integer;
  301. begin
  302. Result := false;
  303. T := GetSystemTime + Time;
  304. while (GetSystemTime < T) do
  305. begin
  306. if (IsUpTextMultiCustom2(S)) then
  307. begin
  308. Result := True;
  309. Exit;
  310. end;
  311. Wait(20 + Random(20));
  312. end;
  313. end;
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320. function FindTalk2: Boolean;
  321. var
  322. ax, ay, yCount, zCount, Count2, x1, y1, x2, y2, Count1, bmpScreen: Integer;
  323. begin
  324. Result := False;
  325. if (GetArrayLength(Players) < 1) then Exit;
  326.  
  327. if FindColor(ax, ay, 65535, MSX1, MSY1, MSX2, MSY2) then
  328. begin
  329.  
  330. SetArrayLength(gtalksBox, 0);
  331. SetArrayLength(YelSkipBoxs, 0);
  332.  
  333. y1 := ay;
  334. if ( ( ay + 5 ) > 334 ) then y2 := 334 else y2 := ay + 5;
  335.  
  336. x1 := ax; x2 := x1;
  337. zCount := 0;
  338.  
  339. repeat
  340. if FindColor(ax, ay, 65535, x2, y1 + 2, x2 + 3, y2 + 3) then
  341. zCount := 0
  342. else
  343. zCount := zCount + 1;
  344.  
  345. if ( zCount = 4 ) then Break;
  346. x2 := x2 + 3;
  347. until ( x2 + 3 > 515 );
  348.  
  349. if ( x2 + 3 <= 515 ) then x2 := x2 - 12;
  350.  
  351. if (x2 - x1 >= length(Players[CurrentPlayer].Nick) * 4) then
  352. begin
  353.  
  354. x1 := x1 - 8;
  355. y1 := y1 - 8;
  356. x2 := x2 + 8;
  357. y2 := y2 + 8;
  358.  
  359. if ( x1 < 0 ) then x1 := 0;
  360. if ( y1 < 0 ) then y1 := 0;
  361. if ( x2 > 515 ) then x2 := 515;
  362. if ( y2 > 334 ) then y2 := 334;
  363.  
  364. Count2 := Count2 + 1;
  365. Count1 := Count1 + 1;
  366. SetArrayLength(gtalksBox, Count2);
  367. gtalksBox[Count2 - 1].x1 := x1;
  368. gtalksBox[Count2 - 1].y1 := y1;
  369. gtalksBox[Count2 - 1].x2 := x2;
  370. gtalksBox[Count2 - 1].y2 := y2 + 6;
  371.  
  372. SetArrayLength(YelSkipBoxs, Count1);
  373. YelSkipBoxs[Count1 - 1].x1 := x1;
  374. YelSkipBoxs[Count1 - 1].y1 := y1;
  375. YelSkipBoxs[Count1 - 1].x2 := x2;
  376. YelSkipBoxs[Count1 - 1].y2 := y2;
  377.  
  378. end else
  379. begin
  380. y1 := y1 - 2;
  381. y2 := y2 + 8;
  382. x1 := x1 - 5;
  383. x2 := x2 + 5;
  384. if ( x1 < 0 ) then x1 := 0;
  385. if ( y1 < 0 ) then y1 := 0;
  386. if ( x2 > 515 ) then x2 := 515;
  387. if ( y2 > 334 ) then y2 := 334;
  388.  
  389. Count1 := Count1 + 1;
  390. SetArrayLength(YelSkipBoxs, Count1);
  391. YelSkipBoxs[Count1 - 1].x1 := x1;
  392. YelSkipBoxs[Count1 - 1].y1 := y1;
  393. YelSkipBoxs[Count1 - 1].x2 := x2;
  394. YelSkipBoxs[Count1 - 1].y2 := y2;
  395. end;
  396.  
  397. if ( GetArrayLength(gtalksBox) <> 0 ) then
  398. begin
  399. for yCount := 0 to GetArrayLength(gtalksBox) - 1 do
  400. begin
  401. if FindBitmapMaskTolerance(NickNameBMP, ax, ay, gtalksBox[yCount].x1, gtalksBox[yCount].y1, gtalksBox[yCount].x2, gtalksBox[yCount].y2, 0, 40) then
  402. begin
  403. WriteLn('Found NickName');
  404. ax := (gtalksBox[yCount].x2 + gtalksBox[yCount].x1) shr 1;
  405. ay := gtalksBox[yCount].y2 - 2;
  406.  
  407. if gTalkSaveBitmap then
  408. begin
  409. bmpScreen := BitmapFromString(515, 334, '');
  410. CopyClientToBitmap(bmpScreen, 1, 1, 515, 334);
  411.  
  412. if ( gtalksBox[yCount].x1 = 0 ) then x1 := 1 else x1 := gtalksBox[yCount].x1;
  413. if ( gtalksBox[yCount].y1 = 0 ) then y1 := 1 else y1 := gtalksBox[yCount].y1;
  414.  
  415. gTalksCount := gTalksCount + 1;
  416. for Count1 := -1 to 1 do
  417. for Count2 := -1 to 1 do
  418. FastSetPixel(bmpScreen, Count1 + x1, Count2 + y1, 255);
  419.  
  420. if ( gtalksBox[yCount].x2 = 515 ) then x1 := 515 else x1 := gtalksBox[yCount].x2;
  421. if ( gtalksBox[yCount].y2 = 334 ) then y1 := 334 else y1 := gtalksBox[yCount].y2;
  422.  
  423. for Count1 := -1 to 1 do
  424. for Count2 := -1 to 1 do
  425. FastSetPixel(bmpScreen, Count1 + x1, Count2 + y1, 255);
  426.  
  427. for Count1 := -1 to 1 do
  428. for Count2 := -1 to 1 do
  429. FastSetPixel(bmpScreen, Count1 + ax, Count2 + ay, 255);
  430. SaveBitmap(bmpScreen, ScriptPath + 'FTalk' + IntToStr(gTalksCount) + '.bmp');
  431. FreeBitmap(bmpScreen);
  432. end;
  433. Result := True;
  434. Exit;
  435. end;
  436. end;
  437. end;
  438. end;
  439. end;
  440.  
  441.  
  442.  
  443.  
  444. procedure Waitmore;
  445. begin
  446. if Memorywait2 then
  447. begin
  448. wait(randomrange(waitMemory3,WaitMemory4));
  449. end;
  450. end;
  451.  
  452.  
  453. procedure StartTime;
  454. begin
  455. Timer := GetTimeRunning + RandomRange(BreakTime1 * 60000, BreakTime2 * 60000);
  456. end;
  457.  
  458.  
  459.  
  460. procedure takebreaks;
  461. var
  462. T,BreakTimer:integer;
  463. Times:string;
  464. begin
  465. if (Breakhandler = false) then exit;
  466. if (GetTimeRunning >= Timer) then
  467. begin
  468. writeln('its time to take a break....');
  469.  
  470.  
  471. BreakTimer := Randomrange(BreakWait1 * 60000, BreakWait2 * 60000);
  472.  
  473. Times := (MsToTime(BreakTimer, Time_Formal));
  474. writeln('Breaking for: ' + Times);
  475. marktime(t);
  476. repeat
  477. wait(400);
  478. logout;
  479. until (not(loggedin));
  480. if (not(loggedin)) then
  481. begin
  482. repeat
  483. wait(1000);
  484. until(TimeFromMark(t) >= BreakTimer);
  485. if (TimeFromMark(T) >= BreakTimer) then
  486. begin
  487. writeln('break time is over, back to the script');
  488. exit;
  489. end;
  490. end;
  491. end;
  492. end;
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499. function OnRangeScreen:boolean;
  500. var
  501. CTS:Integer;
  502. TPA:Tpointarray;
  503. begin
  504. if (not(loggedin)) then exit;
  505. cts := GetColorToleranceSpeed;
  506. ColorToleranceSpeed(2);
  507. SetColorSpeed2Modifiers(0.05, 0.41);
  508.  
  509. result:= FindColorsTolerance(TPA,5334901 , 482, 36, 492, 45, 12);
  510.  
  511.  
  512. ColorToleranceSpeed(CTS);
  513. SetColorSpeed2Modifiers(0.02, 0.2);
  514.  
  515. end;
  516.  
  517. Procedure closerangescreen;
  518. begin
  519. if (not(loggedin)) then exit;
  520. if onrangescreen and SkillScreenFailSafe then
  521. begin
  522. writeln('we are on skill screen, closing');
  523. mousebox(482, 36, 492, 45,1);
  524. end;
  525. end;
  526.  
  527. function OnskillScreen:boolean;
  528. var
  529. CTS:Integer;
  530. TPA:Tpointarray;
  531. begin
  532. if (not(loggedin)) then exit;
  533. cts := GetColorToleranceSpeed;
  534. ColorToleranceSpeed(2);
  535. SetColorSpeed2Modifiers(0.02, 1.48);
  536.  
  537. result:= FindColorsTolerance(TPA,8042720 , 480, 5, 513, 35, 4);
  538.  
  539.  
  540. ColorToleranceSpeed(CTS);
  541. SetColorSpeed2Modifiers(0.02, 0.2);
  542.  
  543. end;
  544.  
  545. Procedure CloseSkillScreen;
  546. begin
  547. if (not(loggedin)) then exit;
  548. if OnSkillScreen and SkillScreenFailSafe then
  549. begin
  550. writeln('we are on skill screen, closing');
  551. mousebox(494,17,500,22,1);
  552. end;
  553. end;
  554.  
  555. function GetHpBarAbove:boolean;
  556. var
  557. Hpbar:tpointarray;
  558.  
  559. begin
  560. result := (FindColorsTolerance(HpBar, 65280, 185, 50, 400, 250 , 3)) and
  561. (FindColorsTolerance(HpBar, 255, 185, 50, 400, 250 , 3))
  562.  
  563. end;
  564.  
  565.  
  566.  
  567.  
  568. procedure MouseSpeedz;
  569. begin
  570. if (not(loggedin)) then exit;
  571. case random(600) of
  572. 1..450: MouseSpeed := MainMouseSpeed;
  573. 451..570: MouseSpeed := MainMouseSpeed + randomrange(-1,1);
  574. 571..590: MouseSpeed := MainMouseSpeed + randomrange(-1,2);
  575. 591..600: MouseSpeed := MainMouseSpeed + randomrange(-1,3);
  576. end;
  577. end;
  578.  
  579.  
  580.  
  581. procedure WaitAfterCast;
  582. begin
  583. if (not(loggedin)) then exit;
  584. case random(600) of
  585. 1..450: Wait(RandomRange(100, 300));
  586. 451..570: Wait(RandomRange(300, 400)); //this is rarely used.
  587. 571..590: Wait(RandomRange(400, 600));
  588. 591..600: Wait(RandomRange(600, 1000));
  589. end;
  590. end;
  591.  
  592.  
  593.  
  594. procedure WaitShortClick;
  595. begin
  596. if (not(loggedin)) then exit;
  597. case random(600) of
  598. 1..450: Wait(RandomRange(100, 150));
  599. 451..570: Wait(RandomRange(150, 200)); //this is rarely used.
  600. 571..590: Wait(RandomRange(200, 250));
  601. 591..600: Wait(RandomRange(250, 400));
  602. end;
  603. end;
  604.  
  605. procedure WaitShortClick2;
  606. begin
  607. if (not(loggedin)) then exit;
  608. case random(600) of
  609. 1..450: Wait(RandomRange(400, 450));
  610. 451..570: Wait(RandomRange(450, 500)); //this is rarely used.
  611. 571..590: Wait(RandomRange(500, 550));
  612. 591..600: Wait(RandomRange(550, 600));
  613. end;
  614. end;
  615.  
  616. procedure WaitHumanClick;
  617. begin
  618. if (not(loggedin)) then exit;
  619. case random(600) of
  620. 1..450: Wait(RandomRange(600, 650));
  621. 451..570: Wait(RandomRange(650, 700));
  622. 571..590: Wait(RandomRange(700, 750));
  623. 591..600: Wait(RandomRange(750, 800));
  624. end;
  625. end;
  626.  
  627. procedure WaitHumanClick2;
  628. begin
  629. if (not(loggedin)) then exit;
  630. case random(600) of
  631. 1..450: Wait(RandomRange(800, 1000));
  632. 451..570: Wait(RandomRange(1000, 1200));
  633. 571..590: Wait(RandomRange(1200, 1400));
  634. 591..600: Wait(RandomRange(1400, 2000));
  635. end;
  636. end;
  637.  
  638. procedure WaitHumanClick3;
  639. begin
  640. if (not(loggedin)) then exit;
  641. case random(600) of
  642. 1..450: Wait(RandomRange(3000, 5000));
  643. 451..570: Wait(RandomRange(5000, 5500));
  644. 571..590: Wait(RandomRange(6000, 6500));
  645. 591..600: Wait(RandomRange(7000, 7500));
  646. end;
  647. end;
  648.  
  649. procedure WaitHumanClick4;
  650. begin
  651. if (not(loggedin)) then exit;
  652. case random(600) of
  653. 1..450: Wait(RandomRange(7500, 11000));
  654. 451..570: Wait(RandomRange(11000, 12000));
  655. 571..590: Wait(RandomRange(13000,14000));
  656. 591..600: Wait(RandomRange(15000, 16000)); //We use different wait times for different Scenarios, these help out a lot.
  657. end;
  658. end;
  659.  
  660. procedure WaitHumanClick5;
  661. begin
  662. if (not(loggedin)) then exit;
  663. case random(600) of
  664. 1..450: Wait(RandomRange(61000, 65000));
  665. 451..570: Wait(RandomRange(65000, 70000)); // only used if you dont have -65 mage.
  666. 571..590: Wait(RandomRange(70000, 75000));
  667. 591..600: Wait(RandomRange(75000, 80000));
  668. end;
  669. end;
  670.  
  671. function NotchatTabAll:boolean;
  672. var
  673. Monster:TpointArray;
  674. TmpCts:Integer;
  675. begin
  676. if (not(loggedin)) then exit;
  677.  
  678. tmpCTS := GetColorToleranceSpeed;
  679. ColorToleranceSpeed(2);
  680. SetColorSpeed2Modifiers(0.10, 0.34);
  681.  
  682.  
  683. result := FindColorsTolerance(Monster, 4213586, 6,482,60,497, 11);
  684.  
  685. ColorToleranceSpeed(0);
  686. SetColorSpeed2Modifiers(0.2, 0.2);
  687.  
  688.  
  689. end;
  690.  
  691. procedure MakeMyChatTabAll;
  692. begin
  693. if (not(loggedin)) then exit;
  694.  
  695. writeln('Our chat Tab is not set to all, making chat tab to all');
  696. mousebox(12,485,45,497,1);
  697. end;
  698.  
  699. procedure ProgressReport;
  700. var
  701. Timeleft,XpPerhour,Casts,CastsPH: Integer;
  702. begin
  703. if (not(loggedin)) then exit;
  704. ClearDebug;
  705. XpPerhour := (3600*(Cast) /((GetTimeRunning/1000)));
  706. Casts := ((Cast) / (29));
  707. CastsPH := (3600*(Casts) / ((GetTimeRunning/1000)));
  708. timeleft := ((Timer) - (GetTimeRunning));
  709. TimeTillBreak := (MsToTime(timeleft, Time_Formal));
  710. WriteLn('* FCurser v'+version);
  711. WriteLn('* Runtime: ' + TimeRunning);
  712. Writeln('*');
  713. writeln('* Experience Gained: ' + IntToStr(Cast) + ' Exp P/H: ' + IntToStr(XpPerhour));
  714. writeln('* Curse Used : ' + IntToStr(Casts) + ' Casts P/h: ' + IntTostr(CastsPH));
  715. Writeln('* No. Of Times : ' + 'Failed Casting: ' + intTostr(failcast) + ' Messed up: ' + inttostr(messedup) + ' Entered Cave: ' + IntToStr(CaveEntrances));
  716. if (Breakhandler = true) then
  717. Writeln('* Time till break : ' + (TimeTillBreak)) ;
  718. Writeln('* Post all Bugs/proggies/errors on this topic: http://villavu.com/forum/showthread.php?t=103236');
  719. end;
  720.  
  721. procedure SmartProggy;
  722. var
  723. info1,info2,info3: String;
  724. casts:integer;
  725. begin
  726. if (not(loggedin)) then exit;
  727. if (not(SmartTprogress)) then
  728. exit;
  729. Casts := ((Cast) / (29));
  730. info1:= 'FCurser V' + version;
  731. info2:= 'Runtime: ' + TimeRunning;
  732. info3:= 'Casts Used: '+ IntToStr(Casts);
  733. SMART_ClearCanvas;
  734. SMART_DrawText(350,0,CharsNPC,info1,clWhite);
  735. SMART_DrawText(350,15,CharsNPC,info2,clWhite);
  736. SMART_DrawText(350,30,CharsNPC,info3,clWhite);
  737. end;
  738.  
  739.  
  740.  
  741. { FindObjex by Starblaster100}
  742.  
  743. function FindObjExXtra(var cx, cy: Integer; Color: TIntegerArray;
  744. Tol, Step, xs, ys, xe, ye: Integer): Boolean;
  745. var
  746. MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
  747. ColorFound: Boolean;
  748. SearchBoxes: Array of Array of TBox;
  749. p: TPointArray;
  750. begin
  751.  
  752. if (not(loggedin)) then exit;
  753. Result := False;
  754.  
  755. //check for all the colors
  756. for i := 0 to (GetArrayLength(Color)-1) do
  757. if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
  758. begin
  759. ColorFound := True;
  760. Break;
  761. end;
  762.  
  763. if not(ColorFound) then
  764. Exit; //None of the colors could be found on screen
  765.  
  766. //Start coordinates
  767. MidX := Round((xe - xs) / 2);
  768. MidY := Round((ye - ys) / 2);
  769.  
  770. //width and height in boxes
  771. Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
  772. Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
  773.  
  774. SetLength(SearchBoxes, Width);
  775.  
  776. //Getting mid of screen in boxes, not pixels
  777. HalfWidth := Floor(Width / 2);
  778. HalfHeight := Floor(Height / 2)
  779.  
  780. //Create the search boxes, starting in mid because of backwards compatibility
  781. for x := -1 * HalfWidth to HalfWidth do
  782. begin
  783. SetLength(SearchBoxes[x + HalfWidth], Height);
  784. for y := -1 * HalfHeight to HalfHeight do
  785. SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(
  786. Max(xs, xs + Round(MidX + ((x - 0.5) * Step))),
  787. Max(ys, ys + Round(MidY + ((y - 0.5) * Step))),
  788. Min(xe, xs + Round(MidX + ((x + 0.5) * Step))),
  789. Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
  790. end;
  791.  
  792. //Create a TPA, where points are representing the boxes
  793. p := TPAFromBox(IntToBox(0, 0, Width-1, Height-1));
  794.  
  795. //Sort thid TPA from the middle to get a spiral like effect
  796. SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
  797.  
  798. //Loop through the boxes, searching for the object (the k and j loop might be better to switch though)
  799. for k := 0 to High(Color) do
  800. for j := 0 to High(p) do
  801. begin
  802. if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1,
  803. SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2,
  804. SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
  805. begin
  806. begin
  807. Result := True;
  808. Exit;
  809. end;
  810. end;
  811. end;
  812. end;
  813.  
  814. function FindObjExX(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray;
  815. Tol,CTS:integer; Hue,Sat:Extended; Step, xs, ys, xe, ye: Integer): Boolean;
  816. var
  817. MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
  818. ColorFound: Boolean;
  819. SearchBoxes: Array of Array of TBox;
  820. p: TPointArray;
  821. begin
  822. if (not(loggedin)) then exit;
  823.  
  824. Result := False;
  825.  
  826.  
  827. for i := 0 to (GetArrayLength(Color)-1) do
  828. begin
  829. ColorToleranceSpeed(CTS);
  830. SetColorSpeed2Modifiers(Hue, sat);
  831.  
  832. if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
  833. begin
  834. ColorToleranceSpeed(0);
  835. SetColorSpeed2Modifiers(0.2, 0.2);
  836. ColorFound := True;
  837. Break;
  838. end;
  839. end;
  840.  
  841. if not(ColorFound) then
  842. Exit;
  843.  
  844.  
  845. MidX := Round((xe - xs) / 2);
  846. MidY := Round((ye - ys) / 2);
  847.  
  848.  
  849. Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
  850. Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
  851.  
  852. SetLength(SearchBoxes, Width);
  853.  
  854.  
  855. HalfWidth := Floor(Width / 2);
  856. HalfHeight := Floor(Height / 2)
  857.  
  858.  
  859. for x := -1 * HalfWidth to HalfWidth do
  860. begin
  861. SetLength(SearchBoxes[x + HalfWidth], Height);
  862. for y := -1 * HalfHeight to HalfHeight do
  863. SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(
  864. Max(xs, xs + Round(MidX + ((x - 0.5) * Step))),
  865. Max(ys, ys + Round(MidY + ((y - 0.5) * Step))),
  866. Min(xe, xs + Round(MidX + ((x + 0.5) * Step))),
  867. Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
  868. end;
  869.  
  870.  
  871. p := TPAFromBox(IntToBox(0, 0, Width-1, Height-1));
  872.  
  873.  
  874. SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
  875.  
  876.  
  877. for k := 0 to High(Color) do
  878. for j := 0 to High(p) do
  879. begin
  880.  
  881. ColorToleranceSpeed(CTS);
  882. SetColorSpeed2Modifiers(Hue, sat);
  883.  
  884. if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1,
  885. SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2,
  886. SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
  887. begin
  888. case random (25) of
  889. 0..15: MMouse(cx, cy, randomrange(-3,3),randomrange(-3,3));
  890. 16..17: MMouse(cx, cy, randomrange(-5,5),randomrange(-5,5));
  891. 18..19: MMouse(cx, cy, randomrange(-6,6),randomrange(-6,6));
  892. 20..21: MMouse(cx, cy, randomrange(-7,7),randomrange(-7,7));
  893. 22..23: MMouse(cx, cy, randomrange(-8,8),randomrange(-8,8));
  894. 24..25: MMouse(cx, cy, randomrange(-9,9),randomrange(-9,9));
  895. end;
  896. If (WaitUptextMulti2(Text, 300)) then
  897. begin
  898.  
  899. ColorToleranceSpeed(0);
  900. SetColorSpeed2Modifiers(0.2, 0.2);
  901.  
  902.  
  903.  
  904. GetMousePos(cx, cy);
  905. Result := True;
  906. Exit;
  907. end;
  908. end;
  909. ColorToleranceSpeed(0);
  910. SetColorSpeed2Modifiers(0.2, 0.2);
  911. end;
  912. ColorToleranceSpeed(0);
  913. SetColorSpeed2Modifiers(0.2, 0.2);
  914. end;
  915.  
  916.  
  917.  
  918.  
  919.  
  920. function FindManualBankMM:boolean;
  921. var
  922. x,y:integer;
  923. begin
  924. result := FindObjExXtra(x, y, [BankMMColor1,BankMMcolor2,BankMMcolor3], BankMMTolerance, 50, MMX1, MMY1, MMX2, MMY2)
  925. end;
  926.  
  927.  
  928. Function FindBankBMP: Boolean;
  929. var
  930. Bank:integer;
  931. x,y:integer; // This bitmap of the bank fails if players
  932. // npcs/items appear under it
  933. begin
  934. Bank := BitmapFromString(3, 5, 'meJxzOvOcMb4YgpxgbDQGnAsAnfwS' + 'CA==');
  935. SetBitmapName(Bank, 'FindBanksymbolFunction');
  936.  
  937. result := (FindBitMapToleranceIn(Bank, X, Y, MMX1, MMY1, MMX2, MMY2, 65))
  938.  
  939. FreeBitmap(Bank); // this uses 5% Cpu.
  940. end;
  941.  
  942. Function AutoBankSymbols2:boolean;
  943. var //causes memory leaks. Uses 20-25% Cpu.
  944. x,y:integer;
  945. begin
  946. result := (FindSymbol(x, y, 'bank') or FindSymbol(x, y, 'minigame'));
  947. end;
  948.  
  949.  
  950. Function FindBankSymbol1: Boolean;
  951. var
  952. TPA:tpointarray;
  953. begin
  954. if (not(loggedin)) then exit;
  955.  
  956.  
  957.  
  958. ColorToleranceSpeed(2);
  959. SetColorSpeed2Modifiers(BankIconHue, BankIconSat);
  960.  
  961. result := FindColorsTolerance(TPA, BankIconColor, MMX1, MMY1, MMX2, MMY2, BankIconTol);
  962.  
  963. // finds bank iconsz
  964.  
  965. ColorToleranceSpeed(0);
  966. SetColorSpeed2Modifiers(0.2, 0.2);
  967. end;
  968.  
  969.  
  970. function FindbanksymboLL: boolean;
  971. begin
  972.  
  973. result := (FindBanksymbol1)
  974. end;
  975.  
  976.  
  977.  
  978.  
  979.  
  980. function FindBanksymbol: BOolean;
  981. begin
  982. if (ManualBankMM = true) then
  983. begin
  984. result := (FindManualBankMM) or (findbankBMP);
  985. end
  986. else
  987. begin
  988. if (AutoBankMM = true) then
  989. begin
  990. result := (FindbanksymboLL);
  991. end
  992. else
  993. begin
  994. if (Autobankmm2 = true) then
  995. begin
  996. result := (AutoBankSymbols2);
  997. end;
  998. end;
  999. end;
  1000. end;
  1001.  
  1002.  
  1003. function OnlobbyScreen:boolean;
  1004. begin
  1005. result := (GetColor(381, 336) = 16777215);
  1006. end;
  1007.  
  1008. procedure ClickToEnterLobby;
  1009. begin
  1010. if (not(loggedin)) then exit;
  1011. if Findbanksymbol then exit;
  1012. MouseBox(323,312,450,350, mouse_right);
  1013. waithumanclick;
  1014. ChooseOption('lay');
  1015. end;
  1016.  
  1017.  
  1018.  
  1019. Function HoverNearbyNpc:boolean;
  1020. var
  1021. I:Tpointarray;
  1022. P:Integer;
  1023. begin
  1024. if (not(loggedin)) then exit;
  1025. I := GetMiniMapDots('npc');
  1026. if (length(I) > 0) then
  1027. begin
  1028. SortTPAFrom(i, Point(MMCX, MMCY));
  1029. P := random(length(I))
  1030. Mmouse(I[0].x, I[0].y,3,3);
  1031. // Mouse(I[0].x, I[0].y, RandomRange(-2, 2), RandomRange(-2, 2), true); // you can take this command and change npc to whatever dot you want and use it however you want, great for auto fighters.
  1032. result := true;
  1033. end;
  1034. end;
  1035.  
  1036.  
  1037.  
  1038.  
  1039. Procedure Keyboards;
  1040. begin
  1041. case random (5) of
  1042. 0..2:begin
  1043. KeyDown(37);
  1044. WaitShortClick
  1045. KeyUp(37);
  1046. WaitShortClick
  1047. KeyDown(40);
  1048. WaitShortClick
  1049. KeyUp(40);
  1050. end;
  1051. 3..4: begin
  1052. KeyDown(39);
  1053. WaitShortClick
  1054. KeyUp(39);
  1055. WaitShortClick
  1056. KeyDown(38);
  1057. WaitShortClick
  1058. KeyUp(38);
  1059. end;
  1060. 5: begin
  1061. KeyDown(38);
  1062. WaitShortClick
  1063. KeyUp(38);
  1064. WaitShortClick
  1065. KeyDown(39);
  1066. WaitShortClick
  1067. KeyUp(39);
  1068. end;
  1069. end;
  1070. end;
  1071.  
  1072.  
  1073.  
  1074. Procedure Antiban;
  1075. Begin
  1076. if (not(loggedin)) then exit;
  1077. case random (100) of
  1078. 0..56: begin
  1079. end;
  1080.  
  1081. 57..100: begin
  1082.  
  1083. case random(150) of
  1084. 10: hoverskill(skill_magic,false);
  1085. 15: HoverOnlineFriend;
  1086. 20: BoredHuman;
  1087. 30: MMouseOffClient('top');
  1088. 40: MMouseOffClient('left');
  1089. 50: MMouseOffClient('right');
  1090. 60: MMouseOffClient('bottom');
  1091. 70: SmallRandomMouse;
  1092. 80: RandomAngle(1);
  1093. 90: RandomAngle(2);
  1094. 100:PickUpMouse;
  1095. 110: CompassMovement(10, 70, true);
  1096. 120: HoverNearbyNpc; // See its an antiban, even though it sucks haha. .. Yeah..
  1097. 130: Keyboards;
  1098. 140: MissMouse(250,250);
  1099. 150: RandomMovement;
  1100. 160: CompassMovement(240,300,true);
  1101. 170: AdjustMouseSpeed(3,10,20);
  1102. 180: RandomFKeys(true);
  1103. 190: RandomTab(true);
  1104.  
  1105. end;
  1106. end;
  1107. end;
  1108. end;
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119. function AlreadyWeakend:boolean;
  1120. begin
  1121. if (not(loggedin)) then exit;
  1122. result := FindTextTPA(clBlack , 0, MCX1, MCY1, MCX2, MCY2, 'foe', smallChars07, Nothing);
  1123. end;
  1124.  
  1125. Procedure NPCisWeakend;
  1126. begin
  1127. if (not(loggedin)) then exit;
  1128. writeln('our Foe is already weakend, We could wait one minute, but were going to log out and log in, its much faster, make sure you have -65 MAGE! if you dont, then your spell WILL HIT!');
  1129. repeat
  1130. wait(400);
  1131. logout;
  1132. if (not(loggedin)) then exit;
  1133. until (not(loggedin));
  1134. end;
  1135.  
  1136. function OutofRunes:boolean;
  1137. Begin
  1138. if (not(loggedin)) then exit;
  1139. result := FindTextTPA(clBlack , 0, MCX1, MCY1, MCX2, MCY2, TheMagicWord, smallChars07, Nothing);
  1140. end;
  1141.  
  1142.  
  1143. function OnmageTab:boolean;
  1144. var
  1145. Monster:TpointArray;
  1146. TmpCts:Integer;
  1147. Melee:Boolean;
  1148. begin
  1149. if (not(loggedin)) then
  1150. exit;
  1151. tmpCTS := GetColorToleranceSpeed;
  1152. ColorToleranceSpeed(2);
  1153. SetColorSpeed2Modifiers(0.06, 0.24);
  1154.  
  1155.  
  1156. result := FindColorsTolerance(Monster, 1382991, 730, 170, 754, 195, 11)
  1157. melee:= result;
  1158.  
  1159. ColorToleranceSpeed(0);
  1160. SetColorSpeed2Modifiers(0.2, 0.2);
  1161. end;
  1162.  
  1163.  
  1164.  
  1165. procedure FindIfonMagetab;
  1166. begin
  1167. if (not(loggedin)) then exit;
  1168. if (not(OnmageTab)) then
  1169. begin
  1170. gametab(tab_magic);
  1171. waitshortclick2;
  1172. end
  1173. else
  1174. begin
  1175. if (OnmageTab) then
  1176. exit;
  1177. end;
  1178. end;
  1179.  
  1180.  
  1181.  
  1182. procedure Termination;
  1183. begin
  1184. if (loggedin) then
  1185. begin
  1186. Writeln('we ran out of runes, or something really went wrong?, terminating script');
  1187. repeat
  1188. if (not(loggedin)) then break;
  1189. logout;
  1190. waithumanclick;
  1191. if (not(loggedin)) then break;
  1192. until (not(loggedin));
  1193. if (not(loggedin)) then
  1194. begin
  1195. terminatescript;
  1196. end;
  1197. end;
  1198. end;
  1199.  
  1200.  
  1201.  
  1202. function FindObjectFar(Color: TintegerArray; Tol,CTS:integer; hMoD,sMoD: extended; Uptext: Array of String; WaitUptextWait,WaitUptextRandom: Integer; x,y,xs,ys:integer): boolean;
  1203. var
  1204. III,i,tmpcts: integer;
  1205. TPA:tpointarray;
  1206. TPAA: T2DPointArray;
  1207. //TIA: array of TIntegerArray; //I decided to make a TintegerArray for people that don't want to use ACA.
  1208. begin
  1209. if (not(loggedin)) then exit;
  1210. tmpcts := GetColorToleranceSpeed;
  1211. ColorToleranceSpeed(CTS);
  1212. SetColorSpeed2Modifiers(hMoD, SMoD);
  1213.  
  1214. FindColorsSpiralTolerance(MSCX, MSCY, TPA, color[III], x,y,xs,ys, Tol)
  1215. ColorToleranceSpeed(tmpCTS);
  1216. SetColorSpeed2Modifiers(0.2, 0.2);
  1217.  
  1218. SplitTPAWrap(TPA,10,TPAA);
  1219. SortATPAFromSize(TPAA,10,false);
  1220. case Entrancemode of
  1221.  
  1222. 1: begin
  1223. for I := 0 to low(TPAA) do
  1224. begin
  1225. MiddleTPAEx(TPAA[i], X, Y);
  1226. MMouse(x, y, RandomRange(-50, 50), RandomRange(-25, 25));
  1227. if WaitUpTextMulti2(uptext,WaitUptextWait+random(WaitUptextRandom)) then
  1228. Begin
  1229. Result := True;
  1230. GetMousePos(X, Y);
  1231. break;
  1232. end;
  1233. break;
  1234. end;
  1235. end;
  1236.  
  1237. 3: for I := 0 to High(TPAA) do
  1238. begin
  1239. MiddleTPAEx(TPAA[i], X, Y);
  1240. MMouse(x, y, RandomRange(-50, 50), RandomRange(-25, 25));
  1241. if WaitUpTextMulti2(uptext,WaitUptextWait+random(WaitUptextRandom)) then
  1242. Begin
  1243. Result := True;
  1244. GetMousePos(X, Y);
  1245. break;
  1246. end;
  1247. break;
  1248. end;
  1249. end;
  1250. end;
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259. function atSafeSpot:boolean;
  1260. var
  1261. TPA:TpointArray;
  1262. I: Tpointarray;
  1263. begin
  1264. if (not(loggedin)) then exit;
  1265. if (debuginfo = true) then
  1266. writeln('checking safe spoit');
  1267.  
  1268. ColorToleranceSpeed(2);
  1269. SetColorSpeed2Modifiers(16.12,9.26);
  1270.  
  1271. FindColorsTolerance(TPA,15856360, MMX1, MMY1, MMX2, MMY2, 3);
  1272.  
  1273. ColorToleranceSpeed(0);
  1274. SetColorSpeed2Modifiers(0.02, 0.2);
  1275.  
  1276. if (Length(TPA) > 0) then
  1277. begin
  1278. FilterPointsPie(TPA, 0, 360, 10, 30, MMCX, MMCY);
  1279. I := TPA;
  1280. if Length(I) > 0 then
  1281. begin
  1282.  
  1283. result := true;
  1284.  
  1285. end;
  1286. end;
  1287. end;
  1288.  
  1289.  
  1290.  
  1291. Function Meleer: Boolean;
  1292. var
  1293. Monster:TpointArray;
  1294. TmpCts:Integer;
  1295. begin
  1296. if (not(loggedin)) then
  1297. exit;
  1298. tmpCTS := GetColorToleranceSpeed;
  1299. ColorToleranceSpeed(2);
  1300. SetColorSpeed2Modifiers(0.51, 1.43);
  1301.  
  1302.  
  1303. result := FindColorsTolerance(Monster, 3152966, MSX1, MSY1, MSX2, MSY2, 5)
  1304.  
  1305. ColorToleranceSpeed(0);
  1306. SetColorSpeed2Modifiers(0.2, 0.2);
  1307. end;
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318. Function LocateMonster1(Color:TintegerArray; Tol,CTS:integer; hMoD,sMoD:Extended; Uptext: Array of String): Boolean;
  1319. var
  1320. R,ii,X,y,i,tmpcts:integer;
  1321. TPA:Tpointarray;
  1322. ATPA:T2DPointArray;
  1323. Boxm :tbox;
  1324. begin
  1325. if (not(Loggedin)) then exit;
  1326. if (not(meleer)) then exit;
  1327. if (findbanksymbol) then exit;
  1328.  
  1329.  
  1330. if findtherandoms and findtalk2 then
  1331. findnormalrandoms;
  1332.  
  1333.  
  1334.  
  1335. MouseSpeedz;
  1336. FindIfonMagetab;
  1337. case random (10) of
  1338.  
  1339. 0..7: Mouse(RandomRange(668, 669),RandomRange(263, 264), random(3),random(3),mouse_move);
  1340. 8..10: Mouse(RandomRange(663, 670),RandomRange(260, 265), random(1),random(1),mouse_move);
  1341. end;
  1342.  
  1343. if WaitUpTextMulti2(['Curse'],300) then
  1344. begin
  1345. clickmouse2(mouse_left);
  1346. waitshortclick;
  1347.  
  1348.  
  1349. tmpCTS := GetColorToleranceSpeed;
  1350. ColorToleranceSpeed(CTS);
  1351. SetColorSpeed2Modifiers(hMoD, sMoD);
  1352.  
  1353. FindColorsTolerance(TPA, Color[ii], MSX1, MSY1, MSX2, MSY2, Tol);
  1354.  
  1355.  
  1356. ColorToleranceSpeed(tmpCTS);
  1357. setColorSpeed2Modifiers(0.2, 0.2);
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364. if Length(TPA) < 0 then exit;
  1365.  
  1366. if (Length(TPA) > 0) and (Length(TPA) < 100) then
  1367. setangle(1);
  1368.  
  1369. case random (10) of
  1370. 0..7: begin
  1371. end;
  1372. 8..10:begin
  1373. R := Random(GetArrayLength(ATPA));
  1374. DeleteValueInTPA(TPA, R);
  1375. end;
  1376. end;
  1377.  
  1378.  
  1379.  
  1380. SplitTPAWrap(TPA,10,ATPA);
  1381.  
  1382. Boxm := GetATPABounds(ATPA);
  1383.  
  1384. case random (500) of
  1385. 0..480: SortATPASize(ATpA,true);
  1386. 481..499: SortATPAFromFirstPoint(ATPA,IntToPoint(MSCX,MSCY));
  1387. end;
  1388.  
  1389.  
  1390.  
  1391.  
  1392. for I := 0 to HIGH(ATPA) do
  1393. begin
  1394. mousespeedz;
  1395.  
  1396. MiddleTPAEx(ATPA[i], X, Y);
  1397. begin
  1398. case random (25) of
  1399. 0..15: MMouse(x, y, randomrange(-3,3),randomrange(-3,3));
  1400. 16..17: MMouse(x, y, randomrange(-5,5),randomrange(-5,5));
  1401. 18..19: MMouse(x, y, randomrange(-6,6),randomrange(-6,6));
  1402. 20..21: MMouse(x, y, randomrange(-7,7),randomrange(-7,7));
  1403. 22..23: MMouse(x, y, randomrange(-8,8),randomrange(-8,8));
  1404. 24..25: MMouse(x, y, randomrange(-9,9),randomrange(-9,9));
  1405. end;
  1406.  
  1407. if WaitUpTextMulti2(['Curse'],300) then
  1408. begin
  1409. wait(randomrange(90,120));
  1410.  
  1411. clickmouse2(mouse_left);
  1412. if Didclick(true,1000) then
  1413. begin
  1414. IncEx(cast,29);
  1415. if (dosmartprogress = true) then
  1416. SmartProggy;
  1417. progressreport;
  1418. case playermode of
  1419. 1: begin
  1420. case random (100) of
  1421. 0..80: begin
  1422. end;
  1423. 81..100:Antiban;
  1424. end;
  1425.  
  1426. case random (50) of
  1427. 0..42: waitafterCast;
  1428. 43..48: waithumanclick2;
  1429. end;
  1430. end;
  1431.  
  1432. 2: begin
  1433. end;
  1434. end;
  1435.  
  1436. result := true;
  1437. exit;
  1438. end
  1439. else
  1440. begin
  1441. inc(Failcast);
  1442. exit;
  1443. end;
  1444. end
  1445. else
  1446. begin
  1447. inc(failcast);
  1448. exit;
  1449. end;
  1450. break;
  1451. end;
  1452. break;
  1453. end;
  1454. end;
  1455. end;
  1456.  
  1457.  
  1458. Procedure LocateMonster2;
  1459. var
  1460. Cx,Cy,tmpcts:integer;
  1461. TPA:Tpointarray;
  1462. begin
  1463. if (not(Loggedin)) then exit;
  1464. if (not(meleer)) then exit;
  1465. if (findbanksymbol) then exit;
  1466.  
  1467.  
  1468. if findtherandoms and findtalk2 then
  1469. findnormalrandoms;
  1470.  
  1471.  
  1472.  
  1473. MouseSpeedz;
  1474. FindIfonMagetab;
  1475. case random (10) of
  1476.  
  1477. 0..7: Mouse(RandomRange(668, 669),RandomRange(263, 264), random(3),random(3),mouse_move);
  1478. 8..10: Mouse(RandomRange(663, 670),RandomRange(260, 265), random(1),random(1),mouse_move);
  1479. end;
  1480.  
  1481. if WaitUpTextMulti2(['Curse'],300) then
  1482. begin
  1483. clickmouse2(mouse_left);
  1484. waitshortclick;
  1485.  
  1486.  
  1487. tmpCTS := GetColorToleranceSpeed;
  1488.  
  1489. ColorToleranceSpeed(2);
  1490. SetColorSpeed2Modifiers(0.51, 1.43);
  1491.  
  1492. FindColorsTolerance(TPA, 3152966, MSX1, MSY1, MSX2, MSY2, 5);
  1493.  
  1494.  
  1495. ColorToleranceSpeed(tmpCTS);
  1496. setColorSpeed2Modifiers(0.2, 0.2);
  1497.  
  1498.  
  1499. if Length(TPA) < 0 then exit;
  1500.  
  1501. if (Length(TPA) > 0) and (Length(TPA) < 100) then
  1502. setangle(1);
  1503.  
  1504. mousespeedz;
  1505.  
  1506. FindObjExX(cx,cy,['Curse'],[3152966],5,2,0.51,1.43,50,MSX1, MSY1, MSX2, MSY2);
  1507.  
  1508. if WaitUpTextMulti2(['Curse'],300) then
  1509. begin
  1510. wait(randomrange(90,120));
  1511.  
  1512. clickmouse2(mouse_left);
  1513. if Didclick(true,1000) then
  1514. begin
  1515. IncEx(cast,29);
  1516. if (dosmartprogress = true) then
  1517. SmartProggy;
  1518. progressreport;
  1519. case playermode of
  1520. 1: begin
  1521. case random (100) of
  1522. 0..80: begin
  1523. end;
  1524. 81..100:Antiban;
  1525. end;
  1526.  
  1527. case random (50) of
  1528. 0..42: waitafterCast;
  1529. 43..48: waithumanclick2;
  1530. end;
  1531. end;
  1532.  
  1533. 2: begin
  1534. end;
  1535. end;
  1536.  
  1537. end
  1538. else
  1539. begin
  1540. inc(Failcast);
  1541. exit;
  1542. end;
  1543. end
  1544. else
  1545. begin
  1546. inc(failcast);
  1547. end;
  1548. end;
  1549. end;
  1550.  
  1551.  
  1552. procedure locatemonster;
  1553. begin
  1554.  
  1555. case Mattmode of
  1556. 1: LocateMonster1([3152966],5,2,0.51,1.43,['Curse']);
  1557. 2: Locatemonster2;
  1558. end;
  1559.  
  1560. end;
  1561.  
  1562.  
  1563.  
  1564. function safe:boolean;
  1565. var
  1566. x,y:integer;
  1567. begin
  1568. result := FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2);
  1569. end;
  1570.  
  1571.  
  1572. procedure CheckifInDanger;
  1573. var
  1574. x,y,t:integer;
  1575. begin
  1576. if (not(loggedin)) then exit;
  1577. if (not(OutsideCaveSaftey)) then exit;
  1578.  
  1579. if FindtheRandoms then
  1580. findnormalrandoms;
  1581. if (gethpbarabove) and (findbanksymbol) then
  1582. begin
  1583. if FindtheRandoms then
  1584. findnormalrandoms;
  1585. marktime (t);
  1586. repeat
  1587. wait(400);
  1588. if (not(loggedin)) then exit;
  1589.  
  1590. if FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2) then
  1591. clickmouse2(mouse_left);
  1592.  
  1593.  
  1594.  
  1595. if FindtheRandoms then
  1596. findnormalrandoms;
  1597. if (not(findbanksymbol)) then exit;
  1598. if (not(getHpbarabove)) then exit;
  1599. until(TimeFromMark(t) >= HpBarOutside);
  1600. if (TimeFromMark(T) >= HpBarOutside) then
  1601. begin
  1602. if (not(findbanksymbol)) then exit;
  1603. if (not(getHpbarabove)) then exit;
  1604. if findbanksymbol and GetHpbarAbove then
  1605. begin
  1606. if FindtheRandoms then
  1607. findnormalrandoms;
  1608. if (GetSkillInfo(3,false) < LowHpOutside) then
  1609. begin
  1610. if FindtheRandoms then
  1611. findnormalrandoms;
  1612. gametab(tab_magic);
  1613. waithumanclick;
  1614. mouse(665,286,0,0,mouse_left);
  1615. waithumanclick2;
  1616. repeat
  1617. if FindtheRandoms then
  1618. findnormalrandoms;
  1619. logout;
  1620. if (not(loggedin)) then break;
  1621. until (not(loggedin));
  1622. if not(loggedin) then
  1623. begin
  1624. writeln('we teleported due to combat outside cave, we failed to re-enter. So....and shit sucked, terminating');
  1625. terminatescript;
  1626. end;
  1627. end;
  1628. end;
  1629. end;
  1630. end;
  1631. end;
  1632.  
  1633.  
  1634.  
  1635. Function CavesTime:boolean;
  1636. begin
  1637. if (not(loggedin)) then exit;
  1638. result := FindTextTPA(ClBlack, 30, MCX1, MCY1, MCX2, MCY2, 'gain', CharsNPC07, Nothing);
  1639. end;
  1640.  
  1641. procedure HandleCaveTime;
  1642. begin
  1643. if CavesTime then
  1644. begin
  1645.  
  1646. writeln('we have to wait before we can re-enter, logging out and waiting two minutes');
  1647. repeat
  1648. wait(400);
  1649. Logout;
  1650. if gethpbarabove and OutsideCaveSaftey then
  1651. CheckifInDanger;
  1652.  
  1653. if (not(loggedin)) then break;
  1654.  
  1655.  
  1656. until (not(loggedin));
  1657. if (not(loggedin)) then
  1658. begin
  1659. writeln('zzz waiting');
  1660. wait(randomrange(125000,135000));
  1661. exit;
  1662. end;
  1663. end;
  1664. end;
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671. Procedure EnterCave;
  1672. var
  1673. x,y:integer;
  1674. begin
  1675. if (EntranceMode = 1) or (entrancemode = 3) then
  1676. begin
  1677. if FindObjectFar([CaveColor],Cavetol,CaveCTS,CaveHue,CaveSat,['nter'],100,50,MSX1, MSY1, MSX2, MSY2) then
  1678. begin
  1679. ClickMouse2(mouse_left);
  1680. ColorToleranceSpeed(0);
  1681. SetColorSpeed2Modifiers(0.2, 0.2);
  1682. if CavesTime then
  1683. HandleCaveTime;
  1684. waithumanclick3;
  1685. if CavesTime then
  1686. HandleCaveTime;
  1687. clicktocontinue;
  1688. end;
  1689. end
  1690. else
  1691. begin
  1692. if EntranceMode = 2 Then
  1693. begin
  1694. //if FindObjExX(x,y,['Enter'],[CaveColor],CaveTol,CaveCTS,CaveHue,CaveSat,70,MSX1, MSY1, MSX2, MSY2) then
  1695. if FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2) then
  1696. begin
  1697. ColorToleranceSpeed(0);
  1698. SetColorSpeed2Modifiers(0.2, 0.2);
  1699.  
  1700. Clickmouse2(mouse_left);
  1701. waithumanclick2;
  1702. if CavesTime then
  1703. HandleCaveTime;
  1704.  
  1705.  
  1706. if CavesTime then
  1707. HandleCaveTime;
  1708.  
  1709. waithumanclick3;
  1710. clicktocontinue;
  1711. end;
  1712. end;
  1713. end;
  1714. end;
  1715.  
  1716.  
  1717. Procedure EnterCaveLoop;
  1718. Begin
  1719. if (not(loggedin)) then exit;
  1720. ColorToleranceSpeed(0);
  1721. SetColorSpeed2Modifiers(0.2, 0.2);
  1722. If FindtheRandoms then
  1723. findnormalrandoms;
  1724. MakeCompass(randomrange (165, 189));
  1725. SetAngle(0);
  1726. waitMore;
  1727. repeat
  1728. waitMore;
  1729. EnterCave;
  1730. if CavesTime then
  1731. HandleCaveTime;
  1732. if OnskillScreen then
  1733. CloseSkillScreen;
  1734. waitMore;
  1735. if (getHpbarabove) then exit;
  1736.  
  1737. If FindtheRandoms then
  1738. findnormalrandoms;
  1739. waitMore;
  1740. if (Not(Findbanksymbol)) then break;
  1741. if (not(loggedin)) then exit;
  1742.  
  1743. until (not(findbanksymbol)) or (not(loggedin));
  1744. clicktocontinue;
  1745. AntiBan;
  1746. if OnskillScreen then
  1747. CloseSkillScreen;
  1748. If FindtheRandoms then
  1749. findnormalrandoms;
  1750. MakeCompass('n');
  1751. setangle(0);
  1752. Inc(CaveEntrances);
  1753. exit;
  1754. end;
  1755.  
  1756.  
  1757.  
  1758. Function WalkToEdgeSouth:boolean;
  1759. begin
  1760. ColorToleranceSpeed(2);
  1761. SetColorSpeed2Modifiers(0.00, 0.88);
  1762.  
  1763.  
  1764. result := RadialWalkTolerance(1776415,100,105,70,2,2,5);
  1765.  
  1766. ColorToleranceSpeed(0);
  1767. SetColorSpeed2Modifiers(0.2, 0.2);
  1768.  
  1769.  
  1770.  
  1771. end;
  1772.  
  1773. Function WalkToEdgeSouth2:boolean;
  1774. begin
  1775. ColorToleranceSpeed(2);
  1776. SetColorSpeed2Modifiers(0.00, 0.88);
  1777.  
  1778.  
  1779. result := RadialWalkTolerance(1776415,75,110,75,2,2,5);
  1780.  
  1781. ColorToleranceSpeed(0);
  1782. SetColorSpeed2Modifiers(0.2, 0.2);
  1783.  
  1784.  
  1785.  
  1786. end;
  1787.  
  1788.  
  1789. Function WalktoWall:boolean;
  1790. begin
  1791. ColorToleranceSpeed(2);
  1792. SetColorSpeed2Modifiers(16.12, 9.26);
  1793.  
  1794.  
  1795. result := RadialWalkTolerance(15856360,324,356,75,2,2,3);
  1796.  
  1797. ColorToleranceSpeed(0);
  1798. SetColorSpeed2Modifiers(0.2, 0.2);
  1799.  
  1800.  
  1801. end;
  1802.  
  1803. Function WalktoWall2:boolean;
  1804. begin
  1805. ColorToleranceSpeed(2);
  1806. SetColorSpeed2Modifiers(16.12, 9.26);
  1807.  
  1808.  
  1809. result := RadialWalkTolerance(15856360,290,300,50,2,2,3);
  1810.  
  1811. ColorToleranceSpeed(0);
  1812. SetColorSpeed2Modifiers(0.2, 0.2);
  1813.  
  1814.  
  1815. end;
  1816.  
  1817. function WalktoWall3:boolean;
  1818. begin
  1819. ColorToleranceSpeed(2);
  1820. SetColorSpeed2Modifiers(16.12, 9.26);
  1821.  
  1822.  
  1823. result := RadialWalkTolerance(15856360,225,270,50,2,2,3);
  1824.  
  1825. ColorToleranceSpeed(0);
  1826. SetColorSpeed2Modifiers(0.2, 0.2);
  1827.  
  1828.  
  1829. end;
  1830.  
  1831.  
  1832.  
  1833. function NPCNearBy:boolean;
  1834. var
  1835. TPA:Tpointarray;
  1836. begin // Basic function.
  1837. TPA := GetMiniMapDots('npc');
  1838. if (length(TPA) > 0) then
  1839. begin
  1840. SortTPAFrom(TPA, Point(MMCX, MMCY));
  1841. FilterPointsPie(TPA, 5, 360, MinNPCdistance, MaxNPCdistance, MMCX, MMCY);
  1842. if (length(tpa) > 0) then
  1843. begin
  1844. writeln('NPC in range, not going to perform running to midpath');
  1845. result := true;
  1846. end;
  1847. end;
  1848. end;
  1849.  
  1850.  
  1851.  
  1852. procedure RunToTheNPC;
  1853. var
  1854. TPA,TPA2,TPA3,TPA2B:TpointArray;
  1855. I,x,y,CTS:Integer;
  1856. P1,P2: tpoint;
  1857. ATPA: T2DPointArray;
  1858.  
  1859. begin
  1860. if (not(loggedin)) then exit;
  1861. if (findbanksymbol) then exit;
  1862.  
  1863. FindColorsTolerance(TPA,16777215 , MMX1, MMY1, MMX2, MMY2, 7)
  1864.  
  1865. cts := GetColorToleranceSpeed;
  1866. ColorToleranceSpeed(2);
  1867.  
  1868. SetColorSpeed2Modifiers(0.00, 0.12);
  1869. FindColorsTolerance(TPA2,126702 , MMX1, MMY1, MMX2, MMY2, 7)
  1870.  
  1871.  
  1872. ColorToleranceSpeed(CTS);
  1873. SetColorSpeed2Modifiers(0.02, 0.2);
  1874.  
  1875.  
  1876.  
  1877. if (Length(TPA) < 0) and (Length(TPA2) < 0)then
  1878. exit;
  1879.  
  1880. FilterPointsPie(TPA2, 0, 360, MinNPCRadius, MaxNPCRadius, MMCX, MMCY)
  1881. ceil((Length(TPA2) * 100) / ((Pi * (25 * 25)) * ((360 - 5) / 360.0)-((Pi * (5 * 5)) * ((360 - 5) / 360.0))));
  1882.  
  1883. TPA2B := TPA2
  1884. if (Length(TPA2B) > 0) then
  1885. begin
  1886.  
  1887. P1 := MiddleTPA(TPA);
  1888. P2 := MiddleTPA(TPA2B);
  1889.  
  1890.  
  1891. TPA3 := TPABetweenPoints(P2,P1,1,0);
  1892.  
  1893. ATPA := FindGapsTPA(TPA3,20);
  1894. MiddleTPAEx(ATPA[i], X, Y);
  1895. SortATPAFromSize(ATPA,1,true);
  1896. if (length(ATPA[i]) > 0) then
  1897. begin
  1898. writeln('NPC far from our distance, going to run midpath');
  1899. mouse (x,y,2,2,mouse_left);
  1900. flag;
  1901. end;
  1902. end;
  1903. end;
  1904.  
  1905.  
  1906.  
  1907. procedure WalktoSafeSpot;
  1908. begin
  1909. if (not(loggedin)) then exit;
  1910. MakeCompass('n');
  1911. SetAngle(0);
  1912. SetRun(true);
  1913.  
  1914. if AtSafeSpot then exit;
  1915.  
  1916.  
  1917.  
  1918. if not WalkToEdgeSouth then
  1919. writeln('failed');
  1920.  
  1921. fflag(0);
  1922.  
  1923. if not WalkToEdgeSouth2 then
  1924. writeln('failed2');
  1925. fflag(0);
  1926.  
  1927. wait(randomrange(3000,5000));
  1928.  
  1929.  
  1930. if not WalktoWall then
  1931. writeln('yes');
  1932. fflag(0);
  1933.  
  1934. if not WalktoWall2 then
  1935. writeln('yes2');
  1936. fflag(0);
  1937.  
  1938. if not WalktoWall3 then
  1939. writeln('we are in safe spot or failed');
  1940. fflag(0);
  1941.  
  1942.  
  1943. makecompass(randomrange(140,160));
  1944. SetAngle(1);
  1945. wait(randomrange(5000,7000));
  1946. if AtSafeSpot then exit;
  1947. end;
  1948.  
  1949.  
  1950.  
  1951. procedure FixMessup;
  1952. begin
  1953. if findtherandoms and findtalk2 then
  1954. findnormalrandoms;
  1955. if (not(loggedin)) then exit;
  1956. if (not(getHpbarabove)) then exit;
  1957. if (Gethpbarabove) and (atsafespot) then
  1958. begin
  1959. if findtherandoms and findtalk2 then
  1960. findnormalrandoms;
  1961. if (not(getHpbarabove)) then exit;
  1962. repeat
  1963. wait(400);
  1964. if findtherandoms and findtalk2 then
  1965. findnormalrandoms;
  1966. if findtherandoms and findtalk2 then
  1967. findnormalrandoms;
  1968. logout;
  1969. if findtherandoms and findtalk2 then
  1970. findnormalrandoms;
  1971. waithumanclick;
  1972. logout;
  1973. if (not(loggedin)) then break;
  1974. until (not(loggedin));
  1975. if (not(loggedin)) then
  1976. begin
  1977. writeln('messed up logging out and in to fix, if you get this and your not in combat please check your gear and match it with the HP bar colors, if your gear has the Colors of the HP bar then change your outfit!');
  1978. writeln('logged out due to mess up');
  1979. inc(Messedup);
  1980. exit;
  1981. end;
  1982. end;
  1983. end;
  1984.  
  1985.  
  1986.  
  1987. procedure fixposition;
  1988. var
  1989. t:integer;
  1990. begin
  1991. marktime(t);
  1992. repeat
  1993. wait(400);
  1994. if (onskillscreen) then exit;
  1995. if (onrangescreen) then exit;
  1996. if (findbanksymbol) then exit;
  1997. if (not(loggedin)) then exit;
  1998. makecompass(randomrange(130,160));
  1999. setangle(1);
  2000. if (meleer) then exit;
  2001. if (not(loggedin)) then exit;
  2002. if (findbanksymbol) then exit;
  2003. wait(400);
  2004. if (onskillscreen) then exit;
  2005. if (onrangescreen) then exit;
  2006. if (outofrunes) then exit;
  2007. if (gethpbarabove) then exit;
  2008. makecompass(randomrange(40,60));
  2009. until(TimeFromMark(t) > MaxNpcTime);
  2010. if (timefromMark(t) >= MaxNpcTime) then
  2011. begin
  2012. if (onskillscreen) then exit;
  2013. if (onrangescreen) then exit;
  2014. if (not(meleer)) and Loggedin then
  2015. begin
  2016. writeln('failed to find melee, going to log out and log in');
  2017. repeat
  2018. if (not(loggedin)) then exit;
  2019. wait(400);
  2020. logout;
  2021. if (not(loggedin)) then exit;
  2022. if (not(loggedin)) then exit;
  2023. until (not(loggedin));
  2024. end;
  2025. end;
  2026. end;
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041. procedure CurseLoop;
  2042. begin
  2043. if (not(loggedin)) then exit;
  2044. wait(randomrange(WaitMemory1,WaitMemory2));
  2045. if (not(loggedin)) then exit;
  2046. repeat
  2047. wait(randomrange(WaitMemory1,WaitMemory2));
  2048.  
  2049. if (findbanksymbol) then exit;
  2050. if (not(loggedin)) then exit;
  2051.  
  2052. if findtherandoms and findtalk2 then
  2053. findnormalrandoms;
  2054.  
  2055. waitmore;
  2056.  
  2057. if (Breakhandler = true) then
  2058. takebreaks;
  2059.  
  2060.  
  2061. waitmore;
  2062.  
  2063.  
  2064. LocateMonster;
  2065.  
  2066. if (AtSafeSpot and (not(getHpBarAbove)) and (not(Meleer))) and Loggedin then
  2067. FixPosition;
  2068.  
  2069. if GetHpBarAbove then
  2070. begin
  2071. if (AtSafeSpot) And (GetHpBarAbove) and (Loggedin) then
  2072. FixMessup;
  2073. end;
  2074.  
  2075.  
  2076. waitmore;
  2077.  
  2078. if (onrangescreen) then
  2079. closerangescreen;
  2080.  
  2081. waitmore;
  2082.  
  2083. if MakeChatTabAll and (NotchatTabAll) then
  2084. MakeMyChatTabAll;
  2085.  
  2086. waitmore;
  2087.  
  2088. if AlreadyWeakend then
  2089. NPCisWeakend;
  2090.  
  2091. waitmore;
  2092.  
  2093. if OutofRunes then
  2094. Termination;
  2095.  
  2096. waitmore;
  2097.  
  2098. if OnskillScreen then
  2099. CloseSkillScreen;
  2100.  
  2101.  
  2102.  
  2103. waitmore;
  2104.  
  2105. until (Findbanksymbol) or (not(loggedin));
  2106.  
  2107. end;
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117. procedure SetPlayerUploop;
  2118. begin
  2119. wait(400);
  2120. if (not (loggedin)) then exit;
  2121.  
  2122. writeln('we are here x21');
  2123. if meleer and (not(AtSafeSpot)) and Loggedin then
  2124. WalktoSafeSpot;
  2125.  
  2126. waitmore;
  2127. if ClicktoContinue then
  2128. clicktocontinue;
  2129.  
  2130. waitmore;
  2131.  
  2132. if OnskillScreen then
  2133. CloseSkillScreen;
  2134.  
  2135. if Onlobbyscreen then
  2136. clicktoenterlobby;
  2137.  
  2138. waitmore;
  2139. end;
  2140.  
  2141.  
  2142.  
  2143.  
  2144. procedure InCaveloop;
  2145. begin
  2146. repeat
  2147. wait(randomrange(Waitmemory1,Waitmemory2));
  2148. if (not(loggedin)) then exit;
  2149.  
  2150. writeln('we are here');
  2151.  
  2152. if AtSafeSpot and Loggedin then
  2153. CurseLoop;
  2154.  
  2155. wait(randomrange(Waitmemory1,Waitmemory2));
  2156.  
  2157. if (Not(AtSafeSpot)) and Loggedin then
  2158. SetPlayerUploop;
  2159.  
  2160. until (not(loggedin)) or (FindBanksymbol);
  2161. end;
  2162.  
  2163. procedure OutsideCaveloop;
  2164. begin
  2165. if (not(FindBanksymbol)) then exit;
  2166. waitmore;
  2167. if (not(loggedin)) then exit;
  2168.  
  2169. if (FindBanksymbol) then
  2170. EnterCaveLoop;
  2171.  
  2172. waitmore;
  2173. if OnskillScreen then
  2174. CloseSkillScreen;
  2175.  
  2176. waitmore;
  2177. If FindtheRandoms then
  2178. findnormalrandoms;
  2179.  
  2180. waitmore;
  2181. if (not(GetHpbarabove)) then
  2182. Entercaveloop;
  2183.  
  2184. waitmore;
  2185. if (GetHpBarAbove) and OutsideCaveSaftey then
  2186. CheckifInDanger;
  2187.  
  2188. waitmore;
  2189. if CavesTime then
  2190. HandleCaveTime;
  2191. end;
  2192.  
  2193.  
  2194. Procedure PlayerLoop;
  2195. begin
  2196. if (not(loggedin)) then exit;
  2197. repeat
  2198. if (not(loggedin)) then exit;
  2199. While (FindBanksymbol) and Loggedin do
  2200. OutsideCaveloop;
  2201. if (not(loggedin)) then exit;
  2202. while (Not(FindBanksymboL)) and Loggedin do
  2203. InCaveloop;
  2204. until (not(loggedin));
  2205. end;
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218. procedure CheckplayerSetup;
  2219. begin
  2220. if (EntranceMode >3) or (EntranceMode <1) then
  2221. begin
  2222. writeln('you have chosen a wrong entrance mode, please, choose one between 1,2 or 3');
  2223. terminatescript;
  2224. end;
  2225. if (AutoBankMM = true) and (ManualBankMM = true) then
  2226. begin
  2227. writeln('you have enabled both Manual and Automatic BankMM (Minimap) Color detection, please only choose one');
  2228. terminatescript;
  2229. end;
  2230. if (AutoBankMM = false) and (ManualBankmm = false) then
  2231. begin
  2232. writeln('you have disabled both manual and automatic bankmm (Minimap) Color detection, please enable one (script cant run without them');
  2233. terminatescript;
  2234. end;
  2235. end;
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244. procedure startitup;
  2245. begin
  2246. Playersetup;
  2247. SetupSRL;
  2248. if (UseReflection = true) then
  2249. SetupReflection;
  2250.  
  2251. ActivateClient;
  2252. SRL_CombatRandoms := False;
  2253. CheckplayerSetup;
  2254. StartTime;
  2255. end;
  2256.  
  2257.  
  2258. procedure loginloop;
  2259. begin
  2260. wait(400);
  2261.  
  2262. loginplayer;
  2263.  
  2264. if Onlobbyscreen then
  2265. clicktoenterlobby;
  2266.  
  2267. MakeCompass('n');
  2268. SetAngle(0);
  2269. end;
  2270.  
  2271.  
  2272. // 11296, 8544
  2273. // right side, 11320, 8539
  2274. // 11309 (x), 8551 is static here) safe spot
  2275.  
  2276.  
  2277.  
  2278.  
  2279. begin
  2280. startitup;
  2281. repeat
  2282. wait(400);
  2283. if (loggedin) then
  2284. begin
  2285. PlayerLoop;
  2286. end
  2287. else
  2288. begin
  2289. if (not(loggedin)) then
  2290. StartTime;
  2291. loginloop;
  2292. end;
  2293. until (false);
  2294. end.
Advertisement
Add Comment
Please, Sign In to add comment