Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program FFACW;
- {$DEFINE SMART}
- {$I SRL-6/SRL.simba}
- {$I SPS/lib/sps-rs3.simba}
- var
- PEOPLE: TStringArray = ['ttack Resurrect v2',
- 'ttack Miacon Jr',
- 'ttack Bus action',
- 'ttack agent arr0w',
- {put here the} 'ttack Viznaw',
- {names of the} 'ttack Miacon',
- {kids u ns} 'ttack Amoxile',
- 'ttack Amoxyle',
- 'ttack squad appie',
- 'ttack Aws Da King',
- 'ttack Ad0rable',
- 'ttack Pk Smoke v1',
- 'ttack Pk smoke v2',
- 'ttack Sith998huntr',
- 'ttack Krissy',
- 'ttack Recyle toy',
- 'ttack Cath is pr0',
- 'ttack Viznaw Jr',
- 'ttack God Hates u',
- 'ttack Imtalented',
- 'ttack Barbyland',
- 'ttack Barples',
- 'ttack H U L K K Y',
- 'ttack PermPurple',
- 'ttack 123heart',
- 'ttack Sag Nasty',
- 'ttack Squad God',
- 'ttack YouFailedMe',
- 'ttack BetterShorie',
- 'ttack Fff',
- 'ttack King of FfA',
- 'ttack Glint',
- 'ttack Jzzr',
- 'ttack Curry Ones',
- 'ttack Electus King',
- 'ttack TruEmpeor',
- 'ttack zStephy',
- 'ttack Maarkk',
- 'ttack Werewolf529',
- 'ttack IV Cres',
- 'ttack DONT KNOW NM',
- 'ttack Dead',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack Markk',
- 'ttack Mark',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- 'ttack ',
- //======================== RS3 NS bot===============================
- //================== Set up NS BOT underneath=======================
- PRAYERS: integer = 1; //Use quick prayers? 1 = true 0 = false
- ATTACK: integer = 1; //NS people? 1 = true 0 = false
- LOCATION: string = 'NORMAL'; //HILLS - POND- REST or NORMAL *(Antilure only for NORMAL and REST atm)
- WORLD: integer = 3; //What world? 80 or 3 (Must be on your favs)
- PLAYERNAME: string = 'boss'; //Your player username from Player Manager list
- xpthen, xpnow, gainedxp, deaths, randnum, lures: integer; //leave this or permd
- limit: integer = 10;
- talked: integer = 1; // autotalk? 1= true 0 = false
- //**only edit (declare players procedure) and (talk procedure) under here else permd
- //==================================PERMD===============================
- {---------------------------------------------------}
- {---------Draw Debug - Status line for user---------}
- {---------------------------------------------------}
- procedure writeStatus(status: string);
- begin
- with (smartImage) do
- begin
- clearArea(Mainscreen.getBounds());
- clearArea(intToBox(0, 0, 574, 16));
- drawBox(36, 355 , 294, 375, true, clAqua);
- drawText('NsBot 1.3 by 3ast', point(5, 5), UpCharsEx, false, clRed);
- drawText('Status: ' + status, point(45, 358), UpCharsEx, false, clRed);
- end;
- end;
- {---------------------------------------------------}
- {-------Check if a clan vex has been opened---------}
- {---------------------------------------------------}
- function checkVex(): boolean;
- const
- VEX_COLOR = 256;
- begin
- if result := getColor(157, 125) = VEX_COLOR then
- begin
- wait(250);
- WriteStatus('checkVex Result : ' + toStr(Result));
- end;
- end;
- {---------------------------------------------------}
- {-------Check if a red portal warning open----------}
- {---------------------------------------------------}
- function checkRed(): boolean;
- const
- REDD_COLOR = 1118717;
- begin
- if result := getColor(180, 75) = REDD_COLOR then
- begin
- wait(250);
- WriteStatus('checkRed Result : ' + toStr(Result));
- end;
- end;
- {---------------------------------------------------}
- {-------CLOSE red portal warning--------------------}
- {---------------------------------------------------}
- procedure closeRed();
- var
- box: TBox;
- begin
- writestatus('Closing red.');
- box := intToBox(466, 76, 471, 82);
- mouseBox(box, MOUSE_LEFT);
- wait(randomRange(200,500));
- smallRandommouse();
- end;
- {--------------------------------------------------}
- {----Close vex - Used to remove clan vex screen----}
- {--------------------------------------------------}
- procedure closeVex();
- var
- box: TBox;
- begin
- writestatus('Closing clan vex.');
- box := intToBox(504, 53, 509, 60);
- mouseBox(box, MOUSE_LEFT);
- wait(randomRange(200,500));
- smallRandommouse();
- end;
- {---------------------------------------------------}
- {--------Check if the Poll screen is open-----------}
- {---------------------------------------------------}
- function checkPoll(): boolean;
- const
- POLL_COLOR = 4245242;
- begin
- result := getColor(424, 124) = POLL_COLOR;
- end;
- {--------------------------------------------------}
- {------Close Poll - Used to remove poll screen-----}
- {--------------------------------------------------}
- procedure closePoll();
- var
- box: TBox;
- begin
- writeStatus('Closing poll.');
- box := intToBox(364, 123, 426, 132);
- mouseBox(box, MOUSE_LEFT);
- wait(randomRange(200,500));
- smallRandommouse();
- end;
- {---------------------------------------------------}
- {---------Check for 'Items safe on death'-----------}
- {---------------------------------------------------}
- function inSafe(): boolean;
- const
- SAFE_COLOR = 2070783;
- begin
- result := getColor(538, 219) = SAFE_COLOR;
- end;
- {---------------------------------------------------}
- {---------- Find green portal Antilure ------------}
- {---------------------------------------------------}
- function findGreenPort(): boolean;
- var
- x, y: integer;
- begin
- if not inSafe() then exit();
- if mainscreen.findObject(x, y, 2123333, 21, ['Portal'], MOUSE_MOVE) then
- begin
- result := 1;
- end else
- begin
- result := 0;
- end;
- end;
- {---------------------------------------------------}
- {----------Check if we are at the towers------------}
- {---------------------------------------------------}
- function atTowers(): boolean;
- var
- x, y: integer;
- begin
- result := findColorTolerance(x, y, 9739681, mainscreen.getBounds(), 4);
- end;
- {---------------------------------------------------}
- {---------Check for water/pond on minimap-----------}
- {---------------------------------------------------}
- function findWater(): boolean;
- var
- x, y: integer;
- begin
- if (LOCATION='POND') then exit();
- if result := findColorTolerance(x, y, 5399860, intToBox(706, 133, 767, 147), 5) then
- begin
- wait(200);
- WriteStatus('findWater Result : ' + toStr(Result));
- end;
- end;
- function findTrees(): boolean;
- var
- x, y: integer;
- begin
- if (LOCATION='HILLS') or (LOCATION='POND') then exit();
- if result := findColorTolerance(x, y, 994876, intToBox(672, 32, 747, 42), 5) then
- begin
- wait(250);
- WriteStatus('findTrees Result : ' + toStr(Result));
- end;
- end;
- function findWest(): boolean;
- var
- x, y: integer;
- begin
- if (LOCATION='HILLS') or (LOCATION='POND') then exit();
- if result := findColorTolerance(x, y, 929083, intToBox(706, 125, 669, 83), 5) then
- begin
- wait(250);
- WriteStatus('findWest Result : ' + toStr(Result));
- end;
- end;
- function findEast(): boolean;
- var
- x, y: integer;
- begin
- if (LOCATION='HILLS') or (LOCATION='POND') then exit();
- if result := findColorTolerance(x, y, 993848, intToBox(706, 125, 669, 83), 5) then
- begin
- wait(250);
- WriteStatus('findEast Result : ' + toStr(Result));
- end;
- end;
- {---------------------------------------------------}
- {------------Check for lava on minimap--------------}
- {---------------------------------------------------}
- function findLava(): boolean;
- var
- x, y: integer;
- begin
- result := findColorTolerance(x, y, 1014713, intToBox(626, 27, 745, 169), 4);
- end;
- {---------------------------------------------------}
- {---------Declare Player - Log the user in----------}
- {---------------------------------------------------}
- procedure declarePlayers();
- begin
- players.setup(['joe blo89'], 'default');
- currentPlayer := 0;
- repeat
- players[0].loginToLobby();
- wait(randomRange(1000, 3000));
- Lobby.quickSelectWorld(WORLD);
- wait(randomRange(12000, 20000));
- until not lobby.isOpen();
- wait(randomRange(1000,2000));
- mainscreen.setAngle(MS_ANGLE_HIGH);
- wait(randomRange(1000,2000));
- minimap.setAngle(MM_DIRECTION_EAST);
- wait(randomRange(1000,2000));
- mainscreen.setZoom(true);
- exitTreasure();
- if checkPoll() then
- closePoll();
- end;
- {---------------------------------------------------}
- {---------Draw Debug - Status line for user---------}
- {---------------------------------------------------}
- procedure getXP();
- begin
- xpnow := chatbox.getXPBar();
- gainedxp := (xpnow-xpthen);
- end;
- {---------------------------------------------------}
- {---------Check for 'Walk north to fight'-----------}
- {---------------------------------------------------}
- function FindNorth(): boolean;
- const
- INTERFACE_COLOR = 3635889;
- var
- TPA: TPointArray;
- searchArea := intToBox(138, 5, 437, 52);
- begin
- result := FindColors(TPA, INTERFACE_COLOR, searchArea);
- end;
- {---------------------------------------------------}
- {-------Check if the examine screen is open---------}
- {---------------------------------------------------}
- function checkExamine(): boolean;
- const
- EXAMINE_COLOR = 4217053;
- begin
- result := getColor(218, 19) = EXAMINE_COLOR;
- end;
- {--------------------------------------------------}
- {---Close examine Used to remove examine screen---}
- {--------------------------------------------------}
- procedure closeExamine();
- var
- box: TBox;
- begin
- writeStatus('Closing examine player.');
- box := intToBox(211, 18, 220, 24);
- mouseBox(box, MOUSE_LEFT);
- wait(randomRange(200,500));
- smallRandommouse();
- end;
- {--------------------------------------------------}
- {---------- Talk - Used as an antiban -------------}
- {--------------------------------------------------}
- procedure Talk();
- var
- i: integer;
- MESSAGES: TStringArray := ['tinyurl/resv2logged',
- 'tinyurl/resv2logged',
- 'tinyurl/resv2logged',
- 'tinyurl/resv2logged',
- 'tinyurl/resv2logged',
- 'tinyurl/resv2logged'
- 'tinyurl/resv2logged'
- 'tinyurl/resv2logged'];
- RAND: integer;
- MESSAGE: string;
- begin
- if (talked = 0) then exit;
- RAND := randomRange(1, high(MESSAGES));
- MESSAGE := MESSAGES[RAND];
- talked := 1;
- TypeByte(VK_RETURN);
- wait(randomRange(2000,5000));
- for i:=1 to Length(MESSAGE) do
- SendKeys(MESSAGE[i], 18 + Random(17), 22 + Random(12));
- wait(randomRange(2000,5000));
- TypeByte(VK_RETURN);
- end;
- {---------------------------------------------------}
- {----------Check for multi crosses to log-----------}
- {---------------------------------------------------}
- function inMulti(): boolean;
- const
- MULTI_COLOR = 343638;
- begin
- if result := getColor(258, 29) = MULTI_COLOR then
- begin
- WriteStatus('inMulti Result : ' + toStr(Result));
- end;
- end;
- {--------------------------------------------------}
- {--------Check if Qucik Prayers are enabled--------}
- {--------------------------------------------------}
- function prayersOn(): boolean;
- const
- PRAYERS = 14054042;
- begin
- result := getColor(305, 401) = PRAYERS;
- end;
- {--------------------------------------------------}
- {------Toggle Prayers - Used for NSing people------}
- {--------------------------------------------------}
- procedure togglePrayer();
- var
- box: TBox;
- begin
- if PRAYERS = 0 then exit();
- writeStatus('Toggling prayers.');
- box := intToBox(303, 402, 309, 408);
- mouseBox(box, MOUSE_LEFT);
- end;
- {--------------------------------------------------}
- {---------WalkTo - Walks us to location------------}
- {--------------------------------------------------}
- procedure walkTo(loc: string);
- var
- north, northh, northhh, northhhh, multi, pond, second, third, sit: Tbox;
- begin
- if (PRAYERS=1) then
- begin
- case random(30) of
- 1..25: if (not prayersOn()) then togglePrayer();
- end;
- end;
- case lowerCase(loc) of
- 'rest':
- case random(100) of
- 1..45: begin
- northhh := intToBox(695, 101, 702, 109);
- mouseBox(northhh, MOUSE_LEFT);
- wait(randomrange(2000,5000));
- sit := intToBox(766,27,781,39);
- mouseBox(sit, Mouse_RIGHT);
- wait(randomrange(1300,1900));
- chooseOption.select(['est']);
- wait(250);
- smallRandommouse();
- WriteStatus('Resting as antiban.');
- wait(randomrange(45000,235000));
- end;
- 46..100: begin
- northhhh := intToBox(703, 101, 712, 110);
- mouseBox(northhhh, MOUSE_LEFT);
- wait(randomrange(2000,5000));
- sit := intToBox(766,27,781,39);
- mouseBox(sit, Mouse_RIGHT);
- wait(randomrange(1200,1800));
- chooseOption.select(['est']);
- wait(250);
- smallRandommouse();
- WriteStatus('Resting as antiban.');
- wait(randomrange(30000,200000));
- end;
- end;
- 'hills':
- begin
- writeStatus('Walking to hills.');
- multi := intToBox(785, 80, 785, 105);
- mouseBox(multi, MOUSE_LEFT);
- wait(randomRange(8000, 8500));
- second := intToBox(700, 100, 708 , 115);
- mouseBox(second, MOUSE_LEFT);
- writeStatus('We are at hills.');
- wait(randomRange(2000, 2500));
- end;
- 'pond':
- begin
- case random(100) of
- 1..35: begin
- writeStatus('Walking to pond.');
- pond := intToBox(683, 159, 688, 174);
- mouseBox(pond, MOUSE_LEFT);
- wait(randomRange(7000, 7580));
- second := intToBox(786, 114, 792, 122);
- mouseBox(second, MOUSE_LEFT);
- wait(randomRange(7000, 8000));
- //third := intToBox(703, 99, 712, 113);
- //mouseBox(third, MOUSE_LEFT);
- //wait(randomRange(1000, 2000));
- writeStatus('We are at pond.');
- end;
- 35..100: begin
- writeStatus('Walking to pond.');
- pond := intToBox(738, 163, 754, 172);
- mouseBox(pond, MOUSE_LEFT);
- wait(randomRange(8000, 9000));
- second := intToBox(727, 115, 740, 130);
- mouseBox(second, MOUSE_LEFT);
- wait(randomRange(3000, 4000));
- writeStatus('We are at pond.');
- end;
- end;
- end;
- 'normal':
- begin
- writeStatus('Walking north.');
- case Random(200) of
- 1..67:
- begin
- north := intToBox(340, 120, 480, 350);
- mouseBox(north, MOUSE_MOVE);
- fastClick(MOUSE_RIGHT);
- chooseOption.select(['alk here']);
- end;
- 68..130:
- begin
- northh := intToBox(690, 100, 700, 113);
- mouseBox(northh, MOUSE_LEFT);
- wait(250);
- smallRandommouse(); ;
- end;
- 131..175:
- begin
- case random(8) of
- 1: mouse(point(695, 102), mouse_Left, MOUSE_ACCURATE);
- 2: mouse(point(699, 114), mouse_Left, MOUSE_ACCURATE);
- 3: mouse(point(323, 235), mouse_Left, MOUSE_ACCURATE);
- 4: mouse(point(700, 108), mouse_Left, MOUSE_ACCURATE);
- 5: mouse(point(700, 91), mouse_Left, MOUSE_ACCURATE);
- 6: mouse(point(706, 97), mouse_Left, MOUSE_ACCURATE);
- 7: mouse(point(700, 119), mouse_Left, MOUSE_ACCURATE);
- 8: mouse(point(357, 71), mouse_Left, MOUSE_ACCURATE);
- end;
- end;
- end;
- wait(randomRange(3500, 4500));
- end;
- end;
- end;
- {------Click Portal - Clicks the white portal-------}
- {---------------------------------------------------}
- function clickPortal: Boolean;
- var
- tFrame, tFrameEdge, tPortal, tPortalEdge, tEdge: TPointArray;
- aEdge: T2DPointArray;
- i, safeCheck, AE: Integer;
- p: TPoint;
- b: TBox;
- begin
- Result := False;
- begin
- case random(1000) of
- 1..30: begin
- WriteStatus('Doing mini antiban');
- case random(4) of
- 0: wait(randomRange(1000,10000));
- 1: sleepAndMoveMouse(1000 + random(2000));
- 2: wait(randomRange(2000,20000));
- 3: sleepAndMoveMouse(2000 + random(4000));
- end;
- end;
- end;
- end;
- if not minimap.isRunEnabled() then
- minimap.toggleRun(true);
- Inc(AE);
- if (AE >= randomrange(3,4)) then
- begin
- minimap.clickCompass();
- AE := 0;
- end;
- FindColorsTolerance(tFrame, 1065555, Mainscreen.getBounds(), 5, ColorSetting(2, 0.15, 0.51));
- tFrameEdge := FindTPAEdges(tFrame);
- FindColorsTolerance(tPortal, 10265781, Mainscreen.getBounds(), 20, ColorSetting(2, 0.27, 0.40));
- tPortalEdge := FindTPAEdges(tPortal);
- if (Length(tFrameEdge) < 10) or (Length(tPortalEdge) < 10) then
- Exit(False);
- for i := 0 to High(tPortalEdge) do
- if (NearbyPointInArrayEx(tPortalEdge[i], 5, 5, tFrameEdge)) then
- Insert(tPortalEdge, tEdge);
- aEdge := ClusterTPAEx(tEdge, 5, 5);
- SortATPAFromMidPoint(aEdge, Mainscreen.playerPoint);
- for i := 0 to High(aEdge) do
- begin
- if (Length(aEdge[i]) < 20) then
- Continue();
- p := MiddleTPA(aEdge[i]);
- b := IntToBox(p.x - 12, p.y - 10, p.x + 12, p.y + 10);
- b.setLimit(Mainscreen.getBounds());
- WriteStatus('Searching for safe portal');
- if (getPixelShift(b, 100) > 200) then
- begin
- MouseSpeed := RandomRange(40, 70);
- Mouse(b.getRandomPoint());
- if (isMouseOverText(['(safe)'])) then
- begin
- case Random(75) of
- 0..25:
- begin
- FastClick(MOUSE_LEFT);
- wait(random(500, 780));
- end;
- 26..50:
- begin
- FastClick(MOUSE_LEFT);
- wait(random(500, 3000));
- smallRandomMouse();
- end;
- 51..75:
- begin
- FastClick(MOUSE_LEFT);
- wait(randomRange(100, 200));
- sleepAndMoveMouse(100 + random(200));
- wait(randomRange(400, 700));
- togglePrayer();
- end;
- end;
- wait(randomrange(500,1000));
- if (minimap.isFlagPresent(Random(3000, 4000))) then
- Minimap.waitPlayerMoving();
- Exit(True);
- end;
- end;
- end;
- end;
- {---------------------------------------------------}
- {----------------- Debugs TPA'S --------------------}
- {---------------------------------------------------}
- function DATPAB(MaATPA: T2DPointArray): TPoint;
- var
- i: integer;
- begin
- for I := 0 to (High(MaATPA)) do
- begin
- result := MaATPA[i].getMiddle();
- with (smartImage) do
- begin
- try
- drawPolygon([point(result.x, result.y + 5), point(result.x, result.y + 25)], clLime);
- drawPolygon([point(result.x + 5, result.y), point(result.x + 25, result.y)], clLime);
- drawPolygon([point(result.x - 5, result.y), point(result.x - 25, result.y)], clLime);
- drawPolygon([point(result.x, result.y - 5), point(result.x, result.y - 25)], clLime);
- drawCross(result, 2, clWhite);
- drawCircle(result, 20, false, clRed);
- except end;
- end;
- end;
- end;
- function PtToHyp(I, C: TPoint): Integer;
- begin
- Result := Round(Hypot(I.X - C.X, I.Y - C.Y));
- end;
- {---------------------------------------------------}
- {-----Determines if we're within the circle---------}
- {---------------------------------------------------}
- function WithinCircle(Cx, Cy, Ra: Integer; I: Tpoint): Boolean;
- var
- TP1: Tpoint;
- begin
- TP1 := point(Cx, Cy);
- if PtToHyp(I, TP1) < Ra then
- Result := True
- else
- Result := False;
- end;
- {---------------------------------------------------}
- {------ Determines if we're within the box----------}
- {---------------------------------------------------}
- function WithInBox(SX, SY, EX, EY: Integer; I: Tpoint): Boolean;
- begin
- if (I.X > SX) and (I.X < EX) and (I.Y > SY) and (I.Y < EY) then
- Result := True
- else
- Result := False;
- end;
- {---------------------------------------------------}
- {--------- Checks if the TPA is in bound------------}
- {---------------------------------------------------}
- function InBound(TestPoint: Tpoint): Boolean;
- begin
- if not (WithInBox(mainscreen.x1, mainscreen.y1, mainscreen.x2, mainscreen.y2, TestPoint)) or WithInCircle(15, 137, 10, TestPoint) or WithInCircle(485, 170, 30, TestPoint) or WithInBox(220, 85, 220, 215, TestPoint) or WithInBox(0, 0, 360, 20, TestPoint) then
- Result := False
- else
- Result := True;
- end;
- {-------------------------------------------------}
- {--- Antiban -- Used just before walking north ---}
- {-------------------------------------------------}
- procedure Antiban();
- begin
- case random(310) of
- 1..60: begin
- pickUpMouse();
- wait(randomRange(175,1250));
- end;
- 61..150: begin
- smallRandomMouse();
- wait(randomRange(200,500));
- end;
- 150..214: begin
- mouseOffClient(OFF_CLIENT_RANDOM);
- wait(randomRange(5125,10510));
- end;
- 215..250: begin
- case random(4) of
- 1: hoverSkill(SKILL_ATTACK);
- 2: hoverSkill(SKILL_DEFENCE);
- 3: hoverSkill(SKILL_STRENGTH);
- 4: hoverRandomSkill();
- end;
- wait(randomRange(2000,7500));
- end;
- 251..310: begin
- sleepAndMoveMouse(2150 + random(2000));
- wait(randomRange(500,1250));
- end;
- end;
- end;
- {-------------------------------------------------}
- {---Antiban / Walk into fighting area procedure---}
- {-------------------------------------------------}
- procedure actions();
- begin
- case random(500) of
- 1..89: Antiban();
- 90..500: WalkTo(LOCATION);
- end;
- end;
- {-------------------------------------------------}
- {---- Re Log - Used for if we have been lured ----}
- {-------------------------------------------------}
- procedure reLog();
- begin
- case random(20) of
- 1..12: players[currentPlayer].exitToLobby();
- 13..20: begin
- mouseBox(intToBox(791, 1, 796, 8), MOUSE_LEFT);
- wait(randomRange(1000,2000));
- mouseBox(intToBox(279, 327, 387, 342), MOUSE_LEFT);
- end;
- end;
- wait(randomRange(8000,15000));
- Lobby.quickSelectWorld(WORLD);
- wait(randomRange(8000,15000));
- wait(randomRange(1000,2000));
- mainscreen.setAngle(MS_ANGLE_HIGH);
- wait(randomRange(1000,2000));
- minimap.setAngle(MM_DIRECTION_EAST);
- wait(randomRange(1000,2000));
- mainscreen.setZoom(true);
- exitTreasure();
- if checkPoll() then
- closePoll();
- end;
- {-------------------------------------------------}
- {---Check if we're in combat (getting attacked)---}
- {-------------------------------------------------}
- function inCombat(): boolean;
- var
- adrenalineThen, adrenalineNow: integer;
- begin
- adrenalineThen := actionBar.getAdrenalinePercent();
- if adrenalineThen >= 70 then
- begin
- exit(true);
- end;
- if adrenalineThen > 0 then
- begin
- wait(2000);
- adrenalineNow := actionBar.getAdrenalinePercent();
- if adrenalineThen < adrenalineNow then
- begin
- exit(true);
- end;
- end else
- begin
- exit(false);
- end;
- end;
- {---------------------------------------------------}
- {-----------Find and click white portal-------------}
- {---------------------------------------------------}
- procedure findPortal();
- Var
- PCol, AE, X, Y, PTol, I: Integer;
- TPA : TPointArray;
- ATPA : T2DPointArray;
- Begin
- If FindNorth() Then
- begin
- actions();
- exit;
- end;
- If inSafe() then
- exit;
- writeStatus('Finding portal.');
- minimap.setAngle(MM_DIRECTION_EAST);
- PCol := 1133920;
- PTol := 13;
- If isMouseOverText(['safe)']) Then
- Begin
- writeStatus('Clicking portal.');
- Inc(deaths);
- fastClick(MOUSE_LEFT);
- wait(randomRange(5000,6000));
- minimap.setAngle(MM_DIRECTION_EAST);
- Exit;
- End;
- inc(AE);
- If FindColorsSpiralTolerance( X, Y, TPA, PCol, mainscreen.x1, mainscreen.y1, mainscreen.x2, mainscreen.y2, PTol) Then
- Begin
- SetLength( ATPA, 10);
- ATPA := TPAToATPAEx( TPA, 50, 30);
- For I := 0 To RandomRange( 0, High( ATPA)) Do
- Begin
- If GetColor( 48, 19)= 16777215 Then
- Begin
- Wait( Random( 1000));
- Exit;
- End;
- Mouse(MiddleTPA(ATPA[I]), 2);
- Wait( 10 + Random( 90));
- writeStatus('Finding portal.');
- If isMouseOverText(['safe)']) Then
- Begin
- writeStatus('Clicking portal.');
- Inc(deaths);
- Mouse(MiddleTPA(ATPA[I]), 1);
- wait(randomRange(5000,6000));
- minimap.setAngle(MM_DIRECTION_EAST);
- Exit;
- End;
- If AE > RandomRange( 3, 4) Then
- case Random(75) of
- 0..25: minimap.clickCompass;
- 26..50: minimap.setAngle(random(0, 60));
- end;
- End;
- End;
- end;
- procedure NewNS();
- var
- x, y, i, ii: integer;
- TPA: TPointArray;
- ATPA: T2DPointArray;
- COLORS: TIntegerArray;
- begin
- writeStatus('Finding player.');
- { COLORS := [8087871, 12296544, 9338696, 6970934, 10520914, 6178891, 11623524, 9062253,
- 14189656, 5256233, 7461497, 3169844, 7884087, 8213568, 6378290,
- 6510898, 8919673, 8996735, 9324676, 8546883, 12557154, 13593459,
- 7552069, 5261097, 12411497, 8919929, 5975624, 10979158, 612872,
- 11836253, 7622203, 5456683, 16528616, 5322281, 9009990, 6766121,
- 1918492, 8153663]; }
- COLORS := [8087871, 6974068, 16528616, 3945247, 756024, 2045032,
- 8875589, 2099568, 10704002, 12674211, 12493665, 11556168,
- 10510401, 12427872, 2236966, 11176279, 1624831, 11149974,
- 14137198, 11162973, 13025298, 875684, 10050622,
- 1287141, 5160182, 10062160, 16118296];
- if inCombat() or FindNorth() or not inSafe() then
- exit;
- if (chooseOption.isOpen()) then
- chooseOption.close();
- for i := 0 to high(COLORS) do
- begin
- writeStatus('Finding player.');
- Wait( 100 + random(100) );
- if inCombat() or findNorth() or not inSafe() then
- exit;
- if (chooseOption.isOpen()) then
- chooseOption.close();
- findColorsSpiralTolerance(x, y, TPA, COLORS[i], mainScreen.getBounds(), 3, colorSetting(2, 0.25, 0.84));
- writeStatus('Finding player.');
- ATPA := TPA.toATPA(30, 30);
- ATPA.sortFromMidPoint(mainscreen.playerPoint);
- smartImage.debugATPA(ATPA);
- if high(ATPA) < 1 OR high(ATPA) = 0 then exit();
- if limit > high(ATPA) then
- begin
- limit := high(ATPA);
- end;
- for ii := 0 to limit do
- begin
- Wait( 100 + random(100) );
- if inCombat() or findNorth() or not inSafe() then
- exit;
- if (chooseOption.isOpen()) then
- chooseOption.close();
- writeStatus('Right clicking color.');
- mouse(middleTPA(ATPA[ii]), MOUSE_RIGHT);
- smartImage.clearArea(mainscreen.getBounds());
- if (chooseOption.isOpen()) then
- begin
- wait(RandomRange(100,200));
- if chooseOption.optionsExist(people) then
- begin
- smartImage.clearArea(mainscreen.getBounds());
- writeStatus('Attacking a NS.');
- Wait( 100 + Random( 500));
- chooseOption.select(people);
- if not prayersOn() and inCombat() and PRAYERS = 1 then
- begin
- case random(20) of
- 1..9: togglePrayer();
- end;
- smallRandommouse();
- end;
- writeStatus('Attacking a NS.');
- wait(randomRange(1200,1500));
- exit;
- end else
- begin
- writeStatus('Closing choose option screen.');
- chooseOption.close();
- end;
- end;
- end;
- end;
- end;
- procedure mainLoop();
- begin
- if not isLoggedIn() or lobby.isOpen() then
- declarePlayers();
- if ((ATTACK=1) and not inCombat() and not findNorth() and inSafe()) then
- begin
- writeStatus('Searching for player.');
- NewNS();
- end;
- if (LOCATION='NORMAL') and not inCombat() and not findNorth() and inMulti() then reLog();
- if (LOCATION='NORMAL') and not inCombat() and not findNorth() and findWest() then reLog();
- if (LOCATION='NORMAL') and not inCombat() and not findNorth() and findEast() then reLog();
- if (LOCATION='REST') and not inCombat() and not findNorth() and inMulti() then reLog();
- if (LOCATION='REST') and not inCombat() and not findNorth() and findWest() then reLog();
- if (LOCATION='REST') and not inCombat() and not findNorth() and findEast() then reLog();
- if inSafe() then
- begin
- if actionbar.getAdrenalinePercent() > 49 then
- SendKeys('7', 15+RandomRange(15,100), 20+RandomRange(10,30));
- if actionbar.getAdrenalinePercent() > 99 then
- SendKeys('8', 15+RandomRange(15,100), 20+RandomRange(10,30));
- end;
- if checkExamine() then
- closeExamine();
- {case random(100) of
- 1: if (LOCATION='NORMAL') then antiLure();
- end;
- if (LOCATION='HILLS') then antiLureHills();
- if inMulti() then
- begin
- if (LOCATION='HILLS') then exit();
- if (LOCATION='POND') then exit();
- Inc(lures);
- reLog();
- exit();
- end; }
- case random(1000) of
- 1..75: begin
- randomMouseSpeed(3, 10, 20);
- writeStatus('Changed mouse speed.');
- end;
- end;
- if (checkVex) then
- begin
- WriteStatus('Closing clan vex.');
- closeVex();
- end;
- if (checkRed) then
- begin
- WriteStatus('Closing warning.');
- closeRed();
- end;
- if ((talked=1)) and inCombat() then
- begin
- case random(1100) of
- 34..94: Talk();
- end;
- end;
- if not inSafe() then
- begin
- repeat
- writeStatus('Finding portal.');
- findPortal();
- until (findNorth() OR inSafe() or checkRed() or CheckVex());
- end else
- begin
- if findNorth() then
- begin
- actions();
- end;
- end;
- randnum := random(55212);
- if (randnum < 80) AND not inCombat() then
- begin
- case randnum of
- 12..20: begin
- sleepAndMoveMouse(1000 + random(2000));
- writeLn('Random was 12-20.');
- end;
- 34..42: begin
- pickUpMouse();
- writeLn('Random was 34-42.');
- end;
- 51..59: begin
- smallRandomMouse();
- writeLn('Random was 51-59.');
- end;
- 71..72: begin
- mouseBox(intToBox(235, 150, 360, 260), MOUSE_LEFT);
- writeLn('Random was 71-72.');
- end;
- end;
- end;
- end;
- begin
- smartShowConsole := FALSE;
- smartEnableDrawing := TRUE;
- setupSRL();
- if not isLoggedIn() or lobby.isOpen() then
- declarePlayers();
- writeStatus('Initiated Ns Bot.');
- xpthen := chatbox.getXPBar();
- clearDebug();
- repeat
- smartImage.clearArea(mainscreen.getBounds());
- mainloop();
- if checkVex() then
- begin
- WriteStatus('Closing clan vex.');
- closeVex();
- end;
- if checkRed() then
- begin
- WriteStatus('Closing warning.');
- closeRed();
- end;
- if (chooseOption.isOpen()) then
- chooseOption.close();
- until (false);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement