Code:
Program AutoFighter;
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P06Include/P06Include.Simba}
{$DEFINE SMART}
var
Col_Monster, Tol_Monster,C_Color,C_Tol,XpKill,XpGained,MonsterKilled, EatFood, x ,y:Integer;
Uptext_1, Uptext_2, Uptext_3, Status,MonsterKill,Message_1,Message_2:String;
C_Uptext_1, C_Uptext_2, C_Uptext_3, TalkRand,Message_3,Message_4:String;
Seconds,StartTime,C_XpKill,XpPerHour,KillsPerHour,TimeOut:Integer;
Hue_Monster,Sat_Monster,C_Hue,C_Sat:Extended;
Message_5:String;
Procedure DeclareVariables;
Begin
{*****************************************************************}
{****************Declare the monster you want to kill.************}
{*********************Valid options are:**************************}
{**********spider,globin,cow,darkwizzard,guard,custom.************}
{Choose defualt timeout if bot detects you in combatwhen your not*}
{*****************************************************************}
MonsterKill := 'guard';
TimeOut := 15;
{****************************************************************}
{********************Type yes to Talk randomly*******************}
{****************************************************************}
TalkRand := 'Yes';
{****************************************************************}
{*****************Fill in random messages here*******************}
{****************************************************************}
Message_1 := '';
Message_2 := '';
Message_3 := '';
Message_4 := '';
Message_5 := '';
{****************************************************************}
{****If the monster you want to kill is not listed use custom****}
{************Fill in the info using ACA(Auto Color Aid)**********}
{****************************************************************}
C_Color := 0;
C_Hue := 0;
C_Sat := 0;
C_Tol := 0;
C_XpKill := 0;
C_Uptext_1 := '';
C_Uptext_2 := '';
C_Uptext_3 := '';
{****************************************************************}
{*********End of User setup, Don't touch below this line*********}
{****************************************************************}
End;
Procedure WriteProgress;
Begin
Seconds := (1 + ((Getsystemtime - StartTime) / 1000));
XpPerHour := (3600 * XPGained) / (Seconds);
KillsPerHour := (3600 * MonsterKilled) / Seconds;
ClearDebug;
Writeln('*************************');
Writeln('Time Running:' + TimeRunning + '');
Writeln('Status:' + Status + '');
Writeln('Monsters killed:' + IntToStr(MonsterKilled) + '' );
writeLn('Kills Per Hour: ' + IntToStr(KillsPerHour) + '');
Writeln('XP Gained:' + IntToStr(XpGained) + '');
writeLn('Combat XP/H: ' + IntToStr(XpPerHour) + '');
Writeln('*************************');
End;
Procedure EatFood;
begin;
EatFood:= DTMFromString('mLgAAAHicY2JgYChlYmAIB+KnQPYdIN6dLMpgoKDAwMUAAYxQzMAAAIIZBEM=');
SetupSRL;
FindDTM(EatFood, x, y, MIX1, MIY1, MIX2, MIY2);
MMouse(x, y, 0, 0);
FreeDTM(EatFood);
end;
end;
Procedure RandomTalk;
Begin
if TalkRand = 'Yes' then
Begin
case random(1000) of
1: TypeSend(''+ Message_1 + '');
2: TypeSend(''+ Message_2 + '');
3: TypeSend(''+ Message_3 + '');
4: TypeSend(''+ Message_4 + '');
5: TypeSend(''+ Message_5 + '');
End;
End;
End;
Function CheckHP(SearchArea: TBox): TPointArray;
var
T: TPoint;
H, I: integer;
Colors: TIntegerArray;
ATPA: T2DPointArray;
begin
Colors := [HP_BAR_COLOR1, HP_BAR_COLOR2];
H := High(Colors);
SetArrayLength(ATPA, H+1);
T := point((MFBox.x2+MFBox.x1) div 2,(MFBox.y2+MFBox.y1) div 2);
for i := 0 to H do
with SearchArea do
FindColorsSpiralTolerance(T.x, T.y, ATPA[i], Colors[i], X1, Y1, X2, Y2, 2);
Result := MergeATPA(ATPA);
end;
Function srl_IsFighting: Boolean;
begin
Result := InRange(Length(CheckHP(MFBox)), 30, 240);
end;
Function IsFighting: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 169, 279, 217);
Result := (AveragePixelShift(PBox, 250, 350) > 15);
//Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
Begin
CheckHP(MFBox);
EatFood;
end;
End;
Function Attack: Boolean;
Var
tmpCTS,i, L,Counter,Fighter: Integer;
ObjTPA: TPointArray;
ObjATPA: T2DPointArray;
X,Y,DMCount,Moves: Integer;
Begin
Moves:=0;
DMCount:=0;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(Hue_Monster, Sat_Monster);
FindColorsTolerance(ObjTPA, Col_Monster, 1, 1, 514, 338, Tol_Monster);
SplitTPAWrap(ObjTPA, 10, ObjATPA);
SortATPASize(ObjATPA,True);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
DMCount:=RandomRange(3,5);
L := High(ObjATPA)
MarkTime(Counter);
For i := 0 To L Do
Begin
MiddleTPAEx(ObjATPA[i], X, Y);
Repeat Begin
Moves:=Moves+1;
mmouse(x, y, 1, 1);
Status := ('Looking for ' + MonsterKill + 's')
WriteProgress;
Wait(RandomRange(400, 500));
If (P06_IsUpTextMultiCustom([''+Uptext_1,''+Uptext_2,''+ Uptext_3])) Then
Begin
clickmouse2(mouse_Left);
Wait(RandomRange(800, 1200));
Status := ('Fighting ' + MonsterKill +'s')
WriteProgress;
While IsFighting do
Wait(RandomRange(400, 800));
MarkTime(Fighter);
If not IsFighting then
Begin
if (TimeFromMark(Fighter) > 1000) then
Begin
if not IsFighting then
Begin
Break;
End;
End;
if (TimeFromMark(Fighter) > TimeOut) then
Begin
Break;
End;
End;
IncEx(XPGained, XpKill);
IncEx(MonsterKilled, 1);
Exit;
End;
End; Until (Moves > DMCount)
If (TimeFromMark(Counter) > 5000) Then
Begin
Break;
End;
End;
Result:=False;
End;
Procedure SetKill;
Begin
Case LowerCase(MonsterKill) Of
'goblin':
Begin
Col_Monster := 7186324;
Hue_Monster := 0.03;
Sat_Monster := 0.72;
Tol_Monster := 9;
XpKill := 10;
Uptext_1 := 'Attack Go';
Uptext_2 := 'ttack Gob';
Uptext_3 := 'ack Globin';
end;
'spider':
Begin
Col_Monster := 345172;
Hue_Monster := 0.02;
Sat_Monster := 1.63;
Tol_Monster := 7;
XpKill := 10;
Uptext_1 := 'Attack Sp';
Uptext_2 := 'ttack Spi';
Uptext_3 := 'ack Spider';
End;
'cow':
Begin
Col_Monster := 2246755;
Hue_Monster := 0.09;
Sat_Monster := 0.55;
Tol_Monster := 7;
XpKill := 10;
Uptext_1 := 'Attack Cow';
Uptext_2 := 'ttack Cow';
Uptext_3 := 'ack Cow';
End;
'darkwizzard':
Begin
Col_Monster := 2505017;
Hue_Monster := 0.00;
Sat_Monster := 0.48;
Tol_Monster := 3;
XpKill := 10;
Uptext_1 := 'Attack Da';
Uptext_2 := 'ttack Dark';
Uptext_3 := 'ack Dark';
End;
'guard':
Begin
Col_Monster := 990868;
Hue_Monster := 0.05;
Sat_Monster := 0.62;
Tol_Monster := 3;
XpKill := 10;
Uptext_1 := 'Attack Gu';
Uptext_2 := 'ttack Gua';
Uptext_3 := 'ack Guard';
End;
'custom':
Begin
Col_Monster := C_COLOR;
Hue_Monster := C_HUE;
Sat_Monster := C_SAT;
Tol_Monster := C_TOL;
XpKill := C_XpKill;
Uptext_1 := C_UPTEXT_1;
Uptext_2 := C_UPTEXT_2;
Uptext_3 := C_UPTEXT_3;
End;
End;
End;
Begin
SetupSRL;
SetupP06Include;
MouseSpeed := 20;
ActivateClient;
DeclareVariables;
StartTime := GetSystemTime;
SetKill;
Attack;
Repeat
Attack;
Until False;
End.
{
MR HYDE
COL 5337207
TOL 3
HUE MOD 0.20
SAT MOD 0.21
}
{
Drunken Dwarf
Col - 1547472
Tol - 0
hue 0.00
Sat 0.00
}
When I compile It says Duplicate Identifier on this procedure