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;
- OutsideCaveSaftey,ABankMM,MBankMM,Memorywait2,MakeChatTabAll: boolean;
- SmartTprogress,ABankMM2,FindtheRandoms,SkillScreenFailSafe:boolean;
- const
- {
- ________________________________________________________________________________
- ================================================================================
- ________________________________________________________________________________
- Section.1 : Player-Setup
- Section.2 : Advanced-Script-Setup
- ________________________________________________________________________________
- {++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
- |1. Prayer Setup |
- |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
- UseReflection = false; // Do you want the script to use Reflection?
- debuginfo = false; //adds debug testing to script, stuff in text in debugger.
- Username = '@gmail.com';// Your Username.
- Password = '';// Your Password. (Four letters, do not use first letters)
- Nickname = ''; // 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.
- Breakhandler = true; // Would you want 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 a 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 your 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 |
- |++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
- 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 your 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 = true; // 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 = false; // Not recommended, this uses about 30% CPU constantly
- // 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 = 0; //
- 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.
- 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;
- BankIconHue = 0.11;
- BankIconSat = 1.15;
- version = '1.4';
- Curse = 29;
- { END OF SET UP DO NOT CHANGE BELOW!
- \\___________________________________________________________________________//}
- procedure playerSetup;
- begin
- HowManyPlayers := 1;
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0;
- Players[0].Name := username;
- Players[0].Pass := password;
- Players[0].Nick := nickname;
- Players[0].Active:=True;
- FindtheRandoms := AttempSolvingRandoms;
- caveEntranceWhite := [7763583, 8553356];
- MBankMM := ManualBankMM
- ABankMM := AutoBankMM
- ABankMM2 := Autobankmm2;
- Memorywait2 := UseLessMemory;
- SkillScreenFailSafe:= SkillFailsafe;
- MakeChatTabAll := CheckChatTabAll;
- SmartTprogress := DoSmartProgress;
- OutsideCaveSaftey := OutFailSafe;
- end;
- 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'); // i added this! :) this is really important to be honest!.
- 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;
- 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;
- 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;
- 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;
- procedure Waitmore;
- begin
- if Memorywait2 then
- begin
- wait(randomrange(waitMemory3,WaitMemory4));
- end;
- end;
- procedure StartTime;
- begin
- Timer := GetTimeRunning + RandomRange(BreakTime1 * 60000, BreakTime2 * 60000);
- end;
- procedure takebreaks;
- var
- T,BreakTimer:integer;
- Times:string;
- begin
- if (Breakhandler = false) then exit;
- if (GetTimeRunning >= Timer) then
- begin
- writeln('its time to take a break....');
- BreakTimer := Randomrange(BreakWait1 * 60000, BreakWait2 * 60000);
- Times := (MsToTime(BreakTimer, Time_Formal));
- writeln('Breaking for: ' + Times);
- marktime(t);
- repeat
- wait(400);
- logout;
- until (not(loggedin));
- if (not(loggedin)) then
- begin
- repeat
- wait(1000);
- until(TimeFromMark(t) >= BreakTimer);
- if (TimeFromMark(T) >= BreakTimer) then
- begin
- writeln('break time is over, back to the script');
- exit;
- end;
- end;
- end;
- end;
- function OnRangeScreen:boolean;
- var
- CTS:Integer;
- TPA:Tpointarray;
- begin
- if (not(loggedin)) then exit;
- cts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.05, 0.41);
- result:= FindColorsTolerance(TPA,5334901 , 482, 36, 492, 45, 12);
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(0.02, 0.2);
- end;
- Procedure closerangescreen;
- begin
- if (not(loggedin)) then exit;
- if onrangescreen and SkillScreenFailSafe then
- begin
- writeln('we are on skill screen, closing');
- mousebox(482, 36, 492, 45,1);
- end;
- end;
- function OnskillScreen:boolean;
- var
- CTS:Integer;
- TPA:Tpointarray;
- begin
- if (not(loggedin)) then exit;
- cts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.02, 1.48);
- result:= FindColorsTolerance(TPA,8042720 , 480, 5, 513, 35, 4);
- ColorToleranceSpeed(CTS);
- SetColorSpeed2Modifiers(0.02, 0.2);
- end;
- Procedure CloseSkillScreen;
- begin
- if (not(loggedin)) then exit;
- if OnSkillScreen and SkillScreenFailSafe then
- begin
- writeln('we are on skill screen, closing');
- mousebox(494,17,500,22,1);
- end;
- end;
- function GetHpBarAbove:boolean;
- var
- Hpbar:tpointarray;
- begin
- result := (FindColorsTolerance(HpBar, 65280, 185, 50, 400, 250 , 3)) and
- (FindColorsTolerance(HpBar, 255, 185, 50, 400, 250 , 3))
- end;
- procedure MouseSpeedz;
- begin
- 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;
- procedure WaitAfterCast;
- begin
- if (not(loggedin)) then exit;
- case random(600) of
- 1..450: Wait(RandomRange(100, 300));
- 451..570: Wait(RandomRange(300, 400)); //this is rarely used.
- 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)); //this is rarely used.
- 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)); //this is rarely used.
- 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)); //We use different wait times for different Scenarios, these help out a lot.
- 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)); // only used if you dont have -65 mage.
- 571..590: Wait(RandomRange(70000, 75000));
- 591..600: Wait(RandomRange(75000, 80000));
- end;
- end;
- function NotchatTabAll:boolean;
- var
- Monster:TpointArray;
- TmpCts:Integer;
- begin
- if (not(loggedin)) then exit;
- tmpCTS := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.10, 0.34);
- result := FindColorsTolerance(Monster, 4213586, 6,482,60,497, 11);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- procedure MakeMyChatTabAll;
- begin
- if (not(loggedin)) then 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));
- 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 (not(SmartTprogress)) then
- exit;
- 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;
- { FindObjex by Starblaster100}
- function FindObjExXtra(var cx, cy: Integer; Color: TIntegerArray;
- Tol, 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;
- //check for all the colors
- for i := 0 to (GetArrayLength(Color)-1) do
- if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
- begin
- ColorFound := True;
- Break;
- end;
- if not(ColorFound) then
- Exit; //None of the colors could be found on screen
- //Start coordinates
- MidX := Round((xe - xs) / 2);
- MidY := Round((ye - ys) / 2);
- //width and height in boxes
- 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);
- //Getting mid of screen in boxes, not pixels
- HalfWidth := Floor(Width / 2);
- HalfHeight := Floor(Height / 2)
- //Create the search boxes, starting in mid because of backwards compatibility
- 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;
- //Create a TPA, where points are representing the boxes
- p := TPAFromBox(IntToBox(0, 0, Width-1, Height-1));
- //Sort thid TPA from the middle to get a spiral like effect
- SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));
- //Loop through the boxes, searching for the object (the k and j loop might be better to switch though)
- for k := 0 to High(Color) do
- for j := 0 to High(p) do
- begin
- 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
- begin
- Result := True;
- Exit;
- end;
- end;
- end;
- end;
- 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);
- 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));
- 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(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- GetMousePos(cx, cy);
- Result := True;
- Exit;
- end;
- end;
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- function FindManualBankMM:boolean;
- var
- x,y:integer;
- begin
- result := FindObjExXtra(x, y, [BankMMColor1,BankMMcolor2,BankMMcolor3], BankMMTolerance, 50, MMX1, MMY1, MMX2, MMY2)
- end;
- Function FindBankBMP: Boolean;
- var
- Bank:integer;
- x,y:integer; // This bitmap of the bank fails if players
- // npcs/items appear under it
- begin
- Bank := BitmapFromString(3, 5, 'meJxzOvOcMb4YgpxgbDQGnAsAnfwS' + 'CA==');
- SetBitmapName(Bank, 'FindBanksymbolFunction');
- result := (FindBitMapToleranceIn(Bank, X, Y, MMX1, MMY1, MMX2, MMY2, 65))
- FreeBitmap(Bank); // this uses 5% Cpu.
- end;
- Function AutoBankSymbols2:boolean;
- var //causes memory leaks. Uses 20-25% Cpu.
- x,y:integer;
- begin
- result := (FindSymbol(x, y, 'bank') or FindSymbol(x, y, 'minigame'));
- end;
- Function FindBankSymbol1: Boolean;
- var
- TPA:tpointarray;
- begin
- if (not(loggedin)) then exit;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(BankIconHue, BankIconSat);
- result := FindColorsTolerance(TPA, BankIconColor, MMX1, MMY1, MMX2, MMY2, BankIconTol);
- // finds bank iconsz
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- function FindbanksymboLL: boolean;
- begin
- result := (FindBanksymbol1)
- end;
- function FindBanksymbol: BOolean;
- begin
- if (ManualBankMM = true) then
- begin
- result := (FindManualBankMM) or (findbankBMP);
- end
- else
- begin
- if (AutoBankMM = true) then
- begin
- result := (FindbanksymboLL);
- end
- else
- begin
- if (Autobankmm2 = true) then
- begin
- result := (AutoBankSymbols2);
- end;
- end;
- end;
- end;
- function OnlobbyScreen:boolean;
- begin
- result := (GetColor(381, 336) = 16777215);
- end;
- procedure ClickToEnterLobby;
- begin
- if (not(loggedin)) then 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
- if (not(loggedin)) then exit;
- I := GetMiniMapDots('npc');
- if (length(I) > 0) then
- begin
- SortTPAFrom(i, Point(MMCX, MMCY));
- P := random(length(I))
- Mmouse(I[0].x, I[0].y,3,3);
- // 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.
- result := true;
- end;
- end;
- Procedure Keyboards;
- begin
- case random (5) of
- 0..2:begin
- KeyDown(37);
- WaitShortClick
- KeyUp(37);
- WaitShortClick
- KeyDown(40);
- WaitShortClick
- KeyUp(40);
- end;
- 3..4: 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 exit;
- case random (100) of
- 0..56: begin
- end;
- 57..100: begin
- case random(150) of
- 10: hoverskill(skill_magic,false);
- 15: HoverOnlineFriend;
- 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; // See its an antiban, even though it sucks haha. .. Yeah..
- 130: Keyboards;
- 140: MissMouse(250,250);
- 150: RandomMovement;
- 160: CompassMovement(240,300,true);
- 170: AdjustMouseSpeed(3,10,20);
- 180: RandomFKeys(true);
- 190: RandomTab(true);
- end;
- end;
- end;
- end;
- function AlreadyWeakend:boolean;
- 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!');
- repeat
- wait(400);
- logout;
- if (not(loggedin)) then exit;
- until (not(loggedin));
- end;
- function OutofRunes:boolean;
- Begin
- if (not(loggedin)) then exit;
- result := FindTextTPA(clBlack , 0, MCX1, MCY1, MCX2, MCY2, TheMagicWord, smallChars07, Nothing);
- end;
- function OnmageTab:boolean;
- var
- Monster:TpointArray;
- TmpCts:Integer;
- Melee:Boolean;
- begin
- if (not(loggedin)) then
- exit;
- tmpCTS := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.06, 0.24);
- result := FindColorsTolerance(Monster, 1382991, 730, 170, 754, 195, 11)
- melee:= result;
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- procedure FindIfonMagetab;
- begin
- if (not(loggedin)) then exit;
- if (not(OnmageTab)) then
- begin
- gametab(tab_magic);
- waitshortclick2;
- end
- else
- begin
- if (OnmageTab) then
- exit;
- end;
- end;
- procedure Termination;
- begin
- if (loggedin) then
- begin
- Writeln('we ran out of runes, or something really went wrong?, terminating script');
- repeat
- if (not(loggedin)) then break;
- logout;
- waithumanclick;
- if (not(loggedin)) then break;
- until (not(loggedin));
- if (not(loggedin)) then
- begin
- terminatescript;
- end;
- end;
- end;
- 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;
- //TIA: array of TIntegerArray; //I decided to make a TintegerArray for people that don't want to use ACA.
- begin
- if (not(loggedin)) then exit;
- tmpcts := GetColorToleranceSpeed;
- ColorToleranceSpeed(CTS);
- 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
- for I := 0 to low(TPAA) do
- 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;
- break;
- end;
- end;
- 3: for I := 0 to High(TPAA) do
- 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;
- break;
- end;
- end;
- end;
- function atSafeSpot:boolean;
- var
- TPA:TpointArray;
- I: Tpointarray;
- begin
- if (not(loggedin)) then exit;
- if (debuginfo = true) then
- writeln('checking safe spoit');
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(16.12,9.26);
- FindColorsTolerance(TPA,15856360, MMX1, MMY1, MMX2, MMY2, 3);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.02, 0.2);
- if (Length(TPA) > 0) then
- begin
- FilterPointsPie(TPA, 0, 360, 10, 30, MMCX, MMCY);
- I := TPA;
- if Length(I) > 0 then
- begin
- result := true;
- end;
- end;
- end;
- Function Meleer: Boolean;
- var
- Monster:TpointArray;
- TmpCts:Integer;
- begin
- if (not(loggedin)) then
- exit;
- tmpCTS := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.51, 1.43);
- result := FindColorsTolerance(Monster, 3152966, MSX1, MSY1, MSX2, MSY2, 5)
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- 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(meleer)) then exit;
- if (findbanksymbol) then exit;
- if findtherandoms 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(CTS);
- SetColorSpeed2Modifiers(hMoD, sMoD);
- FindColorsTolerance(TPA, Color[ii], MSX1, MSY1, MSX2, MSY2, Tol);
- ColorToleranceSpeed(tmpCTS);
- setColorSpeed2Modifiers(0.2, 0.2);
- if Length(TPA) < 0 then exit;
- if (Length(TPA) > 0) and (Length(TPA) < 100) then
- setangle(1);
- case random (10) of
- 0..7: begin
- end;
- 8..10:begin
- R := Random(GetArrayLength(ATPA));
- DeleteValueInTPA(TPA, R);
- end;
- end;
- SplitTPAWrap(TPA,10,ATPA);
- Boxm := GetATPABounds(ATPA);
- case random (500) of
- 0..480: SortATPASize(ATpA,true);
- 481..499: SortATPAFromFirstPoint(ATPA,IntToPoint(MSCX,MSCY));
- end;
- for I := 0 to HIGH(ATPA) do
- begin
- mousespeedz;
- MiddleTPAEx(ATPA[i], X, Y);
- 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));
- 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);
- 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 exit;
- if (not(meleer)) then exit;
- if (findbanksymbol) then exit;
- if findtherandoms 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;
- end;
- end;
- function safe:boolean;
- var
- x,y:integer;
- begin
- result := FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2);
- end;
- procedure CheckifInDanger;
- var
- x,y,t:integer;
- begin
- if (not(loggedin)) then exit;
- if (not(OutsideCaveSaftey)) then exit;
- if FindtheRandoms then
- findnormalrandoms;
- if (gethpbarabove) and (findbanksymbol) then
- begin
- if FindtheRandoms then
- findnormalrandoms;
- marktime (t);
- repeat
- wait(400);
- if (not(loggedin)) then exit;
- if FindObjCustom(x, y, ['nter'], caveEntranceWhite, 2) then
- clickmouse2(mouse_left);
- if FindtheRandoms then
- findnormalrandoms;
- if (not(findbanksymbol)) then exit;
- if (not(getHpbarabove)) then exit;
- until(TimeFromMark(t) >= HpBarOutside);
- if (TimeFromMark(T) >= HpBarOutside) then
- begin
- if (not(findbanksymbol)) then exit;
- if (not(getHpbarabove)) then exit;
- if findbanksymbol and GetHpbarAbove then
- begin
- if FindtheRandoms then
- findnormalrandoms;
- if (GetSkillInfo(3,false) < LowHpOutside) then
- begin
- if FindtheRandoms then
- findnormalrandoms;
- gametab(tab_magic);
- waithumanclick;
- mouse(665,286,0,0,mouse_left);
- waithumanclick2;
- repeat
- if FindtheRandoms then
- findnormalrandoms;
- logout;
- if (not(loggedin)) then break;
- until (not(loggedin));
- if not(loggedin) then
- begin
- writeln('we teleported due to combat outside cave, we failed to re-enter. So....and shit sucked, terminating');
- terminatescript;
- end;
- end;
- end;
- end;
- end;
- end;
- Function CavesTime:boolean;
- begin
- 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');
- repeat
- wait(400);
- Logout;
- if gethpbarabove and OutsideCaveSaftey then
- CheckifInDanger;
- if (not(loggedin)) then break;
- until (not(loggedin));
- if (not(loggedin)) then
- begin
- writeln('zzz waiting');
- 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;
- if CavesTime then
- HandleCaveTime;
- clicktocontinue;
- end;
- end
- else
- begin
- if EntranceMode = 2 Then
- begin
- //if FindObjExX(x,y,['Enter'],[CaveColor],CaveTol,CaveCTS,CaveHue,CaveSat,70,MSX1, MSY1, MSX2, MSY2) then
- 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;
- waithumanclick3;
- clicktocontinue;
- end;
- end;
- end;
- end;
- Procedure EnterCaveLoop;
- Begin
- if (not(loggedin)) then exit;
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- If FindtheRandoms then
- findnormalrandoms;
- MakeCompass(randomrange (165, 189));
- SetAngle(0);
- waitMore;
- repeat
- waitMore;
- EnterCave;
- if CavesTime then
- HandleCaveTime;
- if OnskillScreen then
- CloseSkillScreen;
- waitMore;
- if (getHpbarabove) then exit;
- If FindtheRandoms then
- findnormalrandoms;
- waitMore;
- if (Not(Findbanksymbol)) then break;
- if (not(loggedin)) then exit;
- until (not(findbanksymbol)) or (not(loggedin));
- clicktocontinue;
- AntiBan;
- if OnskillScreen then
- CloseSkillScreen;
- If FindtheRandoms then
- findnormalrandoms;
- MakeCompass('n');
- setangle(0);
- Inc(CaveEntrances);
- exit;
- end;
- Function WalkToEdgeSouth:boolean;
- begin
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.00, 0.88);
- result := RadialWalkTolerance(1776415,100,105,70,2,2,5);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- Function WalkToEdgeSouth2:boolean;
- begin
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.00, 0.88);
- result := RadialWalkTolerance(1776415,75,110,75,2,2,5);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- Function WalktoWall:boolean;
- begin
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(16.12, 9.26);
- result := RadialWalkTolerance(15856360,324,356,75,2,2,3);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- Function WalktoWall2:boolean;
- begin
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(16.12, 9.26);
- result := RadialWalkTolerance(15856360,290,300,50,2,2,3);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- function WalktoWall3:boolean;
- begin
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(16.12, 9.26);
- result := RadialWalkTolerance(15856360,225,270,50,2,2,3);
- ColorToleranceSpeed(0);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- function NPCNearBy:boolean;
- var
- TPA:Tpointarray;
- begin // Basic function.
- TPA := GetMiniMapDots('npc');
- if (length(TPA) > 0) then
- 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 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))));
- TPA2B := TPA2
- if (Length(TPA2B) > 0) then
- begin
- P1 := MiddleTPA(TPA);
- P2 := MiddleTPA(TPA2B);
- TPA3 := TPABetweenPoints(P2,P1,1,0);
- ATPA := FindGapsTPA(TPA3,20);
- MiddleTPAEx(ATPA[i], X, Y);
- SortATPAFromSize(ATPA,1,true);
- if (length(ATPA[i]) > 0) then
- begin
- writeln('NPC far from our distance, going to run midpath');
- mouse (x,y,2,2,mouse_left);
- flag;
- end;
- end;
- end;
- procedure WalktoSafeSpot;
- begin
- if (not(loggedin)) then exit;
- MakeCompass('n');
- SetAngle(0);
- SetRun(true);
- if AtSafeSpot then exit;
- if not WalkToEdgeSouth then
- writeln('failed');
- fflag(0);
- if not WalkToEdgeSouth2 then
- writeln('failed2');
- fflag(0);
- wait(randomrange(3000,5000));
- if not WalktoWall then
- writeln('yes');
- fflag(0);
- if not WalktoWall2 then
- writeln('yes2');
- fflag(0);
- if not WalktoWall3 then
- writeln('we are in safe spot or failed');
- fflag(0);
- makecompass(randomrange(140,160));
- SetAngle(1);
- wait(randomrange(5000,7000));
- if AtSafeSpot then exit;
- end;
- procedure FixMessup;
- begin
- if findtherandoms and findtalk2 then
- findnormalrandoms;
- if (not(loggedin)) then exit;
- if (not(getHpbarabove)) then exit;
- if (Gethpbarabove) and (atsafespot) then
- begin
- if findtherandoms and findtalk2 then
- findnormalrandoms;
- if (not(getHpbarabove)) then exit;
- repeat
- wait(400);
- if findtherandoms and findtalk2 then
- findnormalrandoms;
- if findtherandoms and findtalk2 then
- findnormalrandoms;
- logout;
- if findtherandoms 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 (onskillscreen) then exit;
- if (onrangescreen) then exit;
- if (findbanksymbol) then exit;
- if (not(loggedin)) then exit;
- makecompass(randomrange(130,160));
- setangle(1);
- if (meleer) then exit;
- if (not(loggedin)) then exit;
- if (findbanksymbol) then exit;
- wait(400);
- if (onskillscreen) then exit;
- if (onrangescreen) 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 (onskillscreen) then exit;
- if (onrangescreen) then exit;
- if (not(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 findtherandoms and findtalk2 then
- findnormalrandoms;
- waitmore;
- if (Breakhandler = true) then
- takebreaks;
- waitmore;
- LocateMonster;
- if (AtSafeSpot and (not(getHpBarAbove)) and (not(Meleer))) and Loggedin then
- FixPosition;
- if GetHpBarAbove then
- begin
- if (AtSafeSpot) And (GetHpBarAbove) and (Loggedin) then
- FixMessup;
- end;
- waitmore;
- if (onrangescreen) then
- closerangescreen;
- waitmore;
- if MakeChatTabAll and (NotchatTabAll) then
- MakeMyChatTabAll;
- waitmore;
- if AlreadyWeakend then
- NPCisWeakend;
- waitmore;
- if OutofRunes then
- Termination;
- waitmore;
- if OnskillScreen 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 meleer and (not(AtSafeSpot)) and Loggedin then
- WalktoSafeSpot;
- waitmore;
- if ClicktoContinue then
- clicktocontinue;
- waitmore;
- if OnskillScreen 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 AtSafeSpot and Loggedin then
- CurseLoop;
- wait(randomrange(Waitmemory1,Waitmemory2));
- if (Not(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 OnskillScreen then
- CloseSkillScreen;
- waitmore;
- If FindtheRandoms then
- findnormalrandoms;
- waitmore;
- if (not(GetHpbarabove)) then
- Entercaveloop;
- waitmore;
- if (GetHpBarAbove) and OutsideCaveSaftey 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;
- 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 (ManualBankmm = false) then
- begin
- writeln('you have disabled both manual and automatic bankmm (Minimap) Color detection, please enable one (script cant run without 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(0);
- end;
- // 11296, 8544
- // right side, 11320, 8539
- // 11309 (x), 8551 is static here) safe spot
- 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