Lucidity
2014-12-02 14:28:51
How Long have You Played Runescape?
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, Html
Are you a member of any other communities?
Rune-server
Tell us about yourself…
Please show us one (or multiple) of your scripts.
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, Html
Are you a member of any other communities?
Rune-server
Tell us about yourself…
From: Bly
My name is Sean and I'm from the States. I use to go by Mass, but now I go online by the name Bly and Blytez. I'm very interested in computers, and making things work. I like to play around and see what I'm capable of and to learn a few things while doing so. I enjoy helping people whenever I can.
Please show us one (or multiple) of your scripts.
{==============================================================================\
| F2P Clanwars NS BOT Version ID: 35 |
| By: DMC |
| Last updated 10/17/2014 04:35PM MNT |
|==============================================================================|
| |
| Written By: Da Move Cat/Blytz/Bu11et/Sean |
| Description: Attacks desired targets in clan wars. |
| Contact Info: Seansproxiedskype |
| Credits: Clarity, Main, BMWxi. |
| - This was my first script and I've been working and adding onto it the past |
| 3-4 months. |
\_____________________________________________________________________________}
{==============================================================================\
|*******************************SCRIPT SETUP***********************************|
|~~~~~~~~~~(MAKE SURE YOU SET UP YOUR ACCOUNT ACCORDING TO THE BELOW~~~~~~~~~~~|
|******************************************************************************|
|==============================================================================|
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ABILILTY BAR SETUP~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|==============================================================================|
| |
| 1. Put your Melee abilities in Action Bar 1 |
| 2. Put your Range abilities in Action Bar 2 |
| 3. Check lines 70-80 for keybind setup |
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| PLEASE KEEP YOUR RUNE 2H SWORD / MAGIC SHORT BOW IN SLOT 1 IN YOUR INVENTORY |
| (They need to be in slot 1 if you have weapon switching enabled) |
| (Also works with shieldbows and any 2h sword, recommended R2H MSB) |
| |
|==============================================================================|
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~SCREEN SETUP~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
|==============================================================================|
| Just make your screen like : http://puu.sh/c7juE/28d9bbb6e3.png |
|==============================================================================|
| Edit your targets at line 79 in format 'ttack USERNAME', |
|______________________________________________________________________________}
{==============================================================================\
| Features |
| What is Bu11et's SMART NS Bot capable of? |
|==============================================================================|
| * Anti-lure (West, East, Multi) * Fast portal detection |
| * Switches weapons * Prayer activation |
| * 100% Colour * Attacks targets |
| * Alarm system * World selection |
| * Notifications (Balloon tips) * ..and much more! |
|==============================================================================|
{==============================================================================\
| Script Code |
|==============================================================================|
| |
| * DO NOT EDIT ANY OF THIS UNLESS YOU KNOW WHAT YOU ARE DOING * |
| * CONTACT SEAN/BU11ET IF THE SCRIPT HAS ANY BUGS * |
\_____________________________________________________________________________}
program ClanwarsNS;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$i srl-6/lib/misc/srlplayerform.simba}
const
STATUS_FREQUENCY = 0.1;
VERSIONID = '60';
var
ABILITY50: string = 'a'; // ABILITY50 = Keybind for abilities 50% +
SLOT50: integer = 12; // SLOT50 = Slot number for keybind ABILITY 50 (14 slots in total, 1-14 left to right)
ABILITY100: string = 's'; // ABILITY100 = Keybind for abilities 100%
SLOT100: integer = 13; // SLOT100 = Slot number for keybind ABILITY 100
ANTICIPATION: string = 'q'; // ANTICIPATION = Keybind for anticipation ability
ANTISLOT: integer = 10; // ANTISLOT = Slot number for keybind ANTICIPATION
FREEDOM: string = 'w'; // FREEDOM = Keybind for freedom ability
FREESLOT: integer = 11; // FREESLOT = Slot number for keybind FREEDOM
var
ATTACK_USER: TStringArray;
{ ATTACK_USER := [
-------------------------------------------------------------------------------
-- Targets for getTarget()
-------------------------------------------------------------------------------
}
begin
ATTACK_USER := [
'ttack name here!'];
end;
var
quickPrayers: boolean = true;
switchWeps: boolean = true;
attackPlayers: boolean = false;
sendStatuses: boolean = true;
alarms: boolean = true;
fixGlitch: boolean = true;
eastWestDetection: boolean = true;
recordFails: boolean = true;
progressReport: boolean = true;
PMShutDown: boolean = true;
newPaint: boolean = true;
takeScreenshots: boolean = true;
debugMode: boolean = false;
abilities: boolean = true;
useMagic: boolean = false;
runMulti: boolean = true;
multiLure: boolean = true;
adrenalineSpec: integer = 100;
scriptPaintBMP: integer;
loopCount: integer;
SESSION_TIME: integer = 2;
PHONE_TIME: integer = 10;
abilityMarker, PMMarker, lureMarker, statusMarker: TTimeMarker;
Red, detectedGlitch, time1, sentPhone, antiTimes, Green, timesSwitched, Vex, allow, Multi, EastW, totalTries, switchedWeapons, screenCount: integer;
{ declarePlayers()
-------------------------------------------------------------------------------
-- Declares script settings
-------------------------------------------------------------------------------
}
procedure declarePlayers;
begin
players.setup(playerform.players);
currentPlayer := 0;
with players[0] do
begin
World := strToInt(playerForm.players[0].settings[0]);
SESSION_TIME := strToInt(playerForm.players[0].settings[1]);
quickPrayers := StrToBoolDef(playerForm.players[0].settings[2], true);
alarms := StrToBoolDef(playerForm.players[0].settings[3], true);
sendStatuses := StrtoBool(playerForm.players[0].settings[4]);
attackPlayers := StrToBool(playerForm.players[0].settings[5]);
switchWeps := StrToBool(playerForm.players[0].settings[6]);
useMagic := StrToBool(playerForm.players[0].settings[7]);
eastWestDetection := StrToBool(playerForm.players[0].settings[8]);
multiLure := StrToBool(playerForm.players[0].settings[9]);
runMulti := StrToBool(playerForm.players[0].settings[10]);
recordFails := StrToBool(playerForm.players[0].settings[11]);
progressReport := StrToBool(playerForm.players[0].settings[12]);
PMShutDown := StrToBool(playerForm.players[0].settings[13]);
newPaint := StrToBool(playerForm.players[0].settings[14]);
takeScreenshots := StrToBool(playerForm.players[0].settings[15]);
debugMode := StrToBool(playerForm.players[0].settings[16]);
fixGlitch := StrToBool(playerForm.players[0].settings[17]);
end;
end;
{ initPlayerForm()
-------------------------------------------------------------------------------
-- Initiates script settings
-------------------------------------------------------------------------------
}
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'Bu11et''s SMART NS BOT version ' + VERSIONID + '';
scriptSettingsPath := AppPath + 'Scripts\NsBotSettings.txt';
editBoxLabels := [
'World',
'Time to reload from game session (in minutes)'];
editBoxDefaults := [
'80',
'2'];
checkBoxLabels := [
'Quick prayers',
'Alarms',
'Balloon notifications',
'Attack Users',
'Switch weapons',
'Use magic',
'East/West detection',
'Multi-zone lure detection',
'Run-to-multi (wars)',
'Record fails',
'Progress reports',
'Shut down by PM',
'New paint design',
'Take screenshots',
'Developer mode',
'Fix Glitch'];
checkBoxDefaults := [
'True',
'True',
'True',
'True',
'True',
'True',
'True',
'True',
'True',
'True',
'True',
'False',
'True',
'True',
'False',
'True'];
end;
end;
{ checkForFiles()
-------------------------------------------------------------------------------
-- Checks if our assets are there
-------------------------------------------------------------------------------
}
procedure checkForFiles(filePath, message, link: String);
var
progFile: longInt;
fileName: string;
begin
fileName := AppPath + filePath;
try
if not fileExists(fileName) then
begin
writeln('-- INSTALLATION STATUS: ' + message + ' does not exist - Downloading now.');
progFile := createFile(fileName);
end else
begin
writeln('-- INSTALLATION STATUS: ' + message + ' exists.');
exit;
end;
closeFile(progFile);
progFile := rewriteFile(fileName, false);
writeFileString(progFile, getPage(link));
writeln('-- INSTALLATION STATUS: ' + message + ' has been downloaded.');
finally
if (progFile > 0) then
closeFile(progFile);
end;
end;
{ installAssets()
-------------------------------------------------------------------------------
-- Installs our images
-------------------------------------------------------------------------------
}
procedure installAssets;
begin
writeln('Please wait...now installing Bu11ets NS Bot image assets to your computer...');
if not directoryExists(appPath + 'scripts/Bu11ets_NS_Bot_Images/') then
begin
try
createDirectory(appPath + 'scripts/Bu11ets_NS_Bot_Images/');
writeln('Created a new folder in Simba/Scripts/ called Bu11ets_NS_Bot_Images/');
except end;
end;
checkForFiles('scripts/Bu11ets_NS_Bot_Images/clanwarsns3.png', 'Script Paint', 'http://puu.sh/d2N77/d26432fe6f.png');
checkForFiles('scripts/Bu11ets_NS_Bot_Images/clanwarsns4.png', 'Script Paint', 'http://puu.sh/d2N9t/2e7e51f597.png');
end;
{ Alarm()
-------------------------------------------------------------------------------
-- Plays the alarm
-------------------------------------------------------------------------------
}
procedure Alarm;
begin
if (alarms) then
begin
PlaySound(AppPath + '\FullInvSound.wav');
end;
end;
{ LocateMe()
-------------------------------------------------------------------------------
-- Forwards
-------------------------------------------------------------------------------
}
function LocateMe: Integer; forward;
{ MiniMapWalk1()
-------------------------------------------------------------------------------
-- Random coordinates
-------------------------------------------------------------------------------
}
procedure MiniMapWalk1();
var
mapSquare, mapSquare1: TBox;
begin
if (runMulti) then
begin
mapSquare := intToBox(663, 17, 681, 23);
mouseBox(mapSquare, MOUSE_LEFT);
wait(random(1000, 1250));
if (minimap.isFlagPresent(Random(2000, 3000))) then
Minimap.waitPlayerMoving();
mapSquare1 := intToBox(675, 65, 699, 77);
mouseBox(mapSquare1, MOUSE_LEFT);
end
else if not (runMulti) then
begin
mapSquare := intToBox(684, 86, 704, 97);
mouseBox(mapSquare, MOUSE_LEFT);
end;
end;
{ MiniMapWalk2()
-------------------------------------------------------------------------------
-- Random coordinates
-------------------------------------------------------------------------------
}
procedure MiniMapWalk2();
var
mapSquare, mapSquare1: TBox;
begin
if (runMulti) then
begin
mapSquare := intToBox(663, 17, 681, 23);
mouseBox(mapSquare, MOUSE_LEFT);
wait(random(1000, 1250));
if (minimap.isFlagPresent(Random(2000, 3000))) then
Minimap.waitPlayerMoving();
mapSquare1 := intToBox(675, 65, 699, 77);
mouseBox(mapSquare1, MOUSE_LEFT);
mouseBox(mapSquare1, MOUSE_LEFT);
end
else if not (runMulti) then
begin
mapSquare := intToBox(675, 86, 697, 95);
mouseBox(mapSquare, MOUSE_LEFT);
end;
end;
{ MiniMapWalk3()
-------------------------------------------------------------------------------
-- Random coordinates
-------------------------------------------------------------------------------
}
procedure MiniMapWalk3();
var
mapSquare, mapSquare1: TBox;
begin
if (runMulti) then
begin
mapSquare := intToBox(663, 17, 681, 23);
mouseBox(mapSquare, MOUSE_LEFT);
wait(random(1000, 1250));
if (minimap.isFlagPresent(Random(2000, 3000))) then
Minimap.waitPlayerMoving();
mapSquare1 := intToBox(675, 65, 699, 77);
mouseBox(mapSquare1, MOUSE_LEFT);
end
else if not (runMulti) then
begin
mapSquare := intToBox(687, 87, 706, 94);
mouseBox(mapSquare, MOUSE_LEFT);
end;
end;
{ healthPercent()
-------------------------------------------------------------------------------
-- Returns the health percent of the player
-------------------------------------------------------------------------------
}
function healthPercent(): string;
var
health: integer;
begin
health := actionBar.getHPPercent();
result := 'Health: ' + intToStr(health) + '%';
end;
{ PrayerPercent()
-------------------------------------------------------------------------------
-- Returns the prayer percent of the player
-------------------------------------------------------------------------------
}
function PrayerPercent(): string;
var
prayer: integer;
begin
prayer := actionBar.getPrayerPercent();
result := 'Prayer: ' + intToStr(prayer) + '%';
end;
{ randomRC()
-------------------------------------------------------------------------------
-- Randomly right clicks and move mouse
-------------------------------------------------------------------------------
}
procedure randomRC();
var
screenSquare: TBox;
entireScreen: TBox;
begin
screenSquare := intToBox(151, 62, 475, 339);
mouseBox(screenSquare, MOUSE_RIGHT);
wait(randomRange(2750, 5750));
entireScreen := intToBox(0, 0, 794, 595);
mouseBox(entireScreen, MOUSE_MOVE);
end;
{ clickMiniCenter()
-------------------------------------------------------------------------------
-- Clicks the center of the mini map (player location)
-------------------------------------------------------------------------------
}
procedure clickMiniCenter();
var
mapSquare: TBox;
begin
mapSquare := intToBox(688, 106, 688, 106);
mouseBox(mapSquare, MOUSE_LEFT);
end;
{ inSafe()
-------------------------------------------------------------------------------
-- Determines if we are in fight area
-------------------------------------------------------------------------------
}
function inSafe(): boolean;
const
SAFE_COLOR = 2070783;
begin
result := getColor(538, 219) = SAFE_COLOR;
end;
{ clanCup()
-------------------------------------------------------------------------------
-- Determines if we opened the clan cup interface
-------------------------------------------------------------------------------
}
function clanCup(): boolean;
const
INT_COLOR = 1118779;
begin
result := getColor(96, 47) = INT_COLOR;
end;
{ inCombat()
-------------------------------------------------------------------------------
-- Determines if we're in combat
-------------------------------------------------------------------------------
}
function inCombat(): boolean;
const
KEY_COLOR = 1675987;
var
TPA: TPointArray;
searchArea := intToBox(0, 0, 61, 31);
begin
result := FindColors(TPA, KEY_COLOR, searchArea);
end;
{ incomingUpdate()
-------------------------------------------------------------------------------
-- Determines if a update has been announced
-------------------------------------------------------------------------------
}
function incomingUpdate(): boolean;
const
UPDATE_COLOR = 921743;
var
TPA: TPointArray;
searchArea := intToBox(298, 23, 499, 74);
begin
result := FindColors(TPA, UPDATE_COLOR, searchArea);
end;
{ vexOpen()
-------------------------------------------------------------------------------
-- Determines if a vex has been opened
-------------------------------------------------------------------------------
}
function vexOpen(): boolean;
const
VEX_COLOR = 1388125;
var
TPA: TPointArray;
searchArea := intToBox(392, 269, 400, 282);
begin
result := FindColors(TPA, VEX_COLOR, searchArea);
end;
{ vexOpen2()
-------------------------------------------------------------------------------
-- Determines if a vex has been opened, an extra check
-------------------------------------------------------------------------------
}
function vexOpen2(): boolean;
const
VEX_COLOR = 10063220;
var
TPA: TPointArray;
searchArea := intToBox(52, 45, 80, 63);
begin
result := FindColors(TPA, VEX_COLOR, searchArea);
end;
{ goNorth()
-------------------------------------------------------------------------------
-- Determines if we are in the safe zone
-------------------------------------------------------------------------------
}
function goNorth(): boolean;
const
INTERFACE_COLOR = 3635889;
var
TPA: TPointArray;
searchArea := intToBox(138, 5, 437, 52);
begin
result := FindColors(TPA, INTERFACE_COLOR, searchArea);
end;
{ redPort()
-------------------------------------------------------------------------------
-- Determines if we clicked red portal
-------------------------------------------------------------------------------
}
function redPort(): boolean;
const
INTERFACE_COLOR = 1118717;
var
TPA: TPointArray;
searchArea := intToBox(117, 69, 196, 81);
begin
result := FindColors(TPA, INTERFACE_COLOR, searchArea);
end;
{ redPort2()
-------------------------------------------------------------------------------
-- Determines if we clicked red portal
-------------------------------------------------------------------------------
}
function redPort2(): boolean;
const
INTERFACE_COLOR = 1118717;
var
TPA: TPointArray;
searchArea := intToBox(374, 67, 394, 78);
begin
result := FindColors(TPA, INTERFACE_COLOR, searchArea);
end;
{ prayerActive()
-------------------------------------------------------------------------------
-- Determines if prayer is activated
-------------------------------------------------------------------------------
}
function prayerActive(): boolean;
const
ICON_COLOR = 9060948;
var
TPA: TPointArray;
searchArea := intToBox(299, 395, 313, 414);
begin
result := FindColors(TPA, ICON_COLOR, searchArea);
end;
{ inMulti()
-------------------------------------------------------------------------------
-- Determines if we are in the multi-combat zone
-------------------------------------------------------------------------------
}
function inMulti(): boolean;
const
MULTI_COLOR = 16381945;
var
TPA: TPointArray;
searchArea := intToBox(130, 0, 361, 38);
begin
result := FindColors(TPA, MULTI_COLOR, searchArea);
end;
{ TRSOptions.isOpen()
-------------------------------------------------------------------------------
-- Determines if the settings tab is open
-------------------------------------------------------------------------------
}
function TRSOptions.isOpen(): boolean;
override;
begin
self.setBounds([300, 95, 499, 469]);
result := (countColorTolerance(379903, intToBox(self.x1, self.y1, self.x2, self.y1 + 30), 10) = 135);
end;
{ timeRunning()
-------------------------------------------------------------------------------
-- Time running since script start
-------------------------------------------------------------------------------
}
function timeRunning(TheType: Integer = TIME_FORMAL_LONG): string;
override;
begin
Result := msToTime(GetTimeRunning(), TIME_SHORT);
end;
{ isAngleLow()
-------------------------------------------------------------------------------
-- Determines if the angle is too low
-------------------------------------------------------------------------------
}
function isAngleLow(): boolean;
const
BLACK_COLOR = 65793;
var
TPA: TPointArray;
searchArea := intToBox(380, 361, 562, 379);
begin
result := FindColors(TPA, BLACK_COLOR, searchArea);
end;
{ LookingAtPortal()
-------------------------------------------------------------------------------
-- forward
-------------------------------------------------------------------------------
}
function LookingAtPortal: Boolean; forward;
var
TP: Tpoint;
OldDB: string;
MSCC, MMCC: TPoint;
{ Compas()
-------------------------------------------------------------------------------
-- Gets minimap angle degrees
-------------------------------------------------------------------------------
}
function Compas: Integer;
begin
Result := Round(minimap.getAngleDegrees);
end;
{ ClearAllDebug()
-------------------------------------------------------------------------------
-- Clears the screen of paint
-------------------------------------------------------------------------------
}
procedure ClearAllDebug;
begin
smartImage.clear;
Cleardebug;
end;
{ ClearScreenDebug()
-------------------------------------------------------------------------------
-- Clears the screen of paint
-------------------------------------------------------------------------------
}
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;
{ paintProgress()
-------------------------------------------------------------------------------
-- Progress reports and image painting
-------------------------------------------------------------------------------
}
procedure paintProgress;
begin
disguise('Bu11et''s SMART NS BOT! Time Running: '+timeRunning+' | '+healthPercent+' | '+PrayerPercent+'');
if not (newPaint) then
begin
with (smartImage) do
begin
drawBitmap(scriptPaintBMP, Point(2, 461));
drawText(ToStr(timeRunning), Point(127, 530), 'UpChars', true, 13667100);
drawText(ToStr(totalTries), Point(172, 552), 'UpChars', true, 13667100);
if (recordFails) then
begin
drawText('' + ToStr(Red), Point(485, 480), 'UpChars', true, 13667100);
drawText('' + ToStr(Vex), Point(426, 495), 'UpChars', true, 13667100);
drawText('' +ToStr(Multi), Point(442, 509), 'UpChars', true, 13667100);
drawText('' + ToStr(EastW), Point(475, 524), 'UpChars', true, 13667100);
drawText('' + ToStr(timesSwitched), Point(515, 539), 'UpChars', true, 13667100);
end;
end;
end else
if (newPaint) then
begin
with (smartImage) do
begin
drawBitmap(scriptPaintBMP, Point(2, 461));
drawText(ToStr(timeRunning), Point(115, 536), 'UpChars', true, 15658219);
drawText(ToStr(totalTries), Point(169, 563), 'UpChars', true, 15658219);
if (recordFails) then
begin
drawText('' + ToStr(Red), Point(520, 472), 'UpChars', true, 15658219);
drawText('' + ToStr(Vex), Point(478, 485), 'UpChars', true, 15658219);
drawText('' +ToStr(Multi), Point(489, 500), 'UpChars', true, 15658219);
drawText('' + ToStr(EastW), Point(517, 514), 'UpChars', true, 15658219);
drawText('' + ToStr(timesSwitched), Point(544, 530), 'UpChars', true, 15658219);
end;
end;
end;
if (progressReport) then
begin
writeln('-------- Progress Report --------');
writeln('Time Running : ' + ToStr(timeRunning));
writeln('Attack tries : ' + ToStr(totalTries));
writeln('Red portal clicks : ' + ToStr(Red));
writeln('Vex clicks : ' + ToStr(Vex));
writeln('Times lured to multi : ' + ToStr(Multi));
writeln('Times lured East/West : ' + ToStr(EastW));
writeln('Times switched weapons : ' + ToStr(timesSwitched));
writeln('Times fixed glitch : ' + ToStr(detectedGlitch));
writeln('Antibans performed : ' + ToStr(antiTimes));
writeln('Current loop : ' + ToStr(loopCount));
writeln('-------- End of Report --------');
end;
end;
{ screenShot()
-------------------------------------------------------------------------------
-- Takes screenshots
-------------------------------------------------------------------------------
}
procedure screenShot;
var
i:Integer;
begin
if not directoryExists(appPath + 'scripts/Bu11ets_NS_BOT_Screenshots/') then
begin
try
createDirectory(appPath + 'scripts/Bu11ets_NS_BOT_Screenshots/');
writeln('Created folder Bu11ets_NS_BOT_Screenshots at Simba/Scripts/');
except end;
end;
if inMulti() then
begin
SaveScreenshot(appPath + 'Scripts\Bu11ets_NS_BOT_Screenshots\Screenshot_Multi_Lure_'+ timeRunning() + '.jpg');
end;
if Green = 1 then
begin
Green := 0;
SaveScreenshot(appPath + 'Scripts\Bu11ets_NS_BOT_Screenshots\Screenshot_EastWest_Lure_'+ timeRunning() + '.jpg');
end;
if not Green = 1 or not inMulti() then
begin
SaveScreenshot(appPath + 'Scripts\Bu11ets_NS_BOT_Screenshots\Screenshot_Login_'+ timeRunning() + '.jpg');
end;
writeln('Screenshot has successfully been taken!');
end;
{ SDB()
-------------------------------------------------------------------------------
-- Debug
-------------------------------------------------------------------------------
}
procedure SDB(status: string);
begin
with (smartImage) do
begin
if (newPaint) then
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;
end;
{ Boot()
-------------------------------------------------------------------------------
-- Debug
-------------------------------------------------------------------------------
}
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;
{ closeVex()
-------------------------------------------------------------------------------
-- Closes clan vex
-------------------------------------------------------------------------------
}
function closeVex : Boolean;
var Bmp,wid, hei,tmpX,tmpY,x,y : Integer;
begin
getClientDimensions(wid, hei);
Bmp := BitmapFromString(13, 14, 'meJx9kD1LQmEYhjND8xytUMljOi' +
'iiDmK5ZAjScMAwiBzaJBrahMawoSlwEUJQBylanKLATafAH9Do35A' +
'GwUEww8ueehGC4ObhOdd9nY/3mNld8zu5w9TfmL+t3VnS3Df/R5zN' +
'QDNy/GwkWy5vw7Xd/om34Uu04LQis18OZsW3USDxCBSHHQKnFS2eb' +
'Rd6I2U6PffKYdIu3mtcAfeOOpjF9y8mt6sdTovD58ntYub7M4lyaH' +
'EWp9iqsBO/+YKw3/1ksgukxbFp546NW6JH6rGnDxwJO0QqHIKsh+/' +
'g0dcpM33RVTtcHrW6dmYPlt3VofEwJpwrdlBjyiWcFofo6fp6bQJB' +
'2AmWOT6THQKnxdH001D0mp8gjhyKiAmnxVmxZJgSi/VkOYrjzAGK6K/q');
if (findBitmapToleranceIn(Bmp, x, y, 0, 0, wid - 1, hei - 1, 5)) then
begin
GetBitmapSize(Bmp,tmpX,tmpY);
mouse(point(x, y).rand(tmpX,tmpY), MOUSE_LEFT);
Result := true;
end;
FreeBitmap(Bmp);
end;
{ closeRed()
-------------------------------------------------------------------------------
-- Closes red port
-------------------------------------------------------------------------------
}
function closeRed : Boolean;
var Bmp,wid, hei,tmpX,tmpY,x,y : Integer;
begin
getClientDimensions(wid, hei);
Bmp := BitmapFromString(15, 14, 'meJyNkUtLw0AYRffZSYkUsWCDCg' +
'YUlYIgaihYDUppg6+RiEhpxaoV0i5EqiIUHwTcaBF3glvxB/jvPHJ' +
'lcCkchnwzh5s7iefPeP/m+fOr238/6T02r9MkfYHW7ROwI9ivd+/M' +
'6bnjOL23D8Y4udxsdnZbF6zAkR5EuXYcRAY5ue9bJzpMgKMwbrCCH' +
'RfKW8jt9FWxAxkXqvWz9f0jmdqRXFheQ6YVyfgZNwvyCdQImKXtg7' +
'mwgsxdbDGdutlhC2ZxIwYlI++1b0jTqwdznoXAFVP7lYNQMjXQ8CE' +
'36g/lx1iBWHWwyeqsZISR8UkLo0yYLa7+TZaQn5hCAB4EZlAxNpm7' +
'87n0QympqqAd5KXqzvRiCblx9UAsMo5KAqO9GvBHJPOFdWTr/bw3M' +
'oAj6OAX5pG/AS9xtoA=');
if (findBitmapToleranceIn(Bmp, x, y, 0, 0, wid - 1, hei - 1, 5)) then
begin
GetBitmapSize(Bmp,tmpX,tmpY);
mouse(point(x, y).rand(tmpX,tmpY), MOUSE_LEFT);
Result := true;
end;
FreeBitmap(Bmp);
end;
{ closeExamine()
-------------------------------------------------------------------------------
-- Closes player examines
-------------------------------------------------------------------------------
}
function closeExamine: Boolean;
var Bmp,wid, hei,tmpX,tmpY,x,y : Integer;
begin
getClientDimensions(wid, hei);
Bmp := BitmapFromString(15, 17, 'meJyNkbtqAlEURWd8gigBiY2lKF' +
'hKIIUQRBAiDFqIDwQRLCRgo+AX2NjaJK0itjaJH5CQzk9IYxWxiYU' +
'IQ9osPXK5GMGBxWGffZYXVNMwzEsEvKYgWcp+98khzUouEp+7o4ur' +
'oOUzKYLVXl8FTeRsfcXaev5hkhV6KbL/dkqm7Hz9ll5tXWal5ERGE' +
'/muuARO5eWeeXFVcvz+HXRBN+V6Jgvp2Xf2wwaC3qNVCw+u0IifRR' +
'Gb2Mm3HRD0Hs16PMh8CmjCww0OUwVKuaLJy+BLvCiBfLaKwz8owVX' +
'7vBlvOZ3WI6yUnJRseAYgPlNWveRlWZXshHbD8gR7Tkw0ZB4Hvqnw' +
'P+vzD73/A+g=');
if (findBitmapToleranceIn(Bmp, x, y, 0, 0, wid - 1, hei - 1, 5)) then
begin
GetBitmapSize(Bmp,tmpX,tmpY);
mouse(point(x, y).rand(tmpX,tmpY), MOUSE_LEFT);
Result := true;
end;
FreeBitmap(Bmp);
end;
{ closeBanner()
-------------------------------------------------------------------------------
-- Closes achievement banners
-------------------------------------------------------------------------------
}
function closeBanner: Boolean;
var Bmp,wid, hei,tmpX,tmpY,x,y : Integer;
begin
getClientDimensions(wid, hei);
Bmp := BitmapFromString(12, 12, 'meJxj58nkEioniPilJyt7LpfQnc' +
'4rMolXbCEUiUwS154OFAfKAtUAGUmX/kbt/iitPQsoAlEAZANFgOJ' +
'AWaAadZuF/ls/wpXxCPfAFQBJoCy7RA5QRN9tLVBZ1Kl/QBKoEc4G' +
'igNl2XkyIRohyjz2/YUguAKgLFANl0ALkAFEkk4rgbKmW/4ASSAbI' +
'giUZeOK4eSrBiJu5Ylqc94CFUAQkA0UgUgB1QCN4lZsBAqqrvoNJM' +
'3itsDZQHGgLBNLMLtMmVDna4mZX4AI6As18z4gCeECxYGyQDXcZhM' +
'5+n4AuUBZKZkyYGgASSAbKAIUB8pycfspqJYA/QtRADQZgiDKgOJA' +
'WQDkoZ0C');
if (findBitmapToleranceIn(Bmp, x, y, 0, 0, wid - 1, hei - 1, 5)) then
begin
GetBitmapSize(Bmp,tmpX,tmpY);
mouse(point(x, y).rand(tmpX,tmpY), MOUSE_LEFT);
Result := true;
end;
FreeBitmap(Bmp);
end;
{ screenSetUp()
-------------------------------------------------------------------------------
-- Faces south for findGreen()
-------------------------------------------------------------------------------
}
procedure screenSetUp();
begin
SDB('Setting up the screen to locate the green portal');
if screenCount = 0 then
begin
case Random(50) of
0..25:
begin
minimap.setAngle(randomRange(150, 210));
wait(randomRange(300, 750));
mainscreen.setangle(MS_ANGLE_HIGH);
end;
26..50:
begin
mainscreen.setangle(MS_ANGLE_HIGH);
wait(randomRange(200, 900));
minimap.setAngle(randomRange(135, 190));
end;
end;
wait(random(750, 2500));
end
else if screenCount >= 1 then
begin
SDB('We are already facing the correct way for looking at the portal');
end;
end;
{ switchWeapons()
-------------------------------------------------------------------------------
-- Switches our combat style
-------------------------------------------------------------------------------
}
procedure switchWeapons();
begin
if (tabBackpack.isOpen()) then
begin
if (useMagic) then
begin
tabBackPack.mouseSlot(random(1, 2), MOUSE_MOVE);
end else
if not (useMagic) then
begin
tabBackPack.mouseSlot(1, MOUSE_MOVE);
end;
if (isMouseOverText(['2h', 'une', 'word'])) then
begin
FastClick(MOUSE_LEFT);
wait(randomRange(300, 1250));
actionBar.switchToBar(1);
end;
if (isMouseOverText(['agic', 'hield', 'ow', 'sighted)', 'hieldbow', 'bow'])) then
begin
FastClick(MOUSE_LEFT);
wait(randomRange(100, 750));
actionBar.switchToBar(2);
end;
if (useMagic) and (isMouseOverText(['staff', 'natur'])) then
begin
FastClick(MOUSE_LEFT);
wait(randomRange(400, 1050));
actionBar.switchToBar(3);
end;
end;
end;
{ switchCombat()
-------------------------------------------------------------------------------
-- Calls switchWeapons if number is between 15 - 45
-------------------------------------------------------------------------------
}
procedure switchCombat;
begin
Inc(switchedWeapons);
if switchedWeapons >= (RandomRange(15, 45)) then
begin
SDB('Number between 15 and 45 is : (' + ToStr(switchedWeapons) + ')! It''s time to switch Weapons!');
switchWeapons();
inc(timesSwitched);
switchedWeapons := 0;
end;
end;
{ DATPAB()
-------------------------------------------------------------------------------
-- 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;
{ GMP()
-------------------------------------------------------------------------------
-- Get Mouse Position
-------------------------------------------------------------------------------
}
function GMP(T: Tpoint): Tpoint;
begin
GetMousePos(T.X, T.Y);
Result := T;
end;
{ WaitLoad()
-------------------------------------------------------------------------------
-- Waits if loading..please wait is active
-------------------------------------------------------------------------------
}
procedure WaitLoad;
var
WLT: TTimeMarker;
P: TPoint;
begin
Wait(Random(1000));
while minimap.isFlagPresent(P) do
wait(random(50));
if not (LocateMe = 1) then
Exit;
WLT.start;
repeat
Wait(Random(500));
until not (GetColor(48, 19) = 16777215) or (WLT.getTime > 3000);
end;
{ CA()
-------------------------------------------------------------------------------
-- Minimap degrees
-------------------------------------------------------------------------------
}
function CA(A: Integer): Integer;
begin
Result := A;
while Result > 360 do
Result := Result - 360;
while Result < 0 do
Result := Result + 360;
end;
{ PtToPol()
-------------------------------------------------------------------------------
-- Point to pol
-------------------------------------------------------------------------------
}
function PtToPol(A: Integer; I, C: Tpoint): Integer;
var
N: TPoint;
D, H: Integer;
begin
if A = 0 then
D := Compas
else
D := A;
I.X := I.X - C.X;
I.Y := I.Y - C.Y;
H := Round(Hypot(I.X, I.Y));
if H = 0 then
H := 1;
I.X := round(76 * I.X / H);
I.Y := round(76 * I.Y / H);
N := point( - Round(1000 * Sin(Radians(D))), - Round(1000 * Cos(Radians(D))));
H := Round(Hypot(N.X, N.Y));
N := point(round(76 * N.X / H), round(76 * N.Y / H));
Result := 360 - Round(Degrees(ArcCos((N.X * I.X + N.Y * I.Y) / (1 + Hypot(I.X, I.Y) * Hypot(N.X, N.Y)))));
if Result > 0 then
begin
if D < 180 then
begin
if ((I.X < 0) and (I.Y < N.Y)) or ((I.X > 0) and (I.Y < - 1 * N.Y)) then
Result := 360 - Result;
end
else if ((I.X < 0) and (I.Y > - 1 * N.Y)) or ((I.X > 0) and (I.Y > N.Y)) then
Result := 360 - Result;
end;
end;
{ PolToPt()
-------------------------------------------------------------------------------
-- Location to point
-------------------------------------------------------------------------------
}
function PolToPt(A, H: Integer; C: Tpoint): TPoint;
var
P: TPoint;
Rh: Integer;
begin
A := 360 - A;
P.X := Round( - 100 * Sin(Radians(Compas + A)));
P.Y := Round( - 100 * Cos(Radians(Compas + A)));
Rh := Round(Hypot(P.X, P.Y));
P.X := C.X + round(H * P.X / Rh);
P.Y := C.Y + round(H * P.Y / Rh);
Result := P;
end;
{ PtToHyp()
-------------------------------------------------------------------------------
-- Rounds the estimation
-------------------------------------------------------------------------------
}
function PtToHyp(I, C: TPoint): Integer;
begin
Result := Round(Hypot(I.X - C.X, I.Y - C.Y));
end;
{ WithInLine()
-------------------------------------------------------------------------------
-- Determines if we're within the line
-------------------------------------------------------------------------------
}
function WithInLine(A: Integer; I, C: Tpoint): Boolean;
begin
Result := False;
if ((A < 180) and (PtToPol(0, I, C) > A) and (PtToPol(0, I, C) < (A + 180))) or ((A > 179) and (PtToPol(0, I, C) > A) or (PtToPol(0, I, C) < (A - 180))) then
Result := True;
end;
{ WithinCircle()
-------------------------------------------------------------------------------
-- 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;
{ WithInBox()
-------------------------------------------------------------------------------
-- 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;
{ AdvMMtoMS()
-------------------------------------------------------------------------------
-- Advanced Minimap to mainscreen
-------------------------------------------------------------------------------
}
function AdvMMToMS(I: Tpoint): Tpoint;
var
JGX: Tpoint;
begin
JGX.X := PtToPol(0, I, MMCC);
JGX.Y := PtToHyp(I, MMCC);
Result := PolToPt(JGX.X, 35 + round(657 * JGX.Y / 76), MSCC);
end;
{ ToMS()
-------------------------------------------------------------------------------
-- Determines if on Main Screen
-------------------------------------------------------------------------------
}
function ToMS(T: TPoint): Tpoint;
var
Ang, Dis: Integer;
begin
Ang := PtToPol(0, T, MSCC);
Dis := PtToHyp(T, MSCC);
Result := PolToPt(Ang, Dis, MSCC);
while not (WithInBox(mainscreen.x1, mainscreen.y1, mainscreen.x2, mainscreen.y2, Result)) do
begin
Dis := Dis - Random(10);
Result := PolToPt(Ang, Dis, MSCC);
end;
end;
{ ToMM()
-------------------------------------------------------------------------------
-- Determines distance in minimap
-------------------------------------------------------------------------------
}
function ToMM(T: TPoint): Tpoint;
var
Ang, Dis: Integer;
begin
Ang := PtToPol(0, T, MMCC);
Dis := PtToHyp(T, MMCC);
Result := PolToPt(Ang, Dis, MMCC);
while not (WithInCircle(minimap.cx, minimap.cy, 75, Result)) do
begin
Dis := Dis - Random(10);
Result := PolToPt(Ang, Dis, MMCC);
end;
end;
procedure ClickCoord(I: Tpoint); forward;
{ MMM()
-------------------------------------------------------------------------------
-- Mouse move, right, left
-------------------------------------------------------------------------------
}
procedure MMM(I: Tpoint; T: Integer);
begin
if T > 0 then
begin
if T > 1 then
begin
if T > 2 then
ClickCoord(I)
else
Mouse(I, MOUSE_RIGHT);
end
else
begin
T := 0;
repeat
Mouse(I, MOUSE_LEFT);
Inc(T)
until T > RandomRange(0, 1);
end;
end
else
mouse(point(I.X, I.Y), MOUSE_MOVE);
end;
{ ClickCoord()
-------------------------------------------------------------------------------
-- Converts main screen and minimap coordinates
-------------------------------------------------------------------------------
}
procedure ClickCoord(I: Tpoint);
var
Atmp: Integer;
P: TPoint;
begin
Atmp := 0;
if I.X < mainscreen.x2 then
begin
SDB('Coord is in main screen');
case Random(2) of
0:
begin
SDB('It will stay in main screen');
MMM(I, 1);
end;
1:
begin
SDB('Converting it into mini map');
I := PolToPt(PtToPol(0, I, MSCC), round(PtToHyp(I, MSCC) / 10), MMCC);
MMM(I, 1);
end;
end;
end
else
begin
SDB('Coord is in mini map');
case Random(2) of
0:
begin
SDB('It will stay in mini map');
MMM(I, 1);
end;
1:
begin
SDB('Converting it into main screen');
MMM(ToMS(AdvMMToMs(I)), 0);
while not (isMouseOverText(['alk here'])) do
begin
Inc(Atmp);
if (Atmp > RandomRange(2, 5)) then
Break;
SDB('Not a valid point to click');
I := ToMS(point(I.X + RandomRange( - 50, 50), I.Y + RandomRange( - 50, 50)));
MMM(I, 0);
Wait(100 + Random(400));
end;
MMM(I, 1)
end;
end;
end;
while minimap.isFlagPresent(P) do
wait(random(50));
end;
{ SphereCam()
-------------------------------------------------------------------------------
-- Custom include for rotating camera
-------------------------------------------------------------------------------
}
procedure SphereCam(X, Y: Integer);
var
WT: Tpoint;
WDTx, WDTy: TTimeMarker;
begin
WT := point(Round(Abs(X * 4800 / 360)), Round(Abs(Y * 1200 / 90)));
case Random(2) of
0:
begin
if X < 0 then
KeyDown(VK_Left);
if X > 0 then
KeyDown(VK_Right);
WDTx.start;
Wait(Random(WT.X));
if Y < 0 then
KeyDown(VK_Down);
if Y > 0 then
KeyDown(VK_Up);
WDTy.start;
repeat
Wait(Random(100));
until (WDTy.getTime > Random(WT.Y)) or (WDTx.getTime > WT.X) if WDTx.getTime > WT.X then
begin
if X < 0 then
KeyUp(VK_Left);
if X > 0 then
KeyUp(VK_Right);
end;
end;
1:
begin
if Y < 0 then
KeyDown(VK_Down);
if Y > 0 then
KeyDown(VK_Up);
WDTy.start;
if X < 0 then
KeyDown(VK_Left);
if X > 0 then
KeyDown(VK_Right);
WDTx.start;
Wait(Random(WT.X));
repeat
Wait(Random(100));
until (WDTx.getTime > Random(WT.X)) or (WDTy.getTime > WT.Y) if WDTx.getTime > WT.X then
begin
if Y < 0 then
KeyUp(VK_Down);
if Y > 0 then
KeyUp(VK_Up);
end;
end;
end;
repeat
Wait(Random(100));
until WDTx.getTime > WT.X if WDTx.getTime > WT.X then
begin
if X < 0 then
KeyUp(VK_Left);
if X > 0 then
KeyUp(VK_Right);
end;
repeat
Wait(Random(100));
until (WDTy.getTime > WT.Y);
if WDTy.getTime > WT.Y then
begin
if Y < 0 then
KeyUp(VK_Down);
if Y > 0 then
KeyUp(VK_Up);
end;
end;
procedure XXXENDOFINCLUDEXXX;
begin
end;
var
PC, PAC, FA: Tpoint;
PA, PD, PX, PY, AE, GP, ATT, AF, PrevLoc, OldXP, OldHP: Integer;
HPCol: string;
Pt, FT, AEt: TTimeMarker;
{ CHP()
-------------------------------------------------------------------------------
-- Results the player health percentage
-------------------------------------------------------------------------------
}
function CHP: Integer;
begin
Result := Round(actionBar.getHPPercent);
if Result < 0 then
Result := 0;
end;
{ RandomComp()
-------------------------------------------------------------------------------
-- Rotates camera
-------------------------------------------------------------------------------
}
procedure RandomComp;
begin
ClearScreenDebug;
SDB('Changing angle of screen');
screenCount := 0;
case Random(3) of
0: SphereCam(RandomRange( - 180, 180), RandomRange( - 60, 90));
1, 2: minimap.setAngle(RandomRange( - 180, 180));
end;
end;
{ CannotFind()
-------------------------------------------------------------------------------
-- Rotates camera
-------------------------------------------------------------------------------
}
procedure CannotFind;
begin
ClearScreenDebug;
SDB('Changing angle of screen because we cannot find the portal');
case Random(3) of
0: SphereCam(RandomRange( - 180, 180), RandomRange( - 60, 90));
1, 2: minimap.setAngle(RandomRange( - 180, 180));
end;
end;
{ HandleUnknown()
-------------------------------------------------------------------------------
-- Logs player out if message from Bu11et or Sickbu11et is found
-------------------------------------------------------------------------------
}
procedure HandleUnknown;
begin
if not isLoggedIn then
begin
Alarm();
ClearScreenDebug;
players[currentPlayer].login();
exitTreasure;
end;
end;
procedure LookAtPlayers; forward;
{ HandleAntiBan()
-------------------------------------------------------------------------------
-- Makes us look more human
-------------------------------------------------------------------------------
}
procedure HandleAntiBan;
begin
if LocateMe = 1 then
exit;
SDB('Antiban procedure occurring');
MouseSpeed := RandomRange(30, 45);
case Random(140) of
0..20: begin
randomRC();
SleepAndMoveMouse(GaussRangeInt(500, 4000));
end;
21..30: mouseMovingObject();
31..50: Wait(RandomRange(250, 8500));
51..65: SleepAndMoveMouse(GaussRangeInt(1000, 3500));
66..75: begin
pickUpMouse();
wait(random(250, 1000));
smallRandomMouse();
end;
76..90: randomComp;
91..99: smallRandomMouse();
100..125:
begin
MouseOffClient(Random(4));
Wait(GaussRangeInt(1000, 12000));
end;
126..140:
case Random(50) of
0..25:
case Random(50) of
0..25:
begin
ActionBar.clickSlot(ANTISLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(ANTICIPATION, 200, 600);
end;
end;
26..50:
case Random(50) of
0..25:
begin
ActionBar.clickSlot(FREESLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(FREEDOM, 200, 600);
end;
end;
end;
end;
end;
{ LocateMe()
-------------------------------------------------------------------------------
-- Determines player location
-------------------------------------------------------------------------------
}
function LocateMe: Integer;
var
LCM, P: Tpoint;
begin
if not isLoggedIn then
begin
players[currentPlayer].login();
Result := 0;
end;
if minimap.findSymbol(LCM, MM_SYMBOL_MINIGAME, minimap.getBounds) and not (minimap.findSymbol(LCM, MM_SYMBOL_BANK, minimap.getBounds)) then
begin
MMM(Point(PolToPt(RandomRange(30, 70), RandomRange(20 + Random(30), 76), MMCC).X, PolToPt(60 + Random(60), Random(76), MMCC).Y), 1);
while minimap.isFlagPresent(P) do
wait(Random(50));
end;
if (minimap.findSymbol(LCM, MM_SYMBOL_BANK, minimap.getBounds) and (minimap.findSymbol(LCM, MM_SYMBOL_MINIGAME, minimap.getBounds)) or minimap.findSymbol(LCM, MM_SYMBOL_BANK, minimap.getBounds)) then
begin
Result := 1;
Pt.start;
end;
if inMulti() and InSafe() and (multiLure) then
begin
if isLoggedIn() then
begin
Alarm();
if (takeScreenshots) then
begin
screenShot;
end;
inc(Multi);
Boot('We have been lured to multi, waiting 30-35 seconds to relog!');
wait(20000 + Random(10500));
Boot('We are logging to lobby!');
players[currentPlayer].exitToLobby();
end;
if not isLoggedIn() then
begin
Boot('Signing back online!');
players[currentPlayer].login();
wait(1000 + Random(1500));
Boot('Closing Treasure');
exitTreasure();
Boot('Closing Poll');
closePollWindow();
Minimap.ClickCompass;
end;
end;
if closeRed() then
begin
SDB('We clicked red portal, closing!');
inc(Red);
end;
if closeVex() then
begin
SDB('We opened a vex, closing!');
inc(Vex);
end;
if closeExamine() then
begin
SDB('We closed an examine');
end;
if closeBanner() then
begin
SDB('We closed an achievement banner');
end;
if clanCup() then
begin
SDB('We opened the clan cup, closing!');
clickMiniCenter();
end;
if goNorth() then
begin
Result := 2;
if GetColor(550, 179) = 2116732 then
Result := 3;
if PrevLoc = 1 then
AEt.start;
end;
if GetColor(562, 185) = 2173525 then
begin
Result := 5;
if GetColor(272, 31) = 3635889 then
begin
Result := 4;
end;
end;
PrevLoc := Result;
if not (PrevLoc = Result) then
ClearScreenDebug;
HandleUnknown;
end;
{ LocatePortal()
-------------------------------------------------------------------------------
-- Locates the portal location with DTM
-------------------------------------------------------------------------------
}
function LocatePortal(out MSPoint: TPoint; out MMPoint: TPoint): Boolean;
var
DTM: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
MSPoint := Point( - 1, - 1);
MMPoint := Point( - 1, - 1);
DTM := DTMFromString('mfgEAAHicrcwhCoRQGMTx711BjGI0eUIVTQsaBDGKYLB4ABF2YYtFRBAsgieQBQ/hH/Y16xv4wYRhLBHplUiBWv37FxMO/HDhxI6P3jTIkSBCihIVXggQI9Q9w4BZ/2xYsWDEGy06+J4jJuLCNkAZ8swNvg4adQ==');
try
if (not Minimap.findDTMs(DTM, TPA)) then
begin
Writeln('DID NOT FIND DTM (LOCATE PORTAL)');
RandomComp;
Exit(False);
end;
finally
FreeDTM(dtm);
end;
ATPA := ClusterTPAEx(TPA, 5, 5);
SortATPASize(ATPA, True);
MMPoint := MiddleTPA(ATPA[0]);
MSPoint := Minimap.PointToMainscreen(MMPoint);
Result := (MMPoint.x <> - 1) and (MMPoint.y <> - 1);
end;
{ InBound()
-------------------------------------------------------------------------------
-- 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;
{ LookingAtPortal()
-------------------------------------------------------------------------------
-- Determines if we're looking at the portal or not
-------------------------------------------------------------------------------
}
function LookingAtPortal(): Boolean;
var
MSPoint, MMPoint: TPoint;
LAPS, LAPE: Tpoint;
begin
if (not LocatePortal(MSPoint, MMPoint)) then
Exit(False);
LocatePortal(MSPoint, MMPoint);
PAC := ToMS(AdvMMToMs(PAC));
LAPS := point(PAC.X - 50, PAC.Y - 50);
LAPS := ToMS(LAPS);
LAPE := point(PAC.X + 50, PAC.Y + 50);
LAPE := ToMS(LAPE);
Result := FindColorSpiralTolerance(PAC.X, PAC.Y, 1788506, LAPS.X, LAPS.Y, LAPE.X, LAPE.Y, 9) and (Round(Abs(Compas - PA)) < (60 + (20 - PD)));
if Result then
SDB('Looking at portal')
else
SDB('Not looking at portal');
minimap.setAngle(0);
end;
{ FacePortal()
-------------------------------------------------------------------------------
-- Alternative for LookPortal()
-------------------------------------------------------------------------------
}
procedure FacePortal(R: Integer);
var
FaceTime: Integer;
MSPoint, MMPoint: TPoint;
begin
if (not LocatePortal(MSPoint, MMPoint)) then
Exit();
LocatePortal(MSPoint, MMPoint);
case Random(2) of
0: R := - R;
end;
FaceTime := Compas;
PA := (PA + R);
minimap.setAngle(PA);
end;
{ LookPortal()
-------------------------------------------------------------------------------
-- Rotates the camera when called
-------------------------------------------------------------------------------
}
Procedure LookPortal(R: Integer);
Var
MinH: Integer;
MSPoint, MMPoint: TPoint;
Begin
LocatePortal(MSPoint, MMPoint);
SDB('Attempting to look at portal');
IF PD < RandomRange(10, 15) Then
MinH := RandomRange(-60, 90)
Else
MinH := - 40 - PD;
Case Random(2) Of
0: R := -R;
End;
Case Random(3) Of
0: Begin
FacePortal(R);
Case Random(4) Of
0: SphereCam(R, RandomRange(MinH, MinH - PD));
1: SphereCam(0, RandomRange(MinH, MinH - PD));
2: minimap.clickCompass;
3: minimap.setAngle(0);
End;
End;
1: Begin
Case Random(4) Of
0: SphereCam(R, RandomRange(MinH, MinH - PD));
1: SphereCam(0, RandomRange(MinH, MinH - PD));
2: minimap.clickCompass;
3: minimap.setAngle(0);
End;
FacePortal(R);
End;
2: Begin
Case Random(4) Of
0: minimap.clickCompass;
1: SphereCam(R, RandomRange(MinH, MinH - PD));
2: SphereCam(R, 0);
3: minimap.setAngle(0);
End;
End;
End;
AE := 0;
End;
{ GoToPortal()
-------------------------------------------------------------------------------
-- Goes to the DTM
-------------------------------------------------------------------------------
}
procedure GoToPortal;
var
P: TPoint;
MSPoint, MMPoint: TPoint;
begin
if not LocateMe = 1 then
Exit;
if LocateMe = 1 and inSafe() then
begin
SDB('Procedure GoToPortal');
exit;
end;
if (not LocatePortal(MSPoint, MMPoint)) then
Exit();
Mouse(MMPoint.randRange( - 10, 10), MOUSE_LEFT);
while minimap.isFlagPresent(Random(1000, 2000)) do
wait(Random(100, 200));
AE := 0;
end;
{ PortalATB()
-------------------------------------------------------------------------------
-- Rotates the camera to get a good angle of the portal
-------------------------------------------------------------------------------
}
procedure PortalATB;
begin
if (AE < 2) and (Round(PX) < 15) and (Round(PY) < 10) then
Exit;
if (GetColor(126, 117) = 255) then
MMM(Point(435 + Random(10), 47 + Random(10)), 1);
if (PX < - 15) or (PY > 25) then
GoToPortal;
if not (LookingAtPortal) then
LookPortal(5);
if (Round(PX) < 5) and (PY > 25) then
minimap.setAngle(RandomRange( - 60, 60));
end;
{ checkOurFight()
-------------------------------------------------------------------------------
-- Looks for if we're stuck in combat
-------------------------------------------------------------------------------
}
function checkOurFight(): boolean;
var
KEYWORDS: TStringArray;
begin
KEYWORDS := ['You''re already fighting someone else!'];
result := chatbox.findText(KEYWORDS);
end;
{ checkFight()
-------------------------------------------------------------------------------
-- Activates freedom or anticipation if we're glitched in combat
-------------------------------------------------------------------------------
}
procedure checkFight();
begin
if checkOurFight then
begin
SDB('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(FREEDOM, 200, 800);
end;
end;
26..50:
case Random(50) of
0..25:
begin
ActionBar.clickSlot(ANTISLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(ANTICIPATION, 200, 500);
end;
end;
end;
end else
if not checkOurFight then
begin
SDB('We didn''t detect that you were glitched.');
end;
end;
{ getTarget()
-------------------------------------------------------------------------------
-- Searchs onscreen to find desired targets
-------------------------------------------------------------------------------
}
function getTarget: Boolean;
var
FPCol, FPTol: Integer;
I: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
ATTACK: TStringArray;
p: TPoint;
b: TBox;
begin
Result := False;
if Players[CurrentPlayer].Booleans[0] then
begin
FPCol := 11251383;
FPTol := 44;
end
else
begin
FPCol := 8083511;
FPTol := 50;
end;
if inCombat() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
SDB('We are already in combat, can''t engage in another fight');
Exit(True);
end;
if LocateMe = 1 then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
SDB('We are in the lobby, can''t engage in combat here');
Exit(True);
end;
if goNorth() then
begin
ClearScreenDebug;
smartImage.clearArea(Mainscreen.getBounds());
SDB('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);
Pt.start;
Inc(TotalTries);
SDB('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
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;
SDB('Found target successfully in (' + ToStr(ATT) + ' tries, ' + ToStr(Pt.getTime / 1000) + ' secs)');
Exit(True);
end;
if not (isMouseOverText(ATTACK_USER)) then
begin
FastClick(MOUSE_RIGHT);
if not chooseOption.optionsExist(ATTACK_USER) then
begin
chooseOption.close();
SDB('Target has not been found!');
if (debugMode) then
begin
chooseOption.debugOptions();
end;
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;
SDB('Found target successfully in (' + ToStr(ATT) + ' tries, ' + ToStr(Pt.getTime / 1000) + ' secs)');
Exit(True);
end;
end;
end;
end;
end;
end;
end;
end;
{ EP()
-------------------------------------------------------------------------------
-- Activates quick prayers found on the ability bar
-------------------------------------------------------------------------------
}
procedure EP();
begin
actionBar.mouseIcon(AB_BAR_PRAYER, MOUSE_LEFT);
end;
{ GoInPortal()
-------------------------------------------------------------------------------
-- Searches for the safe portal to enter the fight area
-------------------------------------------------------------------------------
}
function GoInPortal: Boolean;
var
tFrame, tFrameEdge, tPortal, tPortalEdge, tEdge: TPointArray;
aEdge: T2DPointArray;
i, safeCheck: Integer;
p: TPoint;
b: TBox;
begin
Result := False;
Inc(AE);
if AE >= (RandomRange(4, 7)) then
begin
LookPortal(5);
wait(random(500, 2000));
smallRandomMouse();
screenCount := 0;
AE := 0;
end;
SDB('Attempted to enter portal ' + IntToStr(AE) + ' times');
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());
with (smartImage) do
begin
clearArea(Mainscreen.getBounds());
drawTPA(tEdge, clAqua);
drawBox(b, False, clAqua);
drawBox(0, 367, 574, 385, true, clAqua);
drawBox(0, 367, 65, 385, true, clTeal);
drawText('Status: ', point(14, 368), UpCharsEx, false, clAqua);
drawText('We are searching for safe portal', point(79, 368), UpCharsEx, false, clTeal);
end;
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);
end;
26..50:
begin
FastClick(MOUSE_LEFT);
wait(random(500, 3000));
smallRandomMouse();
end;
51..75:
begin
FastClick(MOUSE_LEFT);
EP();
end;
end;
screenCount := 0;
GP := 0;
Green := 0;
safeCheck := 0;
allow := 0;
ClearScreenDebug;
SDB('Found safe portal (' + ToStr(AE) + ' tries, ' + ToStr(Pt.getTime / 1000) + ' secs)');
if (minimap.isFlagPresent(Random(2000, 4000))) then
Minimap.waitPlayerMoving();
Exit(True);
end;
end;
end;
end;
{ findGreen()
-------------------------------------------------------------------------------
-- Searches for the green portal in the fight area to determine our location
-------------------------------------------------------------------------------
}
function findGreen: Boolean;
var
tFrame, tFrameEdge, tPortal, tPortalEdge, tEdge: TPointArray;
aEdge: T2DPointArray;
i: Integer;
p: TPoint;
b: TBox;
begin
if LocateMe = 1 then
begin
SDB('We are in green portal, we won' 't be searching for green portal here');
writeln('We are in lobby, not going to look for the portal!');
exit(True);
end;
if inCombat() then
begin
SDB('Not searching for green portal in combat');
writeln('We are in combat, not going to look for the portal!');
exit(True);
end;
if GP >= randomRange(3, 4) then
begin
if isLoggedIn() then
begin
Green := 1;
Alarm();
if (takeScreenshots) then
begin
screenShot;
end;
GP := 0;
Green := 0;
inc(EastW);
screenCount := 0;
Boot('Cannot detect green portal, we are going to attempt to relog');
wait(5000 + Random(3500));
Boot('We are logging to lobby');
players[currentPlayer].exitToLobby();
end;
if not isLoggedIn() then
begin
GP := 0;
screenCount := 0;
Green := 0;
Boot('Signing back online');
players[currentPlayer].login();
wait(1000 + Random(1500));
Boot('Closing Poll');
closePollWindow();
exitTreasure();
Minimap.ClickCompass;
mainscreen.setangle(MS_ANGLE_HIGH);
end;
end;
if inSafe() then
begin
screenSetUp();
screenCount := 1;
Pt.start;
Result := False;
Inc(GP);
SDB('Looking for green portal ' + IntToStr(GP) + ' times');
FindColorsTolerance(tFrame, 3100230, Mainscreen.getBounds(), 5, ColorSetting(2, 0.72, 2.62));
tFrameEdge := FindTPAEdges(tFrame);
FindColorsTolerance(tPortal, 2381889, Mainscreen.getBounds(), 20, ColorSetting(2, 0.07, 0.44));
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());
with (smartImage) do
begin
clearArea(Mainscreen.getBounds());
drawTPA(tEdge, clWhite);
drawBox(b, False, clWhite);
drawBox(0, 367, 574, 385, true, clAqua);
drawBox(0, 367, 65, 385, true, clTeal);
drawText('Status: ', point(14, 368), UpCharsEx, false, clAqua);
drawText('We are searching for green portal', point(79, 368), UpCharsEx, false, clTeal);
end;
if (getPixelShift(b, 100) > 200) then
begin
Mouse(b.getRandomPoint());
if (isMouseOverText(['Leave'])) then
begin
ClearScreenDebug;
SDB('Found green portal (' + ToStr(GP) + ' tries, ' + ToStr(Pt.getTime / 1000) + ' secs)');
case Random(100) of
0..50:
begin
GP := 0;
Green := 0;
randomComp();
Exit(True);
end;
51..100:
begin
GP := 0;
Green := 0;
smallRandomMouse();
randomComp();
Exit(True);
end;
end;
end;
end;
end;
end;
end;
{ leavePortal()
-------------------------------------------------------------------------------
-- Leaves and terminates if found inside red portal
-------------------------------------------------------------------------------
}
procedure LeavePortal;
begin
SDB('Detected Red Portal, Leaving Portal');
if not (LocateMe = 5) then
begin
while (LocateMe > 4) do
begin
if LocateMe < 5 then
Break;
MMM(PolToPT(180, RandomRange(20, 70), MMCC), 3);
end;
end;
if LocateMe < 4 then
Exit;
SDB('We are in safe area now, shutting down');
end;
{ LookAtPlayers()
-------------------------------------------------------------------------------
-- Sets screen angle according to player colours
-------------------------------------------------------------------------------
}
procedure LookAtPlayers;
begin
minimap.setAngle(PtToPol(0, FA, MMCC));
end;
{ GoToPlayers()
-------------------------------------------------------------------------------
-- Handles swiching weapons, prayer activation and walking out of safe
-------------------------------------------------------------------------------
}
procedure GoToPlayers;
begin
ClearScreenDebug;
SDB('Walking into Fight Area');
MouseSpeed := RandomRange(30, 50);
case Random(100) of
0..30:
begin
case Random(100) of
0..50:
minimap.clickCompass;
51..100:
minimap.setAngle(0);
end;
Wait(random(1000, 4000));
if (quickPrayers) then
begin
if (actionBar.getPrayerPercent() > 0) then
begin
if not prayerActive() then
begin
SDB('Activating prayer');
EP();
end;
end;
end;
case Random(75) of
0..25:
begin
MiniMapWalk1();
end;
26..50:
begin
MiniMapWalk2();
end;
51..75:
begin
MiniMapWalk3();
end;
end;
Wait(1000 + Random(1225));
if (switchWeps) then
begin
switchCombat();
end;
end;
31..75:
begin
wait(random(300, 1050));
case Random(100) of
0..50:
minimap.clickCompass;
51..100:
begin
mainscreen.setangle(MS_ANGLE_HIGH);
minimap.setAngle(0);
end;
end;
if (switchWeps) then
begin
switchCombat();
end;
Wait(300 + Random(950));
case Random(75) of
0..25:
begin
MiniMapWalk1();
end;
26..50:
begin
MiniMapWalk2();
end;
51..75:
begin
MiniMapWalk3();
end;
end;
if (quickPrayers) then
begin
if (actionBar.getPrayerPercent() > 0) then
begin
if not prayerActive() then
begin
SDB('Activating prayer');
EP();
end;
end;
end;
end;
76..100:
begin
case Random(100) of
0..50:
minimap.clickCompass;
51..100:
begin
minimap.setAngle(0);
mainscreen.setangle(MS_ANGLE_HIGH);
end;
end;
if (quickPrayers) then
begin
if (actionBar.getPrayerPercent() > 0) then
begin
if not prayerActive() then
begin
SDB('Activating prayer');
EP();
end;
end;
end;
if (switchWeps) then
begin
switchCombat();
end;
case Random(75) of
0..25:
begin
MiniMapWalk1();
end;
26..50:
begin
MiniMapWalk2();
end;
51..75:
begin
MiniMapWalk3();
end;
end;
end;
end;
if (LocateMe < 2) then
begin
ClearScreenDebug;
HandleUnknown();
Exit;
end;
end;
{ fr33BitMaps()
-------------------------------------------------------------------------------
-- Frees the painted bitmap
-------------------------------------------------------------------------------
}
procedure fr33BitMaps();
begin
freeBitMap(scriptPaintBMP);
end;
{ useAbility()
-------------------------------------------------------------------------------
-- Does our abilities
-------------------------------------------------------------------------------
}
procedure useAbility;
var
adrenaline: integer;
begin
adrenaline := actionBar.getAdrenalinePercent();
if (adrenaline < random(0, 49)) then
begin
SDB('Cannot call any abilities, not enough adrenaline');
end;
if (adrenaline >= 50) and (allow = 0) then
begin
allow := 1;
if ((actionBar.getCurrentBar()) = 1) then
begin
SDB('Using slaughter ability');
end;
if ((actionBar.getCurrentBar()) = 2) then
begin
SDB('Using snapshot ability');
end;
if ((actionBar.getCurrentBar()) = 3) then
begin
SDB('Using asphyxiate ability');
end;
case Random(50) of
0..25:
begin
ActionBar.clickSlot(SLOT50, MOUSE_MOVE);
Fastclick(MOUSE_LEFT);
end;
26..50:
begin
sendKeys(ABILITY50, 200, 600);
end;
end;
end
else if (adrenaline = 100) then
begin
allow := 0;
if ((actionBar.getCurrentBar()) = 1) then
begin
SDB('Using overpower ability');
end;
if ((actionBar.getCurrentBar()) = 2) then
begin
SDB('Using deadshot ability');
end;
if ((actionBar.getCurrentBar()) = 3) then
begin
SDB('Using omnipower ability');
end;
case Random(50) of
0..25:
begin
ActionBar.clickSlot(SLOT100, MOUSE_MOVE);
Fastclick(MOUSE_LEFT);
end;
26..50:
begin
sendKeys(ABILITY100, 100, 900);
end;
end;
end;
end;
{ callAntiBan()
-------------------------------------------------------------------------------
-- Calls our anti ban
-------------------------------------------------------------------------------
}
procedure callAntiBan;
begin
if not (attackPlayers) and loopCount >= (randomRange(20, 30)) then
begin
SDB('It''s time to perform antiban, number is ' + toStr(loopCount));
wait(random(1000, 5000));
HandleAntiBan();
loopCount := 0;
inc(antiTimes);
end else
if (attackPlayers) and loopCount >= (randomRange(75, 125)) then
begin
SDB('It''s time to perform antiban, number is ' + toStr(loopCount));
wait(random(1000, 9000));
HandleAntiBan();
loopCount := 0;
inc(antiTimes);
end;
end;
{ MainLoop()
-------------------------------------------------------------------------------
-- Repeats our tasks
-------------------------------------------------------------------------------
}
procedure MainLoop;
begin
inc(loopCount);
if LocateMe = 1 then
GoInPortal();
if LocateMe = 2 then
GoToPlayers();
if (attackPlayers) then
getTarget();
if inCombat() and (attackPlayers) then
useAbility();
if (incomingUpdate) then
begin
Alarm();
end;
end;
{ checkTerminate()
-------------------------------------------------------------------------------
-- Checks for the messages from the names in the array
-------------------------------------------------------------------------------
}
function checkTerminate(): boolean;
var
KEYWORDS: TStringArray;
begin
KEYWORDS := [
'From Bu',
'From Sick'
];
result := chatbox.findText(KEYWORDS);
end;
{ checkChat()
-------------------------------------------------------------------------------
-- Logs player out if message from Bu11et is found
-------------------------------------------------------------------------------
}
procedure checkChat();
begin
if (PMShutDown) then
begin
if checkTerminate then
begin
Boot('Sounding Alarm, message from Bu11et detected');
Alarm();
Boot('Message from Bu11et detected, Logging out player');
if not inCombat() then
begin
Boot('Sending player North');
minimap.clickCompass;
MiniMapWalk1;
Boot('Logging out player');
players[currentPlayer].exitToLobby();
wait(random(3500, 7000));
Boot('Logging in player');
players[currentPlayer].login();
end else
if inCombat() then
begin
Boot('We are in combat, waiting til signout');
wait(random(30000, 60000));
Boot('Logging out player');
players[currentPlayer].exitToLobby();
wait(random(3500, 7000));
Boot('Logging in player');
players[currentPlayer].login();
end;
end else
if not checkTerminate then
begin
Boot('No messages found from Sickbu11et or Bu11et, not relogging');
end;
end;
end;
{ sendStatus()
-------------------------------------------------------------------------------
-- Sends a balloon hint of the status of the player
-------------------------------------------------------------------------------
}
procedure sendStatus();
begin
if not isLoggedIn() then
begin
showBalloonHint('NS BOT Status', 'We are NOT signed in. '+healthPercent+' '+PrayerPercent+'', 3000, 0);
end;
if inSafe() then
begin
showBalloonHint('NS BOT Status', 'We are in the Fight Area. '+healthPercent+' '+PrayerPercent+'', 3000, 0);
end;
if inCombat() then
begin
showBalloonHint('NS BOT Status', 'We are in combat. '+healthPercent+' '+PrayerPercent+'', 3000, 0);
end;
if LocateMe = 1 then
begin
showBalloonHint('NS BOT Status', 'Looking for safe portal. '+healthPercent+' '+PrayerPercent+'', 3000, 0);
end;
if LocateMe = 2 then
begin
showBalloonHint('NS BOT Status', 'We are walking into Fight Area. '+healthPercent+' '+PrayerPercent+'', 3000, 0);
end;
if LocateMe = 3 then
begin
showBalloonHint('NS BOT Status', 'We are in the Fight Area. '+healthPercent+' '+PrayerPercent+'', 3000, 0);
end;
if inSafe() and inMulti() then
begin
showBalloonHint('NS BOT Status', 'We have been lured. '+healthPercent+' '+PrayerPercent+'', 3000, 0);
end;
end;
{ sixHourFix()
-------------------------------------------------------------------------------
-- Reloads our client if we game session
-------------------------------------------------------------------------------
}
procedure sixHourFix(); override;
begin
print('sixHourFix():', TDebug.HEADER);
if (players.getActive() < 1) then
print('No active players, no use in reloading the client!', TDebug.FATAL);
smartReloadClient((SESSION_TIME * 60000) + random(10000));
if (waitClientReady()) then
begin
print('Client succesfully loaded after reload');
Boot('Logging player in');
wait(random(2500, 6500));
if (players[currentPlayer].login()) then
begin
print('Succesfully logged in after client was reloaded');
Boot('Closing Poll');
wait(random(500, 4000));
closePollWindow();
Boot('Closing treasure');
exitTreasure();
wait(random(1000, 4000));
Boot('Setting screen to face north');
minimap.setAngle(0);
print('sixHourFix()', TDebug.FOOTER);
exit();
end else
print('Failed to login player after restart', TDebug.FATAL);
end else
print('Client never reloaded after restart..', TDebug.FATAL);
end;
var
loop: Integer;
begin
smartShowConsole := FALSE;
installAssets();
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
begin
terminatescript;
end;
smartPlugins := ['d3d9.dll'];
disableSRLDebug := true;
disableSRLLog := true;
smartEnableDrawing := true;
SetupSRL;
declarePlayers;
if (sendStatuses) then
begin
statusMarker.start();
end;
if (eastWestDetection) then
begin
lureMarker.start();
end;
if (PMShutDown) then
begin
PMMarker.start();
end;
if not (attackPlayers) then
begin
abilityMarker.start();
end;
if not (newPaint) then
begin
scriptPaintBMP := loadBitmap(appPath + 'Scripts\Bu11ets_NS_Bot_Images\clanwarsns3.png');
end
else
if (newPaint) then
begin
scriptPaintBMP := loadBitmap(appPath + 'Scripts\Bu11ets_NS_Bot_Images\clanwarsns4.png');
end;
fastReplaceColor(scriptPaintBMP, 0, 1);
addOnTerminate('fr33BitMaps');
screenCount := 0;
AE := 0;
GP := 0;
ClearScreenDebug;
repeat
if not isLoggedIn() then
begin
Alarm();
if (takeScreenshots) then
begin
screenShot;
end;
Boot('Logging player in');
wait(random(2500, 4500));
players[currentPlayer].login();
Boot('Closing Poll');
wait(random(1000, 3000));
closePollWindow();
Boot('Closing treasure');
exitTreasure();
wait(random(1000, 2000));
Boot('Setting screen to face north');
minimap.setAngle(0);
end;
until isLoggedIn();
repeat
if not (attackPlayers) then
begin
if abilityMarker.getTime >= (randomRange(120000, 150000)) then
begin
case Random(50) of
0..25:
case Random(50) of
0..25:
begin
ActionBar.clickSlot(ANTISLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(ANTICIPATION, 200, 400);
end;
end;
26..50:
case Random(50) of
0..25:
begin
ActionBar.clickSlot(FREESLOT, MOUSE_LEFT);
end;
26..50:
begin
sendKeys(FREEDOM, 200, 400);
end;
end;
end;
end;
abilityMarker.reset();
abilityMarker.start();
end;
if (sendStatuses) then
begin
if statusMarker.getTime > (STATUS_FREQUENCY * 3600000) then
begin
SDB('Sending status notification');
sendStatus;
statusMarker.reset();
statusMarker.start();
end;
end;
if (eastWestDetection) then
begin
if lureMarker.getTime > (randomRange(125000, 125000)) then
begin
SDB('Time has passed.. time to look for green portal..');
findGreen();
lureMarker.reset();
lureMarker.start();
end;
end;
if (PMShutDown) then
begin
if PMMarker.getTime > (randomRange(30000, 75000)) then
begin
SDB('Searching for private message..');
checkChat();
PMMarker.reset();
PMMarker.start();
end;
end;
PaintProgress;
MainLoop;
wait(random(6000, 20000));
callAntiBan();
until False;
end.