Log in

View Full Version : How to set PanicKey as a Const?



syberium
02-01-2007, 11:57 PM
hey guys im wondering how i set a "panic key" as a const? so far this is what ive done.

PanicKey = 12; // Pick the number of F key to end script.Ex. Picking number 4 would end script if u press F4.

until(isfkeydown(PanicKey));

but when i try that i get a syntax error... im not sure how to set that up right. :duh:

Boreas
02-02-2007, 12:13 AM
I don't think should give an error. Probably something else. You did do const right?

syberium
02-02-2007, 01:22 AM
well this is how i wanted to use it. until (howmany=howmanyto) or until(isfkeydown(PanicKey)) but now i releaise its the "or" thats causing the problem.

so i did this instead it compiles now.

begin
SetupSRL;
activateclient;
ClearDebug;
DeclarePlayers;
CurrentPlayer := StartPlayer;
if(not(LoggedIn)) then
LoginPlayer;
DoChats;
MakeCompass('E');
MouseSpeed := MSpeed + Random(3)
MakeCompass('E');
Highestangle;
Wait(1000+random(200));
MakeCompass('E');
repeat

zammycast;



howmany:=howmany + 1;

progress;

Wait(400+random(100));

antiban1;

FindFastRandoms;



until (howmany=howmanyto);

if(isfkeydown(PanicKey)) then terminatescript;

if (howmany=howmanyto) then

writeln('Completed '+IntToStr(howmanyto)+' Zammy mage casts.');

end.

Hey321
02-05-2007, 09:05 PM
well this is how i wanted to use it. until (howmany=howmanyto) or until(isfkeydown(PanicKey)) but now i releaise its the "or" thats causing the problem.

so i did this instead it compiles now.

begin
SetupSRL;
activateclient;
ClearDebug;
DeclarePlayers;
CurrentPlayer := StartPlayer;
if(not(LoggedIn)) then
LoginPlayer;
DoChats;
MakeCompass('E');
MouseSpeed := MSpeed + Random(3)
MakeCompass('E');
Highestangle;
Wait(1000+random(200));
MakeCompass('E');
repeat

zammycast;



howmany:=howmany + 1;

progress;

Wait(400+random(100));

antiban1;

FindFastRandoms;



until (howmany=howmanyto);

if(isfkeydown(PanicKey)) then terminatescript;

if (howmany=howmanyto) then

writeln('Completed '+IntToStr(howmanyto)+' Zammy mage casts.');

end.

Try this for PanicKey:



Until((HowMany=HowManyTo) or (isfkeydown(PanicKey)))


That should work, your problem was you added an extra until in the repeat until part ;).

pwnaz0r
02-09-2007, 10:01 PM
wait so if you do until(IsFKeyDown(8))then would it check for it and anytime through the script it would stop it?

syberium
02-09-2007, 11:31 PM
yes thats how it should work pwn, because as we all know if u have 2 scar windows open and u run the 2nd one u opend ctrl-alt-s wont stop the script -.-

Boreas
02-09-2007, 11:38 PM
wait so if you do until(IsFKeyDown(8))then would it check for it and anytime through the script it would stop it?

That will only check it when it gets to the end of the loop, not during. So you will have to hold it down a while (depending how long it takes a loop to go around) for it to stop.