SRL Archive - OSR Help

If... Then statement help


MaetNameno

2013-04-20 22:42:08

I'm working on a project at the moment and if you wanted the script to detect that it hasn't been in combat for like one minute so it could log out and then back on how would you go about getting it to detect that? I'm not sure if this question even makes sense..

rj

2013-04-20 22:44:25

MarkTime(t)
Repeat
wait(200);
Until (NotFighting) or (TimefromMark(t)>60000)


Use pixel shift or something for fighting

Chris!

2013-04-20 22:49:39

Well, when you're in combat your character should be moving, right? So why don't you use pixelshift? Here's an excellent tutorial on pixelshift: http://villavu.com/forum/showthread.php?t=74090.

So you could call that pixelshift function "InCombat". Then in your code you'd do something like:

procedure ######;
begin
repeat
DoStuff
OtherStuff;
Antiban;
until(insertsomethinghere);
if not (InCombat) then
begin
WriteLn('Out of combat for 60 seconds. Logging out.');
TerminateScript;
end;
end;

Please excuse that horrid excuse of an example. :) I hope you get the point, though. If you need too, you can look through other people's scripts for examples!