SCAR Code:
program Fighter;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Fighting.scar}
{.include SRL\SRL\misc\trade.scar}
const
Montol = 9; // tolerance
settrips = 5; // number of trips will do
killnum = 20; // number of monsters to kill per trip
totalkill = 100; // total monsters to kill
waittime = 5000; // Time to wait in between monsters (in ms)1000ms/sec.
waitlogtime = 720000; // Time to wait before it logs back in (in ms)
TheMinCount = 4; // Leave this!
Monster1 = 'Attack Chicken'; // Monster to fight put Attack in front
Monster2 = 'Attack Chicken'; // Monster to fight put Attack in front
Pickup = True; // Pickup Items? (true or false)
Pickup1 = 'Take Feather'; // item to pick up put take in front
Pickup2 = 'Take Feather'; // item to pick up put take in front
Bones = True; // pick up and bury bones? (true or false)
Eat = False; // Want it to eat??
eathp = 8; // Below what hitpoint do you want it to eat?
Food = 1; // How many types of food are you using? up to 2 types
Food1 = 'Trout'; // What type of food are you using?
Food2 = 'Trout'; // What type of food are you using? If only using 1 type leave blank
//==============DO NOT EDIT BELOW THIS POINT!!!===============//
const
reset =0; // DO NOT EDIT!
TimBoneColor =12764106; // DO NOT EDIT!
Chicken1Color =8365499;
Chicken2Color =2774388;
Cow1Color =9089479; //wrong for now change later
Cow2Color =9089479; //wrong for now change later
FeatherColor =12764106;
ShrimpColor =0; //wrong for now il change later
TroutColor =0; //wrong for now il change later
var
Mon1Color,Mon2Color,Food1Color,Food2Color,Food3Color,Pick1,Pick2,trips,Items,Buried,kills:Integer;
//===========DO NOT TOUCH!!!===============//
Procedure setup;
Begin
Case LowerCase(Monster1) Of
'attack chicken' : Mon1Color:=Chicken1Color;
'attack cow' : Mon1Color:=Cow1Color;
End;
Case LowerCase(Monster2) Of
'attack chicken' : Mon2Color:=Chicken2Color;
'attack cow' : Mon2Color:=Cow2Color;
End;
Case LowerCase(Pickup1) Of
'take feather' : Pick1:=FeatherColor;
End;
Case LowerCase(Pickup2) Of
'take feather' : Pick2:=FeatherColor;
End;
Case Lowercase(Food1) Of
'Shrimp' : Food1Color:=ShrimpColor
'Trout' : Food1Color:=TroutColor
End;
Case Lowercase(Food2) Of
'Shrimp' : Food2Color:=ShrimpColor
'Trout' : Food2Color:=TroutColor
End;
end;
//==========================================================//
Procedure DeclarePlayers;
Begin
NumberOfPlayers( 1 );
CurrentPlayer :=( 0 );
Players[0].Name :='user';
Players[0].Pass :='pass';
End;
// Antirandoms //
Function FindFastRandoms: Boolean; // By WT-Fakawi.
Var
i: Integer;
Begin
For I := 1 To 11 Do
Begin
Case I Of
1: If FindDead Then
Result := True;
2: If FindMod Then
Result := True;
3: If FindMime Then
Result := True;
4: If FindMaze Then
Result := True;
5: If FindQuiz Then
Result := True;
6: If FindDemon Then
Result := True;
7: Begin
If NoGameTab Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
End;
End;
8: If RC Then
Result := True;
9: If FindTalk Then
Result := True;
10: If HandleTrade Then
Result := True;
11: If FindFight Then
Begin
Result := True;
End;
End;
Wait(1);
End;
End;
// Sets chats //
Procedure DoChats;
Begin
SetChat('On', 1);
SetChat('On', 1);
SetChat('Friends', 2);
SetChat('Friends', 2);
SetChat('On', 3);
SetChat('On', 3);
End;
//////////////
procedure OutFightO;
var
i: integer;
begin
Flag;
for i:= 1 to 5 do
begin
if(InFight)then
begin
repeat
wait(50);
until(not(InFight));
exit;
end else
wait(300);
end;
end;
// Fighting //
procedure Fight;
Var
Dx,Dy: Integer;
Begin
If (FindObj(Dx, Dy, Monster1, Mon1Color, MonTol)) or
(FindObj(Dx, Dy, Monster2, Mon2Color, MonTol)) Then
begin
kills:= kills + 1; //You forgot "="
Mouse(Dx,Dy,4,4,true)
end else
begin
writeln('Could not find it')
end;
Flag;
OutFightO; //You forgot the second ")"
FindFastRandoms;
end;
// Pickup Items //
procedure Pickupitem; //I EDITED THIS PROCEDURE JUST LIKE THE ONE ABOVE.
Var
Dx,Dy: Integer;
Begin
If Pickup then
begin
If(FindObj(Dx, Dy, Pickup1, Pick1, MonTol))or
(FindObj(Dx, Dy, Pickup2, Pick2, MonTol))Then
begin
Items:= Items + 1;
Mouse(Dx,Dy,4,4,true);
wait(waittime+random(2750))
end else
begin
Writeln('Not found');
end;
Flag;
FindFastRandoms;
end;
end;
// Pickup and Bury Bones //
procedure BuryBones;
Var
Dx,Dy: Integer;
Begin
If Bones then
begin
If (FindObj(Dx, Dy, 'ake Bones', TimBonecolor, MonTol)) Then
begin
Mouse(Dx,Dy,4,4,true);
wait(3000+random(250));
Mouse(627,227,4,4,true);
Writeln('Bones Found and buried')
Buried:= Buried + 1;
end else
begin
Writeln('Bones Not Found')
end;
{If (FindObj(785, 437, 'ury', Boneinvcolor, MonTol)) Then
Begin
Mouse(Dx,Dy,4,4,true);
wait(500+random(250);
Buried:= Buried + 1;
end;
If (FindObj(829, 437, 'ury', Boneinvcolor, MonTol)) Then
Begin
Mouse(Dx,Dy,4,4,true);
wait(500+random(250);
Buried:= Buried + 1;
end;
If (FindObj(702, 475, 'ury', Boneinvcolor, MonTol)) Then
Begin
Mouse(Dx,Dy,4,4,true);
wait(500+random(250);
Buried:= Buried + 1;
end;
If (FindObj(744, 475, 'ury', Boneinvcolor, MonTol)) Then
Begin
Mouse(Dx,Dy,4,4,true);
wait(500+random(250);
Buried:= Buried + 1;
end;}
end else exit;
end;
// Eating // NOT DONE YET
procedure eatup;
begin
if eat then
begin
if (GetHp <= EatHp) and (Food1Color >= 0) then
begin
GameTab(4);
Wait(10 + Random(20));
if (FindColorSpiralTolerance(x, y, food1color, 560, 210, 730, 460, 2))or
(FindColorSpiralTolerance(x, y, food2color, 560, 210, 730, 460, 2))then
begin
MMouse(x + 2, y - 2, 6, 5)
if (IsUpText('Eat')) then
begin
GetMousePos(x, y);
Mouse(x, y, 3, 2, True);
end;
end;
end;
end;
// Progress Report //
procedure proggy;
Begin // LINE WITH THE ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=')
Writeln('')
Writeln('Thank you for using TFighter Created by Timothegreat.')
Writeln('Version: 1.1')
Writeln('')
Writeln('Items picked up:'+IntToStr(items)+'(Will be more for feathers)') //You must put in IntToStr
Writeln('Bones picked up and buried:'+IntToStr(buried));
Writeln('Monsters killed:'+IntToStr(Totalkill));
Writeln('')
Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=')
end;
// Main Loop //
begin
Setupsrl;
setup;
DeclarePlayers;
Repeat
repeat
If Not LoggedIn Then
Begin
loginplayer;
DoChats;
HighestAngle;
setrun(true);
end;
If Not FindFight Then
Begin
Fight;
Eatup;
Pickupitem;
BuryBones;
end else //Above is a begin so you need END else
begin
Writeln('Already in fight.')
end;
// If Foodnum < 1 then Begin Logout; Proggy; break; end; //I DONT KNOW WHAT FOODNUM IS...
until(kills = killnum);
typesend('bye everyone');
kills:= reset;
trips:= trips + 1;
wait(18500+random(750));
Logout;
wait(waitlogtime)
until(trips = settrips)
Proggy;
end.