Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Chris
- program Script;
- {$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}
- {$I F_AntiRandoms.simba}
- var
- rang1,SpecTimer, Timer, Sleeptimer, Str1, Att1, Def1, Hp1: integer;
- PointInsideCave: tpoint;
- CaveBottomRight, CavetopRight, Cavebottomleft, Cavetopleft: tpoint;
- TimeTillSpec, TimeTillLongBreak, TimeTillBreak: string;
- DrinkTime: integer;
- DoneChest, DoneOverloads, DoneAbsobs: boolean;
- V: TVariantArray;
- MeInCave, myposinsidecave: tpoint;
- const
- bankpin = ''; // your bank pin.
- TermCheck = true; // Terminate if lost?.
- Overloads = '40'; // How many overloads to Draw?.
- Absorbs = '72'; // How many Absorb potions to withdraw? put 0 if no absorbs.
- Hopworlds = true;
- Breakhandler = true; // Enable breaking.
- BreakTime1 = 45; // Min time to play before breaking.
- BreakTime2 = 120; // max time to play before breaking.
- BreakWait1 = 5; // min time to break for,
- BreakWait2 = 15; // max time to break for. (random range).
- SleepBreaks = true; // Sleep breaks, initiates after long hours of gameplay.
- SleepBreak1 = 8; // Min timeto play before starting a sleep break.
- SleepBreak2 = 12; // Max time to play before starting a sleep breka.
- SleepWait1 = 2; // Min time to sleep for ** TIME IN HOURS NOT MINUTES*
- SleepWait2 = 4; // Max time to sleep for (random range).
- DoSpecs = true;
- ReSpecTime1 = 75000; // Takes the Spec Bar 5 minutes to recharge to full
- ReSpectime2 = 300000; // add in extra seconds of your own for randomness!
- procedure playerSetup;
- begin
- HowManyPlayers := 1;
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0;
- Players[0].Name := ''; //username
- Players[0].Pass := ''; // password
- Players[0].Nick := '>'; // nickname (4 letters).
- Players[0].Active := True;
- end;
- procedure WaitHumanClick;
- begin
- case random(600) of
- 1..450: Wait(RandomRange(400, 600));
- 451..570: Wait(RandomRange(400, 600));
- 571..590: Wait(RandomRange(600, 800));
- 591..600: Wait(RandomRange(800, 1000));
- end;
- end;
- procedure WaitHumanClick2;
- begin
- case random(600) of
- 1..450: Wait(RandomRange(1000, 1500));
- 451..570: Wait(RandomRange(1500, 2000));
- 571..590: Wait(RandomRange(2000, 2500));
- 591..600: Wait(RandomRange(2500, 3000));
- end;
- end;
- procedure WaitHumanClick3;
- begin
- 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;
- function GetGreenUptext: string;
- var
- WhiteT, BlueT, YellowT, OrangeT, GreenT, FoundText: string;
- begin
- WhiteT := GetTextAtExWrap(8, 8, 300, 21, 0, 5, 1, 14541281, 55, 'UpChars07');
- BlueT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 13423640, 65, 'UpChars07');
- YellowT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 1235160, 40, 'UpChars07');
- OrangeT := GetTextAtExWrap(35, 8, 300, 21, 0, 5, 1, 4687583, 53, 'UpChars07');
- GreenT := GetTextAtExWrap(8, 8, 300, 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;
- 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 OpenWScreen: Boolean;
- begin
- Result := False;
- if WorldScreen then
- exit;
- if Loggedin then
- Exit;
- if not WorldScreen then
- begin
- Mmouse(54, 475, 1, 1);
- WaitHumanClick;
- ClickMouse2(Mouse_Left);
- waithumanclick;
- Result := True;
- end;
- end;
- function whitecolor: boolean;
- var
- Monster: TpointArray;
- TmpCts: Integer;
- begin
- tmpcts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.22, 1.69);
- result := FindColorsTolerance(Monster, 9163999, 192, 67, 583, 469, 4);
- ColorToleranceSpeed(tmpcts);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- procedure loginloop;
- var
- badworlds: TIntegerArray;
- OurCurrentworld: Integer;
- begin
- badworlds := [308,316,325,337,365];
- OpenWorldScreen;
- repeat
- if whitecolor then // If we have our mouse hovering a clickable world then breaks the loop
- break;
- if not whitecolor then
- writeln('We have not hovered a world yet');
- case random(10) of
- 0..2: mouse(randomrange(397, 554), randomrange(78, 394), 1, 1, mouse_move);
- 3..4: mouse(randomrange(298, 462), randomrange(200, 392), 1, 1, mouse_move);
- 5..6: mouse(randomrange(205, 555), randomrange(80, 154), 1, 1, mouse_move);
- 7..10: mouse(randomrange(211, 555), randomrange(246, 367), 1, 1, mouse_move);
- end;
- until (whitecolor)
- if whitecolor then
- begin
- clickmouse2(mouse_left); // Clicks the world as it is selected.
- waithumanclick;
- currentworld;
- waithumanclick;
- OurCurrentworld := CurrentWorldLS // Finds what our current world is
- waithumanclick;
- if InIntArray(Badworlds,OurCurrentworld) then // If its a bad one then exists
- exit; // Bads are: f2p, Pvp and high risk world
- waithumanclick;
- loginplayer; // if not then it logs in and resumes script.
- exit;
- end;
- end;
- function InsideCave: boolean;
- var
- TPA: TpointArray;
- tmpcts: integer;
- begin
- if (not (loggedin)) then
- exit;
- tmpcts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.12, 1.41);
- result := FindColorsTolerance(TPA, 1743843, MMX1, MMY1, MMX2, MMY2, 1);
- ColorToleranceSpeed(tmpcts);
- SetColorSpeed2Modifiers(0.2, 0.2);
- end;
- function HpLevel: integer;
- var
- s,S2: string;
- CurrentHpLevel,CurrentHpLevel2, CurrentHP: integer;
- begin
- if not LoggedIn then
- exit;
- if not InsideCave then
- exit;
- s := GetTextAtExWrap(520, 50, 540, 70, 0, 5, 1, 65525, 0, statchars07);
- S2:= GetTextAtExWrap(520, 50, 540, 70, 0, 5, 1, 65280, 0, statchars07);
- CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
- CurrentHpLevel2:= StrToIntDef(GetNumbers(s2), - 1);
- if (CurrentHpLevel > 0) then
- CurrentHP := CurrentHpLevel;
- if (CurrentHpLevel2 > 0) then
- CurrentHP := CurrentHpLevel2;
- if (CurrentHP > 0 ) then
- begin
- result := CurrentHP
- end;
- end;
- procedure WaitAfterOverLoadClick;
- var
- WaiTMe, T: Integer;
- begin
- WaitMe := randomrange(4000, 300000);
- writeln(waitme);
- marktime(t);
- repeat
- wait(400);
- if not insidecave then exit;
- if (TimeFromMark(t) >= (WaitMe)) then
- exit;
- until (TimeFromMark(t) >= (WaitMe));
- end;
- function FindObject(Color: TintegerArray; Tol, CTS: integer; hMoD, sMoD: extended; split, sort: integer; 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;
- gametab(tab_inv);
- 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, split, TPAA);
- SortATPAFromSize(TPAA, sort, true);
- for I := 0 to High(TPAA) do
- begin
- MiddleTPAEx(TPAA[i], X, Y);
- MMouse(x, y, RandomRange( - 3, 3), RandomRange( - 3, 3));
- if WaitUpTextMulti2(uptext, WaitUptextWait + random(WaitUptextRandom)) then
- begin
- Result := True;
- break;
- end;
- break;
- end;
- end;
- function Absorbed: boolean;
- begin
- if not loggedin then
- exit;
- if not insidecave then
- exit;
- result := FindTextTPAMulti(2070783, 0, MSX1, MSY1, MSX2, MSY2, ['Absorption'], StatChars07, nothing);
- end;
- procedure clickoverload;
- begin
- if not loggedin then
- exit;
- if not insidecave then
- exit;
- writeln('we are here1');
- gametab(tab_inv);
- if absorbed then
- begin
- case random(10) of
- 0..6: writeln('not waiting for overload...continue');
- 7..10: WaitAfterOverLoadClick;
- end;
- end;
- if FindObject([921106], 1, 2, 0.00, 3.41, 1, 1, ['Drink', 'rink', 'verload', 'Overload'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
- begin
- writeln('yes!');
- clickmouse2(mouse_left);
- wait(randomrange(5000, 10000));
- if absorbed then
- begin
- case random(10) of
- 0..6: writeln('not waiting for overload...continue');
- 7..10: WaitAfterOverLoadClick;
- end;
- end;
- end;
- end;
- procedure clickAbsorp;
- begin
- if not loggedin then
- exit;
- if not insidecave then
- exit;
- gametab(tab_inv);
- case random(10) of
- 0..6:
- begin
- if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
- clickmouse2(mouse_left);
- if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
- clickmouse2(mouse_left);
- if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
- clickmouse2(mouse_left);
- DrinkTime := Randomrange(400, 800);
- end;
- 7..8:
- begin
- if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
- clickmouse2(mouse_left);
- if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
- clickmouse2(mouse_left);
- DrinkTime := Randomrange(400, 800);
- end;
- 9..10:
- begin
- if FindObject([11248528], 15, 2, 0.05, 0.27, 1, 1, ['Drink', 'rink', 'Absoprtion', 'bsorption'], 300, 150, MIX1, MIY1, MIX2, MIY2) then
- clickmouse2(mouse_left);
- DrinkTime := Randomrange(400, 800);
- end;
- end;
- end;
- function AbsorPoints: integer;
- var
- s: string;
- CurrentHpLevel: integer;
- begin
- s := GetTextAtExWrap(0, 35, 60, 60, 0, 5, 1, 16777215, 0, NMZ);
- CurrentHpLevel := StrToIntDef(GetNumbers(s), - 1);
- if (CurrentHpLevel > 0) then
- begin
- result := CurrentHpLevel
- end;
- end;
- procedure ProgressReport;
- var
- Total, timeleft, Timeleft2,rang2,rangph, Timeleft3, timegone, Def3, Att2, Def2, Str2, Hp2, HpPerHour, DefPH, AttPh, StrPh: integer;
- begin
- if (not (loggedin)) then
- exit;
- ClearDebug;
- timegone := (GetTimeRunning / 1000);
- Att2 := (R_GetSkillExp(SKILL_ATTACK) - Att1);
- Def2 := (R_GetSkillExp(SKILL_DEFENCE) - Def1);
- Str2 := (R_GetSkillExp(SKILL_STRENGTH) - str1);
- Hp2 := (R_GetSkillExp(SKILL_HITPOINTS) - Hp1);
- Rang2 := (R_GetSkillExp(Skill_range) - rang1);
- Def3 := R_GetSkillExp(SKILL_DEFENCE);
- timeleft := ((Timer) - (GetTimeRunning));
- HpPerHour := (3600 * (Hp2)) / ((timegone));
- AttPh := (3600 * (Att2)) / ((timegone));
- StrPh := (3600 * (STr2)) / ((timegone));
- DefPh := (3600 * (Def2)) / ((timegone));
- Rangph:= (3600 * (Rang2)) / ((timegone));
- WriteLn('* Runtime: ' + TimeRunning);
- Writeln('*');
- writeln('* Att EXP Gained: ' + IntToStr(Att2) + ' Att Exp P/H: ' + IntToStr(Attph));
- writeln('* Str ExP Gained: ' + IntToStr(Str2) + ' str Exp P/H: ' + IntToStr(StrPh));
- writeln('* Def ExP Gained: ' + IntToStr(Def2) + ' Def Exp P/H: ' + IntToStr(DefPh));
- writeln('* Hp ExP Gained: ' + IntToStr(Hp2) + ' Hp Exp P/H: ' + IntToStr(HpPerHour));
- writeln('* Rang ExP Gained: ' + IntToStr(Rang2) +' Rang Exp P/H: ' + IntToStr(Rangph));
- 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;
- 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);
- 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..48:
- begin
- Keyboards;
- end;
- 49..56:writeln('doing nothing');
- 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;
- 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;
- procedure idle;
- var
- HpBarOutside, t: integer;
- begin
- writeln('entered idle mode..');
- marktime(t);
- HpBarOutside := randomrange(3000, 10000);
- repeat
- wait(400);
- if not InsideCave then
- exit;
- if not loggedin then
- exit;
- if srl_InFight then
- exit;
- until (TimeFromMark(T) >= HpBarOutside);
- if (TimeFromMark(T) >= HpBarOutside) then
- begin
- writeln('we entered idling methhod, spinning camera and shit');
- antiban;
- end;
- end;
- procedure InsideCaveloop;
- begin
- if not InsideCave then
- exit;
- writeln('we have started the script while inside the cave, taking our current position as Safe spot/default area as the cave parts');
- repeat
- wait(2000);
- if not loggedin then
- exit;
- if not InsideCave then
- exit;
- progressreport;
- if (R_GetSkillLevel(SKILL_HITPOINTS) >= 59) then
- // if (HpLevel >= 51) then
- clickoverload;
- if not R_IsAutoRetaliateOn then
- Retaliate(true);
- if (not Absorbed) then
- begin
- if not InsideCave then
- exit;
- if not loggedin then
- exit;
- writeln('we dont have absorb colors clicking absorb!');
- ClickAbsorp;
- waithumanclick;
- ClickAbsorp;
- waithumanclick;
- ClickAbsorp;
- waithumanclick;
- ClickAbsorp;
- waithumanclick;
- end;
- if (AbsorPoints <= DrinkTime) then
- begin
- ClickAbsorp;
- waithumanclick;
- ClickAbsorp;
- waithumanclick;
- ClickAbsorp;
- waithumanclick;
- ClickAbsorp;
- waithumanclick;
- end;
- until (not InsideCave);
- if not InsideCave then
- exit;
- if not loggedin then
- exit;
- if not srl_InFight then
- idle;
- end;
- procedure Termination(const Status: string);
- begin
- if (TermCheck = false) then
- exit;
- writeln(Status);
- if loggedin then
- begin
- if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
- terminatescript
- else
- terminatescript;
- end
- else
- terminatescript;
- end;
- function LogMeOut: boolean;
- begin
- writeln('Logging out..');
- if WaitFunc(@ LogOut, 500, RandomRange(8000, 20000)) then
- begin
- writeln('We have managed to log out');
- result := true;
- end
- else
- termination('We have failed to log out, ending script');
- end;
- procedure GraboriginalExp;
- begin
- writeln('we started the script loggedin.. Grabbing original exp for progress report!');
- Att1 := R_GetSkillExp(SKILL_ATTACK);
- Def1 := R_GetSkillExp(SKILL_DEFENCE);
- Str1 := R_GetSkillExp(SKILL_STRENGTH);
- Hp1 := R_GetSkillExp(SKILL_HITPOINTS);
- Rang1:= R_GetSkillExp(SKILL_RANGE);
- end;
- function smartSetAsTarget(pid: integer): boolean;
- begin
- result := true;
- try
- setEIOSTarget('libsmartremote', intToStr(pid));
- writeln('smartSetAsTarget(): Succesfully set SMART['+ intToStr(pid) +'] as Simba''s target');
- except
- writeln('smartSetAsTarget(): Failed to set SMART['+ intToStr(pid) +'] as Simba''s target');
- result := false;
- end;
- end;
- procedure SetupCorrectPlayer(whichPlayer:Integer);
- Var
- OurCurrentplayer:integer;
- begin
- OurCurrentplayer := currentPlayer;
- If (OurCurrentplayer <> whichPlayer) then
- begin
- NextPlayer(Players[CurrentPlayer].Active);
- OurCurrentplayer := currentPlayer;
- If (OurCurrentplayer = whichPlayer) then
- writeln('we switched to our proper next player');
- end;
- end;
- procedure setuprealclient;
- begin
- SetupCorrectPlayer(0);
- if (smartCurrentPID <> 8244) then
- begin
- smartFreeCurrentClient;
- smartSetAsTarget(8244);
- waithumanclick;
- if (smartCurrentPID = 8244) then
- writeln('we managed to pair up to the corrent client')
- else Termination('we failed to pair to the correct smart main client');
- end;
- end;
- begin
- playerSetup;
- setupsrl;
- SetupReflection;
- //
- //setuprealclient;
- R_CombatRandoms := false;
- SRL_CombatRandoms := false;
- DrinkTime := Randomrange(200, 800);
- GraboriginalExp;
- repeat
- wait(400);
- if InsideCave then
- InsideCaveloop
- else Termination('We are not inside cave');
- until (false);
- end.
Advertisement
Add Comment
Please, Sign In to add comment