Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {*+++++++++++++*}
- {+ Insructions +}
- {+ To Hide The Instructions Press the Minus '-' on the first line +}
- {+ Be sure to do your setup correctly! +}
- {*+++++++++++++*}
- {*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
- ================================================================================
- A|(InGame-Setup)
- A1) Brightness to highest | Auto retaliate on.
- A2) You can start either Logged-in or Logged-Out outside the cave.
- A3) Inside the cave you can only start either logged out - or at safe spot.
- A3.B) If you are using reflection then you must always start logged out!!!.
- A4) Equip the following: Ring of life, Magic staff or Mud battle staff.
- A5) Have body runes and teleport runes or teleport Tab in your inventory.
- A6) Have -65 Mage bonus for your magic attack; Full Metal Armor + Dragon Vambs.
- ______________________________________________________________________________
- B|(Script-Setup)
- B1) you need the SRL-OSR include and Smart8.
- B2) If smart is already opened, pair it up before you launch the script.
- B3) Redefine your player settings to your choice.
- B4) If you launched and got an error, paste it at: http://ilya.xxx/ssf/
- ________________________________________________________________________________
- ================================================================================
- {Start of the script}
- program FCurser;
- {$DEFINE SMART8}
- {$I SRL-OSR/SRL.Simba}
- {$I SRL-OSR/SRL/Reflection/Reflection.simba}
- {$i SRL-OSR\SRL\misc\debug.simba}
- {$i SRL-OSR\SRL\misc\SmartGraphics.simba}
- var
- caveEntranceWhite: TIntegerArray;
- Messedup, Failcast, Timer, cast, CaveEntrances: integer;
- TimeTillBreak: string;
- MyPosition: tpoint;
- const
- {
- ________________________________________________________________________________
- ================================================================================
- ________________________________________________________________________________
- Section.1 : Player-Setup
- Section.2 : Advanced-Script-Setup
- ________________________________________________________________________________
- {++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
- |1. Prayer Setup |
- |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
- UseReflection = false; // Do you want the script to use Reflection?
- TermCheck = true; // If errors compile, it allows for termination.
- debuginfo = false; //adds debug testing to script, text in debugger.
- Username = 'zezima';// Your Username.
- Password = 'iscool';// Your Password. (Four letters, do not use first letters)
- Nickname = 'ezim'; // Your Nickname. (Important to set up proper nickname)
- // Script will detect talking randoms inside cave.
- //Review end of post:villavu.com/forum/showthread.php?t=5410
- MainMouseSpeed = 11; // Script changes mouse speed, search MouseSpeedz
- // 10-15 should be good enough.
- AttempSolvingRandoms = true; //If somehow you spawned outside the cave would you
- //Want the script to handle randoms if you get any?
- //Or just ignore them and re-enter cave?.
- //This also includes Detecting Jmods/PMods.
- Playermode = 1; // Three player modes: (1) is same as (2) in all features,
- // but it has random wait times after it does the click.
- // two is pretty much bot like, no major wait times after
- // clicking, no antiban either. Use (1) only please.
- Breakhandler = true; // Would you like for the script to take breaks?
- BreakTime1 = 45; // Minimum Gameplay time before breaks.
- BreakTime2 = 120; // Maximum Gameplay Time before breaks.
- // Time is in Minutes, not MS.
- BreakWait1 = 15; // For how long to take each break?
- BreakWait2 = 30; // Example 15, 30 will take a break for 15-30 minutes.
- TheMagicWord = 'ody'; // This is the WORD that confirms that you've ran out of
- // Runes, for example 'ody' refers to the word (Body)
- // Once said word appears in your chat box, the script
- // Will log out and terminate, this really depends on
- // What staff/runes you're using, don't use first letters.
- DoSmartProgress = false; // This will Draw a Debugged GUI on the Smart-Screen.
- // Displaying Time Running and Spells Cast, more CPU!.
- // recommended to leave off, MORE CPU = more Missclicks
- SkillFailsafe = True; // This will Close the Skill Screen and range enchant
- // Screens if they get opened.
- CheckChatTabAll = True; // This will make sure your Chat Tab is always on (ALL)
- // In order to register that you ran out of runes
- // The script needs to read the sentence in the chabox.
- // Disable this if you use the script while talking to
- // your friends in Clanchat or PM.
- {++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
- |2. Advanced Setup |
- |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
- {++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
- |2. Advanced Setup |
- |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
- EntranceMode = 2; // This is the entrance mode for cave, choices: 1,2 and 3.
- // Recommended you use (2), mode (1)/(3) can lead to out of
- // range error, (1) won't hover players, (3) does, use (2).
- MAttMode = 1; // This determines which attack mode you want to use for
- // Monsters, default is (1) but if it gives you out of range
- // Errors then use (2).
- RunToNPC = true; // if enabled (helpful) it will run to the NPC, now pay
- // attention carefully, it wont click on the NPC dot its self
- // but it will run Midpath, so you have to determin how close
- // or far you want your character to run, continue reading..
- // i find this useful because if it fails to allign correctly
- // it will still attempt to at least run to the npc.
- MinNPCdistance = 0; // This triggers the running, if the script cant find the
- MaxNPCdistance = 20;// NPC in this distance - default 0-15 which means 2 squares
- // in pixel distance on RS mainsscreen (2 character moves)
- // So.. If it can't find the Dot in the designated distance
- // it will run, using the distance you set up for NpcRadius.
- MinNPCRadius = 10; // This will determin what distance range can an NPC dot
- MaxNPCRadius = 70; // be on the minimap screen for it to be valid as a dot.
- // 10-70 scans the hole minimap for NPC dots, now this wont
- // trigger the run. I repeat, this won't click on the dot
- // its self, it clicks midway, to the path.
- MaxNpcTime = 8000; // Maximum amount of time the script will look for the 45.
- // while you're at the safe spot and not in combat, if this
- // passes and it still cant find him, the script will log
- // out and then log back in (restarting safe spot process).
- AutoBankMM = false; // Detects Bank Symbol on the Mini-map using CTS2/Hue/Sat
- // This has been revised and no longer causes memory
- // leaks or CPU hogs (shouldn't if it does...)
- // if this fails then try other options, remember set your
- // brightness to HIGHEST!, also you can take the colors
- // i added then put them in AutoColorAid and add on the
- // new bankIcon colors to the existing color, i obtained
- // my color by starting/restarting RS about 34 times.
- Autobankmm2 = true; // Highly recommend using this if your PC can handle it
- // it searches using (Findsymbols) function = Bitmaps
- ManualBankMM = false; // If AutoBankMM/2 fails to find Bank/Icons then enable
- // This action and set up your own bank MM colors.
- // This also looks for a bitmap i made.
- { Guide to setting up manual bank MM:
- http://villavu.com/forum/showthread.php?t=101113&page=4&p=1228404#post1228404 }
- BankMMColor1 = 4046813;
- BankMMColor2 = 3378855; // If manualBankMM is true, then edit it here.
- BankMMColor3 = 86633;
- BankMMTolerance = 5;
- BankMMCTS = 1; //
- BankMMHue = 0.2; // Only change these using AutoColorAid!
- BankMMSat = 0.2; //
- WaitMemory1 = 150; // This is how fast/slow the script will go through
- WaitMemory2 = 155; // The main loop, this is great for Memory/CPU hogs.
- // you can set this maximum to 400-405, anything higher
- // Pretty much defeats the purpose of botting.
- UseLessMemory = false; // Well this adds even more wait time, instead of just
- WaitMemory3 = 40; // Adding it at the start of all loops, this is inbetween
- WaitMemory4 = 55; // Most procedures, so we're talking about X15~ commands.
- // Anything really higher than 50 will make it slow.
- // However, this can work magics for memory/cpu leaks.
- OutFailSafe = true; // Enable this if you want Outside Cave Failsafes.
- // You will need lumbridge teleport runes, this failsafe
- // will teleport you to lumbridge if you Cant enter
- // Caves for the duration of HpBarOutside and in combat.
- HpBarOutside = 20000; // For how long the script will try to enter the cave,
- // Once this passes the script will teleport you and end.
- // Do note, this counter only starts if you - or some one
- // right next to you is in combat outside the cave.
- //Granted i could use the ORB functionality in here, but honestly.. Am only doing this for SRL membership app.
- // Revising it even though there is a 100% chance i will NEVR use this script on a consistent basis (i have my own spot to train mage, if you actually read comments.. Pm me for script! its awesome!.
- LowHpOutside = 50; // So at what HP should register that its time to tele?
- // Change this if you have Low Hp levels, script will
- // take it as if you got in combat, got stuck outside,
- // reached low hp and then it decided to teleport to save
- // your runes.
- CaveCTS = 2; // These settings detect the cave entrance from every
- CaveColor = 9737631; // Every angle.
- Cavetol = 27; // Change them ONLY IF YOUR USING AUTO COLOR AID!
- CaveHue = 0.07; // IF YOU KNOW WHAT AUTO COLOR AID, then i need not
- CaveSat = 0.09; // explain any further!
- BankIconColor = 2138555;
- BankIconTol = 25; // These colors took around 60 world hops & 50 simba restarts to gather..
- BankIconHue = 0.11; // Surely wasn't easy but they are not stable, when the game colors are too bright - npc's will be read as bank icons as well..
- BankIconSat = 1.15;
- version = '1.4';
- Curse = 29;
- procedure playerSetup;
- begin
- HowManyPlayers := 1; // How many players are you using?
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0;
- With Players[0] Do // What are the preferences for each player?
- Begin
- Name := Username;
- Pass := Password;
- Nick := Nickname;
- LampSkill := Skill_Herblore;
- Active := True;
- End;
- caveEntranceWhite := [7763583, 8553356]; // Sean's cave color, works well! nice back up to have if all other colors break!
- end;
- {Credits to SRL OSR Dev Team, i just added the Green Color to locate magic}
- function GetGreenUptext: string;
- var
- WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
- begin
- WhiteT := GetTextAtExWrap(8, 8, 80, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
- BlueT := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
- YellowT := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
- OrangeT := GetTextAtExWrap(35, 8, 150, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
- GreenT := GetTextAtExWrap(8, 8, 150, 21, 0, 5, 1, 120577, 65, 'UpChars07');
- FoundText := WhiteT + ' ' + BlueT + YellowT + OrangeT + GreenT;
- FoundText := ReplaceWrap(FoundText, '.', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '/', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '\', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, ',', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '*', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '^', '', [rfReplaceAll]);
- FoundText := ReplaceWrap(FoundText, '"', '', [rfReplaceAll]);
- Result := FoundText;
- end;
- {had to add this, so the command wouldn't break, only added green color}
- function IsUpTextMultiCustom2(Text: TStringArray): Boolean;
- var
- TheText: string;
- i, n: Integer;
- begin
- TheText := GetGreenUptext;
- n := High(Text);
- for i := 0 to n do
- if (Pos(Text[i], TheText) > 0) then
- begin
- Result := True;
- Exit;
- end;
- end;
- {Same as above}
- function WaitUpTextMulti2(S: TStringArray; Time: Integer): Boolean;
- var
- T: Integer;
- begin
- Result := false;
- T := GetSystemTime + Time;
- while (GetSystemTime < T) do
- begin
- if (IsUpTextMultiCustom2(S)) then
- begin
- Result := True;
- Exit;
- end;
- Wait(20 + Random(20));
- end;
- end;
- {This is modified so it won't click the Inventory tab to find the random events, it will just locate the text then start the normal findnormal randoms, we can't have it constantly click tabs between mage/inv.
- Credits to SRL - OSRS include dev team!}
- function FindTalk2: Boolean;
- var
- ax, ay, yCount, zCount, Count2, x1, y1, x2, y2, Count1, bmpScreen: Integer;
- begin
- Result := False;
- if (GetArrayLength(Players) < 1) then
- Exit;
- if FindColor(ax, ay, 65535, MSX1, MSY1, MSX2, MSY2) then
- begin
- SetArrayLength(gtalksBox, 0);
- SetArrayLength(YelSkipBoxs, 0);
- y1 := ay;
- if ((ay + 5) > 334) then
- y2 := 334
- else
- y2 := ay + 5;
- x1 := ax;
- x2 := x1;
- zCount := 0;
- repeat
- if FindColor(ax, ay, 65535, x2, y1 + 2, x2 + 3, y2 + 3) then
- zCount := 0
- else
- zCount := zCount + 1;
- if (zCount = 4) then
- Break;
- x2 := x2 + 3;
- until (x2 + 3 > 515);
- if (x2 + 3 <= 515) then
- x2 := x2 - 12;
- if (x2 - x1 >= length(Players[CurrentPlayer].Nick) * 4) then
- begin
- x1 := x1 - 8;
- y1 := y1 - 8;
- x2 := x2 + 8;
- y2 := y2 + 8;
- if (x1 < 0) then
- x1 := 0;
- if (y1 < 0) then
- y1 := 0;
- if (x2 > 515) then
- x2 := 515;
- if (y2 > 334) then
- y2 := 334;
- Count2 := Count2 + 1;
- Count1 := Count1 + 1;
- SetArrayLength(gtalksBox, Count2);
- gtalksBox[Count2 - 1].x1 := x1;
- gtalksBox[Count2 - 1].y1 := y1;
- gtalksBox[Count2 - 1].x2 := x2;
- gtalksBox[Count2 - 1].y2 := y2 + 6;
- SetArrayLength(YelSkipBoxs, Count1);
- YelSkipBoxs[Count1 - 1].x1 := x1;
- YelSkipBoxs[Count1 - 1].y1 := y1;
- YelSkipBoxs[Count1 - 1].x2 := x2;
- YelSkipBoxs[Count1 - 1].y2 := y2;
- end
- else
- begin
- y1 := y1 - 2;
- y2 := y2 + 8;
- x1 := x1 - 5;
- x2 := x2 + 5;
- if (x1 < 0) then
- x1 := 0;
- if (y1 < 0) then
- y1 := 0;
- if (x2 > 515) then
- x2 := 515;
- if (y2 > 334) then
- y2 := 334;
- Count1 := Count1 + 1;
- SetArrayLength(YelSkipBoxs, Count1);
- YelSkipBoxs[Count1 - 1].x1 := x1;
- YelSkipBoxs[Count1 - 1].y1 := y1;
- YelSkipBoxs[Count1 - 1].x2 := x2;
- YelSkipBoxs[Count1 - 1].y2 := y2;
- end;
- if (GetArrayLength(gtalksBox) <> 0) then
- begin
- for yCount := 0 to GetArrayLength(gtalksBox) - 1 do
- begin
- if FindBitmapMaskTolerance(NickNameBMP, ax, ay, gtalksBox[yCount].x1, gtalksBox[yCount].y1, gtalksBox[yCount].x2, gtalksBox[yCount].y2, 0, 40) then
- begin
- WriteLn('Found NickName');
- ax := (gtalksBox[yCount].x2 + gtalksBox[yCount].x1) shr 1;
- ay := gtalksBox[yCount].y2 - 2;
- if gTalkSaveBitmap then
- begin
- bmpScreen := BitmapFromString(515, 334, '');
- CopyClientToBitmap(bmpScreen, 1, 1, 515, 334);
- if (gtalksBox[yCount].x1 = 0) then
- x1 := 1
- else
- x1 := gtalksBox[yCount].x1;
- if (gtalksBox[yCount].y1 = 0) then
- y1 := 1
- else
- y1 := gtalksBox[yCount].y1;
- gTalksCount := gTalksCount + 1;
- for Count1 := - 1 to 1 do
- for Count2 := - 1 to 1 do
- FastSetPixel(bmpScreen, Count1 + x1, Count2 + y1, 255);
- if (gtalksBox[yCount].x2 = 515) then
- x1 := 515
- else
- x1 := gtalksBox[yCount].x2;
- if (gtalksBox[yCount].y2 = 334) then
- y1 := 334
- else
- y1 := gtalksBox[yCount].y2;
- for Count1 := - 1 to 1 do
- for Count2 := - 1 to 1 do
- FastSetPixel(bmpScreen, Count1 + x1, Count2 + y1, 255);
- for Count1 := - 1 to 1 do
- for Count2 := - 1 to 1 do
- FastSetPixel(bmpScreen, Count1 + ax, Count2 + ay, 255);
- SaveBitmap(bmpScreen, ScriptPath + 'FTalk' + IntToStr(gTalksCount) + '.bmp');
- FreeBitmap(bmpScreen);
- end;
- Result := True;
- Exit;
- end;
- end;
- end;
- end;
- end;
- {If a user has a slower pc then its nice to have the script slow down while it cycles through the commands}
- procedure Waitmore;
- begin
- if (UseLessMemory = true) then
- begin
- wait(randomrange(waitMemory3, WaitMemory4));
- end;
- end;
- procedure StartTime;
- begin // generates a random time for breaking, after a break is done this command is run again to generate next break time.
- Timer := GetTimeRunning + RandomRange(BreakTime1 * 60000, BreakTime2 * 60000);
- end;
- {Termination makes sure we end our script at any cost, it still tries to end it safely first and if that fails, it ends it regardless}
- procedure Termination(const Status: string);
- begin
- if (TermCheck = false) then // Users can Enable/disable termination checks
- exit;
- writeln(Status); // Prints our reason for termination
- if loggedin then // if we're logged in, it will log us out.
- begin
- if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then // waits for the script to log out.
- terminatescript
- else
- terminatescript; // if it doesn't manage to log out, it ends anyway
- end else
- terminatescript; // and if we're not loggedin it ends.
- end;
- function LogMeOut: boolean;
- begin
- writeln('Logging out..');
- if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
- begin //Logging out is buggy right now on OSRS, it needs some extra time
- writeln('We have managed to log out');
- result := true;
- end else //ends script if we fail to logout
- termination('We have failed to log out, ending script');
- end;
- procedure TakeBreaks;
- var
- T, BreakTimer: integer;
- begin
- if (BreakHandler = false) then
- Exit;
- if (GetTimeRunning >= Timer) then // Checks if its time to break
- begin
- BreakTimer := Randomrange(BreakWait1 * 60000, BreakWait2 * 60000); // Calculates a time to break for
- MarkTime(T);
- writeln('It is time to take a break');
- WriteLn('Breaking for: ' + (MsToTime(BreakTimer, Time_Formal)));
- if LogMeOut then
- begin
- while (TimeFromMark(T) < BreakTimer) do // Credits & Props to P1ng for proper formating advise!
- Wait(RandomRange(1500, 2500)); // wait time is important so Simba can cycle throug the memory slowly without causing CPU leaks
- WriteLn('Completed break, re-starting script');
- StartTime; // Calculates next break's timer.
- end else // if it fails to log out then script ends.
- termination('We have failed to log out for our break, ending script');
- end;
- end;
- {All of this is an example to demonstrate that there are other ways to do color location functionalities}
- Type TCColor = record // initially i thought of just making an object record..
- Name : String; // So i'll just do one as an example.
- Tol,Color : integer;
- Hmod, Smod : extended;
- end;
- Var
- TColors1: TCColor;
- Procedure SetupExampleRecord();
- begin
- with TColors1 do
- begin
- Name := 'RangeSkill';
- Color:= 5334901;
- Tol := 12;
- HMod := 0.05;
- SMod := 0.41;
- end;
- end;
- {Using Records/Colors}
- Function ColorLocateTest(Color,Tol: integer; Hmod,Smod:extended): boolean;
- var
- tmpcts: Integer;
- TPA: Tpointarray;
- begin
- tmpcts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(Hmod, Smod);
- result := FindColorsTolerance(TPA, Color, Msx1, Msy1, MSx2, Msy2, Tol);
- ColorToleranceSpeed(tmpcts);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- {Or we can do Case String Method, which i found much easier than making record per object}
- Function ColorLocate(what: string): boolean;
- var
- CTS: Integer;
- I, TPA: Tpointarray;
- begin
- cts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- case What of
- 'RangeScreen':
- begin
- SetColorSpeed2Modifiers(0.05, 0.41);
- FindColorsTolerance(TPA, 5334901, 482, 36, 492, 45, 12);
- end;
- 'SkillSCreen':
- begin
- SetColorSpeed2Modifiers(0.02, 1.48);
- FindColorsTolerance(TPA, 8042720, 480, 5, 513, 35, 4);
- end;
- 'NotChatTabAll':
- begin
- SetColorSpeed2Modifiers(0.10, 0.34);
- FindColorsTolerance(TPA, 4213586, 6, 482, 60, 497, 11);
- end;
- 'OnMageTab':
- begin
- SetColorSpeed2Modifiers(0.06, 0.24);
- FindColorsTolerance(TPA, 1382991, 730, 170, 754, 195, 11)
- end;
- 'Meleer':
- begin
- SetColorSpeed2Modifiers(0.51, 1.43);
- FindColorsTolerance(TPA, 3152966, MSX1, MSY1, MSX2, MSY2, 5)
- end;
- 'AtSafeSpot':
- begin
- SetColorSpeed2Modifiers(16.12, 9.26);
- FindColorsTolerance(TPA, 15856360, MMX1, MMY1, MMX2, MMY2, 3);
- if (Length(TPA) > 0) then
- begin
- FilterPointsPie(TPA, 0, 360, 10, 30, MMCX, MMCY);
- I := TPA;
- if Length(I) > 0 then
- result := true;
- end;
- end;
- 'FindBankSymbol1':
- begin
- SetColorSpeed2Modifiers(BankIconHue, BankIconSat);
- FindColorsTolerance(TPA, BankIconColor, MMX1, MMY1, MMX2, MMY2, BankIconTol);
- end;
- end;
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(0.02, 0.2);
- if (length(tpa) > 0) and (not (What = 'AtSafeSpot')) then
- begin
- result := true;
- end
- else
- begin
- if (What = 'AtSafeSpot') then
- begin
- if Length(I) > 0 then
- result := true;
- end;
- end;
- end;
- {same as above, except it does radial walking}
- function DoAction(what: string): boolean;
- var
- CTS: Integer;
- begin
- cts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- case What of
- 'WalkToEdgeSouth':
- begin
- SetColorSpeed2Modifiers(0.00, 0.88);
- result := RadialWalkTolerance(1776415, 100, 105, 70, 2, 2, 5);
- end;
- 'WalkToEdgeSouth2':
- begin
- SetColorSpeed2Modifiers(0.00, 0.88);
- result := RadialWalkTolerance(1776415, 75, 110, 75, 2, 2, 5);
- end;
- 'WalktoWall':
- begin
- SetColorSpeed2Modifiers(16.12, 9.26);
- result := RadialWalkTolerance(15856360, 324, 356, 75, 2, 2, 3);
- end;
- 'WalktoWall2':
- begin
- SetColorSpeed2Modifiers(16.12, 9.26);
- result := RadialWalkTolerance(15856360, 290, 300, 50, 2, 2, 3);
- end;
- 'WalktoWall3':
- begin
- SetColorSpeed2Modifiers(16.12, 9.26);
- result := RadialWalkTolerance(15856360, 225, 270, 50, 2, 2, 3);
- end;
- end;
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(0.02, 0.2);
- end;
- {example for all the above
- Begin
- setupsrl;
- SetupReflection;
- SetupExampleRecord;
- if ColorLocateTest(Tcolors1.Color,TColors1.Tol,TColors1.Hmod,TColors1.smod) then
- writeln('Hello SRL!');
- if ColorLocate('SkillSCreen') then
- writeln('yes');
- if ColorLocateTest(Tcolors1.Color,TColors1.Tol,TColors1.Hmod,TColors1.smod) then
- writeln('Hello SRL!');
- end.}
- procedure closerangescreen;
- begin
- if (not (loggedin)) then
- exit; // Closes Range enchant Menu if it gets open.
- if (SkillFailsafe = true) then
- begin
- writeln('we are on skill screen, closing');
- mousebox(482, 36, 492, 45, 1);
- end;
- end;
- procedure CloseSkillScreen;
- begin
- if (not (loggedin)) then // closes skill screen if it gets opened.
- exit;
- if (SkillFailsafe = true) then
- begin
- writeln('we are on skill screen, closing');
- mousebox(494, 17, 500, 22, 1);
- end;
- end;
- function GetHpBarAbove: boolean;
- var
- Hpbar: tpointarray; //Detecs Out HP bar in a small area
- begin // This is before MiniMap orbs/reflection were added to the game, obviously i've made much better functionalities for combat detection
- result := (FindColorsTolerance(HpBar, 65280, 185, 50, 400, 250, 3)) and (FindColorsTolerance(HpBar, 255, 185, 50, 400, 250, 3))
- end; // With that said, this is simple and it works quite well.
- procedure MouseSpeedz;
- begin // Alternates our mouse speed!.
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: MouseSpeed := MainMouseSpeed;
- 451..570: MouseSpeed := MainMouseSpeed + randomrange( - 1, 1);
- 571..590: MouseSpeed := MainMouseSpeed + randomrange( - 1, 2);
- 591..600: MouseSpeed := MainMouseSpeed + randomrange( - 1, 3);
- end;
- end;
- {Random wait times}
- procedure WaitAfterCast;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(100, 300));
- 451..570: Wait(RandomRange(300, 400));
- 571..590: Wait(RandomRange(400, 600));
- 591..600: Wait(RandomRange(600, 1000));
- end;
- end;
- procedure WaitShortClick;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(100, 150));
- 451..570: Wait(RandomRange(150, 200));
- 571..590: Wait(RandomRange(200, 250));
- 591..600: Wait(RandomRange(250, 400));
- end;
- end;
- procedure WaitShortClick2;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(400, 450));
- 451..570: Wait(RandomRange(450, 500));
- 571..590: Wait(RandomRange(500, 550));
- 591..600: Wait(RandomRange(550, 600));
- end;
- end;
- procedure WaitHumanClick;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(600, 650));
- 451..570: Wait(RandomRange(650, 700));
- 571..590: Wait(RandomRange(700, 750));
- 591..600: Wait(RandomRange(750, 800));
- end;
- end;
- procedure WaitHumanClick2;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(800, 1000));
- 451..570: Wait(RandomRange(1000, 1200));
- 571..590: Wait(RandomRange(1200, 1400));
- 591..600: Wait(RandomRange(1400, 2000));
- end;
- end;
- procedure WaitHumanClick3;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(3000, 5000));
- 451..570: Wait(RandomRange(5000, 5500));
- 571..590: Wait(RandomRange(6000, 6500));
- 591..600: Wait(RandomRange(7000, 7500));
- end;
- end;
- procedure WaitHumanClick4;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(7500, 11000));
- 451..570: Wait(RandomRange(11000, 12000));
- 571..590: Wait(RandomRange(13000, 14000));
- 591..600: Wait(RandomRange(15000, 16000));
- end;
- end;
- procedure WaitHumanClick5;
- begin
- if (not (loggedin)) then
- exit;
- case random(600) of
- 1..450: Wait(RandomRange(61000, 65000));
- 451..570: Wait(RandomRange(65000, 70000));
- 571..590: Wait(RandomRange(70000, 75000));
- 591..600: Wait(RandomRange(75000, 80000));
- end;
- end;
- procedure MakeMyChatTabAll;
- begin
- if (not (loggedin)) then // if our chat tab isn't on all, it assigns it
- exit;
- writeln('Our chat Tab is not set to all, making chat tab to all');
- mousebox(12, 485, 45, 497, 1);
- end;
- procedure ProgressReport;
- var
- Timeleft, XpPerhour, Casts, CastsPH: Integer;
- begin
- if (not (loggedin)) then
- exit;
- ClearDebug;
- XpPerhour := (3600 * (Cast) / ((GetTimeRunning / 1000)));
- Casts := ((Cast) / (29));
- CastsPH := (3600 * (Casts) / ((GetTimeRunning / 1000)));
- timeleft := ((Timer) - (GetTimeRunning));
- TimeTillBreak := (MsToTime(timeleft, Time_Formal)); // Prints our progress report.
- WriteLn('* FCurser v' + version);
- WriteLn('* Runtime: ' + TimeRunning);
- Writeln('*');
- writeln('* Experience Gained: ' + IntToStr(Cast) + ' Exp P/H: ' + IntToStr(XpPerhour));
- writeln('* Curse Used : ' + IntToStr(Casts) + ' Casts P/h: ' + IntTostr(CastsPH));
- Writeln('* No. Of Times : ' + 'Failed Casting: ' + intTostr(failcast) + ' Messed up: ' + inttostr(messedup) + ' Entered Cave: ' + IntToStr(CaveEntrances));
- if (Breakhandler = true) then
- Writeln('* Time till break : ' + (TimeTillBreak));
- Writeln('* Post all Bugs/proggies/errors on this topic: http://villavu.com/forum/showthread.php?t=103236');
- end;
- procedure SmartProggy;
- var
- info1, info2, info3: string;
- casts: integer;
- begin
- if (not (loggedin)) then
- exit;
- if (DoSmartProgress = true) then
- exit; // debugs progress report on smart screen
- Casts := ((Cast) / (29));
- info1 := 'FCurser V' + version;
- info2 := 'Runtime: ' + TimeRunning;
- info3 := 'Casts Used: ' + IntToStr(Casts);
- SMART_ClearCanvas;
- SMART_DrawText(350, 0, CharsNPC, info1, clWhite);
- SMART_DrawText(350, 15, CharsNPC, info2, clWhite);
- SMART_DrawText(350, 30, CharsNPC, info3, clWhite);
- end;
- {Credits to SRL-oSR Dev team, i simply added CTS with Hue/Sat to color finding with this object finder, its better suited for cursing tzhaar monsters}
- function FindObjExX(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol, CTS: integer; Hue, Sat: Extended; Step, xs, ys, xe, ye: Integer): Boolean;
- var
- MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
- ColorFound: Boolean;
- SearchBoxes: array of array of TBox;
- p: TPointArray;
- begin
- if (not (loggedin)) then
- exit;
- Result := False;
- for i := 0 to (GetArrayLength(Color) - 1) do
- begin
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(Hue, sat);
- if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
- begin
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- ColorFound := True;
- Break;
- end;
- end;
- if not (ColorFound) then
- Exit;
- MidX := Round((xe - xs) / 2);
- MidY := Round((ye - ys) / 2);
- Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
- Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;
- SetLength(SearchBoxes, Width);
- HalfWidth := Floor(Width / 2);
- HalfHeight := Floor(Height / 2) for x := - 1 * HalfWidth to HalfWidth do
- begin
- SetLength(SearchBoxes[x + HalfWidth], Height);
- for y := - 1 * HalfHeight to HalfHeight do
- SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(Max(xs, xs + Round(MidX + ((x - 0.5) * Step))), Max(ys, ys + Round(MidY + ((y - 0.5) * Step))), Min(xe, xs + Round(MidX + ((x + 0.5) * Step))), Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
- end;
- p := TPAFromBox(IntToBox(0, 0, Width - 1, Height - 1));
- SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
- for k := 0 to High(Color) do
- for j := 0 to High(p) do
- begin
- ColorToleranceSpeed(CTS); // what i added.
- SetColorSpeed2Modifiers(Hue, sat);
- if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1, SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2, SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
- begin
- case random(25) of
- 0..15: MMouse(cx, cy, randomrange( - 3, 3), randomrange( - 3, 3));
- 16..17: MMouse(cx, cy, randomrange( - 5, 5), randomrange( - 5, 5));
- 18..19: MMouse(cx, cy, randomrange( - 6, 6), randomrange( - 6, 6));
- 20..21: MMouse(cx, cy, randomrange( - 7, 7), randomrange( - 7, 7)); // added to the mix
- 22..23: MMouse(cx, cy, randomrange( - 8, 8), randomrange( - 8, 8));
- 24..25: MMouse(cx, cy, randomrange( - 9, 9), randomrange( - 9, 9));
- end;
- if (WaitUptextMulti2(Text, 300)) then
- begin
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- GetMousePos(cx, cy);
- Result := True;
- Exit;
- end;
- end;
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- ColorToleranceSpeed(1);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- {Bank icon detection}
- function FindManualBankMM: boolean;
- var
- x, y: integer;
- begin // This is done by the player, using a guide i link to in the setup.
- result := FindObjExX(x,y,[''],[BankMMColor1],BankMMTolerance,1,0.2,0.2,50,MMX1, MMY1, MMX2, MMY2);
- end;
- function FindBankBMP: Boolean;
- var
- Bank: integer; //This is a bitmap i made a while ago, still works.
- x, y: integer;
- begin
- Bank := BitmapFromString(3, 5, 'meJxzOvOcMb4YgpxgbDQGnAsAnfwS' + 'CA==');
- SetBitmapName(Bank, 'FindBanksymbolFunction');
- result := (FindBitMapToleranceIn(Bank, X, Y, MMX1, MMY1, MMX2, MMY2, 65)) FreeBitmap(Bank);
- end;
- function AutoBankSymbols2: boolean;
- var // This uses the SRL-OSR bitmap which i found very laggy on my old laptop
- x, y: integer; // Well, let's just say this new laptop i got can run 6 runescape clients without even using 10% cpu..
- begin // so i like it now :).
- result := (FindSymbol(x, y, 'bank') or FindSymbol(x, y, 'minigame'));
- end;
- function FindBankSymbol1: Boolean;
- var
- TPA: tpointarray;
- begin
- if (not (loggedin)) then
- exit; //This is a color i made by hoping worlds and using AutoColorAid
- ColorToleranceSpeed(2); // It took a while to get but should work (*EXCEPT*) when you load rs and its really bright.
- SetColorSpeed2Modifiers(BankIconHue, BankIconSat); // Then it mistakes NPC'S for bank symbol.. Lol.
- result := FindColorsTolerance(TPA, BankIconColor, MMX1, MMY1, MMX2, MMY2, BankIconTol);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- function FindBanksymbol: BOolean;
- begin
- if (ManualBankMM = true) then
- begin
- result := (FindManualBankMM) or (findbankBMP);
- end
- else
- begin
- if (AutoBankMM = true) then
- begin
- result := (FindBanksymbol1); // A basic function that decides how to locate Bank Symbol - it all depends on what the user
- end // Decides to use, be it my own personal bitmap/bank colors or his own or the include's bitmap.
- else
- begin
- if (Autobankmm2 = true) then
- begin
- result := (AutoBankSymbols2);
- end;
- end;
- end;
- end;
- function OnlobbyScreen: boolean;
- begin
- result := (GetColor(381, 336) = 16777215); // This has never worked.
- end;
- procedure ClickToEnterLobby;
- begin
- if (not (loggedin)) then // Doesnt work since the Login procedure stops everything else.
- exit;
- if Findbanksymbol then
- exit;
- MouseBox(323, 312, 450, 350, mouse_right);
- waithumanclick;
- ChooseOption('lay');
- end;
- function HoverNearbyNpc: boolean;
- var
- I: Tpointarray;
- P: Integer;
- begin // This is a Basic antiban that Moves mouse to near by yellow NPC dots.
- if (not (loggedin)) then
- exit;
- I := GetMiniMapDots('npc'); // gets the dots.
- if (length(I) > 0) then // If there are dots then continues..
- begin
- SortTPAFrom(i, Point(MMCX, MMCY)); // sorts them from center point.
- P := random(length(I)) Mmouse(I[0].x, I[0].y, 3, 3); // moves to a random npc dot.
- result := true; // and this should be a procedure not function
- end;
- end; // last time i changed it i had a black out and forgot what i was doing, so am a leave it at that.
- procedure Keyboards;
- begin
- case random(5) of
- 0..2:
- begin
- KeyDown(37);
- WaitShortClick KeyUp(37);
- WaitShortClick KeyDown(40);
- WaitShortClick KeyUp(40);
- end;
- 3..4: // moves keyboards.
- begin
- KeyDown(39);
- WaitShortClick KeyUp(39);
- WaitShortClick KeyDown(38);
- WaitShortClick KeyUp(38);
- end;
- 5:
- begin
- KeyDown(38);
- WaitShortClick KeyUp(38);
- WaitShortClick KeyDown(39);
- WaitShortClick KeyUp(39);
- end;
- end;
- end;
- procedure Antiban;
- begin
- if (not (loggedin)) then // Our antiban,
- exit;
- case random(100) of
- 0..56:
- begin
- end;
- 57..100:
- begin
- case random(150) of
- 10: hoverskill(skill_magic, false);
- 20: BoredHuman;
- 30: MMouseOffClient('top');
- 40: MMouseOffClient('left');
- 50: MMouseOffClient('right');
- 60: MMouseOffClient('bottom');
- 70: SmallRandomMouse;
- 80: RandomAngle(1);
- 90: RandomAngle(2);
- 100: PickUpMouse;
- 110: CompassMovement(10, 70, true);
- 120: HoverNearbyNpc; // Thats the procedure above
- 130: Keyboards; // Same as above
- 140: MissMouse(250, 250);
- 150: RandomMovement; // Rest are from the include.
- 160: CompassMovement(240, 300, true);
- 170: AdjustMouseSpeed(3, 10, 20);
- 180: RandomFKeys(true);
- 190: RandomTab(true);
- end;
- end;
- end;
- end;
- function AlreadyWeakend: boolean; // Finds the word 'foe' in text to know if the NPC is weaked and then warn the player.
- begin
- if (not (loggedin)) then
- exit;
- result := FindTextTPA(clBlack, 0, MCX1, MCY1, MCX2, MCY2, 'foe', smallChars07, Nothing);
- end;
- procedure NPCisWeakend;
- begin
- if (not (loggedin)) then
- exit;
- 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!');
- if LogMeOut then
- writeln('we have logged out')
- else termination('Our NPC got weakened and we failed to log out.. ending script!');
- end;
- function OutofRunes: boolean;
- begin
- if (not (loggedin)) then
- exit; // Detects the word in chat box that tells the user that his avatar is out of runes usually the word 'body' 'ody'.
- result := FindTextTPA(clBlack, 0, MCX1, MCY1, MCX2, MCY2, TheMagicWord, smallChars07, Nothing);
- end;
- procedure FindIfonMagetab;
- begin
- if (not (loggedin)) then
- exit;
- if not ColorLocate('OnmageTab') then
- begin
- gametab(tab_magic);
- waitshortclick2; // Gametab(tab magic) works.. But i want more fail safes.
- end
- else
- begin
- if ColorLocate('OnmageTab') then
- exit;
- end;
- end;
- {This is used to detect the white cave entrance, but the difference between this one and others *Other than the fact it can lead to out of range errors* it wont move mouse to any other object/player in white on the screen}
- function FindObjectFar(Color: TintegerArray; Tol, CTS: integer; hMoD, sMoD: extended; Uptext: array of string; WaitUptextWait, WaitUptextRandom: Integer; x, y, xs, ys: integer): boolean;
- var
- III, i, tmpcts: integer;
- TPA: tpointarray;
- TPAA: T2DPointArray;
- begin
- if (not (loggedin)) then
- exit;
- tmpcts := GetColorToleranceSpeed;
- ColorToleranceSpeed(CTS); // grabs our colors for the cave.
- SetColorSpeed2Modifiers(hMoD, SMoD);
- FindColorsSpiralTolerance(MSCX, MSCY, TPA, color[III], x, y, xs, ys, Tol)
- ColorToleranceSpeed(tmpCTS);
- SetColorSpeed2Modifiers(0.2, 0.2);
- SplitTPAWrap(TPA, 10, TPAA);
- SortATPAFromSize(TPAA, 10, false);
- case Entrancemode of
- 1:
- begin // I've asked and asked how can you do case to the 64xInteger bits (I.E Low/High) so you won't have to write case or two functions.. But nope, not possible.
- for I := 0 to low(TPAA) do // This inverts the object finding, it goes straight for the cave but sometimes crashes! so i dont recommend it.
- begin // Only reason i made this was because one person wanted it to fully click the cave
- MiddleTPAEx(TPAA[i], X, Y); // and since we didn't have reflection.. yet I came up with this easy solution.
- MMouse(x, y, RandomRange( - 50, 50), RandomRange( - 25, 25));
- if WaitUpTextMulti2(uptext, WaitUptextWait + random(WaitUptextRandom)) then
- begin
- Result := True;
- GetMousePos(X, Y);
- break; // If only it was possible to do the Low/High in Case by them selves in one line, it would save up 10 lines.
- end;
- break;
- end;
- end;
- 3:
- for I := 0 to High(TPAA) do // This is fine.
- begin
- MiddleTPAEx(TPAA[i], X, Y);
- MMouse(x, y, RandomRange( - 50, 50), RandomRange( - 25, 25));
- if WaitUpTextMulti2(uptext, WaitUptextWait + random(WaitUptextRandom)) then
- begin
- Result := True;
- GetMousePos(X, Y);
- break;
- end; // Incase you're wondering Mode 2 is that plain Findobjexx function!.
- break;
- end;
- end;
- end;
- {This finds our monster and does the magic!@}
- function LocateMonster1(Color: TintegerArray; Tol, CTS: integer; hMoD, sMoD: Extended; Uptext: array of string): Boolean;
- var
- R, ii, X, y, i, tmpcts: integer;
- TPA: Tpointarray;
- ATPA: T2DPointArray;
- Boxm: tbox;
- begin
- if (not (Loggedin)) then
- exit;
- if not ColorLocate('Meleer') then
- exit;
- if (findbanksymbol) then
- exit;
- if (AttempSolvingRandoms = true) and findtalk2 then // Like i've said before, find talk 2 wont switch to inv tab but will find the player's nickname in yellow text!.
- findnormalrandoms; // If it does.. Then it switches to normalrandoms!.
- case random(10) of
- 0..3: MouseSpeedz; // changes mouse speed..
- 4..10: writeln('not changing mouse speed');
- end;
- FindIfonMagetab; // find if we did switch to mage tab.
- case random(10) of
- 0..7: Mouse(RandomRange(668, 669), RandomRange(263, 264), random(3), random(3), mouse_move);
- 8..10: Mouse(RandomRange(663, 670), RandomRange(260, 265), random(1), random(1), mouse_move); // then click curse.
- end;
- if WaitUpTextMulti2(['Curse'], 300) then // the word 'Curse' is green!....
- begin
- clickmouse2(mouse_left);
- waitshortclick;
- tmpCTS := GetColorToleranceSpeed;
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(hMoD, sMoD);
- FindColorsTolerance(TPA, Color[ii], MSX1, MSY1, MSX2, MSY2, Tol);
- ColorToleranceSpeed(tmpCTS);
- setColorSpeed2Modifiers(0.2, 0.2); //This is the level 45 color. Just an extra fail safe.
- if Length(TPA) < 0 then
- exit;
- if (Length(TPA) > 0) and (Length(TPA) < 100) then // if the monster is not in a good camera angle..
- setangle(1);
- case random(10) of
- 0..7:
- begin
- end;
- 8..10: // then script will change camera.
- begin
- R := Random(GetArrayLength(ATPA));
- DeleteValueInTPA(TPA, R);
- end;
- end;
- SplitTPAWrap(TPA, 10, ATPA);
- Boxm := GetATPABounds(ATPA); // creates bounds for the monst
- case random(500) of
- 0..480: SortATPASize(ATpA, true); // Either sorts it from Size or
- 481..499: SortATPAFromFirstPoint(ATPA, IntToPoint(MSCX, MSCY)); // From first point.
- end;
- for I := 0 to HIGH(ATPA) do // ALl the above is used to alternate where the mouse will head to!
- begin // obviously it will click one spot more than others.. That's what a human would do, but then again slip a few times and not click the same spot or miss click.
- case random(10) of
- 0..1: MouseSpeedz; // changes mouse speed..
- 2..10: writeln('not changing mouse speed');
- end;
- MiddleTPAEx(ATPA[i], X, Y); // gets center point!
- begin
- case random(25) of
- 0..15: MMouse(x, y, randomrange( - 3, 3), randomrange( - 3, 3));
- 16..17: MMouse(x, y, randomrange( - 5, 5), randomrange( - 5, 5));
- 18..19: MMouse(x, y, randomrange( - 6, 6), randomrange( - 6, 6)); // SO moves mouse with offset.
- 20..21: MMouse(x, y, randomrange( - 7, 7), randomrange( - 7, 7));
- 22..23: MMouse(x, y, randomrange( - 8, 8), randomrange( - 8, 8));
- 24..25: MMouse(x, y, randomrange( - 9, 9), randomrange( - 9, 9));
- end;
- if WaitUpTextMulti2(['Curse'], 300) then
- begin
- wait(randomrange(90, 120));
- clickmouse2(mouse_left); // and there it goes..
- if Didclick(true, 1000) then
- begin
- IncEx(cast, 29);
- if (dosmartprogress = true) then
- SmartProggy;
- progressreport;
- case playermode of
- 1:
- begin
- case random(100) of
- 0..80:
- begin
- end;
- 81..100: Antiban;
- end;
- case random(50) of
- 0..42: waitafterCast;
- 43..48: waithumanclick2;
- end;
- end;
- 2:
- begin
- end;
- end;
- result := true;
- exit;
- end
- else
- begin
- inc(Failcast);
- exit;
- end;
- end
- else
- begin
- inc(failcast);
- exit;
- end;
- break;
- end;
- break;
- end;
- end;
- end;
- procedure LocateMonster2;
- var
- Cx, Cy, tmpcts: integer;
- TPA: Tpointarray;
- begin
- if (not (Loggedin)) then // Same as above except its designed for pure bot mode, no wait times.
- exit;
- if not ColorLocate('Meleer') then
- exit;
- if (findbanksymbol) then
- exit;
- if (AttempSolvingRandoms = true) and findtalk2 then
- findnormalrandoms;
- MouseSpeedz;
- FindIfonMagetab;
- case random(10) of
- 0..7: Mouse(RandomRange(668, 669), RandomRange(263, 264), random(3), random(3), mouse_move);
- 8..10: Mouse(RandomRange(663, 670), RandomRange(260, 265), random(1), random(1), mouse_move);
- end;
- if WaitUpTextMulti2(['Curse'], 300) then
- begin
- clickmouse2(mouse_left);
- waitshortclick;
- tmpCTS := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.51, 1.43);
- FindColorsTolerance(TPA, 3152966, MSX1, MSY1, MSX2, MSY2, 5);
- ColorToleranceSpeed(tmpCTS);
- setColorSpeed2Modifiers(0.2, 0.2);
- if Length(TPA) < 0 then
- exit;
- if (Length(TPA) > 0) and (Length(TPA) < 100) then
- setangle(1);
- mousespeedz;
- FindObjExX(cx, cy, ['Curse'], [3152966], 5, 2, 0.51, 1.43, 50, MSX1, MSY1, MSX2, MSY2);
- if WaitUpTextMulti2(['Curse'], 300) then
- begin
- wait(randomrange(90, 120));
- clickmouse2(mouse_left);
- if Didclick(true, 1000) then
- begin
- IncEx(cast, 29);
- if (dosmartprogress = true) then
- SmartProggy;
- progressreport;
- case playermode of
- 1:
- begin
- case random(100) of
- 0..80:
- begin
- end;
- 81..100: Antiban;
- end;
- case random(50) of
- 0..42: waitafterCast;
- 43..48: waithumanclick2;
- end;
- end;
- 2:
- begin
- end;
- end;
- end
- else
- begin
- inc(Failcast);
- exit;
- end;
- end
- else
- begin
- inc(failcast);
- end;
- end;
- end;
- procedure locatemonster;
- begin
- case Mattmode of
- 1: LocateMonster1([3152966], 5, 2, 0.51, 1.43, ['Curse']);
- 2: Locatemonster2; // depends on player choice.
- end;
- end;
- function safe: boolean;
- var
- x, y: integer; // This uses SeanStar's cave entrance color, they work well.
- begin
- result := FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2);
- end;
- procedure CheckifInDanger;
- var
- x, y, t: integer;
- begin
- if (not (loggedin)) then // Checks if we are in combat outside cave.
- exit;
- if (OutFailSafe = false) then
- exit;
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- if (gethpbarabove) and (findbanksymbol) then
- begin
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- marktime(t); // Sets a timer.
- while (TimeFromMark(T) < HpBarOutside) do // Waits during that timer and tries to enter cave
- begin
- wait(400);
- if (not (loggedin)) then
- exit;
- if FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2) then
- clickmouse2(mouse_left);
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- if (not (findbanksymbol)) then
- exit;
- if (not (getHpbarabove)) then
- exit; // if we fail to enter then.. It Continues and ends script.
- if (TimeFromMark(T) >= HpBarOutside) then
- begin
- if (not (findbanksymbol)) then
- exit;
- if (not (getHpbarabove)) then
- exit;
- if findbanksymbol and GetHpbarAbove then
- begin
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- if (GetSkillInfo(3, false) < LowHpOutside) then
- begin
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- gametab(tab_magic);
- waithumanclick;
- mouse(665, 286, 0, 0, mouse_left); // script will try to tele out.
- waithumanclick2;
- if LogMeOut then // if managed to log out then..
- Termination('We got stuck in combat outside cave, terminating, managed to log out.')
- else // if not then..
- Termination('Stuck outside cave in combat, couldnt log out terminating');
- end;
- end;
- end;
- end;
- end;
- end;
- function CavesTime: boolean;
- begin // detects the cave wait time message upon entrance.
- if (not (loggedin)) then
- exit;
- result := FindTextTPA(ClBlack, 30, MCX1, MCY1, MCX2, MCY2, 'gain', CharsNPC07, Nothing);
- end;
- procedure HandleCaveTime;
- begin
- if CavesTime then
- begin
- writeln('we have to wait before we can re-enter, logging out and waiting two minutes');
- if LogMeOut then
- begin
- writeln('Waiting for cave time to pass');
- wait(randomrange(125000, 135000));
- exit;
- end;
- end;
- end;
- procedure EnterCave;
- var
- x, y: integer;
- begin
- if (EntranceMode = 1) or (entrancemode = 3) then
- begin
- if FindObjectFar([CaveColor], Cavetol, CaveCTS, CaveHue, CaveSat, ['nter'], 100, 50, MSX1, MSY1, MSX2, MSY2) then
- begin
- ClickMouse2(mouse_left);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- if CavesTime then
- HandleCaveTime;
- waithumanclick3; // enters cave.. entrance mode is chosen by player.
- if CavesTime then
- HandleCaveTime;
- if ClickContinueEx(false, false) then
- begin
- wait(randomrange(11000, 15000));
- if (UseReflection = true) then
- MyPosition := R_GetTileGlobal;
- clicktocontinue;
- end;
- end;
- end
- else
- begin
- if EntranceMode = 2 then
- begin
- if FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2) then
- begin
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- Clickmouse2(mouse_left);
- waithumanclick2;
- if CavesTime then
- HandleCaveTime;
- if CavesTime then
- HandleCaveTime;
- if ClickContinueEx(false, false) then
- begin
- wait(randomrange(11000, 15000));
- if (UseReflection = true) then
- MyPosition := R_GetTileGlobal;
- clicktocontinue;
- end;
- end;
- end;
- end;
- end;
- procedure EnterCaveLoop;
- begin
- if (not (loggedin)) then
- exit;
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- MakeCompass(randomrange(165, 189));
- setangle(0);
- waitMore;
- repeat
- waitMore;
- EnterCave; // And this is our entrance loop
- if CavesTime then
- HandleCaveTime;
- if ColorLocate('Skillscreen') then
- CloseSkillScreen;
- waitMore;
- if (getHpbarabove) then
- exit;
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- waitMore;
- if (not (Findbanksymbol)) then
- break; // keeps trying to enter!
- if (not (loggedin)) then
- exit;
- until (not (findbanksymbol)) or (not (loggedin));
- if ClickContinueEx(false, false) then
- begin
- wait(randomrange(11000, 15000));
- if (UseReflection = true) then
- MyPosition := R_GetTileGlobal;
- clicktocontinue;
- end;
- AntiBan;
- if ColorLocate('SkillScreen') then
- CloseSkillScreen;
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- MakeCompass('n');
- setangle(0);
- Inc(CaveEntrances);
- exit;
- end;
- function NPCNearBy: boolean;
- var
- TPA: Tpointarray;
- begin // Checks the distance between the Player and NPC
- TPA := GetMiniMapDots('npc');
- if (length(TPA) > 0) then // more explained in the setup const's.
- begin
- SortTPAFrom(TPA, Point(MMCX, MMCY));
- FilterPointsPie(TPA, 5, 360, MinNPCdistance, MaxNPCdistance, MMCX, MMCY);
- if (length(tpa) > 0) then
- begin
- writeln('NPC in range, not going to perform running to midpath');
- result := true;
- end;
- end;
- end;
- procedure RunToTheNPC;
- var
- TPA, TPA2, TPA3, TPA2B: TpointArray;
- I, x, y, CTS: Integer;
- P1, P2: tpoint;
- ATPA: T2DPointArray;
- begin
- if (not (loggedin)) then
- exit;
- if (findbanksymbol) then // creates a path between the player and the NPC, runs midpath towards it (not exactly to it, more like 2 squares north of it.. Thus reaching closest spot and getting most exp}
- exit;
- FindColorsTolerance(TPA, 16777215, MMX1, MMY1, MMX2, MMY2, 7)
- cts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.00, 0.12);
- FindColorsTolerance(TPA2, 126702, MMX1, MMY1, MMX2, MMY2, 7)
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(0.02, 0.2);
- if (Length(TPA) < 0) and (Length(TPA2) < 0) then
- exit;
- FilterPointsPie(TPA2, 0, 360, MinNPCRadius, MaxNPCRadius, MMCX, MMCY) ceil((Length(TPA2) * 100) / ((Pi * (25 * 25)) * ((360 - 5) / 360.0) - ((Pi * (5 * 5)) * ((360 - 5) / 360.0)))); // The second part i took from Villavu forums - credits goes to owner of the formula (post i took it from said it was copy pasting it from another post, which i cant find for some reason}
- TPA2B := TPA2 if (Length(TPA2B) > 0) then // Believe it or not, the above was the easy part.. The parts below took almost a week to figure out. Only reason i was motivated to finish it is because Dgby said something that i found really offensive when i asked him to help :P, i got back at him - sent him the link for this RAW on pastebin :D.
- begin
- P1 := MiddleTPA(TPA); //Right once that hard part is out of the way, it creates mid path between you and the final point.
- P2 := MiddleTPA(TPA2B);
- TPA3 := TPABetweenPoints(P2, P1, 1, 0); // This TPA between both points.
- ATPA := FindGapsTPA(TPA3, 20); // Finds the gaps between them (Straight path i guess)
- MiddleTPAEx(ATPA[i], X, Y); // Then we create middle path from it
- SortATPAFromSize(ATPA, 1, true); // we sort it
- if (length(ATPA[i]) > 0) then // and if its big enough (keep in mind we use specific radius, everything not in it is unaccounted for
- begin
- writeln('NPC far from our distance, going to run midpath');
- mouse(x, y, 2, 2, mouse_left); // we'll run midpath which is usually 2 squares or so from it, thus we can start maging safely!
- flag;
- end;
- end;
- end;
- procedure WalktoSafeSpot;
- var
- R_RightSide, R_Safespot: tpoint;
- begin
- if (not (loggedin)) then
- exit;
- if (UseReflection = true) and (MyPosition.x > 0) then
- begin
- R_RightSide.x := MyPosition.x + 24;
- R_RightSide.y := MyPosition.y - 5; // Because reflection uses Camera to walk - this most likely won't hit the correct square!
- R_Safespot.x := MyPosition.x + 12;
- R_Safespot.y := MyPosition.y + 5;
- R_WebWalk(R_RightSide);
- wait(randomrange(5000, 7000));
- R_WebWalk(R_Safespot);
- makecompass(randomrange(140, 160));
- SetAngle(1);
- wait(randomrange(5000, 7000));
- if ColorLocate('AtSafeSpot') then
- exit;
- end
- else
- begin
- MakeCompass('n');
- SetAngle(0);
- SetRun(true);
- if ColorLocate('AtSafeSpot') then
- exit;
- if not DoAction('WalkToEdgeSouth') then
- writeln('failed'); //However, radial walk works 9/10 of times!
- fflag(0);
- if not DoAction('WalkToEdgeSouth2') then
- writeln('failed2');
- fflag(0);
- wait(randomrange(3000, 5000));
- if not DoAction('WalktoWall') then
- writeln('yes');
- fflag(0);
- if not DoAction('WalktoWall2') then
- writeln('yes2');
- fflag(0);
- if not DoAction('WalktoWall3') then
- writeln('we are in safe spot or failed');
- fflag(0);
- makecompass(randomrange(140, 160));
- SetAngle(1);
- wait(randomrange(5000, 7000));
- if ColorLocate('AtSafeSpot') then
- exit;
- end;
- end;
- procedure FixMessup;
- begin
- if (AttempSolvingRandoms = true) and findtalk2 then
- findnormalrandoms;
- if (not (loggedin)) then
- exit;
- if (not (getHpbarabove)) then
- exit;
- if (Gethpbarabove) and (ColorLocate('AtSafeSpot')) then
- begin
- if (AttempSolvingRandoms = true) and findtalk2 then
- findnormalrandoms;
- if (not (getHpbarabove)) then
- exit;
- repeat
- wait(400);
- if (AttempSolvingRandoms = true) and findtalk2 then
- findnormalrandoms;
- if (AttempSolvingRandoms = true) and findtalk2 then
- findnormalrandoms;
- logout;
- if (AttempSolvingRandoms = true) and findtalk2 then
- findnormalrandoms;
- waithumanclick;
- logout;
- if (not (loggedin)) then
- break;
- until (not (loggedin));
- if (not (loggedin)) then
- begin
- 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!');
- writeln('logged out due to mess up');
- inc(Messedup);
- exit;
- end;
- end;
- end;
- procedure fixposition;
- var
- t: integer;
- begin
- marktime(t);
- repeat
- wait(400);
- if ColorLocate('SkillScreen') then
- exit;
- if ColorLocate('RangeScreen') then
- exit;
- if (findbanksymbol) then
- exit;
- if (not (loggedin)) then
- exit;
- makecompass(randomrange(130, 160));
- setangle(1);
- if ColorLocate('meleer') then
- exit;
- if (not (loggedin)) then
- exit;
- if (findbanksymbol) then
- exit;
- wait(400);
- if ColorLocate('SkillScreen') then
- exit;
- if ColorLocate('RangeScreen') then
- exit;
- if (outofrunes) then
- exit;
- if (gethpbarabove) then
- exit;
- makecompass(randomrange(40, 60));
- until (TimeFromMark(t) > MaxNpcTime);
- if (timefromMark(t) >= MaxNpcTime) then
- begin
- if ColorLocate('SkillScreen') then
- exit;
- if ColorLocate('RangeScreen') then
- exit;
- if not ColorLocate('meleer') and Loggedin then
- begin
- writeln('failed to find melee, going to log out and log in');
- repeat
- if (not (loggedin)) then
- exit;
- wait(400);
- logout;
- if (not (loggedin)) then
- exit;
- if (not (loggedin)) then
- exit;
- until (not (loggedin));
- end;
- end;
- end;
- procedure CurseLoop;
- begin
- if (not (loggedin)) then
- exit;
- wait(randomrange(WaitMemory1, WaitMemory2));
- if (not (loggedin)) then
- exit;
- repeat
- wait(randomrange(WaitMemory1, WaitMemory2));
- if (findbanksymbol) then
- exit;
- if (not (loggedin)) then
- exit;
- if (AttempSolvingRandoms = true) and findtalk2 then
- findnormalrandoms;
- waitmore;
- if (Breakhandler = true) then
- takebreaks;
- waitmore;
- LocateMonster;
- if (ColorLocate('AtSafeSpot') and (not (getHpBarAbove)) and (not (ColorLocate('meleer')))) and Loggedin then
- FixPosition;
- if GetHpBarAbove then
- begin
- if (ColorLocate('AtSafeSpot')) and (GetHpBarAbove) and (Loggedin) then
- FixMessup;
- end;
- waitmore;
- if ColorLocate('RangeScreen') then
- closerangescreen;
- waitmore;
- if (CheckChatTabAll = true) and (ColorLocate('NotChatTabAll')) then
- MakeMyChatTabAll;
- waitmore;
- if AlreadyWeakend then
- NPCisWeakend;
- waitmore;
- if OutofRunes then
- Termination('We have run out of Runes, terminating!');
- waitmore;
- if ColorLocate('SkillSCreen') then
- CloseSkillScreen;
- waitmore;
- until (Findbanksymbol) or (not (loggedin));
- end;
- procedure SetPlayerUploop;
- begin
- wait(400);
- if (not (loggedin)) then
- exit;
- writeln('we are here x21');
- if ColorLocate('Meleer') and (not (ColorLocate('AtSafeSpot'))) and Loggedin then
- WalktoSafeSpot;
- waitmore;
- if ClickContinueEx(false, false) then
- begin
- wait(randomrange(11000, 15000));
- if (UseReflection = true) then
- MyPosition := R_GetTileGlobal;
- clicktocontinue;
- end;
- waitmore;
- if ColorLocate('RangeScreen') then
- CloseSkillScreen;
- if Onlobbyscreen then
- clicktoenterlobby;
- waitmore;
- end;
- procedure InCaveloop;
- begin
- repeat
- wait(randomrange(Waitmemory1, Waitmemory2));
- if (not (loggedin)) then
- exit;
- writeln('we are here');
- if ColorLocate('atsafespot') and Loggedin then
- CurseLoop;
- wait(randomrange(Waitmemory1, Waitmemory2));
- if (not (ColorLocate('AtSafeSpot'))) and Loggedin then
- SetPlayerUploop;
- until (not (loggedin)) or (FindBanksymbol);
- end;
- procedure OutsideCaveloop;
- begin
- if (not (FindBanksymbol)) then
- exit;
- waitmore;
- if (not (loggedin)) then
- exit;
- if (FindBanksymbol) then
- EnterCaveLoop;
- waitmore;
- if ColorLocate('SkillSCreen') then
- CloseSkillScreen;
- waitmore;
- if (AttempSolvingRandoms = true) then
- findnormalrandoms;
- waitmore;
- if (not (GetHpbarabove)) then
- Entercaveloop;
- waitmore;
- if (GetHpBarAbove) and (OutFailSafe = true) then
- CheckifInDanger;
- waitmore;
- if CavesTime then
- HandleCaveTime;
- end;
- procedure PlayerLoop;
- begin
- if (not (loggedin)) then
- exit;
- repeat
- if (not (loggedin)) then
- exit;
- while (FindBanksymbol) and Loggedin do
- OutsideCaveloop;
- if (not (loggedin)) then
- exit;
- while (not (FindBanksymboL)) and Loggedin do
- InCaveloop;
- until (not (loggedin));
- end;
- {just checks settings...}
- procedure CheckplayerSetup;
- begin
- if (EntranceMode > 3) or (EntranceMode < 1) then
- begin
- writeln('you have chosen a wrong entrance mode, please, choose one between 1,2 or 3');
- terminatescript;
- end;
- if (AutoBankMM = true) and (ManualBankMM = true) then
- begin
- writeln('you have enabled both Manual and Automatic BankMM (Minimap) Color detection, please only choose one');
- terminatescript;
- end;
- if (AutoBankMM = false) and (Autobankmm2 = false) then
- begin
- writeln('you have ENABLED both AUTOMATIC and automatic bankmm22 (Minimap) Color detection, please enable one (script cant run with both of them');
- terminatescript;
- end;
- if (AutoBankMM = true) and (Autobankmm2 = true) then
- begin
- writeln('you have ENABLED both AUTOMATIC and automatic bankmm22 (Minimap) Color detection, please enable one (script cant run with both of them');
- terminatescript;
- end;
- end;
- procedure startitup;
- begin
- Playersetup;
- SetupSRL;
- if (UseReflection = true) then
- SetupReflection;
- ActivateClient;
- SRL_CombatRandoms := False;
- CheckplayerSetup;
- StartTime;
- end;
- procedure loginloop;
- begin
- wait(400);
- loginplayer;
- if Onlobbyscreen then
- clicktoenterlobby;
- MakeCompass('n');
- setangle(1);
- end;
- begin
- startitup;
- repeat
- wait(400);
- if (loggedin) then
- begin
- PlayerLoop;
- end
- else
- begin
- if (not (loggedin)) then
- StartTime;
- loginloop;
- end;
- until (false);
- end.
Advertisement
Add Comment
Please, Sign In to add comment