{$UNDEF SCRIPT_ID}{$DEFINE SCRIPT_ID := 'e03d0524-9b81-4cb9-98f6-d9fe1243c778'} {$UNDEF SCRIPT_REVISION}{$DEFINE SCRIPT_REVISION := '2'} {$IFDEF WINDOWS}{$DEFINE SCRIPT_GUI}{$ENDIF} {$I SRL-B/osr.simba} {$I BashLib/osr.simba} { ---------------------------------------------------------------------------------- ~~~ Need Support? Contact Me ~~~ Discord ID: big.aussie Discord Server: https://discord.gg/qsmKs5uKfR Email: thebigaussie@proton.me Github: https://github.com/BigAussie/BASH ---------------------------------------------------------------------------------- } // ###These are edited in the GUI and saved to your configuration .ini, you should not need to change these manually.## var WEBHOOKURL: String = ''; DiscordUID: String = ''; STOP_AT_LEVEL: Integer = -1; ENABLEWEBHOOKS: Boolean = True; PINGONTERMINATED: Boolean = True; ENABLEREMOTEINPUT: Boolean = True; TELEPORTMOUSE: Boolean = False; RUNELITEMODE: Boolean = False; ActiveTimer: TStopWatch; Type TLocation = (START, FINISH, ROUGHWALL, TIGHTROPE1, TIGHTROPE2, NARROWWALL, WALL, GAP, CRATE, UNKNOWN); ResultEx = (COMPLETE, FAILED, NOTFOUND); TObstacle = record Index, MaxTime, XP: Int32; NextLoc: TLocation; WalkTile : TPoint; Colors: Array of TCTS2Color; MMTiles: TPointArray; UpText: TStringArray; AngleMin, AngleMax: Int32; end; DraynorAgility = record (TBaseBankScript) StartTile : TPoint; Obstacles : Array [0..7] of TObstacle; Obs_Names : Array [0..7] of String; FailCount,Attempts : Int32; MyFullPos: TRSPosition; Timer: TStopWatch; RunningTime: TStopWatch; BoostTimer: TStopWatch; MarkOfGrace: TRSitem; Index: Int32; StartXP: Integer; CurrentXP: Integer; PrevXP: Integer; XPGained: Integer; LapCount: Integer; StartingMarks: Integer; end; procedure DraynorAgility.HighlightRect(Rect: TRectangle; Color, Opacity: Integer); begin RSClient.Image.Clear(MainScreen.Bounds); RSClient.Image.DrawRect(Rect, $FFFF00); end; procedure OnBreakStart(Task: PBreakTask); begin ActiveTimer.Pause(); end; procedure OnBreakFinish(Task: PBreakTask); begin ActiveTimer.Resume(); end; procedure OnSleepStart(Task: PSleepTask); begin ActiveTimer.Pause(); end; procedure OnSleepFinish(Task: PSleepTask); begin ActiveTimer.Resume(); end; procedure DraynorAgility.SendWebhook(msg: String; FilePath: String = ''); var HTTP: Int32; Response, Payload: String; begin if WEBHOOKURL = "" then Exit; if DiscordUID <> '' then msg := '<@' + DiscordUID + '> ' + msg; // First attempt with JSON payload Payload := '{"content": "' + msg + '"}'; HTTP := InitializeHTTPClient(False); try SetHTTPHeader(HTTP, 'Content-Type', 'application/json'); Response := PostHTTPPage(HTTP, WEBHOOKURL, Payload); if Response = '' then WriteLn('Webhook successfully sent with JSON payload.') else WriteLn('Webhook sent with JSON payload. Response: ', Response); // Fallback to FORMS if JSON Fails - We had to fallback as some users had issues with JSON Thanks @Chandler for all the help testing this. if Pos('"code": 50006', Response) > 0 then begin FreeHTTPClient(HTTP); HTTP := InitializeHTTPClient(False); AddPostVariable(HTTP, 'content', msg); Response := PostHTTPPageEx(HTTP, WEBHOOKURL); if Response = '' then WriteLn('Webhook fallback successfully sent with form data after code 50006 error.') else WriteLn('Webhook fallback sent with form data after code 50006 error. Response: ', Response); end; finally FreeHTTPClient(HTTP); end; end; procedure DraynorAgility.SendTerminationNotification(); begin Self.SendWebhook('Draynor Agility has terminated or crashed.'); end; procedure DraynorAgility.TakeScreenshot(Name: String); var i: Int32; begin CreateDirectory('Screenshots/'); i := Length(GetFiles('Screenshots/', 'png')); SaveScreenshot('Screenshots/BADraynorAgility_' + Name + '_' + IntToStr(i) + '.png'); end; procedure TAntiban.Setup(); override; begin Self.Skills := [ERSSkill.Agility, ERSSkill.TOTAL]; Self.MinZoom := 0; Self.MaxZoom := 10; Antiban.OnStartBreak := @OnBreakStart; Antiban.OnFinishBreak := @OnBreakFinish; Antiban.OnStartSleep := @OnSleepStart; Antiban.OnFinishSleep := @OnSleepFinish; inherited; end; function FormatRoundedNumber(Number: Integer): String; begin // If the number is >= 1 million, format it with 1 decimal place and add "M" suffix if Number >= 1000000 then Result := FormatFloat('0.0M', Number / 1000000) // If the number is >= 1 thousand, format it with no decimal places and add "K" suffix else if Number >= 1000 then Result := FormatFloat('0K', Number / 1000) // For smaller numbers, use the regular SRL.FormatNumber function else Result := SRL.FormatNumber(Number); end; procedure DraynorAgility.Report(); var ActiveRuntime: Integer; CurrentXP: Integer; GainedXP: Integer; CurrentMarks: Integer; TotalMarks: Integer; XPPerHour, XPPerHourExcludingBreaks: Integer; begin ClearDebug(); CurrentMarks := Inventory.CountItemStack('Mark of grace'); TotalMarks := CurrentMarks - StartingMarks; APIClient.SubmitStats(APIClient.GetUUID()); XPBar.EarnedXP(); CurrentXP := XPBar.Read(); GainedXP := CurrentXP - StartXP; WriteLn('========================================'); WriteLn(' BigAussies Draynor Roof-Hopper '); WriteLn('========================================'); WriteLn(' Current Obstacle: '+Obs_Names[Index+1]); WriteLn(' Runtime: ' + SRL.MsToTime(GetTimeRunning, Time_Short)); WriteLn(' XP Gained: ' + FormatRoundedNumber(GainedXP)); WriteLn(' Marks of grace: ' + IntToStr(TotalMarks)); if (STOP_AT_LEVEL <> -1) or (STOP_AT_LEVEL = 99) then WriteLn(' Current Level: ' + IntToStr(Stats.GetLevel(ERSSkill.Agility)) + ' / Stop at Level: ' + IntToStr(STOP_AT_LEVEL)); WriteLn('----------------------------------------'); XPPerHour := Round((GainedXP) / (RunningTime.ElapsedTime / 3600000)); XPPerHourExcludingBreaks := Round((GainedXP) / (ActiveTimer.ElapsedTime / 3600000)); WriteLn(' XP/Hour: ' + FormatRoundedNumber(XPPerHourExcludingBreaks)); if WLSettings.Breaks then WriteLn(' Next Break: ' + SRL.MsToTime(Max(0, Round(Antiban.Breaks[0].NextAtTime - GetTimeRunning)), Time_Short)); if Length(Antiban.Sleeps) > 0 then if Antiban.Sleeps[0].NextAtTime > GetTimeRunning then WriteLn(' Next Sleep: ' + SRL.MsToTime(Max(0, Round(Antiban.Sleeps[0].NextAtTime - GetTimeRunning)), Time_Short)); WriteLn('========================================'); WriteLn(' BigAussies Draynor Roof-Hopper '); if RUNELITEMODE then WriteLn(' Version: ' + {$MACRO SCRIPT_REVISION} + ' NEON MODE') else WriteLn(' Version: ' + {$MACRO SCRIPT_REVISION}); WriteLn('========================================'); end; // full Credits to SkunkBUILDAGUIworks & Student for this function procedure TRSMinimap.RotateWithinAngles(min, max: Int32); var minMaxAvg: Int32 := Floor((min + max) div 2); preferredAngle: Int32 := SRL.SkewedRand(minMaxAvg, min, max); begin if preferredAngle < 0 then preferredAngle := preferredAngle + 360; if InRange(self.getCompassAngle(True), min, max) then Exit; //tztok Aussie fat cok Minimap.SetCompassAngle(preferredAngle); end; function DraynorAgility.GetLocation(): TLocation; begin if not RSClient.IsLoggedIn then Exit(UNKNOWN); MyFullPos := Map.FullPosition; if MyFullPos.Plane = 0 then Exit(START); if MyFullPos.Plane = 3 then begin if MyFullPos.InBox([8294, 37306, 8314, 37322]) then Exit(TIGHTROPE1); if MyFullPos.InBox([8256, 37326, 8270, 37342]) then Exit(TIGHTROPE2); if MyFullPos.InBox([8256, 37362, 8284, 37370]) then Exit(NARROWWALL); if MyFullPos.InBox([8240, 37386, 8260, 37406]) then Exit(WALL); if MyFullPos.InBox([8254, 37410, 8310, 37418]) then Exit(GAP); if MyFullPos.InBox([8278, 37386, 8288, 37410]) then Exit(CRATE); end; Exit(UNKNOWN); end; function DraynorAgility.GetNextObstacle(): Int32; var Loc: TLocation; begin Loc := Self.GetLocation(); case Loc of START, FINISH: Exit(0); TIGHTROPE1: Exit(1); TIGHTROPE2: Exit(2); NARROWWALL: Exit(3); WALL: Exit(4); GAP: Exit(5); CRATE: Exit(6); else Exit(-1); end; end; function DraynorAgility.CheckForMarks(): Boolean; var TrueDot: TPoint; TPA, Dots: TPointArray; ATPA: T2DPointArray; Finder: TRSObjectFinder; i, InitialMarkCount: Int32; begin Result := False; if not RSClient.IsLoggedIn then Exit; if Minimap.PercentBlack() > 85 then Exit; Dots := Minimap.GetDots(ERSMinimapDot.ITEM); if Dots.Len() < 1 then Exit; Dots.Sort(Minimap.Center); TrueDot := [Dots[0].X + 2, Dots[0].Y + 2]; if TrueDot.DistanceTo(Minimap.Center) > 35 then Exit; Minimap.WaitPlayerMoving(300, SRL.NormalRange(3000, 4500)); if RUNELITEMODE then Finder.Colors += CTS2(1710796, 6, 0.01, 4.44) else Finder.Colors += CTS2(2207426, 3, 0.03, 0.39); Finder.ClusterDistance := 10; for i := 1 to 2 do begin ATPA := MainScreen.FindObject(Finder); if ATPA.Len >= 1 then Break; MainScreen.FacePoint(TrueDot); end; if ATPA.Len < 1 then Exit; Self.HighlightRect(Minimap.PointToMsRect(TrueDot), clRed, 80); for TPA in ATPA do begin if TELEPORTMOUSE then Mouse.Teleport(TPA.Mean) else Mouse.Move(TPA.Mean); if MainScreen.IsUpText(['Take Ma', 'ark of Gr'], 75) then Break; end; RSClient.Image.Clear(MainScreen.Bounds); if not MainScreen.IsUpText(['Take Ma', 'ark of Gr'], 75) then Exit; InitialMarkCount := Inventory.CountItemStack('Mark of grace'); if SRL.Dice(SRL.NormalRange(80, 97)) then begin Mouse.Click(MOUSE_LEFT); Result := MainScreen.DidRedClick; end else begin Mouse.Click(MOUSE_RIGHT); Result := ChooseOption.Select('Take Mark'); end; if Result then begin Minimap.WaitFlag(SRL.NormalRange(1, 4)); WaitUntil(Inventory.CountItemStack('Mark of grace') > InitialMarkCount, 50, 3000); end; end; function DraynorAgility.FindObstacle(Obs: TObstacle): Boolean; var Pt, Tile: TPoint; MSRect: TRectangle; TPA: TPointArray; ATPA: T2DPointArray; Finder: TRSObjectFinder; Color: TCTS2Color; i: Int32; begin if (not RSClient.IsLoggedIn) then Exit(False); for Tile in Obs.MMTiles do begin if WLSettings.RemoteInput.Enabled then RSClient.Image.Clear(Mainscreen.Bounds); MSRect := Map.GetTileMS(Tile, 0); if MainScreen.IsVisible(MSRect.Mean) then begin if WLSettings.RemoteInput.Enabled then Self.HighlightRect(MSRect, 16105854, 75); if Length(Obs.Colors) > 0 then begin Finder.Colors := Obs.Colors; Finder.ClusterDistance := 5; Finder.Grow := 5; for i := 1 to SRL.NormalRange(3, 5) do begin ATPA := MainScreen.FindObject(Finder, MSRect.Expand(5).Bounds); if Length(ATPA) < 1 then Continue; for TPA in ATPA do begin if TELEPORTMOUSE then Mouse.Teleport(TPA.Mean) else Mouse.Move(TPA.Mean); if MainScreen.IsUpText(Obs.UpText, 75) then Exit(True); end; end; end else begin for i := 1 to SRL.NormalRange(2, 4) do begin Pt := SRL.RandomPoint(MSRect); if TELEPORTMOUSE then Mouse.Teleport(Pt) else Mouse.Move(Pt); if MainScreen.IsUpText(Obs.UpText, 75) then Exit(True); end; end; end; end; if (Obs.AngleMin <> 0) and (Obs.AngleMax <> 0) then Minimap.RotateWithinAngles(Obs.AngleMin, Obs.AngleMax); Result := False; end; function DraynorAgility.HandleObstacle(Obs: TObstacle): ResultEx; var T: TCountDown; i: Int32; NextObs: TObstacle; ReportTriggered: Boolean; CurrentAngle, TargetMinAngle, TargetMaxAngle: Int32; begin Result := NOTFOUND; ReportTriggered := False; Self.DoAntiban(); if not RSClient.IsLoggedIn then Exit; while Minimap.IsPlayerMoving() do Wait(75, 125); Self.CheckForMarks(); if Obs.WalkTile.X < 2 then Obs.WalkTile := Obs.MMTiles[0]; for i := 1 to 3 do begin if Self.FindObstacle(Obs) then Break; if i = 3 then begin if (not Map.Walker.WebWalk([Obs.WalkTile.X, Obs.WalkTile.Y], 20, 0.2)) then begin WriteLn('Failed to walk to obstacle at: (' + IntToStr(Obs.WalkTile.X) + ', ' + IntToStr(Obs.WalkTile.Y) + ')'); Exit(NOTFOUND); end; end; end; if not Mainscreen.IsUpText(Obs.UpText, 65) then Exit(NOTFOUND); Mouse.Click(MOUSE_LEFT); if not MainScreen.DidRedClick then Exit; if WLSettings.RemoteInput.Enabled then RSClient.Image.Clear(Mainscreen.Bounds); Self.Attempts := 0; if WaitUntil(Minimap.IsPlayerMoving(), 50, 8000) then Minimap.WaitPlayerMoving(700); T.Init(Obs.MaxTime); while not T.IsFinished do begin if not ReportTriggered then begin Self.Report(); ReportTriggered := True; end; if XPBar.Read() > Self.PrevXP then begin WL.Activity.Restart(); Break; end; if Obs.Index < High(Self.Obstacles) then begin NextObs := Self.Obstacles[Obs.Index + 1]; if (NextObs.AngleMin <> 0) and (NextObs.AngleMax <> 0) then begin TargetMinAngle := NextObs.AngleMin; TargetMaxAngle := NextObs.AngleMax; if not InRange(CurrentAngle, TargetMinAngle, TargetMaxAngle) then begin Minimap.RotateWithinAngles(TargetMinAngle, TargetMaxAngle); end; end; end; end; Wait(250, 350); Result := COMPLETE; Inc(Self.XPGained, Obs.XP); Self.PrevXP := XPBar.Read(); end; procedure DraynorAgility.Free(); begin if WLSettings.RemoteInput.Enabled then RSClient.Image.Clear(Mainscreen.Bounds); end; procedure DraynorAgility.Init(MaxActions: UInt32; MaxTime: UInt64); override; var CurrentZoomLevel: Integer; begin inherited; if WLSettings.RemoteInput.Enabled then RSClient.Image.Clear(Mainscreen.Bounds); Map.SetupChunkEx([48, 51, 48, 50], [0, 3]); Objects.Setup(Map.Objects(), @Map.Walker); Npcs.Setup(Map.NPCs(), @Map.Walker); Map.Walker.AdaptiveWalk := True; StartXP := XPBar.Read(); RSW.EnableRunAtEnergy := 85; CurrentZoomLevel := Options.GetZoomLevel; if (CurrentZoomLevel < 0) or (CurrentZoomLevel > 10) then Options.SetZoomLevel(SRL.NormalRange(0, 10)); if PINGONTERMINATED and ENABLEWEBHOOKS then AddOnTerminate(@Self.SendTerminationNotification); Mouse.Speed := SRL.NormalRange(18,24); Self.PrevXP := XPBar.Read(); StartingMarks := Inventory.CountItemStack('Mark of grace'); Self.Obs_Names := ['Climb Roughwall', 'Cross Tightrope', 'Cross Tightrope2', 'Handle Narrow Wall', 'Wall Shuffle', 'Jump Gap', 'Climb Crate', 'Climb Roughwall']; with Obstacles[0] do begin Index := 0; UpText := ['imb']; MMTiles := [[8316, 37315]]; if RUNELITEMODE then Colors := [CTS2(1164328, 9, 0.27, 1.94), CTS2(1842388, 3, 0.01, 5.92)] else Colors := [CTS2(3428709, 4, 0.08, 0.30)]; XP := 2; NextLoc := TIGHTROPE1; MaxTime := 7500; AngleMin := 6; AngleMax := 83; end; with Obstacles[1] do begin Index := 1; UpText := ['oss']; MMTiles := [[8296, 37322]]; if RUNELITEMODE then Colors := [CTS2(1164328, 9, 0.27, 1.94), CTS2(1842388, 3, 0.01, 5.92)] else Colors := [CTS2(3821917, 6, 0.16, 0.11)]; XP := 8; NextLoc := TIGHTROPE2; MaxTime := 7500; end; with Obstacles[2] do begin Index := 2; UpText := ['oss']; MMTiles := [[8272, 37330]]; if RUNELITEMODE then Colors := [CTS2(1164328, 9, 0.27, 1.94), CTS2(1842388, 3, 0.01, 5.92)] else Colors := [CTS2(3821917, 6, 0.16, 0.11)]; XP := 7; NextLoc := NARROWWALL; MaxTime := 7500; end; with Obstacles[3] do begin Index := 3; UpText := ['ance']; MMTiles := [[8262, 37374]]; if RUNELITEMODE then Colors := [CTS2(1164328, 9, 0.27, 1.94), CTS2(1842388, 3, 0.01, 5.92)] else begin Colors := [CTS2(1776416, 1, 0.01, 0.01)]; AngleMin := 40; AngleMax := 83; end; XP := 7; NextLoc := WALL; MaxTime := 4500; end; with Obstacles[4] do begin Index := 4; UpText := ['ump']; MMTiles := [[8256, 37406]]; if RUNELITEMODE then Colors := [CTS2(1164328, 9, 0.27, 1.94), CTS2(1842388, 3, 0.01, 5.92)]; XP := 10; NextLoc := GAP; MaxTime := 4500; end; with Obstacles[5] do begin Index := 5; UpText := ['ump']; MMTiles := [[8284, 37410]]; if RUNELITEMODE then Colors := [CTS2(1164328, 9, 0.27, 1.94), CTS2(1842388, 3, 0.01, 5.92)]; XP := 4; NextLoc := CRATE; MaxTime := 3500; end; with Obstacles[6] do begin Index := 6; UpText := ['imb']; MMTiles := [[8312, 37388]]; if RUNELITEMODE then Colors := [CTS2(1164328, 9, 0.27, 1.94), CTS2(1842388, 3, 0.01, 5.92)] else Colors := [CTS2(862515, 2, 0.44, 9.19)]; XP := 79; NextLoc := FINISH; MaxTime := 6000; AngleMin := 6; AngleMax := 83; end; AddOnTerminate(@Self.Free); RunningTime.Start(); ActiveTimer.Start(); end; procedure DraynorAgility.Run(MaxActions: UInt32; MaxTime: UInt64); begin Self.Init(MaxActions, MaxTime); repeat Chat.HandleLevelUp(); if Self.ShouldStopScript() then Exit; Self.ProcessObstacles(); Wait(SRL.NormalRange(125, 275)); until Self.ShouldStop(); Self.ShutdownScript(); end; function DraynorAgility.ShouldStopScript(): Boolean; begin if (STOP_AT_LEVEL <> -1) and (Stats.GetLevel(ERSSkill.Agility) >= STOP_AT_LEVEL) then begin WriteLn('Reached level ', STOP_AT_LEVEL, '. Stopping script.'); Logout.ClickLogout; TerminateScript('Reached stop level. Logging out'); Exit(True); end; if WL.Activity.IsFinished() then begin WriteLn('No activity detected in 5 minutes! Shutting down.'); Exit(True); Logout.ClickLogout; TerminateScript('No activity detected in 5 minutes! Shutting down.'); end; Result := False; end; procedure DraynorAgility.ProcessObstacles(); var TRes: ResultEx; Recal, StartOver: Boolean; TargetMinAngle, TargetMaxAngle: Int32; begin Recal := False; StartOver := False; for Index := Self.GetNextObstacle to High(Self.Obstacles) do begin TRes := Self.HandleObstacle(Self.Obstacles[Index]); if TRes = NOTFOUND then begin Inc(Self.Attempts); Self.GetLocation(); if Self.Attempts > 4 then begin Self.HandleFailedObstacle(); Exit; end; if (Self.Obstacles[Index].AngleMin <> 0) and (Self.Obstacles[Index].AngleMax <> 0) then begin TargetMinAngle := Self.Obstacles[Index].AngleMin; TargetMaxAngle := Self.Obstacles[Index].AngleMax; Minimap.RotateWithinAngles(TargetMinAngle, TargetMaxAngle); end else begin Antiban.RandomRotate(); end; Recal := True; end; if Recal then Break; if Index = 6 then begin StartOver := True; Break; end; end; if StartOver then Exit; end; procedure DraynorAgility.HandleFailedObstacle(); begin MyFullPos := Map.FullPosition; WriteLn('Failed to locate obstacle: ' + Obs_Names[Index]); WriteLn('Index: ' + ToStr(Index) + ', Loc: ' + ToStr(Self.GetLocation) + ', Ang: ' + ToStr(Minimap.GetCompassAngle(True))); WriteLn('Coords: (' + IntToStr(MyFullPos.X) + ', ' + IntToStr(MyFullPos.Y) + ', Plane: ' + IntToStr(MyFullPos.Plane) + ')'); TakeScreenshot('FailedObstacle'); Logout.ClickLogout(); TerminateScript(); end; procedure DraynorAgility.ShutdownScript(); begin Logout.ClickLogout(); TerminateScript('Time to shutdown'); end; var Script: DraynorAgility; {$IFDEF SCRIPT_GUI} type TConfig = record(TScriptForm) WebhookLabel , DiscordUIDLabel, DiscordUIDInfo: TLabel; WebHookInput, DiscordUIDInput, StopAtLevelInputBox: TLabeledEdit; PingOnDMCheckBox, PingOnInGameChatCheckBox, PingOnTerminatedCheckBox, EnableWebhooksCheckBox, TeleportMouseCheckBox, RuneliteModeCheckBox: TLabeledCheckBox; StopAtLevelLabel, WebhookInfo: TLabel; end; procedure TConfig.StartScript(sender: TObject); override; begin DiscordUID := Self.DiscordUIDInput.GetText; WEBHOOKURL := Self.WebHookInput.GetText; ENABLEWEBHOOKS := Self.EnableWebhooksCheckBox.IsChecked(); PINGONTERMINATED := Self.PingOnTerminatedCheckBox.IsChecked(); ENABLEREMOTEINPUT := WLSettings.RemoteInput.Enabled; TELEPORTMOUSE := Self.TeleportMouseCheckBox.IsChecked(); RUNELITEMODE := Self.RuneliteModeCheckBox.IsChecked(); WriteINI('Draynor Agility Settings', 'TeleportMouse', BoolToStr(TELEPORTMOUSE, 'true', 'false'), 'Configs/BASettings.ini'); WriteINI('Draynor Agility Settings', 'RuneliteMode', BoolToStr(RUNELITEMODE, 'true', 'false'), 'Configs/BASettings.ini'); WriteINI('Webhook Settings', 'DiscordUID', DiscordUID, 'Configs/BASettings.ini'); WriteINI('Webhook Settings', 'WebhookURL', WEBHOOKURL, 'Configs/BASettings.ini'); WriteINI('Webhook Settings', 'PingOnTerminated', BoolToStr(PINGONTERMINATED, 'true', 'false'), 'Configs/BASettings.ini'); WriteINI('Webhook Settings', 'EnableWebhooks', BoolToStr(ENABLEWEBHOOKS, 'true', 'false'), 'Configs/BASettings.ini'); WriteINI('WaspLib Settings', 'EnableRemoteInput', BoolToStr(ENABLEREMOTEINPUT, 'true', 'false'), 'Configs/BASettings.ini'); inherited; end; procedure TConfig.OpenURL(Sender: TObject); begin if Sender = Self.WebhookInfo then OpenWebPage('https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks') else if Sender = Self.DiscordUIDInfo then OpenWebPage('https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID'); end; procedure TConfig.WebhooksCheckboxChanged(Sender: TObject); begin Self.WebhookInfo.SetVisible(Self.EnableWebhooksCheckBox.IsChecked()); Self.DiscordUIDInfo.SetVisible(Self.EnableWebhooksCheckBox.IsChecked()); Self.DiscordUIDInput.SetVisible(Self.EnableWebhooksCheckBox.IsChecked()); Self.WebHookInput.SetVisible(Self.EnableWebhooksCheckBox.IsChecked()); Self.PingOnTerminatedCheckBox.SetVisible(Self.EnableWebhooksCheckBox.IsChecked()); end; procedure TConfig.RuneliteModeCheckboxChanged(Sender: TObject); begin if Self.RuneliteModeCheckBox.IsChecked() then begin if MessageDlg('Confirmation', 'This mode ONLY supports Runelite 32BIT Client. You must have all plugins disabled except for Agility. The plugins colors must be default. Are you sure you want to enable Runelite mode?', mtConfirmation, [mbYes, mbNo]) = mrNo then begin Self.RuneliteModeCheckBox.SetChecked(False); end; end; end; procedure TConfig.Run(); override; var Img: TPicture; BGImg: TImage; tab: TTabSheet; SavedDiscordUID, SavedWebhookURL: String; SavedPingOnTerminated, SavedEnableWebhooks, SavedRemoteInput, SavedTeleportMouse, SavedRuneliteMode: Boolean; begin Self.Setup("BigAussies Draynor RoofHopper"); Self.Start.SetOnClick(@Self.StartScript); SavedDiscordUID := ReadINI('Webhook Settings', 'DiscordUID', 'Configs/BASettings.ini'); SavedWebhookURL := ReadINI('Webhook Settings', 'WebhookURL', 'Configs/BASettings.ini'); SavedEnableWebhooks := StrToBoolDef(ReadINI('Webhook Settings', 'EnableWebhooks', 'Configs/BASettings.ini'), False); SavedPingOnTerminated := StrToBoolDef(ReadINI('Webhook Settings', 'PingOnTerminated', 'Configs/BASettings.ini'), True); SavedRemoteInput := StrToBoolDef(ReadINI('WaspLib Settings', 'EnableRemoteInput', 'Configs/BASettings.ini'), False); SavedTeleportMouse := StrToBoolDef(ReadINI('Draynor Agility Settings', 'TeleportMouse', 'Configs/BASettings.ini'), False); SavedRuneliteMode := StrToBoolDef(ReadINI('Draynor Agility Settings', 'RuneliteMode', 'Configs/BASettings.ini'), False); WLSettings.RemoteInput.Enabled := SavedRemoteInput; WLSettings.RemoteInput.BlockInput := True; // Disabled input, remove this if you want to enable input. Self.AddTab('Script Settings'); tab := Self.Tabs[High(Self.Tabs)]; Self.CreateAccountManager(tab); with Self.TeleportMouseCheckBox do begin Create(tab); Self.Form.GetFont().SetStyle([fsBold]); SetLeft(TControl.AdjustToDPI(37)); SetTop(TControl.AdjustToDPI(140)); SetCaption('Teleport Mouse mode'); SetHint('Instead of moving the mouse to obstacles the mouse will be teleported.'); SetChecked(SavedTeleportMouse); end; with Self.RuneliteModeCheckBox do begin Create(tab); Self.Form.GetFont().SetStyle([fsBold]); SetLeft(Self.TeleportMouseCheckBox.GetLeft()); SetTop(Self.TeleportMouseCheckBox.GetTop() + TControl.AdjustToDPI(25)); SetCaption('Runelite mode'); SetHint('Enable or Disable Runelite mode.'); SetChecked(SavedRuneliteMode); CheckBox.SetOnChange(@RuneliteModeCheckboxChanged); end; with Self.StopAtLevelInputBox do begin Create(tab); Self.Form.GetFont().SetStyle([fsBold]); SetLeft(Self.TeleportMouseCheckBox.GetLeft() + TControl.AdjustToDPI(175)); SetTop(TControl.AdjustToDPI(140)); SetWidth(110); SetCaption('Stop at Level'); SetHint('Enter -1 to never stop.'); Edit.SetOnKeyPress(@Edit.NumberField); end; with Self.EnableWebhooksCheckBox do begin Create(tab); SetCaption("Discord Notifications"); SetLeft(Self.RuneliteModeCheckBox.GetLeft()); SetTop(Self.RuneliteModeCheckBox.GetTop() + TControl.AdjustToDPI(25)); SetHint('Script will ping you on your own discord server when it stops.'); SetChecked(SavedEnableWebhooks); CheckBox.SetOnChange(@WebhooksCheckboxChanged); Self.Form.GetFont().SetStyle([fsBold]); end; with Self.WebhookInfo do begin Create(tab); SetLeft(Self.EnableWebhooksCheckBox.GetLeft()); SetTop(Self.EnableWebhooksCheckBox.GetTop() + TControl.AdjustToDPI(25)); SetCaption('Click here to learn how to generate your own Discord webhook URL'); SetHint('Click here to learn how to generate your own Discord webhook URL'); setOnClick(@OpenURL); SetFontSize(TControl.AdjustToDPI(7)); Self.Form.GetFont().SetStyle([fsBold]); end; with Self.DiscordUIDInput do begin Create(tab); SetLeft(Self.WebhookInfo.GetLeft()); SetTop(Self.WebhookInfo.GetTop() + TControl.AdjustToDPI(30)); SetCaption('Discord UID (Optional)'); SetHint('What name to @ in discord when script terminates'); SetWidth(TControl.AdjustToDPI(140)); SetText(SavedDiscordUID); end; with Self.DiscordUIDInfo do begin Create(tab); SetLeft(Self.DiscordUIDInput.GetLeft() + Self.DiscordUIDInput.GetWidth() + TControl.AdjustToDPI(10)); SetTop(Self.DiscordUIDInput.GetTop() + TControl.AdjustToDPI(18)); SetCaption('Click here to learn how to find your Discord User ID'); SetHint('Click here to learn how to find your Discord User ID'); setOnClick(@OpenURL); SetFontSize(TControl.AdjustToDPI(7)); end; with Self.WebHookInput do begin Create(tab); SetLeft(Self.DiscordUIDInput.GetLeft()); SetTop(Self.DiscordUIDInput.GetTop() + TControl.AdjustToDPI(45)); SetCaption('Discord Webhook URL'); SetHint('Discord Webhook URL'); SetWidth(TControl.AdjustToDPI(180)); SetText(savedWebhookURL); end; with Self.PingOnTerminatedCheckBox do begin Create(tab); SetCaption("Ping on script termination"); SetLeft(Self.WebHookInput.GetLeft()); SetTop(Self.WebHookInput.GetTop() + TControl.AdjustToDPI(50)); SetHint('Enable to ping when the script terminates cleanly'); SetChecked(SavedPingOnTerminated); end; WebhooksCheckboxChanged(Self.EnableWebhooksCheckBox.CheckBox); Self.CreateVersionPanel(tab); Self.CreateAntibanManager(); Self.CreateWaspLibSettings(); Self.CreateAPISettings(); inherited; end; var Config: TConfig; {$ENDIF} begin begin {$IFDEF SCRIPT_GUI} Sync(@Config.Run); {$ENDIF} Script.Run(WLSettings.MaxActions, WLSettings.MaxTime); end; end.