Hey, just getting back to you on the fightmode function. First off you need to declare players and then have them do all the setup for the players and whatnot and that's easy. You want to make it so your character's map is pointing perfectly north at the highest angle possible. I kind of edited your script a little... okay i guess it's a lot but take a look at it. I tested it out for a while and it let my character die. I think the healing process is way to slow. It should be sped up a bit (I didn't speed it up in the script below). Another good add would be a progress report. Oh and I really think that it should have more than one colour because it's getting very confused or you can just change the tolerance?
SCAR Code:
Program MonkTerminator;
{.include srl/srl.scar}
{.include srl/srl/skill/Fighting.scar}
Const
MonkColour = 8562644; //Color of the Monks head. This is important. If monks are not found, change this colour.
MSpeed = 8; //Mouse motion speed.
HealHealth = 50; //Minimum HP percentage to heal at.
Procedure DeclarePlayers;
Begin
HowManyPlayers := 2;
NumberOfPlayers (HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; //user name
Players[0].Pass :=''; //password
Players[0].Nick :=''; //3 consecutive letters of username
Players[0].Active := True; //don't touch
Players[0].Skill := 'strength';
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active := True;
Players[1].Skill := 'strength';
End;
Procedure SetPlayerParams;
Begin
if ( not ( LoggedIn )) then Exit;
GameTab(1);
begin
if Players[CurrentPlayer].Skill = 'attack' then SetFightMode(1);
if Players[CurrentPlayer].Skill = 'strength'then SetFightMode(2);
if Players[CurrentPlayer].Skill = 'defence' then SetFightMode(4);
LampSkill := LowerCase ( Players[CurrentPlayer].Skill );
end;
SetChat('on', 1);
SetChat('friends', 2);
SetChat('off', 3);
SetChat('on', 1);
FindTalk;
end;
Function FindMonk: Boolean;
Begin
x := MSCX;
y := MSCY;
if (FindObj(x, y, 'onk', MonkColour, 15)) then
begin
Result:= True;
end else
begin
Wait(500 + Random(1000));
Result:= False;
end;
End;
Procedure RClickMonk;
Begin
Case Random(2) of
0: begin
Mouse(x, y, 0, 0, True);
end;
1: begin
Mouse(x, y, 0, 0, False);
wait(50 + Random(100));
ClickOption('ttac', 1);
end;
end;
End;
Procedure AttackMonk;
Begin
if(FindMonk) then
begin
if(not (InFight) or not(IsFightAt(x, y))) then
begin
RClickMonk;
wait(200);
FFlag(0);
MouseSpeed := MSpeed;
wait(2000);
repeat
wait(2500 + Random(2000));
MMouse(Random(750), Random(450), 10, 10);
until(not (InFight));
end;
if(InFight) then
begin
FTWait(2);
OutFight;
end;
end;
End;
Procedure MonkHeal;
Begin
if (HpPercent <= HealHealth) then
begin
if(FindMonk) then
begin
if(not (infight) or not(IsFightAt(x, y))) then
begin
Wait(50);
FFlag(0);
MouseSpeed := MSpeed;
//Start actual healing code...
Mouse(x, y, 0, 0, False);
Sleep(50 + Random(100));
ClickOption('alk-to', 1);
Sleep(1000 + Random(200));
ClickToContinue;
Sleep(1000 + Random(200));
Mouse(Random(201) + 156, Random(12) + 383, 0, 0, True);
ClickToContinue;
Sleep(500 + Random(200));
ClickToContinue;
Sleep(500 + Random(200));
ClickToContinue;
Sleep(2000 + Random(1000));
end;
if(InFight) then
begin
FTWait(2);
OutFight;
end;
end;
end;
End;
Procedure Setup;
Begin
WriteLn('->[ Initializing...');
SetRun(True);
MouseSpeed := MSpeed;
ActivateClient;
ClearDebug;
End;
Begin
SetUpSRL;
DisguiseScar('RuneScape - the massive online adventure game by Jagex Ltd');
Repeat
DeclarePlayers;
LoginPlayer;
SetPlayerParams;
HighestAngle;
PerfectNorth;
Setup;
begin
repeat
AntiBan;
Wait(50 + Random(100));
MonkHeal;
AttackMonk;
until(not(LoggedIn))
end;
if(not(Loggedin)) then NextPlayer(false);
Until(false)
End.
Edit:
Spent the last hour or however long it was going through and adding a whole bunch of new crap in there. Can somebody scroll through it to see if it looks right? Thanks!
Oh by the way can someone get some good colours for the monks? I made it so you can put in 8 different colours if you scroll down a bit in the script you'll see where it goes.
SCAR Code:
Program MonkTerminator;
{.include srl/srl.scar}
{.include srl/srl/skill/Fighting.scar}
Const
MSpeed = 8; //Mouse motion speed.
HealHealth = 50; //Minimum HP percentage to heal at.
PlayerTime = 300; // Time for each player in minutes.
Var
MonkColours: array[1..8] of integer;
MCIndex: integer;
StartTime, PlayTime, RunningTime : LongInt;
Monks : integer;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 2;
NumberOfPlayers (HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; //user name
Players[0].Pass :=''; //password
Players[0].Nick :=''; //3 consecutive letters of username
Players[0].Active := True; //don't touch
Players[0].Skill := 'strength';
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active := True;
Players[1].Skill := 'strength';
End;
Procedure SetPlayerParams;
Begin
if ( not ( LoggedIn )) then Exit;
GameTab(1);
begin
if Players[CurrentPlayer].Skill = 'attack' then SetFightMode(1);
if Players[CurrentPlayer].Skill = 'strength'then SetFightMode(2);
if Players[CurrentPlayer].Skill = 'defence' then SetFightMode(4);
LampSkill := LowerCase ( Players[CurrentPlayer].Skill );
end;
SetChat('on', 1);
SetChat('friends', 2);
SetChat('off', 3);
SetChat('on', 1);
FindTalk;
end;
Procedure PlayerStats;
Var
Active: string;
i, temp: Integer;
Begin
if Players[CurrentPlayer].Active=True then
Active:='True'
else
Active:='False';
WriteLn ('');
WriteLn ('');
Writeln (' Name : '+ Players[CurrentPlayer].Name);
Writeln (' Number : '+inttostr(CurrentPlayer));
Writeln (' Autoing : '+ Active);
if ( Players[CurrentPlayer].Worked > 0 ) then
Writeln (' Worked : '+ inttostr(Players[CurrentPlayer].Worked));
Writeln (' Location : '+ Players[CurrentPlayer].loc);
Temp:=(GetSystemTime div 1000);
Temp := Temp - StartTime;
if ( Playtime < temp ) then
Writeln (' Time Left : '+ IntToStr ( Temp - PlayTime / 60 ) + ' Minutes');
WriteLn ('');
WriteLn ('');
for I := 0 to HowManyPlayers - 1 do
begin
if Players[i].Active=True then Active:='T' else Active:='F';
WriteLn ( ' ' + Inttostr ( I) + ' : ' + Players[i].Name + ' = ' + Active
+' . - Lvl : '
+' '+inttostr(Players[i].level[1])
+' '+inttostr(Players[i].level[2])
+' '+inttostr(Players[i].level[3])+
+' '+inttostr(Players[i].level[5])+
+' '+inttostr(Players[i].level[8])+'. '
+' W : '+IntToStr(Players[i].Worked)+' min. '
+' K : '+ IntToStr(Players[i].Killed)+' Monks. '
+' L : '+Players[i].loc);
end
WriteLn ('');
WriteLn ('');
end;
Procedure ProgressReport;
begin
writeln('');
WriteLn('');
WriteLn(' Monk Trainer and Healer');
Writeln('');
Writeln(' Worked for '+ TimeRunning);
Writeln(' Attacked '+inttostr(Monks)+' Monks.');
PlayerStats;
SRLRandomsReport;
end;
Procedure SetupMonkColors;
Begin
MonkColours[1] := 8562644;
MonkColours[2] := 8562644;
MonkColours[3] := 8562644;
MonkColours[4] := 8562644;
MonkColours[5] := 8562644;
MonkColours[6] := 8562644;
MonkColours[7] := 8562644;
MonkColours[8] := 8562644;
End;
Function FindMonk: Boolean;
Var CBx, CBy : Integer;
Begin
for MCIndex := 1 to 8 do
begin
if FindColorSpiralTolerance(CBx, CBy, MonkColours[MCIndex], MSX1, MSY1, MSX2, MSY2, 12) then
begin
Result:= True;
end else
begin
Wait(500 + Random(1000));
Result:= False;
end;
end;
End;
Procedure RClickMonk;
Begin
Case Random(2) of
0: begin
Mouse(x, y, 0, 0, True);
end;
1: begin
Mouse(x, y, 0, 0, False);
wait(50 + Random(100));
ClickOption('ttac', 1);
end;
end;
End;
Procedure AttackMonk;
Begin
if(FindMonk) then
begin
if(not (InFight) or not(IsFightAt(x, y))) then
begin
RClickMonk;
wait(200);
FFlag(0);
MouseSpeed := MSpeed;
wait(2000);
repeat
wait(2500 + Random(2000));
MMouse(Random(750), Random(450), 10, 10);
until(not (InFight));
end;
if(InFight) then
begin
FTWait(2);
OutFight;
end;
end;
Monks := Monks + 1;
Players[CurrentPlayer].Killed := Players[CurrentPlayer].Killed+1;
End;
Procedure MonkHeal;
Begin
if (HpPercent <= HealHealth) then
begin
if(FindMonk) then
begin
if(not (infight) or not(IsFightAt(x, y))) then
begin
Wait(50);
FFlag(0);
MouseSpeed := MSpeed;
Mouse(x, y, 0, 0, False);
Sleep(50 + Random(100));
ClickOption('alk-to', 1);
Sleep(1000 + Random(200));
ClickToContinue;
Sleep(1000 + Random(200));
Mouse(Random(201) + 156, Random(12) + 383, 0, 0, True);
ClickToContinue;
Sleep(500 + Random(200));
ClickToContinue;
Sleep(500 + Random(200));
ClickToContinue;
Sleep(2000 + Random(1000));
end;
if(InFight) then
begin
FTWait(2);
OutFight;
end;
end;
end;
End;
Procedure SetUpScript;
Begin
WriteLn('->[ Initializing...');
SetupMonkColors;
MCIndex := 1;
SetUpSRL;
DeclarePlayers;
MouseSpeed := MSpeed;
LoginPlayer;
End;
Begin
SetUpScript;
DisguiseScar('RuneScape - the massive online adventure game by Jagex Ltd');
Repeat
SetPlayerParams;
HighestAngle;
PerfectNorth;
MakeCompass('N');
ProgressReport;
begin
repeat
AntiBan;
Wait(50 + Random(100));
MonkHeal;
AttackMonk;
RunningTime := GetSystemTime;
if(not(LoggedIn))
or(RunningTime - StartTime >((PlayerTime * 60000)+ Random (Playertime * 100)))then Break;
Until WeAreDead or (not(LoggedIn))
if LoggedIn then
begin
SetChat('off', 1);
repeat
Wait(1000);
until(not(LoggedIn));
Writeln('Switching User Now');
NextPlayer(True);
Wait(1000 + Random(2000));
end;
end;
if(not(Loggedin)) then NextPlayer(False);
Until(false)
End.