Anyone interested in testing my upcoming universal fighter?
- 1400+ lines :p
- Autoresponder
- Prayer using while recovering hp (if there's no food) and ProtectItems if about to die
- eats any food (auto bitmaps)
- monster level detection -> calculate max fighttime
- pickups
- sleeping in a nice format '6h 30m'
- screenshot saving + autorespond logging (both go to scripts-folder)
- UseMM = if no mobs on screen, click yellow MM dotsEDIT: UPDATED: Calculate hue and sat mods, huge + to monster finding :)
program MultiFighter;
{==============================================================================]
[ MultiFighter by marpis ]
[ ]
[ NAME : MultiFighter ]
[ VERSION : BETA ]
[ WRITER : marpis ]
[ DESCRIPTION : Fights any monster with melee and ranged ]
[ ]
[==============================================================================]
[ Instructions: READ CAREFULLY! ]
[ [url]http://www.villavu.com/[/url] ]
[ Screenshots and Autoresponder logs will be saved to your Scripts folder ]
[==============================================================================]
[ SMART SETTINGS ]
[==============================================================================}
//{$Define UseSmart} //comment this line if you don't use SMART
const
World = 149; //world number
Members = false; //members world?
Signed = true; //signed client?
{==============================================================================}
{$IfDef UseSmart} //don't touch lines 16-29
{.include SRL/SRL/misc/smart.scar}
{$EndIf}
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/prayer.scar}
type
mUser = record
Name, Nick, Pass, RunDir, FightMode: string;
Active, UseRanged: boolean;
CombatSetup, Others: TBooleanArray;
MonsterColors, PickupColors: TIntegerArray;
Levels: array [0..24] of integer;
BoxReward, MonsterNames, PickupNames: TStringArray;
HueMod, SatMod: extended;
MonTol: integer;
end;
{==============================================================================]
[ SCRIPT SETTINGS ]
[==============================================================================}
const
LoopTime = 25; // How many minutes to play before switching players
SleepTime = '6h 30m'; // example: '6h 15m' sleeps every 6th hour 15th minute
SleepFor = '2h 15m'; // example: '1h 30m' sleeps for 1 hour and 30 minutes
SaveSS = true; // Save screenshots if player goes inactive?
{==============================================================================]
[ DECLARE PLAYERS ]
[==============================================================================}
var mFighter: array of mUser;
procedure DeclarePlayers;
begin
HowManyPlayers:= 2; // How many players are you using? (including inactive)
CurrentPlayer:= 0; // Starting player?
SetArrayLength(mFighter, HowManyPlayers);
NumberOfPlayers(HowManyPlayers);
// PLAYER 0
with mFighter[0] do
begin
Name:= '';
Nick:= '';
Pass:= '';
Active:= true;
MonsterColors:= [1055614, 3038590, 8299706];
MonsterNames:= ['hicken'];
PickupColors:= [];
PickupNames:= [];
CombatSetup:= [false, false]; //Multicombat zone? Eat food?
Others := [false, false, true]; //Use MM? Bury bones? Autotalk?
FightMode := 'even';
RunDir := 'N';
BoxReward := ['oin', 'ash'];
end;
// PLAYER 1
with mFighter[1] do
begin
Name:= '';
Nick:= '';
Pass:= '';
Active:= true;
MonsterColors:= [2625395, 3412884, 3216013, 2822267];
MonsterNames:= ['eadly'];
PickupColors:= [14211549, 13882328, 13882328,923501];
PickupNames:= ['ones', 'rrow'];
CombatSetup:= [true, true]; //Multicombat zone? Eat food?
Others := [true, true, true]; //Use MM? Bury bones? Autotalk?
FightMode := 'even';
RunDir := 'N';
BoxReward := ['oin', 'ash'];
end;
end;
{================ DON'T TOUCH ANYTHING BELOW =================================}
var //global variables
RoundMark, SleepMark, fails, TalkTimer, BMPFood: integer;
RespondedChatLines, MyResponds: TStringArray;
type
TObject2 = record
x: integer;
y: integer;
InFight: boolean;
end;
procedure SRLPlayers;
var
i, ii: integer;
begin
for i:= 0 to High(mFighter) do
begin
players[i].Name := mFighter[i].Name;
players[i].Pass := mFighter[i].Pass;
players[i].Nick := mFighter[i].Nick;
players[i].Active := mFighter[i].Active;
SetLength(players[i].BoxRewards, Length(mFighter[i].BoxReward));
for ii:= 0 to High(mFighter[i].BoxReward) do
players[i].BoxRewards[ii]:= mFighter[i].BoxReward[ii];
end;
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ procedure DeleteATPAIndex(i: Integer; var arr: T2DPointArray);
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
procedure DeleteATPAIndex(i: Integer; var arr: T2DPointArray);
begin
swap(arr[i], arr[High(arr)]);
SetLength(arr, High(arr));
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function IsInFight(x, y: integer): Boolean;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function IsInFight(x, y: integer): Boolean;
var
G, R: TPointArray;
begin
if not loggedin then exit;
FindColorsTolerance(G, 65280, x-30, y-30, x+30, y+30, 0);
FindColorsTolerance(R, 255, x-30, y-30, x+30, y+30, 0);
Result := High(CombineTPA(G, R)) > 10;
end;
// Wizzup
Function DebugATPA(aPoints: Array Of TPointArray; BmpName: String): Boolean;
Var
Width, Height, ClientBMP, I, L, C, Col: Integer;
xs, ys, xe, ye: Integer;
OuterPoints: TPointArray;
Begin
For I := 0 To High(aPoints) Do
L := L + Length(aPoints[i]);
SetLength(OuterPoints, L + 1);
C := 0;
For I := 0 To High(aPoints) Do
For L := 0 To High(aPoints[i]) Do
Begin
C := C + 1;
OuterPoints[C] := aPoints[i][L];
End;
Try
Begin
xe := xs xor xs;
ye := ys xor ys;
xs := 1 shl 20;
ys := 1 shl 20;
For I := 0 To High(OuterPoints) Do
Begin
xs := Min(xs, OuterPoints[i].X);
ys := Min(ys, OuterPoints[i].Y);
xe := Max(xe, OuterPoints[i].X);
ye := Max(ye, OuterPoints[i].Y);
End;
Width := xe - xs;
Height := ye - ys;
DisplayDebugImgWindow(0, 0);
DisplayDebugImgWindow(Width, Height);
ClientBMP := BitmapFromString(Width, Height, '');
CopyClientToBitmap(ClientBMP, xs, ys, xe, ye)
For I := 0 To High(aPoints) Do
Begin
Col := Random(16777215);
For L := 0 To High(aPoints[i]) Do
FastSetPixel(ClientBMP, aPoints[i][L].X - xs, aPoints[i][L].Y - ys, Col);
End;
SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
DisplayDebugImgWindow(Width, Height);
If BmpName <> '' Then
SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
FreeBitmap(ClientBMP);
End
Except
FreeBitmap(ClientBMP);
End;
Result := True;
End;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function FindObjects
var Objs: Array of TObject2 Here the found objects are stored
width, height: Size of the object
colors: TIntegerArray, object colors
tolerance: Color tolerance
accuracy: Minimum amount of pixels per object
ExcludeSelf: Ignore objects at the same spot than you are
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function FindObjects(var Objs: Array of TObject2; width, height: integer; colors: TIntegerArray; accuracy, tolerance: integer; HueMod, SatMod: extended; ExcludeSelf: boolean): boolean;
var
TPA, TempTPA: TPointArray;
ATPA: T2DPointArray;
i, CTS: integer;
P: TPoint;
Box: TBox;
begin
if not loggedin then exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(HueMod, SatMod);
for i:= 0 to high(colors) do
begin
FindColorsSpiralTolerance(MSCX, MSCY, TempTPA, colors[i], MSX1, MSY1, MSX2, MSY2, tolerance);
TPA:= CombineTPA(TPA, TempTPA);
end;
ColorToleranceSpeed(CTS);
if (Length(TPA) < accuracy) then
begin
ColorToleranceSpeed(CTS);
exit;
end;
ATPA:= SplitTPAEx(TPA, width, height);
SetArrayLength(Objs, Length(ATPA));
Result := true;
SortATPASize(ATPA, true);
//DebugATPA(ATPA, '');
for i:= 0 to High(ATPA) do
begin
P:= MiddleTPA(ATPA[i]);
Box:= IntToBox(245, 145, 275, 180);
if (PointInBox(P, Box) and ExcludeSelf) or (Length(ATPA[i]) < accuracy) then
DeleteATPAIndex(i, ATPA)
else
begin
Objs[i].x := P.x;
Objs[i].y := P.y;
Objs[i].InFight := IsInFight(P.x, P.y);
end;
end;
ColorToleranceSpeed(CTS);
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function ArrangeObjects(Objs: Array of TObject2): array of TObject2;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function ArrangeObjects(Objs: Array of TObject2): array of TObject2;
var
i, w: integer;
Distances, Distances2: TIntegerArray;
begin
SetArrayLength(Distances, GetArrayLength(Objs));
SetArrayLength(Distances2, GetArrayLength(Objs));
for i:= 0 to High(Objs) do
begin
Distances[i] := Distance(MSCX, MSCY, Objs[i].x, Objs[i].y);
Distances2[i] := Distance(MSCX, MSCY, Objs[i].x, Objs[i].y);
end;
quicksort(distances);
for i:= 0 to High(Objs) do
begin
InIntArrayEx(Distances2, w, distances[i]);
Result[i] := Objs[w];
end;
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ procedure DeleteObj2ArrayIndex(i: Integer; var arr: Array of TObject2);
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
procedure DeleteObj2ArrayIndex(i: Integer; var arr: Array of TObject2);
begin
swap(arr[i], arr[High(arr)]);
SetLength(arr, High(arr));
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ procedure FilterFightingMonsters(Mobs: Array of TObject2);
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
procedure FilterFightingMonsters(Mobs: Array of TObject2);
var
i: integer;
begin
for i:= 0 to High(Mobs) do
if Mobs[i].InFight then
DeleteObj2ArrayIndex(i, Mobs);
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function IsOptionMulti(Text: TStringArray): Boolean;
edited from ChooseOptionMulti()
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function IsOptionMulti(Text: TStringArray): Boolean;
var
B: TBox;
TPA: TPointArray;
X, Y, I, C: Integer;
P: TPoint;
begin
Result := False;
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
FindColorsTolerance(TPA, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
If Length(TPA) < 10 Then
Exit;
B.X2 := 0;
B.Y2 := 0;
P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[i].X = TPA[I+1].X - 1 Then
Begin
If C > 5 Then
Begin
B.X1 := P.X;
B.Y1 := P.Y;
Break;
End Else
C := C + 1;
End
Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
InvertTPA(TPA);
C := 0;
P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[i].X = TPA[I+1].X + 1 Then
Begin
If C > 5 Then
Begin
B.X2 := P.X;
B.Y2 := P.Y;
Break;
End Else
C := C + 1;
End Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
For i:=0 To High(Text) do
If FindText(X, Y, Text[i], upchars, B.X1, B.Y1, B.X2, B.Y2) Then
Begin
Result := True;
Exit;
End;
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function IsOption(s: string): boolean;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function IsOption(s: string): boolean;
begin
Result:= IsOptionMulti([s]);
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function GetNPCsIn(x1, y1, x2, y2: integer): TPointArray;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function GetNPCsIn(x1, y1, x2, y2: integer): TPointArray;
begin
FindColorsSpiralTolerance(MMCX, MMCY, result, 1179390, x1, y1, x2, y2, 18);
RAaSTPA(result, 4);
SortTPAFrom(result, Point(MMCX, MMCY));
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function GetArrowCount:integer;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function GetArrowCount:integer;
begin
gametab(5);
result := GetAmount(680, 250);
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function RangedInFight: boolean;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function RangedInFight: boolean;
var
a, t: integer;
begin
a:= GetArrowCount;
MarkTime(t);
repeat
wait(10+random(100));
result:= GetArrowCount < a;
until(result or (TimeFromMark(t)> 3999));
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function posexx(substrarr: TStringArray; str: string): integer;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function posexx(substrarr: TStringArray; str: string): integer;
var
i: integer;
begin
for i:= 0 to High(SUBstrarr) do
begin
result:= pos(lowercase(substrarr[i]), lowercase(str));
if (result > 0) then
exit;
end;
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
{ function Autotalk(seconds: integer): boolean;
seconds is the minimun time between responds. Use it if you like it!
remember to include posexx() too!
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function Autotalk(seconds: integer): boolean;
var
i, ii: integer;
MyLevels: array [0..23] of integer;
ChatLines, Senders, Messages: array [0..7] of string;
TSA: TStringArray;
s: string;
responded: boolean;
begin
if (TimeFromMark(TalkTimer) < seconds*1000) then exit;
// Read messages in the chatbox
for i:= 1 to 8 do
begin
Senders[i-1]:= lowercase(GetChatboxText(i, clBlack));
Messages[i-1]:= lowercase(GetChatboxText(i, clChat));
ChatLines[i-1]:= Senders[i-1] + Messages[i-1];
end;
// Find triggers
for i:= 7 downto 0 do
begin
if (pos(players[currentplayer].nick, Senders[i])=0) then
if not InStrArr(ChatLines[i], RespondedChatLines, false) then
begin
{================================== LEVELS ===========================================================}
if (posexx(['att','att','str','def','rang','magi','healt', 'hp', 'pray'], Messages[i])>0) then
begin
responded:= true;
writeln('Answering: Levels');
GetAllLevels;
for ii := 0 to 23 do
Mylevels[ii] := players[currentplayer].Level[ii+1];
// Attack
if pos('att', Messages[i])>0 then
begin
TSA:= ['att ', 'attack ', 'attlvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[0]);
end;
// Strength
if pos('str', Messages[i])>0 then
begin
TSA:= ['str ', 'strength ', 'strlvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[1]);
end;
// Defence
if pos('def', Messages[i])>0 then
begin
TSA:= ['def ', 'defence ', 'deflvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[2]);
end;
// Ranged
if pos('rang', Messages[i])>0 then
begin
TSA:= ['rang ', 'ranged ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[3]);
end;
// Prayer
if pos('pray', Messages[i])>0 then
begin
TSA:= ['pray ', 'prayer ', 'praylvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[4]);
end;
// Magic
if pos('mag', Messages[i])>0 then
begin
TSA:= ['mag ', 'magic ', 'maglvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[5]);
end;
// Runecrafting
if posexx(['runecraft','rc'], Messages[i])>0 then
begin
TSA:= ['rc ', 'runecrafting ', 'rclvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[6]);
end;
// HP
if posexx(['hp', 'healt'], Messages[i])>0 then
begin
TSA:= ['hp ', 'healt ', 'health ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[7]);
end;
// Agility
if posexx(['agi'], Messages[i])>0 then
begin
TSA:= ['agi ', 'agility ', 'agilvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[8]);
end;
// Herblore
if posexx(['herb'], Messages[i])>0 then
begin
TSA:= ['herb ', 'herblore ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[9]);
end;
// Thieving
if posexx(['thiev', 'thief'], Messages[i])>0 then
begin
TSA:= ['thieving ', 'thief ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[10]);
end;
// Crafting
if posexx(['craft'], Messages[i])>0 then
begin
TSA:= ['crafting ', 'craft ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[11]);
end;
// Fletching
if posexx(['fletc'], Messages[i])>0 then
begin
TSA:= ['fletch ', 'fletching ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[12]);
end;
// Slayer
if posexx(['slay'], Messages[i])>0 then
begin
TSA:= ['slayer ', 'slaying ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[13]);
end;
// Mining
if posexx(['minin'], Messages[i])>0 then
begin
TSA:= ['mining ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[14]);
end;
// Smithing
if posexx(['smith'], Messages[i])>0 then
begin
TSA:= ['smith ', 'smithing ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[15]);
end;
// Fishing
if posexx(['fish'], Messages[i])>0 then
begin
TSA:= ['fish ', 'fishing ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[16]);
end;
// Cooking
if posexx(['cook'], Messages[i])>0 then
begin
TSA:= ['cooking ', 'cook ', 'cooklvl']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[17]);
end;
// Firemaking
if posexx(['fm', 'firemak'], Messages[i])>0 then
begin
TSA:= ['fm ', 'firemaking ', 'fmlvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[18]);
end;
// Woodcutting
if posexx(['wc', 'woodcut'], Messages[i])>0 then
begin
TSA:= ['wc ', 'woodcut ', 'woodcutting ', 'wclvl ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[19]);
end;
// Farming
if posexx(['farm', 'farmin'], Messages[i])>0 then
begin
TSA:= ['farm ', 'farming ']
s:=s + TSA[random(Length(TSA))] + IntToStr(MyLevels[19]);
end;
// S A Y T H E L I N E
s:= Trim(s);
if s = '' then
begin
writeln('ERROR: Autorespond failed');
exit;
end;
writeln(s);
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
TypeSend(s);
end else
{================================== MAX HIT ====================================================}
if (posexx(['max hit', 'maxhit'], Messages[i])>0) then
begin
responded:= true;
writeln('Answering: Max hit');
TSA:= ['over 9000!!','more than yours nub','i can 1 hit kalphite queen','too much','you cant even imagine it','insane','not your business','wanna try on arena'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end else
{================================ BOT ACCUSE ===============================================}
if (posexx(['bot', 'auto', 'macro'], Messages[i])>0) then
begin
responded:= true;
writeln('Answering: Max hit');
TSA:= ['haha 8P','lololol','couldnt care less actually','ehmm lol','yea right'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end else
{================================== ABUSE ====================================================}
if (posexx(['noob', 'nuub', 'nob', 'newb'], Messages[i])>0) then
begin
responded:= true;
writeln('Answering: Abuse');
TSA:= ['phewt','pfft','yea right','could still pwn u'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end else
{================================= WHAT'S UPS ================================================}
if (posexx(['whatup', 'wazzup', 'wazup', 'watap', 'watup', 'wat up', 'what''s up', 'whatsup', 'whats up', 'wasup', 'wassup'], Messages[i])>0)
begin
responded:= true;
writeln('Answering: Greetings');
TSA:= ['im cool','fine','okay','im bored','nuttin','nothin'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end else
{================================= GREETINGS =================================================}
if (posexx(['hi', 'hello', 'hey', 'hai', 'yoyo', 'yo yo'], Messages[i])>0)
and (posexx(['high', 'they', 'hide', 'chicken', 'hint', 'phail'], Messages[i])=0) then
begin
responded:= true;
writeln('Answering: Greetings');
TSA:= ['hi there','yo yo','wasup','whatap','whats up','hello'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end else
{================================ COMPLIMENTS ==============================================}
if (posexx(['nice', 'cool', 'kewl', 'great', 'awesome', 'sweet', 'fancy'], Messages[i])>0) and
(posexx(['weapon', 'shield', 'armor', 'plate', 'pl8', 'cape', 'helm', 'staff', 'sword', 'gear', 'body', 'leg', 'name', 'hit', 'pants', 'trousers', 'shirt'], Messages[i])>3) then
begin
responded:= true;
writeln('Answering: Compliments');
TSA:= ['heh thanks','ty','thanks dude','yup','lol','not rly'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end else
{================================ FRIEND REQUEST ===========================================}
if (posexx(['iends?'], Messages[i])>0) then
begin
responded:= true;
writeln('Answering: Friend request');
TSA:= ['ehmm no ty','thx but no thx','not interested','mm naaah','lol no ty','not rly'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end else
{================================ JUST NAME ================================================}
if pos(players[currentplayer].nick, Messages[i])>0 then
begin
responded:= true;
writeln('Answering: Name mentioned');
TSA:= ['ya', 'yo', 'hmmh'];
s := TSA[random(Length(TSA))];
SetLength(MyResponds, Length(MyResponds)+1);
MyResponds[High(MyResponds)] := s;
Typesend(s);
end;
{===========================================================================================}
// end of triggers
result:= responded;
if result then
begin
MarkTime(TalkTimer);
SetLength(RespondedChatLines, Length(RespondedChatLines)+1);
RespondedChatLines[High(RespondedChatLines)] := ChatLines[i];
exit;
end;
end;
end;
end;
function PixelShift(x1, y1, x2, y2, t: integer): integer;
var
bmp, bmp2, x, y: integer;
begin
bmp := BitmapFromString((x2 -x1), (y2 - y1), '');
bmp2 := BitmapFromString((x2 -x1), (y2 - y1), '');
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(bmp), x1, y1, x2, y2, 0, 0, (x2 - x1), (y2 - y1));
wait(t);
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(bmp2), x1, y1, x2, y2, 0, 0, (x2 - x1), (y2 - y1));
for x := 1 to (x2 - x1) do
for y := 1 to (y2 - y1) do
if FastGetPixel(bmp2, x, y) <> FastGetPixel(bmp, x, y) then
Inc(result);
FreeBitmap(bmp);
FreeBitmap(bmp2);
end;
function m_IsMoving: boolean;
begin
result := PixelShift(MMCX-25, MMCY-25, MMCX+25, MMCY+25, 200) > 150;
end;
procedure SetupPlayer; forward;
procedure NextP(a: boolean);
begin
NextPlayer(a);
repeat
wait(1000);
until(GetColor(MSCX, MSCY) <> 0);
SetupPlayer;
end;
function SwitchPlayers: boolean;
var
i, ii: integer;
begin
for i := 0 to 4 do
begin
case i of
0:Result := TimeFromMark(RoundMark) > LoopTime*60*1000;
1:Result := not mFighter[currentplayer].Active;
2:begin
for ii := 0 to 4 do
if not loggedin then wait(1000) else break;
Result := not loggedin;
end;
3:Result := fails > 19;
4:Result := not TabExists(1);
end;
if result then
begin
writeln('SWITCH PLAYERS!');
case i of
0: mFighter[currentplayer].Active := true;
1, 2, 3:
begin
mFighter[currentplayer].Active := false;
SaveScreenshot(mFighter[currentplayer].Name+'_'+DateToStr(Date)+'.bmp');
end;
4:
begin
SaveScreenshot(mFighter[currentplayer].Name+'_'+DateToStr(Date)+'.bmp');
FindNormalRandoms;
wait(6000);
mFighter[currentplayer].Active := TabExists(1);
end;
end;
exit;
end;
end;
end;
function EatFood: boolean;
var
x, y: integer;
begin
if not loggedin then exit;
if not mFighter[CurrentPlayer].CombatSetup[1] then exit;
Result:= FindBitmapToleranceIn(BMPFood, x, y, MIX1, MIY1, MIX2, MIY2, 15);
if not Result then
begin
mFighter[CurrentPlayer].CombatSetup[1] := False;
exit;
end;
status('Eating...');
Mouse(x+5, y+5, 3, 3, true);
wait(2000+random(100));
end;
function OutOfArrows: boolean;
var
x, y: integer;
begin
if not mFighter[currentplayer].UseRanged then exit;
Gametab(5);
result:= not FindColor(x, y, 65535, 667, 247, 698, 257);
end;
function WieldArrows: boolean;
var
TIA: array [0..27] of integer;
i, x, y, m, hi, DTMArrows: integer;
Arrows: TPointArray;
begin
if not loggedin then exit;
if not mFighter[currentplayer].active then exit;
GameTab(4);
DTMArrows:= DTMFromString('78DA63F466626078C2800618914820ED0954F' +
'392801A67A09A0F04D4D801D57C24A0C61CA8E63D01352640356F' +
'08A8B104AA794A408D0D50CD43026AEC816A1E1150E30454F318B' +
'F1A00FDC20BBD');
if not FindDTM(DTMArrows, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
FreeDTM(DTMArrows);
exit;
end;
Arrows:= ItemCoordinates('inv', 'dtm', DTMArrows, []);
hi:= High(Arrows);
for i:= 0 to hi do
TIA[i]:= GetAmount(Arrows[i].x, Arrows[i].y);
InIntArrayEx(TIA, m, AMax(TIA));
writeln('Wielding stack with: '+inttostr(TIA[m])+' arrows');
Mouse(Arrows[m].x+10, Arrows[m].y+10, 3, 3, false);
wait(randomrange(250, 350));
result:= ChooseOption('ield');
FreeDTM(DTMArrows);
end;
procedure RunBack(from: string; runfar: boolean; action, waittime: integer);
var
newdir: string;
begin
case lowercase(from) of
'n': newdir:= 's';
'e': newdir:= 'w';
's': newdir:= 'n';
'w': newdir:= 'e';
end;
RunAway(newdir, runfar, action, waittime);
end;
procedure SaveResponds;
var
SaveFilez: TStringList;
i: integer;
begin
SaveFilez := TStringList.Create;
SaveFilez.Clear;
SaveFilez.Add('~~ MultiFighter Autotalk Record ~~');
SaveFilez.Add('Date : '+DateToStr(Date));
SaveFilez.Add('');
for i:= 0 to Min(high(RespondedChatLines), high(MyResponds)) do
begin
SaveFilez.Add('* '+RespondedChatLines[i]);
SaveFilez.Add(' -> '+MyResponds[i]);
SaveFilez.Add('');
end;
if not SaveToFile(SaveFilez, ScriptPath + 'MF_'+DateToStr(Date)+'.txt') then
writeln('Saving report failed!');
end;
procedure AntiBan;
begin
if not mFighter[currentplayer].active then exit;
case random(10) of
0: Gametab(1+random(13));
1: hoverskill('random', false);
2, 3, 4, 5, 6: PickUpMouse;
end;
if mFighter[currentplayer].Others[2] then
if AutoTalk(30) then
Inc(players[currentplayer].integers[4]);
UseRewardBox;
end;
function PanicPrayer: boolean;
var
s: string;
begin
if GetMMLevels('prayer', s) > 0 then
if PrayerExists('11') then
result := ClickPrayer('11', true);
end;
procedure Flee;
var
DeathMark: integer;
s: string;
label
GoBack;
begin
if not loggedin then exit;
RunAway(mFighter[currentplayer].RunDir, true, 2, 5000+random(1000));
if mFighter[currentplayer].UseRanged then
if OutOfArrows then
if not WieldArrows then
begin
mFighter[currentplayer].Active := false;
exit;
end;
if mFighter[currentplayer].CombatSetup[1] then
if EatFood then goto GoBack;
if not mFighter[currentplayer].CombatSetup[1] then
status('Recovering...');
if GetMMLevels('prayer', s) > 9 then
if PrayerExists('10') then
ClickPrayer('10', true);
repeat
FindNormalRandoms;
if IsInFight(MSCX, MSCY-20) then
begin
if PanicPrayer then
writeln('Protect Item activated!')
else
writeln('WE ARE DOOMED!');
MarkTime(DeathMark);
repeat
mFighter[currentplayer].active := not FindDead;
wait(50);
until(FindDead or (TimeFromMark(DeathMark) > 90000) or (not IsInFight(MSCX, MSCY-20)));
wait(3000);
if FindDead then exit;
ClickPrayer('11', false);
end;
AntiBan;
case random(2) of
0:begin
Mouse(0, 0, MSX2, MSY2, false);
wait(750+random(500));
ChooseOption('xamin');
end;
1: MakeCompass(inttostr(random(360)));
end;
until(SwitchPlayers or (HPPercent > 95));
GoBack:
if PrayerActivated('10') then
ClickPrayer('10', false);
RunBack(mFighter[currentplayer].RunDir, true, 2, 5000);
status('');
end;
procedure HPCheck;
begin
if not loggedin then exit;
status('HPCheck...');
mFighter[currentplayer].active := not FindDead;
if (HPPercent < 76) then
begin
repeat
if not EatFood then
begin
Flee;
exit;
end;
until((HPPercent > 74) or not loggedin);
end;
end;
function InCombat: boolean;
begin
case mFighter[currentplayer].UseRanged of
true: result:= RangedInFight;
false: result:= IsInFight(MSCX, MSCY-20);
end;
end;
function GetLevelUpText: integer;
var
s: string;
begin
s:= Trim(Between('l:', ')', GetUpText));
Result:= StrToIntDef(s, 0);
end;
function FightMonster(Target: TObject2): boolean;
var
t, MaxKillTime, MobLvl, x, y: integer;
begin
if not loggedin then exit;
if not mFighter[currentplayer].active then exit;
case mFighter[currentplayer].UseRanged of
true: MaxKillTime:= 120*1000;
false:MaxKillTime:= 90*1000;
end;
if not mFighter[currentplayer].CombatSetup[0] then
if IsInFight(Target.x, Target.y) then
exit;
FindNormalRandoms;;
MMouse(Target.x, Target.y, 3, 3);
wait(50+random(50));
MobLvl:= GetLevelUptext;
if MobLvl > 0 then
case mFighter[currentplayer].UseRanged of
false:
begin
MaxKillTime:= MaxKillTime + ((MobLvl - mFighter[currentplayer].Levels[0]) * 2000);
MaxKillTime:= Max(MaxKillTime, 10000);
end;
true:
begin
MaxKillTime:= MaxKillTime + ((MobLvl - mFighter[currentplayer].Levels[4]) * 2000);
MaxKillTime:= Max(MaxKillTime, 15000);
end;
end;
GetMousePos(x, y);
FindNormalRandoms;
Mouse(x, y, 0, 0, false);
wait(150+random(50));
if IsOptionMulti(mFighter[CurrentPlayer].MonsterNames) then
Result:= ChooseOption('tta')
else
begin
if (x > 200) then
MMouse(x-200, y, 10, 100)
else
MMouse(x+200, y, 10, 100);
exit;
end;
writeln('Max killtime (ms): '+inttostr(MaxKillTime));
if not mFighter[currentplayer].UseRanged then
begin
wait(900+random(200));
while m_IsMoving do wait(50+random(50));
FFlag(2);
wait(900+random(200));
end;
MarkTime(t);
repeat
HPCheck;
FindNonInventoryRandoms;
SleepAndMoveMouse(750+random(500));
FindNonInventoryRandoms;
until(not InCombat or (TimeFromMark(t) > MaxKillTime) or OutOfArrows);
status('');
if OutOfArrows then
begin
RunAway(mFighter[currentplayer].RunDir, true, 2, 30000+random(5000));
mFighter[currentplayer].Active := WieldArrows;
if mFighter[currentplayer].Active then RunBack(mFighter[currentplayer].RunDir, true, 2, 2500);
end;
end;
function PickupItem(colors: TIntegerArray; names: array of string): boolean;
var
items: array of TObject2;
i, j, l, t: integer;
begin
if not loggedin then exit;
if not mFighter[currentplayer].Active then exit;
if (Length(colors) = 0) or (Length(names) = 0) then exit;
if FindObjects(items, 15, 15, colors, 3, 10, 0.5, 0.5, false) then
begin
items:= ArrangeObjects(items);
l:= Min(High(items), 2);
for i:= 0 to l do
begin
Mouse(items[i].x, items[i].y, 2, 2, false);
wait(300+random(100));
for j:= 0 to high(names) do
begin
result:= IsOption(names[j]);
if result then
begin
MarkTime(t);
ChooseOption(names[j]);
wait(1000+random(100));
while (m_IsMoving and (TimeFromMark(t)<10000)) do wait(100+random(10));
exit;
end;
end;
end;
end;
end;
procedure BuryBonez;
var
x, y, DTMBones: integer;
begin
if not mFighter[currentplayer].active then exit;
if not loggedin then exit;
DTMBones:= DTMFromString('78DA633463626078C48006189148206D0B547' +
'38F801A57A09A3B04D4B803D53C24C29C4744A87946408D3D50CD' +
'5B026A6C806A5EE1570300AAD30949');
status('Burying bones...');
Gametab(4);
IncEx(players[currentplayer].integers[3], CountItems(DTMBones, 'dtm', [0]));
repeat
FindNormalRandoms;
if FindDTM(DTMBones, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 4, 4);
wait(250+random(100));
if IsUpText('ury') then
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
wait(1500+random(200));
end;
until(not FindDTM(DTMBones, x, y, MIX1, MIY1, MIX2, MIY2));
FreeDTM(DTMBones);
end;
procedure SetupFood;
var
i, x, y: integer;
box: TBox;
begin
if not loggedin then exit;
if not mFighter[CurrentPlayer].CombatSetup[1] then
begin
BMPFood := BitmapFromString(0, 0, '');
FreeBitmap(BMPFood);
exit;
end;
for i:= 1 to 28 do
begin
if ExistsItem(i) then
begin
MMouseItem(i);
wait(250+random(100));
if IsUpText('Eat') then
begin
box := InvBox(i);
BMPFood := BitmapFromString(box.x2 - box.x1 -10, box.y2 - box.y1 -10, '');
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMPFood), box.x1+5, box.y1+5, box.x2 -5, box.y2 -5, 0, 0, (box.x2 - box.x1 -10), (box.y2 - box.y1 -10));
writeln('Food found in inventory');
exit;
end;
end;
end;
mFighter[CurrentPlayer].CombatSetup[1]:= false;
end;
procedure SetLevels;
var
i: integer;
begin
if not loggedin then exit;
GetAllLevels;
for i := 1 to 21 do
mFighter[currentplayer].Levels[i] := players[currentplayer].Level[i];
mFighter[currentplayer].Levels[0] := GetCombatLevel;
for i := 0 to 21 do
if mFighter[currentplayer].Levels[i] < 1 then
begin
writeln('** ERROR ********************************************');
writeln('* Failed getting levels: '+padr('Level['+inttostr(i)+'] = 0', 13)+' *');
writeln('* If you are using SMART, try again using a browser *');
writeln('* If it still doesn''t work, contact me at forums: *');
writeln('* [url]http://www.villavu.com/[/url] *');
writeln('*****************************************************');
//logout;
terminatescript;
end;
end;
function UsingRanged: boolean;
begin
if not loggedin then exit;
result:= posexx(['ccura', 'ongr', 'api'], mFighter[currentplayer].FightMode)>0;
if Result then
writeln('Player is using ranged')
else
writeln('Player is using melee');
GameTab(5);
if Result then
if GetArrowCount > 0 then exit else
if not WieldArrows then
mFighter[currentplayer].active:= false;
end;
procedure FightMode;
var
m: integer;
Levels: TIntegerArray;
begin
if not loggedin then exit;
case mFighter[currentplayer].FightMode of
'defence','defense','longrange': SetFightMode(4);
'strength','rapid': SetFightMode(2);
'attack','accurate': SetFightMode(1);
'even':begin
if mFighter[currentplayer].UseRanged then exit;
Levels := [mFighter[currentplayer].Levels[1], mFighter[currentplayer].Levels[2], mFighter[currentplayer].Levels[3]];
InIntArrayEx(Levels, m, AMin(Levels));
if m = 2 then m:= 3;
SetFightMode(m+1);
end;
end;
Retaliate(true);
end;
procedure CheckLevelUps;
var
i: integer;
gotlvl: boolean;
begin
if not loggedin then exit;
if (players[currentplayer].integers[0] mod 10 <> 0) or (players[currentplayer].integers[0] = 0) then exit;
GetAllLevels;
for i := 1 to 24 do
if players[currentplayer].Level[i] < mFighter[currentplayer].Levels[i] then
begin
gotlvl := true;
Inc(players[currentplayer].integers[1]);
end;
SetLevels;
FightMode;
end;
procedure SearchMobs;
var
NPCs: TPointArray;
label
TurnCompass;
begin
writeln('Monsters not found: '+inttostr(fails));
if mFighter[currentplayer].Others[0] then
begin
NPCs:= GetNPCsIn(MMX1, MMY1, MMX2, MMY2);
if Length(NPCs) < 1 then goto TurnCompass;
MouseFlag(NPCs[0].x, NPCs[0].y, 4, 4, 0);
exit;
end;
TurnCompass:
MakeCompass(inttostr(random(360)));
wait(2000+random(500));
end;
{*******************************************************************************
function function TPAMods(var MidColour: integer; var HueMod, SatMod: Extended; Colors: TIntegerArray): boolean;
By: TorrentOfFlame
Description: Works out the MidColour, Tolerance, Hue Modifier and Saturation Modifier for TPA's based on inputted
values
*******************************************************************************}
function TPAMods(var MidColour, Tolerance: integer; var HueMod, SatMod: Extended; Colors: TIntegerArray): boolean;
var
H, S, L, Tol: Extended;
i, ii: integer;
HSLColor: Array[1..3] of Extended;
HSL: Array[0..1] of Array[1..3] of Extended;
begin
for i := 0 to High(Colors) do
begin
ColortoHSL(Colors[i], HSLColor[1], HSLColor[2], HSLColor[3]);
for ii:= 1 to 3 do
begin
HSL[0][ii] := MinE(HSLColor[ii], HSL[0][ii]);
HSL[1][ii] := MaxE(HSLColor[ii], HSL[1][ii]);
end;
end;
H := HSL[1][1] - HSL[0][1];
S := HSL[1][2] - HSL[0][2];
L := HSL[1][3] - HSL[0][3];
MidColour := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
HueMod := (H/L);
SatMod := (S/L);
Tol := L;
if (MidColour <= 0) then
begin
WriteLn('TPA Variables not found.');
Result := False;
end else
Result := True;
Tolerance := Trunc(Tol + 0.5);
end;
procedure SetupMonsterFinder(var tolerance: integer; var HueMod, SatMod: extended);
var
HM, SM: extended;
tol, MC, CTS, i, tries: integer;
ATPA: T2DPointArray;
label
FailExit;
begin
TPAMods(MC, tol, HM, SM, mFighter[currentplayer].MonsterColors);
SetLength(ATPA, 2);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HM, SM);
tol := min(10, tol);
repeat
writeln('TEST TOLERANCE = '+inttostr(tol));
ATPA[1] := [];
for i := 0 to high(mFighter[currentplayer].MonsterColors) do
begin
FindColorsSpiralTolerance(MSCX, MSCY, ATPA[0], mFighter[currentplayer].MonsterColors[i], MSX1, MSY1, MSX2, MSY2, tol);
ATPA[1] := CombineTPA(ATPA[0], ATPA[1]);
end;
writeln('Length(ATPA[1]) = '+inttostr(Length(ATPA[1])));
if Length(ATPA[1]) > 1000 then
begin
tol := tol - 1;
if tol < 0 then
begin
FailExit:
writeln('Failed to find best color modifiers, using following:');
writeln(' * Tolerance = 10');
writeln(' * Huemod = 0.4');
writeln(' * SatMod = 0.4');
Tolerance := 10;
HueMod := 0.4;
SatMod := 0.4;
ColorToleranceSpeed(CTS);
exit;
end;
inc(tries);
end else
begin
writeln('Length(ATPA[1]) = '+inttostr(Length(ATPA[1])));
Tolerance := tol;
HueMod := HM;
SatMod := SM;
writeln('BEST COLOR MODIFIERS FOUND:');
writeln(' * Tolerance = '+inttostr(tolerance));
writeln(' * Huemod = '+floattostr(HueMod));
writeln(' * SatMod = '+floattostr(SatMod));
ColorToleranceSpeed(CTS);
exit;
end;
until(false);
goto FailExit;
end;
procedure SetupPlayer;
begin
if not loggedin then exit;
SetupFood;
mFighter[currentplayer].UseRanged := UsingRanged;
SetLevels;
FightMode;
Fails := 0;
SetAngle(true);
SetAngle(true);
if mFighter[currentplayer].HueMod <= 0 then
SetupMonsterFinder(mFighter[currentplayer].MonTol, mFighter[currentplayer].HueMod, mFighter[currentplayer].SatMod);
end;
procedure Report;
var
i: integer;
begin
ClearDebug;
SaveResponds;
writeln('|~ Multifighter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
writeln('|_Player_|_Kills_|_Levels_|_Pickups_|_Bones_|_Responds_|_Active_|');
for i:= 0 to High(mFighter) do
writeln('| '+padr(players[i].Nick, 7)+'| '+padr(inttostr(players[i].integers[0]), 6)+'| '+padr(IntToStr(players[i].integers[1]), 7)+'| '+padr(inttostr(players[i].integers[2]), 8)+'| '+padr(inttostr(players[i].integers[3]), 6)+'| '+padr(IntToStr(players[i].integers[4]),9)+'| '+padr(booltostr(players[i].active), 6)+'|');
writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
writeln('| Minutes to switch: '+padr(inttostr(((LoopTime-(TimeFromMark(RoundMark)/60/1000)))), 43)+'|');
writeln('| Worked for: '+padr(timerunning, 50)+'|');
writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|');
end;
procedure CheckRun;
var
x, y: integer;
s: string;
begin
if (GetMMLevels('run', s) > 70) then
if not FindColorTolerance(x, y, 6871530, 715, 100, 730, 110, 10) then
SetRun(true);
end;
function BedTime: boolean;
var
h, m, i: integer;
hs: string;
begin
if SleepTime = '' then exit;
for i := 1 to length(SleepTime) do
begin
hs := hs + copy(SleepTime, i, 1);
if EndsWith('h', hs) then break;
end;
hs := GetNumbers(hs);
h := StrToIntDef(hs, 0);
m := StrToIntDef(between('h', 'm', SleepTime), 0);
result := (h*60*60*1000) + (m*60*1000) < TimeFromMark(SleepMark);
end;
procedure Sleepz;
var
h, m, t, i: integer;
hs, ms: string;
begin
if SleepFor = '' then exit;
Status('Sleeping...');
for i := 1 to length(SleepFor) do
begin
hs := hs + copy(SleepTime, i, 1);
if EndsWith('h', hs) then break;
end;
hs := GetNumbers(hs);
h := StrToIntDef(hs, 0);
m := StrToIntDef(between('h', 'm', SleepFor), 0);
logout;
MarkTime(t);
repeat
Disguise(inttostr(h - TimeFromMark(t)/1000/60/60)+'h '+inttostr(m - TimeFromMark(t)/1000/60)+'m');
Sleep(30*1000);
SleepAndMoveMouse(10*1000);
until(TimeFromMark(t) > (h*60*60*1000 + m*60*1000));
Disguise('Mozilla Firefox');
loginplayer;
MarkTime(SleepMark);
end;
procedure MainLoop;
var
i: integer;
Monsterz: Array of TObject2;
begin
if not loggedin then terminatescript;
MarkTime(SleepMark);
repeat
MarkTime(RoundMark);
repeat
FindNormalRandoms;
CheckRun;
HPCheck;
if FindObjects(Monsterz, 30, 30, mFighter[CurrentPlayer].MonsterColors, 5, mFighter[currentplayer].MonTol, mFighter[currentplayer].HueMod, mFighter[currentplayer].SatMod, true) then
begin
FindNormalRandoms;
if not mFighter[currentplayer].CombatSetup[0] then FilterFightingMonsters(Monsterz);
Monsterz:= ArrangeObjects(Monsterz);
for i:= 0 to Min(High(Monsterz), 1) do
begin
if FightMonster(Monsterz[i]) then
begin
fails:= 0;
Inc(players[currentplayer].integers[0]);
if PickupItem(mFighter[currentplayer].PickupColors, mFighter[currentplayer].PickupNames) then
Inc(players[currentplayer].integers[2]);
break;
end;
if (i = Min(High(Monsterz), 2)) then
begin
Inc(fails);
if (fails mod 3 = 0) then SearchMobs;
end;
end;
CheckLevelUps;
end else
begin
Inc(fails);
SearchMobs;
end;
if mFighter[currentplayer].Others[1] then
if InvFull then BuryBonez;
AntiBan;
Report;
if BedTime then Sleepz;
until(SwitchPlayers);
NextP(mFighter[currentplayer].active);
until(false);
end;
const
version = '';
procedure SetupFighter;
var
content: string;
i: integer;
UseSMARTY: boolean;
begin
SetupSRL;
DeclarePlayers;
SRLPlayers;
Disguise('Mozilla Firefox');
ClearDebug;
Content:= GetPage('http://koti.mbnet.fi/marpis/mFighterNews.html');
for i:= 1 to 9 do
if pos('<line'+inttostr(i)+'>', Content) > 0 then
writeln(Between('<line'+inttostr(i)+'>', '</line'+inttostr(i)+'>', Content));
writeln('');
if Between('<ver>', '</ver', Content) <> version then
begin
for i:= 0 to 4 do
writeln('WARNING! YOUR SCRIPT IS OUTDATED!');
writeln('Visit the SRL forums to download the latest version:');
writeln('http://www.villavu.com/');
end;
{$IfDef UseSmart}
UseSMARTY := true;
SmartSetupEx(World, Members, Signed, false);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
{$EndIf}
if not UseSMARTY then wait(3000);
ActivateClient;
MouseSpeed:= 14+random(3);
wait(2000);
ClearReport;
end;
begin
SetupFighter;
if not loggedin then loginplayer;
SetupPlayer;
MainLoop;
end.