program HoodzFighterAero; {$DEFINE SMART} {$i AeroLib/AeroLib.Simba} var DsgnForm: TForm; TLabel0: TLabel; TButton0: TButton; TCheckBox0: TCheckBox; tabControl: TPageControl; tabs: array [0..1] of TTabSheet; labelMain: array [0..6] of TLabel; textMain: array [0..3] of TEdit; labelNPC: array [0..5] of TLabel; textNPC: array [0..5] of TEdit; name, pass, statsID, statsPass: string; color, tol, waitTime, pixels: Integer; hue, sat: Extended; OSBuddy, GUIDONE: Boolean; x, y, randomHP, randomEnergy, AB, ABChance: Integer; DTM_Lobster, DTM_Trout, DTM_Salmon, DTM_Shark, DTM_MonkFish, DTM_Tuna: Integer; FoodDTMs: TIntegerArray; options, attackStyle: TStringArray; first, failAttack, newTime: Integer; type TNPC_ = record name: String; mainColor, mainTol, mainPixels: Integer; mainHue, mainSat: Extended; subColor, subTol: TIntegerArray; subHue, subSat: TExtendedArray; end; var Npc: TNPC_; const default = 'Comic Sans MS'; clDefault = $20000000; VERSION = '7'; procedure saveSettings(); var OSBNumb, I: Integer; keyNameArray, settingsArray: TStringArray; begin OSBNumb := 0; if (OSBuddy) then OSBNumb := 1; keyNameArray := ['color', 'tol', 'hue', 'sat', 'waitTime', 'pixels', 'osbuddy', 'statsID', 'statsPass']; settingsArray := [toStr(color), toStr(tol), toStr(hue), toStr(sat), toStr(waitTime), toStr(pixels), toStr(OSBNumb), statsID, statsPass]; for I := 0 to 8 do WriteINI('HOODZFIGHTER SETTINGS', keyNameArray[I], settingsArray[I], ScriptPath + '/HoodzFighter-Settings.ini'); end; procedure checkSettings(); var keyNameArray, settingsArray: TStringArray; I: Integer; begin if (not fileExists(scriptPath + 'HoodzFighter-Settings.ini')) then begin keyNameArray := ['color', 'tol', 'hue', 'sat', 'waitTime', 'pixels', 'osbuddy', 'statsID', 'statsPass']; settingsArray := ['0', '0', '0', '0', '100' , '150', '1']; if (fileExists(stats_Path+stats_File)) then begin setLength(settingsArray, length(settingsArray) + 1); settingsArray[high(settingsArray)] := readINI('General', 'Stats_ID', stats_Path+stats_File); setLength(settingsArray, length(settingsArray) + 1); settingsArray[high(settingsArray)] := readINI('General', 'Stats_Pass', stats_Path+stats_File); end else begin setLength(settingsArray, length(settingsArray) + 1); settingsArray[high(settingsArray)] := ''; setLength(settingsArray, length(settingsArray) + 1); settingsArray[high(settingsArray)] := ''; end; writeln('creating settings: HoodzFighter-Settings.ini'); for I := 0 to 8 do WriteINI('HOODZFIGHTER SETTINGS', keyNameArray[I], settingsArray[I], ScriptPath + '/HoodzFighter-Settings.ini'); end; end; function getSettings(): TStringArray; var s: String; I: Integer; tempArray, keyNameArray: TStringArray; begin keyNameArray := ['color', 'tol', 'hue', 'sat', 'waitTime', 'pixels', 'osbuddy', 'statsID', 'statsPass']; for I := 0 to 8 do begin setLength(tempArray, length(tempArray) + 1); tempArray[high(tempArray)] := readINI('HOODZFIGHTER SETTINGS', keyNameArray[I], ScriptPath + '/HoodzFighter-Settings.ini'); end; result := tempArray; end; procedure procedure_OnClick(sender: TObject); {$IFNDEF CODEINSIGHT} native; {$ENDIF} begin if (sender = TButton0) then begin GUIDONE := true; name := textMain[0].getText(); pass := textMain[1].getText(); color := StrToIntDef(textNPC[0].getText(), 0); tol := StrToIntDef(textNPC[1].getText(), 0); hue := StrToFloatDef(textNPC[2].getText(), 0.00); sat := StrToFloatDef(textNPC[3].getText(), 0.00); waitTime := StrToIntDef(textNPC[4].getText(), 100); pixels := StrToIntDef(textNPC[5].getText(), 100); OSBuddy := TCheckBox0.getState() = 1; {$IFDEF SMART} writeln('smart detected, osbuddy mode OFF'); OSBuddy := false; {$ENDIF} statsID := textMain[2].getText(); statsPass := textMain[3].getText(); client.WriteLn('HoodzFighter - Aero has been started'); DsgnForm.Close(); end; end; procedure InitForm; {$IFNDEF CODEINSIGHT} native; {$ENDIF} var I: Integer; tabCaptions: TStringArray = ['Main', 'NPC']; panelCaptions: TStringArray = ['Main', 'NPC']; labelMainStrings: TStringArray = ['Player info', 'Username:', 'Password:', 'Stats', 'StatsID:', 'Stats Pass:', 'Client settings']; labelNPCStrings: TStringArray = ['Color', 'Tol', 'Hue', 'Sat', 'Wait time (ms)', 'Pixels']; begin DsgnForm.Init(nil); with DsgnForm do begin SetCaption('HoodzFighter Aero'); SetBounds(0, 0, 430, 420); SetPosition(poScreenCenter); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); end; tabControl.init(dsgnForm); with tabControl do begin setParent(dsgnForm); setBounds(2, 5, 426, 414); for i := 0 to high(tabs) do begin tabs[i] := addTabSheet(); tabs[i].setCaption(tabCaptions[i]); end; end; {START MAIN} for i := 0 to high(labelMain) do begin labelMain[i].Init(tabs[0]); with labelMain[i] do begin SetParent(tabs[0]); SetCaption(labelMainStrings[i]); if (i = 0) then setBounds(7, 9, 42, 16) else if (i = 1) or (i = 4) then setBounds(7, labelMain[i-1].getTop + 40, 42, 16) else if (i <> 3) and (i <> high(labelMain)) then setBounds(7, labelMain[i-1].getTop + 33, 42, 16) else setBounds(7, labelMain[i-1].getTop + 60, 42, 16); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); end; end; for i := 0 to high(textMain) do begin textMain[i].Init(tabs[0]); with textMain[i] do begin SetParent(tabs[0]); if (i = 0) then setBounds(100, 49, 300, 16) else if (i = 2) then setBounds(100, textMain[i-1].getTop + 97, 300, 16) else setBounds(100, textMain[i-1].getTop + 33, 300, 16); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); if (i = 2) or (i = 3) then setText(options[i + 5]); if (i = 1) or (i = 3) then SetPasswordChar('*'); end; end; TCheckBox0.Init(tabs[0]); with TCheckBox0 do begin SetParent(tabs[0]); SetCaption('Use OSBuddy client (orion/rsbuddy)'); SetBounds(10, 305, 42, 16); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); setState(strToIntDef(options[6], 1)); end; TButton0.Init(tabs[0]); with TButton0 do begin SetParent(tabs[0]); SetCaption('Start'); SetBounds(180, 343, 60, 30); SetOnClick(procedure_OnClick); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); end; {END MAIN} {START NPC} TLabel0.Init(tabs[1]); with TLabel0 do begin setParent(tabs[1]); setCaption('NPC Info'); setBounds(7, 7, 50, 16); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); end; for i := 0 to high(labelNPC) do begin labelNPC[i].Init(tabs[1]); with labelNPC[i] do begin setParent(tabs[1]); setBounds(7, 47 + (I * 35), 42, 16); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); setCaption(labelNPCStrings[i]); end; end; for i := 0 to high(textNPC) do begin textNPC[i].Init(tabs[1]); with textNPC[i] do begin setParent(tabs[1]); setBounds(100, 47 + (I * 35), 300, 16); GetFont().SetName(default); GetFont().SetColor(536870912); GetFont().SetSize(0); setText(options[i]); end; end; {END NPC} DsgnForm.ShowModal; end; procedure Free; {$IFNDEF CODEINSIGHT} native; {$ENDIF} begin if (DsgnForm = nil) then exit(); client.writeln('Freeing form...'); DsgnForm.free; end; procedure ShowForm(); begin try sync(InitForm); except writeln('ERROR: Failed to initialize form'); finally sync(Free); end; end; procedure Updater(); var NewFile: integer; OnlineVersion, NewScript, NewFileName: string; begin writeln('Checking for script updates...'); OnlineVersion := GetPage('http://pastebin.com/raw.php?i=WRsu2y9a'); if (trim(OnlineVersion) > VERSION) then begin writeLn('Script update available!'); writeLn('Updating script to v' + OnlineVersion); NewScript := GetPage('http://pastebin.com/raw.php?i=5Rj1kTEj'); NewFileName := scriptPath + 'HoodzFighter Aero V' + Trim(OnlineVersion) + '.simba'; NewFile := Rewritefile(NewFileName, true); try WriteFileString(NewFile, NewScript); except begin writeLn('Fatal error writing to ' + NewFileName + '!!'); terminatescript; end; end; CloseFile(NewFile); writeLn('New script downloaded to ' + NewFileName + '. Please restart Simba.'); TerminateScript; end else writeLn('You have the latest version of the script!'); end; function stats_checkDetails(): Boolean; var client: Integer; S: String; begin result := true; Client := InitializeHTTPClient(False); ClearPostData(Client); AddPostVariable(Client, 'user_id', statsID); AddPostVariable(Client, 'password', statsPass); AddPostVariable(Client, 'script_id', '5'); AddPostVariable(Client, 'timeamount', '0'); S := PostHTTPPageEx(Client, 'http://stats.grats.pw/POST.php'); FreeHTTPClient(Client); if (strToInt(s) = 9001) then result := false; end; procedure declarePlayer(); begin Me.Name := name; Me.Pass := pass; Me.Active := True; me.Member := True; end; procedure customMouse(point: TPoint); begin case random(0, 6) of 0..2: BrakeMMouse(point, random(5), random(5), true); 3: BrakeMMouse(point, random(5), random(5), false); 4..5: MissMouse(point, random(5), random(5)); 6: HumanMMouse(point, random(5), random(5)); end; end; function randomHPGenerate(): Integer; begin result := random(50, 70); writeln('Random hp generated at: ' + toStr(result) + '%'); end; function randomEnergyGenerate(): Integer; begin result := random(15, 38); writeln('Random run energy generated at: ' + toStr(result) + '%'); end; function addIntArray(int: Integer; intArray: TIntegerArray): TIntegerArray; begin setLength(intArray, length(intArray) + 1); intArray[high(intArray)] := int; result := intArray; end; procedure freeExecute; var I: Integer; begin for I := 0 to high(FoodDTMs) do freeDTM(foodDTMs[I]); end; function MakeDTM(outlineCol, steps: Integer; searchBox: TBox): LongInt; var TPA: TPointArray; midPoint: TPoint; I: Integer; DTMPoints: TPointArray; newDTM: TMDTM; newPoint: TMDTMPoint; begin findColors(TPA, outlineCol, searchBox.X1, searchBox.Y1, searchBox.X2, searchBox.Y2); if length(TPA) = 0 then exit; midPoint := middleTPA(TPA); for I := 0 to high(TPA) with steps + 1 do begin combineTPAWrap(DTMPoints, [TPA[I]], DTMPoints); if I > high(TPA) then break; end; newDTM.init; with newPoint do begin asz := 1; x := midPoint.x; y := midPoint.y; c := getColor(midPoint.x, midPoint.y); t := 25; bp := false; end; newDTM.AddPoint(newPoint); for I := 0 to High(DTMPoints) do begin with newPoint do begin asz := 1; x := DTMPoints[I].x; y := DTMPoints[I].y; c := OutlineCol; t := 1; bp := false; end; newDTM.AddPoint(newPoint); end; Result := AddDTM(newDTM); end; procedure getFood(); var I, I2, outLineAmount, dtm, x, y: Integer; box: TBox; begin for I := 1 to 28 do begin box := invBox(I); outLineAmount := CountColor(clOutline_black, box.X1, box.Y1, box.X2, box.Y2); if (outLineAmount > 0) then begin for I2 := 0 to high(FoodDTMs) do begin if (not findDTM(FoodDTMs[I2], x, y, box.X1, box.Y1, box.X2, box.Y2)) then begin if (I2 = high(FoodDTMs)) then begin mouseBox(box, MOUSE_MOVE); if (waitUptext('Eat', 300)) then begin dtm := makeDTM(clOutline_black, 7, intToBox(box.X1, box.Y1, box.X2, box.Y2)); foodDTMs := addIntArray(DTM, foodDTMs); Writeln('Food detected in slot: ' + toStr(I)); break; end; end; end else if (I2 = high(FoodDTMs)) then Writeln('Food detected in slot: ' + toStr(I)); end; end; end; end; {=========================================== changes then compass with the mouse wheel ===========================================} procedure setCompassMM(newAngle, rand: Integer; highAngle: Boolean); var currentAngle, dist: Extended; right: Boolean; TPABox: TPointArray; mousePoint, endPoint: TPoint; x1, y1: Integer; begin newAngle := random(newAngle - rand, newAngle + rand); currentAngle := getCompassAngle(); dist := __setCompass_MinCheck(currentAngle, Int(newAngle)); right := (Round((360 - currentAngle) + newAngle) mod 360 <= Round((currentAngle + 360) - newAngle) mod 360); if (dist <= 15) then exit; if (right) then TPABox := TPAFromBox(intToBox(16, 103, 276, 445)) else TPABox := TPAFromBox(intToBox(364, 116, 680, 430)); if (highAngle) then mousePoint := TPABox[random(0, 30000)] else mousePoint := TPABox[random(0, high(TPABox))]; customMouse(mousePoint); getMousePos(x1, y1); if (right) and (highAngle) then endPoint := Point(Round(x1 + (dist * 3.00)), y1 + random(80, 150)) else if (right) then endPoint := Point(Round(x1 + (dist * 3.00)), y1 - random(80, 150)); if (not right) and (highAngle) then endPoint := Point(Round(x1 - (dist * 3.00)), y1 + random(80, 150)) else if (not right) then endPoint := Point(Round(x1 - (dist * 3.00)), y1 - random(80, 150)); HoldMouse(x1, y1, MOUSE_MIDDLE); customMouse(endPoint); sleep(random(1, 30)); getMousePos(x1, y1); ReleaseMouse(x1, y1, MOUSE_MIDDLE); end; function getAttackStyle(): TStringArray; var bCol : TColEx; cmbBoxes: TBoxArray; resultBox, textBox: TBox; arraybox: Array of TBox; I, I2, dist, YPoint, x1, y1: Integer; TPA: TPointArray; ATPA: T2DPointArray; s: String; styles: TStringArray; begin if (not gameTab(TAB_COMBAT)) then exit(['Attack', 'Strength', 'Defence']); cmbBoxes := [toBox(572, 255, 631, 290), toBox(656, 255, 715, 290), toBox(572, 308, 631, 343), toBox(655, 308, 714, 343)]; for I := 0 to high(cmbBoxes) do if (countColorTolerance(1908866, cmbBoxes[I].X1, cmbBoxes[I].Y1, cmbBoxes[I].X2, cmbBoxes[I].Y2, 32) > 50) then begin resultBox := cmbBoxes[I]; break; end; mouseBox(resultBox, MOUSE_MOVE); sleep(random(1000, 2000)); bCol.create(10551295, 1); bCol.findAllIn(AREA_INV, TPA); ATPA := floodFillTPA(TPA); SortATPASize(ATPA, true); if (length(ATPA) = 0) then exit(['shared']); TPA := ATPA[0]; textBox := TPA.getBounds(); dist := textBox.Y2 - textBox.Y1; if (dist = 40) then YPoint := textBox.Y1 + (round(dist/3) * 2) else YPoint := textBox.Y1 + round(dist/2); textBox := toBox(textBox.X1 + 1, YPoint, textBox.X2 - 1, textBox.Y2); s := getTextAtEx(textBox.X1, textBox.Y1, textBox.X2, textBox.Y2, 0, 5, 1, 0, 0, 'Smallchars07'); s := between('(', 'X', s); styles := ['Attack', 'Strength', 'Defence', 'Ranged', 'Shared ']; for I2 := 0 to high(styles) do begin if (stringMatch(styles[I2], s) > 0.5) then begin if (I = 2) and (I2 = 2) and (getWeaponName <> 'Abyssal whip') then exit(['Ranged', 'Defence']); if (I2 = 4) then exit(['Attack', 'Strength', 'Defence']); exit([styles[I2]]); end; end; end; procedure getABProfile(); begin if (not isLoggedIn) then begin AB := random(100, 300); writeln('not logged in, antiban is randomized and is not set to your account. randomized number: ' + toStr(AB)); end else begin AB := countColor(0, 10, 460, 82, 474); writeln('your peronal Antiban-Profile-Number is: ' + toStr(AB)); end; ABChance := round((AB * 5) + 13 + 37); end; procedure setupPlayer(); begin writeln('player setup...'); if (not isLoggedIn()) then loginPlayer(false); if (isLoggedIn()) then begin toggleRunning(true); setAngle(ANGLE_HIGH); if (AB = 0) then begin typeSend(toStr(random(0, 9)), false); sleep(20); typeByte(VK_BACK); getABProfile(); attackStyle := getAttackStyle(); setRetaliate(false); end; end; end; procedure setup(); begin npc.mainColor := color; npc.mainHue := hue; npc.mainSat := sat; npc.mainTol := tol; npc.mainPixels := pixels; mouseSpeed := Random(20, 30); writeln('MouseSpeed set at: ' + intToStr(mouseSpeed)); randomHP := randomHPGenerate(); randomEnergy := randomEnergyGenerate(); setupPlayer(); writeln('Training skill(s): ' + toStr(attackStyle)); DTM_Lobster := DTMFromString('m6wAAAHic42ZgYHBhYmDwgmJPIHYEYhsgNodiOyB2BWIfIA5gZGCIAeIoIPYD4lAoDoPyfYDYC4idgHhHshjQdEaisAaQJBYTZyIEIwEA/ycJgA=='); DTM_Salmon := DTMFromString('mggAAAHicY2NgYOCGYhDgA2IJIBYGYi4gFgJifiBmhMqDxA44SkBFUDErAyZgxaoSYR4DAwCTLQG6'); DTM_Trout := DTMFromString('mggAAAHicY2NgYOAGYmEglgBiPgYIAIlxQTEIMAIxPxALAXF5UhxUBBWzAklWBkyAqRKCIQAAnDwB2A=='); DTM_Shark := DTMFromString('mlwAAAHicY2dgYOACYkYgZgViESCWYoAALiiWgfKZoXK8QCwMxDnBtlCdmJidATfArgOCoQAAsEwBww=='); DTM_MonkFish := DTMFromString('mggAAAHicY2NgYNjGzMCwGYhPAfE6IN4ExEeAmIuRgUEAiPmgNCsQMwFxSbI/w+ryEqBORhTMDiRBGB0w4sAQAADtDAeJ'); DTM_Tuna := DTMFromString('mkwEAAHicE2ZgYNjLxMCwB4h3APEWIN4EpXdAxfcB8QEgPgjER4H4JBCfguKzULHDUPnnQPM+QvEHIH4LxC+A+AkQPwTie0B8G4jvQ9l3gfgBVB6k9xVUD0hvW14WkGSkEqYeoJaLcLgKAARYIQs='); FoodDTMs := [DTM_Lobster, DTM_Trout, DTM_Salmon, DTM_Shark, DTM_MonkFish, DTM_Tuna]; getFood(); addOnTerminate('freeExecute'); newTime := getTimeRunning() + 20000; first := 0; end; function getNPCHealth(): Integer; var gCol : TColEx; ATPA: T2DPointArray; TPA: TPointArray; hpBox: TBox; begin hpBox := toBox(6, 37, 129, 50); gCol.create(1937194, 19, 0.31, 2.13); if (not gCol.findAllIn(hpBox, TPA)) then Exit(0); result := round(length(TPA) / 15); if (result > 100) then result := 100; if (result <= 0) then result := 1; end; function inCombat(timeOut: Integer): boolean; var angle, I: Integer; t: Timer; middlePoint: TPoint; TPA: TPointArray; begin Result := false; if (not OSBuddy) then begin angle := round(getCompassAngle); case angle of 0..45: middlePoint := Point(265, 167); 46..95: middlePoint := Point(269, 160); 96..160: middlePoint := Point(265, 156); 161..200: middlePoint := Point(254, 162); 201..230: middlePoint := Point(254, 167); 231..285: middlePoint := Point(251, 175); 286..320: middlePoint := Point(259, 170); 321..360: middlePoint := Point(259, 176); end; t.start(); repeat if (t.timeElapsed() >= timeOut) then break; TPA := TPAFromCircle(middlePoint.X, middlePoint.Y, 20); FillEllipse(TPA); for I := 0 to high(TPA) do if (getColor(TPA[I].X, TPA[I].Y) = 16728128) or (getColor(TPA[I].X, TPA[I].Y) = 192) then result := true; until (Result); end else result := getNPCHealth() > 0; end; function findNPC(): TPoint; var tCol : TColEx; TPA: TPointArray; ATPA: T2DPointArray; I: Integer; box: TBox; begin tCol.create(npc.mainColor, npc.mainTol, npc.mainHue, npc.mainSat); if (not tCol.findAllIn(AREA_MS, TPA)) then exit; ATPA := FloodFillTPA(TPA); SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY)); if (length(ATPA) <= 0) then exit; for I := 0 to high(ATPA) do begin if (length(ATPA[I]) >= pixels) then begin box := toBox(ATPA[I].getBounds().X1 - 10, ATPA[I].getBounds().Y1 - 25, ATPA[I].getBounds().X2, ATPA[I].getBounds().Y2); if (box.x1 < 0) then box.x1 := 0; if (box.y1 < 0) then box.y1 := 0; if (not findColorSpiral(x, y, 255, box.X1, box.Y1, box.X2, box.Y2)) and (not findColorSpiral(x, y, 65280, box.X1, box.Y1, box.X2, box.Y2)) then exit(MiddleTPA(ATPA[I])); end; end; result := Point(-1, -1); end; function hoverNearestNPC(): Boolean; var I: Integer; TP: TPoint; begin TP := findNPC(); if (TP.X = -1) then exit; if (pointInBox(TP, intToBox(MSX1, MSY1, MSX2, MSY2))) then begin customMouse(TP); exit(true); end; end; function waitFight(WaitPerLoop, MaxTime: Integer): Boolean; var T: Timer; begin if (not osbuddy) then exit(inCombat(1900 + waitTime)); T.start(); while (T.timeElapsed < MaxTime) do begin if (inCombat(1)) then Exit(True); Wait(WaitPerLoop); end; end; procedure logoutHandler(Reason: String); begin writeln('logging out, reason: ' + reason); waitFight(1000, 30000); logoutPlayer; terminateScript; end; {by flight (removed activateClient())} procedure randomMovementEdit(); var I : Integer; Deg : Extended; Keys : TIntegerArray; begin if not isLoggedIn() then exit; Keys := [VK_RIGHT, VK_LEFT]; I := Random(2); if (Random(2) = I) then begin Deg := getCompassAngle(); Wait(100 + random(50)); KeyDown(Keys[I]); Wait(500 + random(1000)); KeyUp(Keys[I]); Wait(500 + random(1000)); end else if (Random(3) = 0) then sleepAndMoveMouse(1000 + random(200)); end; procedure miniAntiban(); begin case random(0, 410) of 0..60: randomMovementEdit(); 61..67: MMouseOffClient('random'); 68..72: checkMovingObjs(false); end; end; procedure attackNPC(); var I: Integer; t: Timer; begin if (hoverNearestNPC()) then begin case random(0, 14) of 0..13: fastClick(MOUSE_LEFT); 14: begin fastClick(MOUSE_RIGHT); sleep(random(30, 120)); waitOption('Attack', 350); end; end; if (didYellowClick()) then begin while (isLoggedIn() and isPlayerWalking()) do sleep(random(250, 300)); attackNPC(); end; sleep(1000 + random(500)); while (isLoggedIn() and isPlayerWalking()) do sleep(random(240, 300)); waitFight(250 + random(30), random(2500, 3300)); first := 0; miniAntiban(); end; if (first = 0) then begin failAttack := getTimeRunning() + 600000; inc(first); Exit; end; if (failAttack < getTimeRunning()) then logoutHandler('can not find any npcs'); end; procedure heal(); var I: Integer; begin gameTab(TAB_INV); for I := 0 to high(FoodDTMs) do begin if (findDTM(FoodDTMs[I], x, y, MIX1, MIY1, MIX2, MIY2)) then begin customMouse(Point(x, y)); sleep(random(20, 100)); case random(0, 8) of 0..7: fastClick(MOUSE_LEFT); 8: begin fastClick(MOUSE_RIGHT); waitOptionMulti(['Eat', 'Drink'], 300); end; end; sleep(random(3500, 4800)); break; end else if (I = high(FoodDTMs)) then logoutHandler('Out of food'); end; randomHP := randomHPGenerate(); end; {=========================================== gets to a random angle with the mouse wheel ===========================================} procedure randomAngleMM(); var leftSide, rightSide: TBox; boxArray: array of TBox; endPoint: TPoint; I: Integer; begin leftSide := intToBox(9, 9, 360, 480); rightSide:= intToBox(361, 9, 720, 480); boxArray := [leftSide, rightSide]; I := random(0, 1); mouseBox(boxArray[I], MOUSE_MOVE); sleep(random(40, 600)); getMousePos(x, y); if (pointInBox(Point(x, y), leftSide)) then endPoint := Point(x + 80 + random(1, 340), y + random(9, 19)) else endPoint := Point(x - 80 - random(1, 340), y + random(9, 19)); HoldMouse(x, y, MOUSE_MIDDLE); customMouse(endPoint); sleep(random(1, 30)); ReleaseMouse(x, y, MOUSE_MIDDLE); end; procedure checkXp(); begin if (random(8) > 6) then hoverSkill(SKILL_HITPOINTS, false); hoverSkill(attackStyle[random(0, high(attackStyle))], false); end; procedure antiban(); var TP: TPoint; rand, I: Integer; begin if ((not isUsingRun()) and (getRunEnergy() > randomEnergy)) then begin toggleRunning(true); randomEnergyGenerate(); end; for I := 0 to 0 do begin TP := findNPC(); if (TP.X = -1) then break; getMousePos(x, y); if (distance(TP.X, TP.Y, x, y) < 10) or (distance(TP.X, TP.Y, x, y) > 250) then break; hoverNearestNPC(); end; rand := random(0, ABChance); if (rand = 1) then begin case random(0, 120) of 0..20: compassMovement(20, 120, false); 21..35: randomMovementEdit(); 36..50: pickUpMouse(); 51..63: randomAngleMM(); 64..80: MMouseOffClient('random'); 80..90: checkMovingObjs(false); 91..99: checkXp(); 100..119: setCompassMM(random(5, 355), 5, true); end; end; end; procedure performChecks(); begin if (not GUIDONE) then terminateScript; if (color <> 0) then saveSettings(); if ((statsID = '') or (statsPass = '')) then begin Writeln('*** STATS BY GRATS *** Stats information needed, please enter your ID and pass.'); Writeln('*** STATS BY GRATS *** If you dont have a Stats account register here: http://stats.grats.pw/reg.php'); terminateScript; end; if (not stats_checkDetails()) then begin Writeln('*** STATS BY GRATS *** stats ID/pass wrong, check your details again or check: '); Writeln('*** STATS BY GRATS *** https://villavu.com/forum/showthread.php?t=99977&p=1208343#post1208343'); terminateScript; end; if (not directoryExists(stats_Path)) then forceDirectories(stats_Path); writeINI('General', 'Stats_ID', statsID, stats_Path+stats_File); writeINI('General', 'Stats_Pass', statsPass, stats_Path+stats_File); end; function getState(): Integer; begin if (not isLoggedIn) then exit(3); if (not inCombat(1900 + waitTime)) then exit(0); if (getHealthPercent <= randomHP) then exit(1); exit(2); end; procedure executeState(State: Integer); begin case (State) of 0: attackNPC(); 1: heal(); 2: antiban(); 3: loginPlayer(false); end; sleep(random(100, 150)); clickToContinue(); stats_Commit(); writeln(state); end; begin ClearDebug; updater(); checkSettings(); options := getSettings(); ShowForm(); performChecks(); Stats_Setup('5'); declarePlayer(); initAL(); setup(); repeat executeState(getState()); until (false); end.