SRL Archive - Help and Support

Failsafe Key


weaselforce

2006-05-21 23:20:53

How does one create a failsafe with "IsKeyDown". I dont know how to setup a while loop to carry through a whole procedure. If anyone can shed some light, provide some alternatives, i'd be very appreciative.

phantombmx

2006-05-21 23:30:44

hope this helps.. it wont terminate unless you press the letter a

program New;

procedure blah;
begin
while(not(IsKeyDown('a')))do
begin
Wait(10);
//stuff1;
//stuff2;
//stuff3;
end;
WriteLn('You pressed the failsafe, ending script');
TerminateScript;
end;

begin
blah;
end.

weaselforce

2006-05-21 23:37:37

why doesnt this work?

begin
While(not(IsKeyDown('f')))do
begin
ToFletch := Amount
Fletched := 0
SetupSRL;
RandomDisguise;
MouseSpeed := 12
BenMouse := True
ClearReport;
ActivateClient;
CloseWindow;
ChatsOff;
RandomEvents;
Experience;
ExperienceReport;
LoadCrap;
Repeat
BankingWithdraw;
Fletch;
BankingDeposit;
RunsForProgress := (RunsForProgress + 1)
if(RunsForProgress >= 10) then
begin
Progress;
RunsForProgress := 0
HoverSkill('fletching');
RandomRClick
end
Until(Fletched >= Amount)
end;
end.

phantombmx

2006-05-21 23:44:08

you forgot to add a semi-colon(;) to one of the ends.. it can also be done using a repeat until

repeat
stuff;
until(IsKeyDown('a'))

heres the code you should have.. see if it works..

begin
ToFletch := Amount;
Fletched := 0;
SetupSRL;
RandomDisguise;
MouseSpeed := 12;
BenMouse := True;
ClearReport;
ActivateClient;
CloseWindow;
ChatsOff;
RandomEvents;
Experience;
ExperienceReport;
LoadCrap;
repeat
BankingWithdraw;
Fletch;
BankingDeposit;
RunsForProgress := RunsForProgress + 1;
if(RunsForProgress >= 10)then
begin
Progress;
RunsForProgress := 0;
HoverSkill('fletching');
RandomRClick;
end;
until(Fletched >= Amount)or(IsKeyDown('f'))
end.

weaselforce

2006-05-21 23:47:30

Good thinking, could you possibly correct my while loop one :) i want to get a better understanding of it

phantombmx

2006-05-22 00:00:36

just move the
while (blah) do
begin
to in between LoadCrap; and the repeat and that should solve it.. also remember to end all ends with a semi-colon (end;)

weaselforce

2006-05-22 00:01:24

ok thanks