From: [S]paz
*fixes Zytex's eyes*
Btw wait 1 sec until it finds text is very dangerous, what if something goes wrong and it never says private, your left waiting forever!!!
~Spaz
that, can be fixed fairly easily to prevent looping infinite. but im more interested in tests, and if that becomes a major problem now, ill fix it now. until then… still waiting for someone to actually try it.
From: Baked0420
he didn't diss wizzup?, he just didn't get what wizzup? was telling him.
but saiko, it won't work because the mat changes what sign it goes with, I think that's what wizzup? is trying to tell you.
yeah i didnt understand him, …kinda still dont but yeah. it's still working for me.
and to you others try not to spam like that, i want some real feedback. and if you read above, "no offence wizzup"…you know.
edit: ive read his post over and over, i still get the same result -.-. my script doesnt look for a mat in a specific place with a specific sign. i assign a color to a mat, then the trial and error starts, for each assignment (ex. jog, situps…) it trys it on mat1 first,(which i have assigned a color to, no matter where that mat is located, it is mat1.) if its wrong, the next time it gets the same assignment, it goes to the next mat color and so on. maybe ill make a video…cant really explain so well.
anyways… here is the code, for those of you who hadn't even looked at it and already booing me:f:
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.