Script 3:
{==============================================================================\
| F2P Clanwars NS Bot |
| By: RDCA / Albert |
| Version: 1.47 |
| Last update: 3/4/2015 |
\_____________________________________________________________________________}
{==============================================================================\
| Setup |
|==============================================================================|
| * Edit who to attack line 70 |
| |
| * Edit Freedom and Anticipation on lines 52 and 53 |
| Tip: Have revolution enabled, have anticiption |
| on slot 5 and keybind number 5, and freedom |
| on slot 9 and keybind number 9. |
| |
| * Move your player info in the top left corner |
| Picture: http://prntscr.com/69alm3 |
| |
| * Make sure your 100% spec and 50% are the same slot and |
number |
| Example: Slot 8, number 8, Slot 7, number 7 |
| |
| * OS preset, chatbox as small as possible, ability bar on |
| top, and both interface and ability bar locked |
\_____________________________________________________________________________}
{==============================================================================\
| Features |
|==============================================================================|
| * Portal Detection * Attack people |
| * Progress report * Fix glitch |
| * Talk to taunt * Fix stun/snare |
| * Human error * Quick prayers |
| * Status bar * Antiban |
| * Fail safes * Antilure |
| * XP Tracker * 100% spec |
| * 100% color * 50% spec |
| * RS Update checker * World selection |
| * Closes clan vex * Weapon switching |
| * Re-wield arrows * and much more! |
\_____________________________________________________________________________}
program FFACW;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I srl-6/lib/misc/srlplayerform.simba}
var
ANTISLOT: integer = 5; { This is the slot for anticipation }
FREESLOT: integer = 9; { This is the slot for freedom }
ACCOUNTNAME: string = 'OQZ'; { Put your account name here }
MELEE_BAR: integer = 1; { Ability bar with melee abilities }
RANGE_BAR: integer = 3; { Ability bar with range abilities }
PRAYERS, MULTI, ATTACKUSR, ANTIB, SWITCHWEAPONS, HUMANERROR, ANTILURE, ATTALL, TALKPPL, FIXGLITCH, REST: boolean;
RUNEDTM, SPEC, MINISPEC, scriptPaintBMP, randnum, screenCount, GP, Green, bna: integer;
timesChanged, userDeaths, attacks, lures, relogs, msgsent, xpbefore, xpnow, xpgained, detectedGlitch,AF, stunned, THEWORLD, rested, randAngle, talked: integer = 0;
ATTACK_USER: TStringArray;
{---------------------------------------------------}
{--- doTarget - Prepares the script with targets ---}
{---------------------------------------------------}
procedure doTarget();
begin
if (not ATTALL) then
begin
ATTACK_USER := ['ttack Jollyjake2',
'ttack Cell 18',
'ttack Paigonz',
'ttack Cetas',
'ttack Hawkwork',
'ttack Shiva Hari',
'ttack Kaneo2007',
'ttack LOX',
'ttack Nagnoc',
'ttack Alien cook',
'ttack Hawkwork',
'ttack Shook Ones',
'ttack We Superior',
'ttack DTF Rohan',
'ttack DTF'];
end else
begin
ATTACK_USER := ['ttack '];
end;
end;
{---------------------------------------------------}
{------Clear Screen - Clears the debug screen-------}
{---------------------------------------------------}
procedure ClearScreenDebug;
begin
smartImage.clearArea(intToBox(0, 0, 574, 365));
smartImage.clearArea(intToBox(576, 0, 698, 598));
smartImage.clearArea(intToBox(1, 387, 575, 458));
Cleardebug;
end;
{---------------------------------------------------}
{---------Draw Debug - Status line for user---------}
{---------------------------------------------------}
procedure WSB(status: string);
begin
ClearScreenDebug();
with (smartImage) do
begin
clearArea(intToBox(0, 367, 574, 385));
drawBox(0, 367, 574, 385, true, clAqua);
drawBox(0, 367, 65, 385, true, clTeal);
drawText('Status: ', point(14, 368), UpCharsEx, false, clAqua);
drawText( + status, point(79, 368), UpCharsEx, false, clTeal);
end;
end;
{---------------------------------------------------}
{--------- clickArrow - Wields rune arrows ---------}
{---------------------------------------------------}
procedure wieldArrows();
var
X,Y:integer;
begin
RUNEDTM := DTMFromString('mlwAAAHicY2dgYOBnARJALATEPEAsC8RiQMwGxN2MDAzTgHgGEM8C4mYgboKKMTAwMcQL8zL0yIqAaVMHVwY9c2swGwTkkLAkFIPYjHgwFAAAJDUIxg==');
if (tabBackpack.open()) then
begin
WSB('Backpack is open.');
if FindDTM(RUNEDTM, x, y, 581, 293, 792, 567) then
begin
mouse(x, y, MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['ield','une','rrow']) then
begin
wait(randomrange(600,1200));
ClickMouse(X, Y, mouse_left);
WSB('Wielded rune arrows.');
wait(randomrange(200,1400));
smallRandomMouse();
end;
end;
FreeDTM(RUNEDTM);
end;
end;
{---------------------------------------------------}
{------- changeWeapons - Used for switching --------}
{---------------------------------------------------}
procedure changeWeapons();
var
CURRENT_BAR: integer;
begin
CURRENT_BAR := actionBar.getCurrentBar();
if (CURRENT_BAR = MELEE_BAR) then
begin
WSB('We are fighting with Melee.');
wait(randomRange(200,300));
WSB('Switching to Range.');
KeyDown(VK_B);
wait(RandomRange(100, 200));
KeyUp(VK_B);
wait(randomRange(1000,1500));
KeyDown(VK_N);
wait(RandomRange(100, 200));
KeyUp(VK_N);
wait(randomRange(1000,1500));
KeyDown(VK_M);
wait(RandomRange(100, 200));
KeyUp(VK_M);
wait(randomRange(1000,1500));
KeyDown(VK_3);
wait(RandomRange(100, 200));
KeyUp(VK_3);
wait(randomRange(500,600));
WSB('We are now fighting with Range.');
end else
begin
if (CURRENT_BAR = RANGE_BAR) then
begin
WSB('We are fighting with Range.');
wait(randomRange(200,300));
WSB('Switching to Melee.');
KeyDown(VK_B);
wait(RandomRange(100, 200));
KeyUp(VK_B);
wait(randomRange(1000,1500));
KeyDown(VK_N);
wait(RandomRange(100, 200));
KeyUp(VK_N);
wait(randomRange(1000,1500));
KeyDown(VK_M);
wait(RandomRange(100, 200));
KeyUp(VK_M);
wait(randomRange(1000,1500));
KeyDown(VK_1);
wait(RandomRange(100, 200));
KeyUp(VK_1);
wait(randomRange(500,600));
WSB('We are now fighting with Melee.');
end;
end;
end;
{---------------------------------------------------}
{------Draw Boot Status -- Used when relogging------}
{---------------------------------------------------}
procedure BOOT(status: string);
begin
with (smartImage) do
begin
clearArea(intToBox(0, 0, 574, 16));
drawBox(0, 0, 574, 16, true, clRed);
drawBox(0, 0, 65, 16, true, clMaroon);
drawText('Boot: ', point(11, 1), UpCharsEx, false, clRed);
drawText( + status, point(80, 1), UpCharsEx, false, clMaroon);
end;
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
WSB('Closing poll.');
box := intToBox(364, 123, 426, 132);
mouseBox(box, MOUSE_LEFT);
wait(randomRange(200,500));
smallRandommouse();
end;
{---------------------------------------------------}
{------Check if red portal warning is open----------}
{---------------------------------------------------}
function checkWarning(): boolean;
const
WARNING_COLOR = 1909802;
begin
result := getColor(480, 92) = WARNING_COLOR;
end;
{--------------------------------------------------}
{------Close Poll - Used to remove poll screen-----}
{--------------------------------------------------}
procedure closeWarning();
var
box: TBox;
begin
WSB('Closing red portal warning.');
case random(100) of
0..49: begin
box := intToBox(474, 86, 484, 94);
mouseBox(box, MOUSE_LEFT);
wait(randomRange(200,500));
end;
50..100: begin
KeyDown(VK_ESCAPE);
end;
end;
smallRandommouse();
minimap.clickCompass();
wait(randomRange(1000,2000));
mainscreen.setAngle(MS_ANGLE_HIGH);
wait(randomRange(500,2000));
end;
{---------------------------------------------------}
{----------Check if Lured West - Antilure-----------}
{---------------------------------------------------}
function findWest(): boolean;
var
x, y: integer;
begin
if (not ANTILURE) then exit();
if result := findColorTolerance(x, y, 929083, intToBox(706, 125, 669, 83), 5) then
begin
wait(250 + random(20));
WSB('Have we been lured west? ' + toStr(Result));
end;
end;
{---------------------------------------------------}
{----------Check if Lured East - Antilure-----------}
{---------------------------------------------------}
function findEast(): boolean;
var
x, y: integer;
begin
if (not ANTILURE) then exit();
if result := findColorTolerance(x, y, 993848, intToBox(706, 125, 669, 83), 5) then
begin
wait(250 + random(20));
WSB('Have we been lured east? ' + toStr(Result));
end;
end;
{---------------------------------------------------}
{---------Check for 'Items safe on death'-----------}
{---------------------------------------------------}
function inSafe(): boolean;
const
SAFE_COLOR = 2070783;
begin
result := getColor(538, 219) = SAFE_COLOR;
end;
{--------------------------------------------------}
{-----doScreen - Sets screen up for procedures-----}
{--------------------------------------------------}
procedure doScreen();
begin
if ((minimap.getAngleDegrees() > 105) or (minimap.getAngleDegrees() < 75)) then
begin
writeLn('Camera angle is: ' + toStr(minimap.getAngleDegrees()) + ' - Changing to EAST');
wait(randomRange(200,600));
minimap.setAngle(90);
wait(randomRange(400,800));
writeLn('Camera angle is: ' + toStr(minimap.getAngleDegrees()) + ' - change completed.');
end;
end;
{---------------------------------------------------}
{---------Declare Player - Log the user in----------}
{---------------------------------------------------}
procedure declarePlayers();
var
i: integer;
begin
wait(randomRange(1000,2000));
clearScreenDebug;
players.setup(playerform.players);
currentPlayer := 0;
players[currentPlayer].world := strToInt(playerForm.players[currentPlayer].settings[0]);
players[currentPlayer].login();
wait(randomRange(1000,2000));
mainscreen.setAngle(MS_ANGLE_HIGH);
wait(randomRange(1000,2000));
doScreen();
wait(randomRange(1000,2000));
exitTreasure();
if checkPoll() then
closePoll();
mainscreen.setZoom(true);
end;
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'RDCANS - Player form';
editBoxLabels := ['World', '100% Spec Key', '50% Spec Key'];
editBoxDefaults := ['3', '8', '7'];
checkBoxLabels := [
'Quick prayers',
'Walk to multi',
'Antiban',
'Antilure',
'Attack people',
'Attack everyone',
'Switch Weapons',
'Human Error',
'Talk',
'Fix glitch',
'Rest'];
checkBoxDefaults := [
'True',
'False',
'True',
'True',
'False',
'False',
'False',
'True',
'False',
'True',
'True'];
end;
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 a clan vex has been opened---------}
{---------------------------------------------------}
function checkVex(): boolean;
const
VEX_COLOR = 1182724;
begin
result := getColor(262, 185) = VEX_COLOR;
end;
{--------------------------------------------------}
{----Close vex - Used to remove clan vex screen----}
{--------------------------------------------------}
procedure closeVex();
begin
WSB('Closing clan vex.');
KeyDown(VK_ESCAPE);
smallRandommouse();
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
WSB('Closing examine player.');
box := intToBox(211, 18, 220, 24);
mouseBox(box, MOUSE_LEFT);
wait(randomRange(200,500));
smallRandommouse();
end;
{---------------------------------------------------}
{----------Check for multi crosses to log-----------}
{---------------------------------------------------}
function inMulti(): boolean;
const
MULTI_COLOR = 343638;
begin
result := getColor(258, 29) = MULTI_COLOR;
end;
{--------------------------------------------------}
{--------Check if Quick Prayers are enabled--------}
{--------------------------------------------------}
function prayersOn(): boolean;
const
ICON_COLOR = 9060948;
var
TPA: TPointArray;
searchArea := intToBox(299, 395, 313, 414);
begin
result := FindColors(TPA, ICON_COLOR, searchArea);
end;
{--------------------------------------------------}
{------Toggle Prayers - Used for NSing people------}
{--------------------------------------------------}
procedure togglePrayer();
begin
if not (PRAYERS) then exit;
if actionBar.getPrayerPercent() = 0 then exit;
WSB('Toggling prayers.');
actionBar.mouseIcon(AB_BAR_PRAYER, MOUSE_LEFT);
wait(randomRange(200, 600));
sleepAndMoveMouse(200 + random(600));
end;
{-------------------------------------------------}
{---Check if we're in combat (getting attacked)---}
{-------------------------------------------------}
function inCombat(): boolean;
const
KEY_COLOR = 1675987;
var
TPA: TPointArray;
searchArea := intToBox(0, 0, 105, 25);
begin
result := FindColors(TPA, KEY_COLOR, searchArea);
end;
{--------------------------------------------------}
{---------- Talk - Used as an antiban -------------}
{--------------------------------------------------}
procedure Talk();
var
i: integer;
MESSAGES: TStringArray := ['Wb Roofl',
'Rr0flrf wb',
'Nicy try lool',
'Why u avoiding rooofl',
'rf0flro',
'u mad? r0flrf0',
'Stop avoiding? r0flro',
'Dont log pls loool',
'dont nap idiot r0flr0frl'
'Gl r0flr i dont off l00l',
'Still permd r00fl',
'Nice nap r00ofl',
'R0flrfl still permd kid',
'l0l dont avoid king ' + ACCOUNTNAME,
'Wyd l0l rofl',
'dumb paki l0l',
'idiot indian kid',
'Think im off u? l00l',
'r0flr0fl dont rage',
'l000l dont get mad',
'no offs r0fl',
'gl in ffa kid l000l',
'ur acc is crap 0flr0flr',
'wow ur weak l0000l',
'ur good xp r0frofl',
'wb slave r0flr0l'];
RAND: integer;
MESSAGE: string;
begin
if (talked = 1) then exit;
RAND := randomRange(0, high(MESSAGES));
MESSAGE := MESSAGES[RAND];
inc(msgsent);
talked := 1;
TypeByte(VK_RETURN);
wait(randomRange(200,500));
for i:=1 to Length(MESSAGE) do
SendKeys(MESSAGE[i], 18 + Random(17), 22 + Random(12));
wait(randomRange(200,500));
TypeByte(VK_RETURN);
end;
{--------------------------------------------------}
{------ Talk - Used as an antilure antiban --------}
{--------------------------------------------------}
procedure talkAntilure();
var
i: integer;
MESSAGES: TStringArray := ['luring me wont make me off u r0flr',
'lures arent offs lmao rip',
'r00fl trying to lure king ' + ACCOUNTNAME,
'try harder next time l0l',
'maybe next time rflrf0rl',
'dumb paki luring king ' + ACCOUNTNAME,
'idiot indian luring god ' + ACCOUNTNAME,
'yea dont think so rofl kid'];
RAND: integer;
MESSAGE: string;
begin
RAND := randomRange(0, high(MESSAGES));
MESSAGE := MESSAGES[RAND];
TypeByte(VK_RETURN);
wait(randomRange(200,500));
for i:=1 to Length(MESSAGE) do
SendKeys(MESSAGE[i], 18 + Random(17), 22 + Random(12));
wait(randomRange(200,500));
TypeByte(VK_RETURN);
end;
{-------------------------------------------------}
{----- doEmote - Used for relogging antiban ------}
{-------------------------------------------------}
procedure doEmote();
begin
case random(100) of
0..50: typeByte(VK_Q);
51..100: typeByte(VK_Z);
end;
end;
{-------------------------------------------------}
{---- Rest - Used as a random antiban feature ----}
{-------------------------------------------------}
procedure doRest();
var
box: TBox;
begin
if ((findNorth) or (not inSafe)) then exit();
box := intToBox(765,25,780,40);
mouseBox(box, Mouse_RIGHT);
wait(randomrange(1300,1900));
chooseOption.select(['est']);
wait(250 + random(20));
rested := 1;
smallRandommouse();
end;
{-------------------------------------------------}
{---- Re Log - Used for if we have been lured ----}
{-------------------------------------------------}
procedure reLog();
begin
BOOT('Attempting to relog.');
if inCombat() then wait(randomRange(10000,20000));
if ((findNorth) OR (not inSafe)) then exit();
wait(randomRange(1000,2000));
{if (ANTIB) then
begin
if (TALKPPL) then
begin
case random(10) of
0..2: talkAntilure();
3..8: doEmote();
9..10: doRest();
end;
end else
begin
case random(10) of
0..7: doEmote();
8..10: doRest();
end;
end;
wait(randomRange(2000,4000));
end;}
inc(relogs);
players[currentPlayer].exitToLobby();
wait(randomRange(2000,3000));
declarePlayers();
end;
{-------------------------------------------------}
{-Check Stuck--Checks if we are stunned or snared-}
{-------------------------------------------------}
function checkStuck(): boolean;
var
KEYWORDS: TStringArray;
begin
KEYWORDS := ['You''ve been prevented from moving.',
'You can''t reach that.',
'You can''t do that while stunned.'];
result := chatbox.findText(KEYWORDS);
end;
{-------------------------------------------------}
{----- Check Fight - Check if we're glitched -----}
{-------------------------------------------------}
procedure checkStunned();
begin
if (actionBar.getAbilityCooldown(FREESLOT) = 100) then
begin
if checkStuck then
begin
if (HUMANERROR) then
begin
case random(30) of
1..28: begin
WSB('We detected that you''re stunned, fixing!');
inc(stunned);
case Random(50) of
0..25:
begin
ActionBar.clickSlot(FREESLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(inttostr(FREESLOT), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
end;
end;
end else
begin
WSB('We detected that you''re stunned, fixing!');
inc(stunned);
case Random(50) of
0..25:
begin
ActionBar.clickSlot(FREESLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(inttostr(FREESLOT), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
end;
wait(randomRange(100,198));
smallrandommouse();
end else
if not checkStuck then
begin
WSB('We didn''t detect that you were stunned.');
end;
end;
end;
{-------------------------------------------------}
{--Check Our Fight -- Search chatbox for message--}
{-------------------------------------------------}
function checkOurFight(): boolean;
var
KEYWORDS: TStringArray;
begin
KEYWORDS := ['You''re already fighting someone else!'];
result := chatbox.findText(KEYWORDS);
end;
{-------------------------------------------------}
{----- Check Fight - Check if we're glitched -----}
{-------------------------------------------------}
procedure checkFight();
begin
if checkOurFight then
begin
WSB('We detected that you''re glitched, fixing!');
inc(detectedGlitch);
case Random(50) of
0..25:
case Random(50) of
0..25:
begin
ActionBar.clickSlot(FREESLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(inttostr(FREESLOT), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
26..50:
case Random(50) of
0..25:
begin
ActionBar.clickSlot(ANTISLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(inttostr(ANTISLOT), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
end;
end else
if not checkOurFight then
begin
WSB('We didn''t detect that you were glitched.');
end;
end;
{--------------------------------------------------}
{---------WalkTo - Walks us to location------------}
{--------------------------------------------------}
procedure walkTo(loc: string);
var
north, multi, second, third: Tbox;
begin
doScreen();
if not minimap.isRunEnabled() then
minimap.toggleRun(true);
if (PRAYERS) then
begin
if (HUMANERROR) then
begin
case random(30) of
1..26: if (not prayersOn()) then TogglePrayer();
end;
end else
begin
if (not prayersOn()) then TogglePrayer();
end;
end;
case lowerCase(loc) of
'hills':
begin
WSB('Walking to hills.');
case random(20) of
1..9: begin
multi := intToBox(785, 80, 785, 105);
mouseBox(multi, MOUSE_LEFT);
wait(randomRange(8000, 8500));
second := intToBox(700, 100, 708 , 115);
mouseBox(second, MOUSE_LEFT);
wait(randomRange(2000, 2500));
end;
10..20: begin
multi := intToBox(712, 96, 732, 116);
mouseBox(multi, MOUSE_LEFT);
wait(randomRange(2500,3000));
second := intToBox(742, 87, 750, 108);
mouseBox(second, MOUSE_LEFT);
wait(randomRange(4000,5000));
third := intToBox(715, 105, 720, 122);
mouseBox(third, MOUSE_LEFT);
wait(randomRange(1000,2000));
end;
end;
end;
'normal':
begin
WSB('Walking north.');
case Random(175) of
1..70:
begin
north := intToBox(340, 120, 480, 350);
mouseBox(north, MOUSE_MOVE);
wait(randomRange(200,500));
fastClick(MOUSE_RIGHT);
chooseOption.select(['alk here']);
end;
71..120:
begin
north := intToBox(695, 88, 716, 124);
mouseBox(north, MOUSE_LEFT);
end;
121..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(2500, 3500));
if (REST) AND (rested = 0) then
begin
case random(5) of
1..2: begin
if (minimap.isResting()) then exit;
doRest();
rested := 1;
end;
end;
end;
if ((random(500) < 20) AND (randAngle = 0)) then
begin
WSB('Changing camera angle');
minimap.setAngle(randomRange(1 + random(5),350 + random(7)));
randAngle := 1;
end;
wait(randomRange(1000,2000));
end;
end;
if (minimap.isFlagPresent(Random(4000, 5000))) then
Minimap.waitPlayerMoving();
end;
{-------------------------------------------------}
{--- Antiban -- Used just before walking north ---}
{-------------------------------------------------}
procedure Antiban();
begin
bna := 1;
WSB('Running antiban procedure');
MouseSpeed := RandomRange(30, 60);
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(5) of
0: hoverSkill(SKILL_ATTACK);
1: hoverSkill(SKILL_DEFENCE);
2: hoverSkill(SKILL_STRENGTH);
3: hoverRandomSkill();
4: hoverOnlineFriend();
end;
wait(randomRange(2000,7500));
end;
251..310: begin
sleepAndMoveMouse(2150 + random(2000));
wait(randomRange(500,1250));
end;
end;
if (MULTI) then
begin
WalkTo('HILLS');
end else
begin
WalkTo('NORMAL');
end;
end;
{-------------------------------------------------}
{---Antiban / Walk into fighting area procedure---}
{-------------------------------------------------}
procedure actions();
begin
if ((ANTIB) AND (bna=0)) then
begin
case random(500) of
1..60: Antiban();
61..500:begin
if (MULTI) then
begin
WalkTo('HILLS');
end else
begin
WalkTo('NORMAL');
end;
end;
end;
end else
begin
if (MULTI) then
begin
WalkTo('HILLS');
end else
begin
WalkTo('NORMAL');
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;
doScreen();
if (ANTIB) then
begin
case random(1000) of
1..50: begin
WSB('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 checkWarning() then closeWarning();
if not minimap.isRunEnabled() then
minimap.toggleRun(true);
case random(100) of
25..60: wieldArrows();
end;
if ((userDeaths >= randomRange(20,30)) AND (SWITCHWEAPONS)) then
begin
changeWeapons;
inc(timesChanged);
end;
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());
WSB('We are searching for safe portal');
if (getPixelShift(b, 100) > 200) then
begin
MouseSpeed := RandomRange(40, 70);
Mouse(b.getRandomPoint());
if (isMouseOverText(['(safe)'])) then
begin
inc(userDeaths);
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;
ClearScreenDebug;
talked := 0;
bna := 0;
case random(5) of
1: rested := 0;
end;
case random(3) of
1: randAngle := 0;
end;
wait(randomrange(500,1000));
if (minimap.isFlagPresent(Random(3000, 4000))) then
Minimap.waitPlayerMoving();
Exit(True);
end;
if checkWarning() then closeWarning();
Exit(True);
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;
{---------------------------------------------------}
{-------Get Target -- Find one of our slaves--------}
{---------------------------------------------------}
function getTarget: Boolean;
var
FPCol, FPTol, TotalTries, ATT, AE: Integer;
TP: Tpoint;
I: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
ATTACK: TStringArray;
Pt, FT, AEt: TTimeMarker;
p: TPoint;
b: TBox;
begin
Result := False;
if (PRAYERS) then
begin
FPCol := 11251383;
FPTol := 44;
end
else
begin
FPCol := 8083511;
FPTol := 50;
end;
if not isLoggedIn() or lobby.isOpen() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are not logged in');
Exit(True);
end;
if inCombat() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are already in combat, can''t engage in another fight');
Exit(True);
end;
if not inSafe then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are in the lobby, can''t engage in combat here');
Exit(True);
end;
if findNorth() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are in the safe zone, can''t engage in combat here');
Exit(True);
end;
if (FIXGLITCH) then
begin
checkFight();
end;
if inSafe() then
if (minimap.isFlagPresent(Random(2000, 4000))) then
Minimap.waitPlayerMoving();
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
Inc(ATT);
Inc(TotalTries);
WSB('Attempted to find target ' + IntToStr(ATT) + ' times');
if FindColorsSpiralTolerance(TP.X, TP.Y, TPA, FPCol, mainscreen.x1 + 10, mainscreen.y1 + 10, mainscreen.x2 - 10, mainscreen.y2 - 10, FPTol) then
begin
ATPA := TPAToATPAEx(TPA, 45, 45);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
DATPAB(ATPA);
for I := 0 to Random(High(ATPA)) do
begin
if not isLoggedIn() or lobby.isOpen() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are not logged in');
Exit(True);
end;
if inCombat() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are already in combat, can''t engage in another fight');
Exit(True);
end;
if not inSafe() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are in the lobby.');
Exit(True);
end;
if findNorth() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
WSB('We are in safe zone.');
Exit(True);
end;
MouseSpeed := RandomRange(30, 60);
if InBound(MiddleTPA(ATPA[I])) then
begin
p := MiddleTPA(ATPA[I]);
b := IntToBox(p.x - 12, p.y - 10, p.x + 12, p.y + 10);
b.setLimit(Mainscreen.getBounds());
Mouse(b.getRandomPoint());
if (isMouseOverText(ATTACK_USER)) then
begin
fastClick(MOUSE_LEFT);
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
ATT := 0;
Inc(attacks);
AF := 0;
WSB('Found target successfully in (' + ToStr(ATT) + ' tries)');
Exit(True);
end;
if not (isMouseOverText(ATTACK_USER)) then
begin
FastClick(MOUSE_RIGHT);
if not chooseOption.optionsExist(ATTACK_USER) then
begin
chooseOption.close();
WSB('Target has not been found!');
end;
if chooseOption.optionsExist(ATTACK_USER) then
begin
if chooseOption.optionsExist(['ttack']) then
begin
chooseOption.select(ATTACK_USER, MOUSE_LEFT);
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
ATT := 0;
AF := 0;
Inc(attacks);
WSB('Found target successfully');
Exit(True);
end;
end;
end;
end;
end;
end;
end;
end;
{-------------------------------------------------}
{----Time Running - Returns the script runtime----}
{-------------------------------------------------}
function timeRunning(TheType: Integer = TIME_FORMAL_LONG): string;
override;
begin
Result := msToTime(GetTimeRunning(), TIME_SHORT);
end;
{-------------------------------------------------}
{------do Spec - Does the 100% special attack-----}
{-------------------------------------------------}
procedure doSpec();
begin
if not inCombat then exit;
WSB('Using 100% spec.');
if (HUMANERROR) then
begin
case random(30) of
1..24: begin
case Random(50) of
0..19:
begin
ActionBar.clickSlot(SPEC, MOUSE_MOVE);
Fastclick(MOUSE_LEFT);
wait(randomRange(100,500));
smallRandomMouse();
end;
20..50:
begin
sendKeys(inttostr(SPEC), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
end;
end;
end else
begin
case Random(50) of
0..19:
begin
ActionBar.clickSlot(SPEC, MOUSE_MOVE);
Fastclick(MOUSE_LEFT);
wait(randomRange(100,500));
smallRandomMouse();
end;
20..50:
begin
sendKeys(inttostr(SPEC), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
end;
end;
{-------------------------------------------------}
{------doMiniSpec - Does the 50% special attk-----}
{-------------------------------------------------}
procedure doMiniSpec();
begin
if not inCombat then exit;
WSB('Using 50% spec.');
if (HUMANERROR) then
begin
case random(30) of
1..24: begin
case Random(50) of
0..19:
begin
ActionBar.clickSlot(MINISPEC, MOUSE_MOVE);
Fastclick(MOUSE_LEFT);
wait(randomRange(100,500));
smallRandomMouse();
end;
20..50:
begin
sendKeys(inttostr(MINISPEC), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
end;
end;
end else
begin
case Random(50) of
0..19:
begin
ActionBar.clickSlot(MINISPEC, MOUSE_MOVE);
Fastclick(MOUSE_LEFT);
wait(randomRange(100,500));
smallRandomMouse();
end;
20..50:
begin
sendKeys(inttostr(MINISPEC), 15+RandomRange(15,100), 20+RandomRange(10,30));
end;
end;
end;
end;
{-------------------------------------------------}
{----Count XP - Counts XP gained this session-----}
{-------------------------------------------------}
procedure countXP();
begin
xpnow := chatbox.getXPBar();
xpgained := (xpnow - xpbefore);
end;
{-------------------------------------------------}
{-----Progress Report - Draws progress report-----}
{-------------------------------------------------}
procedure progressReport();
begin
countXP();
with (smartImage) do
begin
drawBitmap(scriptPaintBMP, Point(1, 464));
drawText(ToStr(timeRunning), Point(93, 492), 'UpChars', true, 13667100);
drawText(ToStr(relogs), Point(81, 542), 'UpChars', true, 13667100);
drawText(ToStr(msgsent), Point(135, 562), 'UpChars', true, 13667100);
drawText(ToStr(stunned), Point(327, 543), 'UpChars', true, 13667100);
drawText(ToStr(detectedGlitch), Point(344, 562), 'UpChars', true, 13667100);
drawText(ToStr(xpgained), Point(313, 493), 'UpChars', true, 13667100);
end;
end;
{-------------------------------------------------}
{------- Main Loop - This is the main loop -------}
{-------------------------------------------------}
procedure mainLoop();
begin
if not isLoggedIn() or lobby.isOpen() then
declarePlayers();
if (checkVex) then
begin
WSB('Closing clan vex.');
closeVex();
end;
if (ATTACKUSR) then
begin
WSB('Searching for player.');
getTarget();
ClearScreenDebug;
end;
if (checkVex) then
begin
WSB('Closing clan vex.');
closeVex();
end;
if ((actionbar.getAdrenalinePercent() > 49) AND (actionbar.getAdrenalinePercent() < 80)) then
begin
doMiniSpec();
end;
if actionbar.getAdrenalinePercent() > 99 then
begin
doSpec();
end;
if (ANTILURE) and not inCombat() and inSafe() and not findNorth() then
begin
if (MULTI) then
begin
if findWest() or findEast() then relog;
end;
if (not MULTI) then
begin
if inMulti() OR findWest() or findEast() then relog;
end;
end;
if (inSafe) and not (findNorth) and (inCombat) then
begin
checkStunned();
end;
if (ANTIB) then
begin
case random(15) of
1: smallRandomMouse();
end;
end;
if (TALKPPL) and inCombat() then
begin
case random(1100) of
42..93: Talk();
end;
end;
if checkExamine() then
closeExamine();
if inCombat then
begin
WSB('We are in combat');
end;
if not inCombat and insafe then
begin
WSB('Running main loop');
end;
if not inSafe() then
begin
clickPortal();
end else
begin
if findNorth() then
begin
WSB('We are in safe zone.');
actions();
end;
end;
randnum := random(2000);
if ((randnum < 53) AND not (ATTACKUSR) AND not inCombat() AND (ANTIB)) then
begin
WSB('Running mini antiban');
case randnum of
1..12: begin
sleepAndMoveMouse(1000 + random(2000));
end;
13..22: begin
pickUpMouse();
end;
23..48: begin
smallRandomMouse();
end;
49..50: begin
mouseBox(intToBox(235, 150, 360, 260), MOUSE_LEFT);
end;
51..52: begin
MouseSpeed := RandomRange(30, 60);
end;
end;
end;
case random(150) of
1..70: wait(randomRange(200,2000));
81..140: wait(randomRange(500,5000));
end;
progressReport();
end;
begin
smartShowConsole := FALSE;
smartEnableDrawing := TRUE;
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
begin
terminatescript;
end;
setupSRL();
if not isLoggedIn() or lobby.isOpen() then
declarePlayers();
scriptPaintBMP := loadBitmap('pattern.png');
xpbefore := chatbox.getXPBar();
progressReport();
doTarget();
THEWORLD := strToInt(playerForm.players[0].settings[0]);
SPEC := strToInt(playerForm.players[0].settings[1]);
MINISPEC := strToInt(playerForm.players[0].settings[2]);
PRAYERS := StrToBool(playerForm.players[0].settings[3]);
MULTI := StrToBool(playerForm.players[0].settings[4]);
ANTIB := StrToBool(playerForm.players[0].settings[5]);
ANTILURE := StrToBool(playerForm.players[0].settings[6]);
ATTACKUSR := StrToBool(playerForm.players[0].settings[7]);
ATTALL := StrToBool(playerForm.players[0].settings[8]);
SWITCHWEAPONS := StrToBool(playerForm.players[0].settings[9]);
HUMANERROR := StrToBool(playerForm.players[0].settings[10]);
TALKPPL := StrToBool(playerForm.players[0].settings[11]);
FIXGLITCH := StrToBool(playerForm.players[0].settings[12]);
REST := StrToBool(playerForm.players[0].settings[13]);
WSB('Initiated script.');
wait(randomRange(1000,2000));
mainscreen.setAngle(MS_ANGLE_HIGH);
wait(randomRange(1000,2000));
doScreen();
wait(randomRange(1000,2000));
clearDebug();
repeat
mainloop();
if (chooseOption.isOpen()) then
chooseOption.close();
until (false);
end.