/////////////////////////////////////////////////////////////////////// // // // READ THE DIRECTIONS IN THE OP FIRST OR ELSE // // Make sure you have setup your player file // // Under SRL>PlayerManager // // Press Play // // // /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// // // // Don't touch below this line unless you know what you're doing!! // // // /////////////////////////////////////////////////////////////////////////////////////////// program AshamanBonfire; {$IFDEF RAYMONDPOWNS}{wrappers} function FloodFillTPAWrap(const TPA: TPointArray): T2DPointArray; var tempATPA: T2DPointArray; begin tempATPA:= FloodFillTPA(TPA); Result:= tempATPA; SetLength(tempATPA, 0); end; function FindTPAEdges(const p: TPointArray): TPointArray; begin FindTPAEdgesWrap(p, result); end; Function RotatePoints(Const P: TPointArray; A, cx, cy: Extended): TPointArray; begin RotatePointsWrap(P, A, cx, cy, result); end; function TPAFromCircle(const CX, CY, Radius: Integer): TPointArray; begin TPAFromCircleWrap(CX, CY, Radius, result); end; function TPAFromEllipse(const CX, CY, XRadius, YRadius : Integer): TPointArray; begin TPAFromEllipseWrap(CX, CY, XRadius, YRadius, result); end; function TPAFromBox(const Box : TBox) : TPointArray; begin TPAFromBoxWrap(Box, result); end; Function ReturnPointsnotInTPA(Const TotalTPA: TPointArray; const Box: TBox): TPointArray; begin ReturnPointsnotInTPAWrap(TotalTPA, Box, result); end; function CombineIntArray(const Ar1, Ar2: TIntegerArray): TIntegerArray; begin CombineIntArrayWrap(Ar1, Ar2, result); end; function ReArrangeandShortenArray(const a: TPointArray; Dist: Integer): TPointArray; begin ReArrangeandShortenArrayWrap(a, Dist, result); end; function ReArrangeandShortenArrayEx(const a: TPointArray; w, h: Integer): TPointArray; begin ReArrangeandShortenArrayExWrap(a, w, h, result); end; function CombineTPA(const Ar1, Ar2: TPointArray): TPointArray; begin CombineTPAWrap(Ar1, Ar2, Result); end; function RemoveDistTPointArray(x, y, dist: Integer;const ThePoints: TPointArray; RemoveHigher: Boolean): TPointArray; begin RemoveDistTPointArrayWrap(x, y, dist, ThePoints, RemoveHigher, Result); end; function TPAFromText(const text, font: String; var w,h: Integer): TPointArray; begin TPAFromTextWrap(text, font, w, h, result); end; function GetColors(const Coords: TPointArray): TIntegerArray; begin GetColorsWrap(Coords, Result); end; function Explode(del, str: string): TStringArray; begin ExplodeWrap(del, str, Result); end; function MergeATPA(const ATPA : T2DPointArray): TPointArray; begin MergeATPAWrap(ATPA, Result); end; function SplitTPA(arr : TPointArray; dist : Integer) : T2DPointArray; begin SplitTPAWrap(arr, dist, result); end; function SplitTPAEx(arr : TPointArray; w, h : integer) : T2DPointArray; begin SplitTPAExWrap(Arr, w, h, result); end; function ClearTPAFromTPA(arP, ClearPoints : TPointArray) : TPointArray; begin ClearTPAFromTPAWrap(arP, ClearPoints, result); end; function TPAToATPAEx(arP : TPointArray; w, h : integer) : T2DPointArray; begin TPAtoATPAExWrap(arP, w, h, result); end; function TPAToATPA(arP : TPointArray; dist : Integer) : T2DPointArray; begin TPAtoATPAWrap(arP, dist, result); end; function FindGapsTPA(TPA : TPointArray; MinPixels : integer) : T2DPointArray; begin FindGapsTPAWrap(tpa, MinPixels, result); end; {$ENDIF} {$Define SMART} {$I SRL-6/SRL.Simba} {$i srl-6/lib/misc/srlplayerform.simba} {$I SPS/lib/SPS-RS3.Simba} var logCount, XP, startingExperience, spirits, XPH, logsPH: extended; currentBTime, timeout, reset: TTimeMarker; w, x, y, z, breakRounds, totalBreaks, realBTime: integer; logDTM, timeoutLength, resetLength: integer; debug, failsafe, lightlogs, normalbank: boolean; functionStop: string; const scriptVersion = '3.71'; POSDebug = False; procedure declarePlayers(); var i,j: integer; begin players.setup(playerForm.playerNames, playerForm.playerFile); // load the SPF players from the SRL Player Manager currentPlayer := 0; // player to use first // set player attributes based on the settings from the form for i := 0 to high(players) do with players[i] do begin // convert the integers integers[0] := strToInt(playerForm.players[i].settings[1]); //minutes until break integers[1] := strToInt(playerForm.players[i].settings[2]); //minutes to break World := 100; //world if (playerForm.players[i].settings[10] = 'Normal') then normalBank := true; if not normalBank then for j := 0 to high(playerForm.comboBoxItems[1]) do //quickload if (playerForm.players[i].settings[10] = playerForm.comboBoxItems[1][j]) then integers[2] := j+2; // booleans booleans[0] := strToBool(playerForm.players[i].settings[3]); //take breaks booleans[1] := strToBool(playerForm.players[i].settings[5]); //find spirits FindMod := strToBool(playerForm.players[i].settings[4]); //logmod lightlogs := strToBool(playerForm.players[i].settings[8]); //light logs failsafe := strToBool(playerForm.players[i].settings[6]); //failsafe debug := strToBool(playerForm.players[i].settings[7]); //debug // any other data types you've decided to use strings[0] := playerForm.players[i].settings[0]; //quickkey strings[1] := playerForm.players[i].settings[9]; //logtype end; end; procedure initPlayerForm(); begin with playerForm do begin name := 'AshamanBonfire v'+toStr(ScriptVersion); scriptHelpThread := ''; scriptSettingsPath := ''; editBoxLabels := ['QuickKey', 'Minutes until Break', '# of Minutes to Break']; editBoxDefaults := [ '0', '600', '15']; checkBoxLabels := ['Take Breaks', 'Logout if Mod is near', 'Find Spirits', 'Timeout Failsafe', 'DebugMode', 'Light Logs']; checkBoxDefaults := ['True','True','True', 'True', 'False', 'True']; comboBoxLabels := ['LogType','QuickLoad']; comboBoxDefaults := ['Maple','Normal']; setLength(comboBoxItems, length(comboBoxLabels)); comboBoxItems[0] := ['Normal', 'Oak', 'Willow', 'Teak', 'Maple', 'Mahogany', 'Eucalyptus', 'Yew', 'Magic', 'Elder']; comboBoxItems[1] := ['Normal', 'PRESET_1', 'PRESET_2']; end; end; procedure setDTMs; begin FUNCTIONSTOP:='SetDTMs ENTERED'; logDTM := DTMFromString('mwQAAAHic42RgYOAFYmkgFgVibgYI4ILyZYBYEqpGFCrHAlUHEhcDYj4gZgViFx1OIMkIxExImBFJjJEhBaoWH2YkAsMBABO8AjM='); w := (players[currentPlayer].integers[0] * 60000); x := (players[currentPlayer].integers[1] * 60000); y := RandomRange(-13 * 60000, 13 * 60000); z := RandomRange(-7 * 60000, 7 * 60000); FUNCTIONSTOP:='SetDTMs EXIT'; end; procedure fr33DTMs; begin freeDTM(logDTM); end; function breakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): boolean; var H,M,S: Integer; begin FUNCTIONSTOP:='BREAK ENTERED'; if not IsLoggedIn then Exit; if (GetTimeRunning < ((W) + (Y) + BreakRounds)) then Exit else if (GetTimeRunning > ((W) + (Y) + BreakRounds)) then begin RealBTime := Round((X+Z)/60000); Writeln('Taking a break for about ' + IntToStr(RealBTime) + ' minutes.'); players[currentPlayer].Logout; CurrentBTime.Reset; CurrentBTime.Start; Repeat Wait(21000); ConvertTime((X+Z)-CurrentBTime.GetTime,H,M,S); Writeln('Breaktime left: '+IntToStr(H)+':'+IntToStr(M)+':'+IntToStr(S)); Until(CurrentBTime.GetTime>(X+Z)); Writeln('Logging in.'); players[currentPlayer].Login; Wait(4000); Timeout.Start; Reset.Start; Result := IsLoggedIn; Minimap.ClickCompass; MainScreen.SetAngle(MS_ANGLE_HIGH); IncEx(BreakRounds, (W) + (X)); Inc(TotalBreaks); Writeln('The next break will occur in about ' + IntToStr(players[currentPlayer].integers[0]) + ' minutes.'); W := (players[currentPlayer].integers[0] * 60000); X := (players[currentPlayer].integers[1] * 60000); Y := RandomRange(-13 * 60000, 13 * 60000); Z := RandomRange(-7 * 60000, 7 * 60000); end; FUNCTIONSTOP:='BREAK EXIT'; end; function grabMaps: Boolean; var Map: String; //Map Locations Name: String; //Map Names SPSFile: LongInt; begin Name:= IncludePath + 'SPS\img\runescape_surface\0_0SP.png'; Map:= 'http://img607.imageshack.us/img607/3805/c7l2.png'; begin if (not FileExists(Name)) then begin writeln('No file, downloading'); SPSFile:=CreateFile(Name); CloseFile(SPSFile); SPSFile:= RewriteFile(Name, False); WriteFileString(SPSFile, GetPage(Map)); CloseFile(SPSFile); end; end; Result:= (FileExists(IncludePath + 'SPS\img\runescape_surface\0_0SP.png')); end; procedure requirementsCheck; begin if (not GrabMaps) then RaiseException(erCustomError, 'SPS Maps Do not Exist OR They Are Named Incorrectly!'); end; {******************************************************************************* Function AutoupdateMe; By: Shuttleu Edited By: Ashaman88 Description: Autoupdates Script. *******************************************************************************} procedure AutoUpdateMe; var Neifile: Integer; OnlineVersion, NewScript, NeiFeilNennen: String; begin Writeln('Checking for script updates...'); OnlineVersion := GetPage('http://ashamanbonfire.googlecode.com/git/Version.txt'); Writeln(OnlineVersion); Writeln(ScriptVersion) if (trim(OnlineVersion) > ScriptVersion) then begin WriteLn('Newer script version online!'); WriteLn('Autoupdating to newer version.'); NewScript := GetPage('http://ashamanbonfire.googlecode.com/git/AshamanBonfire.simba'); NeiFeilNennen := ScriptPath+ 'AshamanBonfire V'+OnlineVersion+'.simba'; Neifile := Rewritefile(NeiFeilNennen, true); Try WriteFileString(Neifile, NewScript); Except begin WriteLn('Fatal error writing to '+NeiFeilNennen+'!!'); Terminatescript; end; end; CloseFile(Neifile); WriteLn('New script downloaded to '+NeiFeilNennen+'!! Please use this one!!'); TerminateScript; end else WriteLn('You have the latest version of the script!'); end; function firePresent: boolean; var MB: TBox; TPA: TPointArray; fireColors: T2DColorData; begin if not isLoggedIn then exit; MB := mainscreen.playerBox; MB.edit(-80, -80, +80, +80); //logs //yeller fireColors := [[1938904, 9, [2, [0.24, 2.64, 0.00]]], [7137516, 12, [2, [0.14, 1.91, 0.00]]]]; if (fireColors.gatherIn(tpa, mb)) then result := length(tpa)>50; setlength(tpa,0); end; procedure printSmart; begin SmartImage.Clear; SmartImage.DrawText('==========AshamanBonfire==========',Point(11,319),clWhite); SmartImage.DrawText('============Version: '+ScriptVersion+'============',Point(11,319+10),clWhite); SmartImage.DrawText('Time Running: ' + ToStr(TimeRunning),Point(11,319+20),clWhite); SmartImage.DrawText('Experience Earned: ' +ToStr(XP),Point(11,319+30),clWhite); SmartImage.DrawText('Experience/Hour: ' + ToStr(XPH),Point(11,319+40),clWhite); SmartImage.DrawText('==================================',Point(11,319+50),clWhite); if Spirits > 0 then SmartImage.DrawText('Spirits Freed: ' + ToStr(Spirits),Point(11,319+60),clWhite); end; function TRSChatBox.getXP: Integer; var b: TBox; s: String; tpa : TPointArray; atpa : T2DPointArray; i,cts,p,p2: Integer; begin result := -1; b := [self.x2 - 199, self.y1 + 10, self.x2, self.y2 - 92]; findColorsTolerance(tpa, 14013909, b, 4, colorSetting(2, 0.00, 0.00)); if length(tpa) < 2 then begin print('chatBox.getXP(): No XP found', TDebug.SUB); exit; end; atpa := tpa.cluster(10); atpa.sortBySize; b := atpa[low(atpa)].getbounds; b.edit(-2,-2,+2,+3); s := Replace(tesseractgettext(b.x1,b.y1,b.x2,b.y2, FILTER_SMALL_CHARS_2), ' ', '', [rfReplaceAll]); P := Pos('x', S); P2 := Pos('X', S); if (P > 0) Or (P2 > 0) then Result := StrToIntDef(ExtractFromStr(Copy(s, P, Length(S)), Numbers), 0) else Result := StrToIntDef(ExtractFromStr(S, Numbers), 0); print('chatBox.getXP(): XP found: ' + tostr(result), TDebug.SUB); end; procedure progressReport; begin if not Debug then ClearDebug; XP := (ChatBox.GetXP - Round(StartingExperience)); XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0))); LogsPH := Round((LogCount * (3600.0 / (GetTimeRunning / 1000.0)))); writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|'); writeln('| AshamanBonfire v'+PadR(toStr(ScriptVersion), 24), '|'); writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|'); writeln(PadR('| Running For: '+TimeRunning, 60)+'|'); writeln(PadR('| '+players[currentPlayer].strings[1]+'''s Burned: ' + GroupDigits(LogCount,','), 40) + padR('Logs/H: ' + GroupDigits(LogsPH,','), 20) + '|'); writeln(PadR('| Exp Earned: ' + GroupDigits(XP,','), 40) + padR('Exp/Hour: ' + GroupDigits(XPH,','), 20) + '|'); writeln('|___________________________________________________________|'); writeln('|___________________________________________________________|'); Timeout.Start; Reset.Start; PrintSmart; end; function countLogs: integer; var X,Y,I: Integer; begin FUNCTIONSTOP := 'COUNTLOGS ENTERED'; result := tabBackpack.countDTM(LogDTM); if debug then Writeln(ToStr(Result)+' logs found in inventory'); FUNCTIONSTOP:='COUNTLOGSEXIT'; end; Function BankShantay: Boolean; var P: TPoint; T: TTimeMarker; Time: Integer; begin FUNCTIONSTOP:='BANKSHANTAY ENTERED'; if not IsLoggedIn then Exit; if (ChooseOption.IsOpen) then mouseOffClient(4); T.Start; if (not Bankscreen.Open(BANK_CHEST_SHANTAY)) And (not BankScreen.IsOpen) then begin if (Length(Minimap.GetDots(MM_DOT_NPC,Minimap.GetBounds))>0) And ((CountColorTolerance(459779,Minimap.GetBounds,10)>5000) Or (CountColorTolerance(1774084,Minimap.GetBounds,10)>5000))then begin players[currentPlayer].ExitToLobby; Wait(RandomRange(2000,3000)); if not players[currentPlayer].Login then if failsafe then TerminateScript; Wait(RandomRange(2000,3000)); Minimap.ClickCompass; MainScreen.SetAngle(MS_ANGLE_HIGH); Wait(RandomRange(2000,3000)); Timeout.Start; end else if SPS.BlindWalk(Point(110,126)) then begin While (Minimap.IsPlayerMoving) And (T.GetTime < GaussRangeInt(10000,20000)) Do Wait(1000); if (not Bankscreen.Open(BANK_CHEST_SHANTAY)) And (not BankScreen.IsOpen) then Exit; end else if Minimap.FindSymbol(P,MM_SYMBOL_BANK, Minimap.GetBounds) then begin Mouse(X+10+GaussRangeInt(-2,2),Y-10+GaussRangeInt(-2,2),Mouse_Left,Mouse_Human); Wait(RandomRange(5000,9000)); Minimap.ClickCompass; MainScreen.SetAngle(MS_ANGLE_HIGH); if (not Bankscreen.Open(BANK_CHEST_SHANTAY)) And (not BankScreen.IsOpen) then Exit; end else begin Mouse(Point(628,150),Mouse_Left,Mouse_Human); FastClick(Mouse_left); Wait(GaussRangeInt(3000,6000)); if (not Bankscreen.Open(BANK_CHEST_SHANTAY)) And (not BankScreen.IsOpen) then Exit; end; end; Time:=GaussRangeInt(3000,8000); T.Start; Repeat if not IsLoggedIn then Exit; if T.GetTime>Time then begin if Debug then Writeln('Took too long to open bank'); Exit; end; Wait(Random(100)); Until BankScreen.IsOpen Or PinScreen.IsOpen; PinScreen.Enter(players[currentPlayer].BankPin); if normalbank then if BankScreen.GetPackCount > 0 then BankScreen.QuickDeposit(QUICK_DEPOSIT_INVENTORY); T.Start; Repeat Wait(Random(100)); if normalbank then begin if BankScreen.Withdraw(10, WITHDRAW_AMOUNT_ALL, ['']) then Break; end else If bankScreen.clickButton(Players[CurrentPlayer].Integers[2]) Then Break; if not IsLoggedIn then Exit; if T.GetTime>Time then begin Writeln('Out of logs'); Writeln('Screenshot saved, send to Ashaman if you"re not really out of logs!'); SaveScreenshot(ScriptPath + '/fail_.bmp'); if failsafe then TerminateScript; end; Until False; if normalBank then BankScreen.Close else begin t.start; Time:=GaussRangeInt(4000, 8000); Repeat if not bankScreen.__find() then Break; If (T.GetTime>Time) Or (Not IsLoggedIn) Then Exit; Wait(GaussRangeInt(0, 200)); Until False; end; T.Start; Repeat Wait(Random(152)); if not IsLoggedIn then Exit; if T.GetTime>Time then begin Writeln('Inventory still not full, WTF??'); SaveScreenshot(ScriptPath + '/fail_.bmp'); if failsafe then TerminateScript; end; Until (TabBackpack.IsItemInSlot(28)); Result:=True; FUNCTIONSTOP:='BANKSHANTAY EXIT'; end; function TSPSArea.walkToPos2(pos: TPoint; playerPos: TPoint): boolean; var p: TPoint; begin result := false; if (SPS_PosToMM(pos, playerPos, p)) then begin result := true; // if distance is less than 10 then there is no real point walking. if (distance(p, minimap.getCenterPoint()) < 1) then exit; mouse(p, MOUSE_LEFT); if (minimap.isFlagPresent(3000 + random(500))) then while (minimap.isPlayerMoving()) do minimap.waitPlayerMoving(); if (minimap.isFlagPresent()) then //case failed minimap.waitPlayerMoving(); end; print('TSPSArea.walkToPos(): result = '+boolToStr(result)); end; procedure MoveAway; begin FUNCTIONSTOP:='MOVEAWAY ENTERED'; if not IsLoggedIn then Exit; if (Length(Minimap.GetDots(MM_DOT_NPC,Minimap.GetBounds))>0) And ((CountColorTolerance(459779,Minimap.GetBounds,10)>5000) Or (CountColorTolerance(1774084,Minimap.GetBounds,10)>5000))then begin players[currentPlayer].ExitToLobby; Wait(RandomRange(2000,3000)); if not players[currentPlayer].Login then if failsafe then TerminateScript; Wait(RandomRange(2000,3000)); Minimap.ClickCompass; MainScreen.SetAngle(MS_ANGLE_HIGH); Wait(RandomRange(2000,3000)); Timeout.Start; end; Case GaussRangeInt(0,5) Of 0: SPS.walkToPos2(Point(109,124),SPS.getPlayerPos()); 1: SPS.walkToPos2(Point(108,124),SPS.getPlayerPos()); 2: SPS.walkToPos2(Point(109,128),SPS.getPlayerPos()); 3: SPS.walkToPos2(Point(108,128),SPS.getPlayerPos()); 4: SPS.walkToPos2(Point(108,124),SPS.getPlayerPos()); end; FUNCTIONSTOP:='MOVEAWAY EXIT'; end; Function lightFire:Boolean; begin FUNCTIONSTOP:='LIGHTFIRE ENTERED'; if not IsLoggedIn then Exit; if TabBackpack.ClickDTM(LogDTM,Mouse_Right,'ight',0,False) then if TabBackpack.WaitForShift(GaussRangeInt(3000,4000)) then begin Result:= True; Wait(GaussRangeInt(3000,6000)); end else MoveAway; FUNCTIONSTOP:='LIGHTFIRE EXIT'; end; Function FindFire: Boolean; var I: Integer; T: TTimeMarker; begin FUNCTIONSTOP:='FINDFIRE ENTERED'; if not IsLoggedIn then Exit; Result:=False; ExitSquealOfFortune; ClaimSpinTicket; Wait(Random(100)); For I:=0 To 1 Do if FindDTM(LogDTM,X,Y,TabBackpack.GetBounds) then begin if (WaitFunc(@FirePresent,100,RandomRange(6000,7000))) or (not lightlogs) then begin SendKeys(players[currentPlayer].strings[0], 60 + Random(60), 60 + Random(60)); Wait(GaussRangeInt(0, 100)); if Toolscreen.IsOpen(RandomRange(3000,6000)) then begin ToolScreen.Select('bonfire'); Result:= TabBackpack.WaitForShift(GaussRangeInt(2000,4000)); if Result then Exit else begin if (I=1) and (lightLogs) then begin MoveAway; LightFire; end else Wait(GaussRangeInt(8000,9000)); end; end; end else begin MoveAway; LightFire; end; end; FUNCTIONSTOP:='FINDFIRE EXIT'; end; function findSpirit: boolean; var I,H,X,Y: Integer; mb: TBox; TPA,TPa2 : TPointArray; ATPA : T2DPointArray; spiritColors: T2DColorData; begin FUNCTIONSTOP:='FINDSPIRIT ENTERED'; if not IsLoggedIn then Exit; Result:=False; mb:=Mainscreen.PlayerBox; mb.Edit(-35,-35,+35,+35); //lighter darker spiritColors := [[6663398, 3, [2, [0.37, 1.38, 0.00]]], [5602513, 8, [2, [0.24, 1.84, 0.00]]]]; if not (spiritColors.gatherIn(tpa, mb)) then exit(false); ATPA := TPA.Cluster(4); ATPA.FilterBetween(0,10); ATPA.SortBySize; SetLength(TPA,0); smartimage.clear; SmartImage.DebugATPA(ATPA); H := High(ATPA); For I := 0 To H Do begin Writeln('length of possible spirit: '+tostr(Length(ATPA[i]))); writeln('density of possible spirit: ' + toStr(atpa[i].getDensity)); if (atpa[i].getDensity > 0.8) or (atpa[i].getDensity < 0.2) then continue; MiddleTPAEx(ATPA[I],X,Y); if (ChooseOption.IsOpen) then begin if Debug then Writeln('Closing options menu'); MouseBox(TabBackpack.GetBounds); end; Mouse(X+GaussRangeInt(-2,2),Y+GaussRangeInt(-2,2)); if IsMouseOverText(['emon','spirit','rit','ee','Coll','-sp','ward','reward','ewar','act'],RandomRange(150,200)) then begin FastClick(Mouse_Right); if ChooseOption.Select(['Collect'],750) then begin SmartImage.Clear; Wait(GaussrangeInt(600,2000)); Result:=True; Spirits:=Spirits+1; SetLength(ATPA,0); Exit; end; end; end; SetLength(ATPA,0); FUNCTIONSTOP:='FINDSPIRIT EXIT'; end; Function Antiban: Boolean; var I: Integer; begin FUNCTIONSTOP:='ANTIBAN ENTERED'; I := Random(600); Case I Of 1..3: begin MouseOffClient(Random(4)); Wait(GaussRangeInt(1000,7000)); Result := True; end; 4..7: begin hoverSkill(Skill_Firemaking); Wait(GaussRangeInt(1000,2000)); TabBackpack.Open; Result := True; end; 8..50: begin mousemovingobject; Result := True; end; 51..200: begin SleepAndMoveMouse(GaussRangeInt(1000,2500)); Result:=True; end; 201..400: begin MouseOffClient(Random(4)); Wait(GaussRangeInt(1000,7000)); Result:=True; end; 401..600: begin Wait(RandomRange(250, 1500)); Result:=True; end; end; if TabBackpack.Count>5 then Wait(GaussRangeInt(3500, 3600)); FUNCTIONSTOP:='ANTIBAN EXIT'; end; procedure waiting; var inv1, time, inv2: integer; b: TBox; t: TTimeMarker; begin FUNCTIONSTOP:='WAITING ENTERED'; if not IsLoggedIn then Exit; T.Start; Inv1:= TabBackpack.Count; Inv2:= GaussRangeInt(0,5); Time:=GaussRangeInt(3500,5500); Repeat Wait(Random(100)); if not IsLoggedIn then Exit; if CountLogs>Inv2 then AntiBan; if (players[currentPlayer].booleans[1]) And (TabBackpack.Count<22) And (FindSpirit) then Break; if (not FirePresent) And (not isMouseOverMenuOpen(b)) then Break; if Inv1>TabBackPack.Count then begin Inv1:=TabBackPack.Count; if Debug then Writeln('Inventory changed'); T.Start; Timeout.Start; Reset.Start; end; if (ClaimTicket) Or (not IsLoggedIn) then Exit; Until (CountLogs=0) or (T.GetTime>Time); FUNCTIONSTOP:='WAITING EXIT'; end; procedure Mainloop; begin FUNCTIONSTOP:='MAINLOOP ENTERED'; ExitSquealOfFortune; ClaimSpinTicket; if (CountLogs=0) then WaitFunc(@BankShantay,Random(100),GaussRangeInt(10000,20000)); LogCount:=LogCount+(CountLogs); if FindFire then Waiting; ExitSquealOfFortune; ClaimSpinTicket; if CountLogs=0 then ProgressReport; if Timeout.GetTime>TimeoutLength then begin Writeln('Something went wrong, shutting down'); SaveScreenshot(ScriptPath + '/fail_.bmp'); if failsafe then begin players[currentPlayer].Logout; TerminateScript; end; end; if Reset.GetTime>ResetLength then begin Writeln('Something went wrong, resetting stuff'); Minimap.ClickCompass; MainScreen.SetAngle(MS_ANGLE_HIGH); BankShantay; Reset.Start; end; if not IsLoggedIn then begin if players[currentPlayer].Login then begin Wait(GaussRangeInt(2000,4000)); Minimap.ClickCompass; MainScreen.SetAngle(MS_ANGLE_HIGH); Reset.Start; ExitSquealOfFortune; ClaimSpinTicket; end else Exit; end; if players[currentPlayer].booleans[0] then BreakHandler(players[currentPlayer].integers[0],players[currentPlayer].integers[1],15,7); Wait(Random(100)); FUNCTIONSTOP:='MAINLOOP exit'; end; procedure LastRun; begin Writeln(FunctionStop); end; procedure Setup; begin ClearDebug; AutoUpdateMe; SmartEnableDrawing := True; initPlayerForm(); // initiate your settings runPlayerForm(); // run the form // use this so the script doesn't continue if the user exits out of the form if (not playerForm.isScriptReady) then terminatescript; declarePlayers(); smartPlugins := ['OpenGL32.dll','d3d9.dll']; SetupSRL; RequirementsCheck; SPS.Setup('0_0SP', 'Runescape_Surface\'); AddOnTerminate('Fr33DTMs'); SetDTMs; AddOnTerminate('LastRun'); if not IsLoggedIn then begin if not players[currentPlayer].Login then TerminateScript; Writeln('Just loggedin, waiting a bit'); Wait(RandomRange(6000,10000)); end; if not Debug then DisableSRLDebug:=True else DisableSRLDebug := false; clearDebug; if conversationBox.continue(true, true) then wait(randomRange(3000, 2000)); minimap.clickCompass; mainScreen.setAngle(MS_ANGLE_HIGH); startingExperience := chatBox.getXP; players[currentPlayer].FindMod := False; ExitTreasure; ClaimTicket; LogCount:=CountLogs; Timeout.Start; Reset.Start; TimeoutLength:= GaussRangeInt(600000,650000); ResetLength:= GaussRangeInt(250000,400000); SmartImage.Clear; Writeln('Looks like we are doing bonfires at Shantay Pass!'); Writeln('Lets get this show on the road!'); end; begin setup; while (players.getActive() > 0) do if not POSDebug then Mainloop else SPS.DebugPlayerPos; end.