sukomabawls
07-13-2007, 08:11 PM
my autofighter script thats being released soon has a few errors and i need some help working them out, so if you will test the main loop for me and you'll notice right away that after it kills the monster it doesnt even check if you need food or not, it just logs out and does the writeln i put in for the reason, you'll see... Also one tiny quick thing, this isnt very imprtant, but i think the attack type selection could use a quick upgrade, idk.
program SukomabawlsAutoFighter;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/fighting.scar}
var AJV:integer;
const //Make Sure You Are Logged In When The Script Starts
Color1 = 6512487;//Monster Colors In Lines 5-7
Color2 = 9012366;//You Can Fight Multiple Monsters, Just Add Their Colors Too!
Color3 = 7107444;
Color4 = 7236209;
Color5 = 6844271;
Color6 = 4804688;
MonsterName = 'Giant Rat';//Monster Name
Tol = 5;//Monster Finding Tolerance
TimeOut = 25000;//Keep This Number Over 15 Seconds(15000)
Skill = 'Strength';//What Skill To Train, Attack, Strength, Defence
clickr = false;// Keep This False
//Food Eating Section//
UseFood = True;// True or false
CurrentHP = 17;// Put Your HP Level Here
EatAt = 8;// What HP To Eat Food At
FightBack = 14;// Continue Fighting At What HP
Food = 7184764;// 2 Food Colors
Food2 = 5009237;// You Can Use 2 Different Food Items, Just Put 2nd Color Here
LogoutNow = 5;// Logout If HP Gets To This
procedure DeclarePlayers;
begin
Writeln('Thanks For Choosing My AutoFighter!');
Wait(5000);
ClearDebug;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='your pooned8';//Username Here
Players[0].Pass :='******';//Password Here
Players[0].Nick :='you'; // 3-4 Username Letters (No Caps!!)
Players[0].Active:= True;
end;
Procedure Heal;
Begin
If (UseFood = True) Then
WriteLn('Checking If Food Is Needed...');
If (GetHp <= EatAt) Then
repeat;
WriteLn('Eating Food, HP Too Low!');
GameTab(4);
If (GameTab(4)) Then
If (FindColorTolerance(x, y, Food, MIX1, MIY1, MIX2, MIY2, 3)or
FindColorTolerance(x, y, Food2, MIX1, MIY1, MIX2, MIY2, 3)) Then
MMouse(x, y, 2, 3);
If (IsUpText('Eat')) Then
MMouse(x, y, 2, 3);
Mouse(x, y, 2, 3, True);
AJV:=AJV+1;
until(GetHp >= FightBack);
end;
procedure Kill;
begin
FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut)
end;
Procedure AntiRandomsAndBans;
begin
SRLRandomsReport;
BoredHuman;
RandomMovement;
HoverSkill(Skill, Clickr);
FindNormalRandoms;
AlmostLogout;
end;
procedure Health;
begin
If (GetHp <= LogoutNow) Then
Logout;
begin
Writeln('HP Got Too Low, You Were Logged Out!');
NextPlayer(True);
LoginPlayer;
end;
end;
Begin
SetupSRL;
DeclarePlayers;
Repeat
Kill;
Heal;
Kill;
Heal;
Health;
Kill;
Heal;
Kill;
Health;
AntiRandomsAndBans;
HoverSkill('Random', false);
wait(2453+Random(432));
Health;
Until(IsFKeyDown(5));
end.
Thanks if you can help, i really just need the EatFood function up and working, but the attack type selection would also be helpfull.
program SukomabawlsAutoFighter;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/fighting.scar}
var AJV:integer;
const //Make Sure You Are Logged In When The Script Starts
Color1 = 6512487;//Monster Colors In Lines 5-7
Color2 = 9012366;//You Can Fight Multiple Monsters, Just Add Their Colors Too!
Color3 = 7107444;
Color4 = 7236209;
Color5 = 6844271;
Color6 = 4804688;
MonsterName = 'Giant Rat';//Monster Name
Tol = 5;//Monster Finding Tolerance
TimeOut = 25000;//Keep This Number Over 15 Seconds(15000)
Skill = 'Strength';//What Skill To Train, Attack, Strength, Defence
clickr = false;// Keep This False
//Food Eating Section//
UseFood = True;// True or false
CurrentHP = 17;// Put Your HP Level Here
EatAt = 8;// What HP To Eat Food At
FightBack = 14;// Continue Fighting At What HP
Food = 7184764;// 2 Food Colors
Food2 = 5009237;// You Can Use 2 Different Food Items, Just Put 2nd Color Here
LogoutNow = 5;// Logout If HP Gets To This
procedure DeclarePlayers;
begin
Writeln('Thanks For Choosing My AutoFighter!');
Wait(5000);
ClearDebug;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='your pooned8';//Username Here
Players[0].Pass :='******';//Password Here
Players[0].Nick :='you'; // 3-4 Username Letters (No Caps!!)
Players[0].Active:= True;
end;
Procedure Heal;
Begin
If (UseFood = True) Then
WriteLn('Checking If Food Is Needed...');
If (GetHp <= EatAt) Then
repeat;
WriteLn('Eating Food, HP Too Low!');
GameTab(4);
If (GameTab(4)) Then
If (FindColorTolerance(x, y, Food, MIX1, MIY1, MIX2, MIY2, 3)or
FindColorTolerance(x, y, Food2, MIX1, MIY1, MIX2, MIY2, 3)) Then
MMouse(x, y, 2, 3);
If (IsUpText('Eat')) Then
MMouse(x, y, 2, 3);
Mouse(x, y, 2, 3, True);
AJV:=AJV+1;
until(GetHp >= FightBack);
end;
procedure Kill;
begin
FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut)
end;
Procedure AntiRandomsAndBans;
begin
SRLRandomsReport;
BoredHuman;
RandomMovement;
HoverSkill(Skill, Clickr);
FindNormalRandoms;
AlmostLogout;
end;
procedure Health;
begin
If (GetHp <= LogoutNow) Then
Logout;
begin
Writeln('HP Got Too Low, You Were Logged Out!');
NextPlayer(True);
LoginPlayer;
end;
end;
Begin
SetupSRL;
DeclarePlayers;
Repeat
Kill;
Heal;
Kill;
Heal;
Health;
Kill;
Heal;
Kill;
Health;
AntiRandomsAndBans;
HoverSkill('Random', false);
wait(2453+Random(432));
Health;
Until(IsFKeyDown(5));
end.
Thanks if you can help, i really just need the EatFood function up and working, but the attack type selection would also be helpfull.