SCAR Code:
program Sergeant_Solver;
{.include srl/srl/misc/Smart.scar}
{.include srl/srl.scar}
var users, x, y, StarJumps, PushUps, SitUps, Jog: integer;
Busy, SJ, PU, SU, J: boolean;
const Mat1 = 745026;
Mat2 = 946986;
Mat3 = 542270;
Mat4 = 3167543;
procedure setup;
begin
NumberOfPlayers(1); //The number of players you will be using
Players[0].Name:= ''
Players[0].Pass:= ''
Players[0].Nick:= '' //3-4 characters, no capitals
Players[0].Skill:= 'strength' //woodcutting or firemaking
Players[0].Active:= True
SetPlayerNameTPAs;
Users:= HowManyPlayers;
end;
procedure Perform_Exercise;
begin
if FindNPCChatText('star', Nothing) then
//perform StarJumps.
begin
Busy:= true;
SJ:= true;
PU:= false;
SU:= false;
J:= false;
StarJumps:= StarJumps + 1;
case StarJumps of
1:
begin
FindObjEx(x, y, ['Exer'], [Mat1], 4, 50, msx1, msy1, msx2, msy2);
end;
2:
begin
FindObjEx(x, y, ['Exer'], [Mat2], 4, 50, msx1, msy1, msx2, msy2);
end;
3:
begin
FindObjEx(x, y, ['Exer'], [Mat3], 4, 50, msx1, msy1, msx2, msy2);
end;
4:
begin
FindObjEx(x, y, ['Exer'], [Mat4], 4, 50, msx1, msy1, msx2, msy2);
end;
end;
mouse(x, y, 0, 0, true);
repeat
wait(1000);
until FindNPCChatText('private', Nothing)
end;
if not Busy then
begin
if FindNPCChatText('jog', Nothing) then
//Perform Jog.
begin
Busy:= true;
SJ:= false;
PU:= false;
SU:= false;
J:= true;
Jog:= Jog + 1;
case Jog of
1:
begin
FindObjEx(x, y, ['Exer'], [Mat1], 4, 50, msx1, msy1, msx2, msy2);
end;
2:
begin
FindObjEx(x, y, ['Exer'], [Mat2], 4, 50, msx1, msy1, msx2, msy2);
end;
3:
begin
FindObjEx(x, y, ['Exer'], [Mat3], 4, 50, msx1, msy1, msx2, msy2);
end;
4:
begin
FindObjEx(x, y, ['Exer'], [Mat4], 4, 50, msx1, msy1, msx2, msy2);
end;
end;
mouse(x, y, 0, 0, true);
repeat
wait(1000);
until FindNPCChatText('private', Nothing)
end;
end;
if not busy then
begin
if FindNPCChatText('push', Nothing) then
//Perform PushUps.
begin
Busy:= true;
SJ:= false;
PU:= true;
SU:= false;
J:= false;
PushUps:= PushUps + 1;
case PushUps of
1:
begin
FindObjEx(x, y, ['Exer'], [Mat1], 4, 50, msx1, msy1, msx2, msy2);
end;
2:
begin
FindObjEx(x, y, ['Exer'], [Mat2], 4, 50, msx1, msy1, msx2, msy2);
end;
3:
begin
FindObjEx(x, y, ['Exer'], [Mat3], 4, 50, msx1, msy1, msx2, msy2);
end;
4:
begin
FindObjEx(x, y, ['Exer'], [Mat4], 4, 50, msx1, msy1, msx2, msy2);
end;
end;
mouse(x, y, 0, 0, true);
repeat
wait(1000);
until FindNPCChatText('private', Nothing)
end;
end;
if not busy then
begin
if FindNPCChatText('sit', Nothing) then
//Perform SitUps.
begin
Busy:= true;
SJ:= false;
PU:= false;
SU:= true;
J:= false;
SitUps:= SitUps + 1;
case SitUps of
1:
begin
FindObjEx(x, y, ['Exer'], [Mat1], 4, 50, msx1, msy1, msx2, msy2);
end;
2:
begin
FindObjEx(x, y, ['Exer'], [Mat2], 4, 50, msx1, msy1, msx2, msy2);
end;
3:
begin
FindObjEx(x, y, ['Exer'], [Mat3], 4, 50, msx1, msy1, msx2, msy2);
end;
4:
begin
FindObjEx(x, y, ['Exer'], [Mat4], 4, 50, msx1, msy1, msx2, msy2);
end;
end;
mouse(x, y, 0, 0, true);
repeat
wait(1000);
until FindNPCChatText('private', Nothing)
end;
end;
end;
procedure Evaluate;
begin
wait(1000);
if PushUps > 4 then PushUps:= 0;
if SitUps > 4 then SitUps:= 0;
if StarJumps > 4 then StarJumps:= 0;
if Jog > 4 then Jog:= 0;
Busy:= false;
if not FindNPCChatText('sight', Nothing) then
begin
if not FindNPCChatText('Wrong', Nothing) then
begin
if SJ = true then
begin
StarJumps:= StarJumps - 1;
SJ:= false;
writeln('Found StarJump mat. mat# ' + inttostr(StarJumps + 1));
end;
if PU = true then
begin
PushUps:= PushUps - 1;
PU:= false;
writeln('Found PushUp mat. mat# ' + inttostr(PushUps + 1));
end;
if SU = true then
begin
SitUps:= SitUps -1;
SU:= false;
writeln('Found SitUp mat. mat# ' + inttostr(SitUps + 1));
end;
if J = true then
begin
Jog:= Jog - 1;
J:= false;
writeln('Found jog mat. mat# ' + inttostr(Jog + 1));
end;
end;
end;
end;
begin
Smartsetupex(29, false, true, false);
Settargetdc(smartgetdc);
SetupSRL;
ScriptID:= '808';
setup;
LoginPlayer;
wait(900 + random(900));
SetAngle(true);
makecompass('N');
StarJumps:= 0;
PushUps:= 0;
SitUps:= 0;
Jog:= 0;
SJ:= false;
PU:= false;
SU:= false;
J:= false;
if FindObjEx(x, y, ['Exer'], [Mat1], 4, 50, msx1, msy1, msx2, msy2) then
begin
mouse(x, y, 0, 0, true);
repeat
wait(1000);
until FindNPCChatText('private', Nothing)
end;
repeat
Perform_Exercise;
Evaluate;
until FindNPCChatText('sight', Nothing)
FindNPCChatText('continue', ClickLeft)
writeln('Drill Demon Solved.');
wait(8000);
end.