Log in

View Full Version : "TimeRunning" help please.



Irae
09-05-2012, 12:02 AM
Hi everyone i'm currently stuck trying to work a timerunning into one of my scripts and this is the procedure...

procedure teleaftertime;
begin
if TimeRunning (300000) = True;
then
typesend('::shops')
end;

I know I probably have it wrong but if someone can point me into the right direction that would be great... If you can't tell what i'm trying to do its that after 300 seconds (5 minutes) to teleport out using '::shops' but i want the script to keep checking to see if its time ti teleport out even in combat. If someone has the skill to help me out that would be greatly appreciated :D

YoHoJo
09-05-2012, 12:09 AM
If TimeRunning=300000 Then
Assuming you have a function called TimeRunning set/started.

Runaway
09-05-2012, 12:11 AM
Hey Irae,

The function TimeRunning results a string with hours, minutes, and seconds. What you want to use is MarkTime and TimeFromMark:


var
t: Integer;
// ^ declared globally

MarkTime(t);
// ^ call MarkTime before your main loop
repeat
if (TimeFromMark(t) > (5 * 60 * 1000)) then
TypeSend('::shops');
// FightSomething;
// EatWhatever;
until(False);


Hopefully no further explanation is needed :)

Irae
09-05-2012, 12:18 AM
Hey Irae,

The function TimeRunning results a string with hours, minutes, and seconds. What you want to use is MarkTime and TimeFromMark:


var
t: Integer;
// ^ declared globally

MarkTime(t);
// ^ call MarkTime before your main loop
repeat
if (TimeFromMark(t) > (5 * 60 * 1000)) then
TypeSend('::shops');
// FightSomething;
// EatWhatever;
until(False);


Hopefully no further explanation is needed :)

Ok im still new but let me see if I get this... I need to add the "t: Integer;" to my variables and place the "marktime(t);" as a new procedure and place it at the beginning of my loop?

riwu
09-05-2012, 01:22 AM
You can place everything under a single procedure. And if you want to repeat it, you will need 2 loops, 1 given by Runaway, and another to repeat the MarkTime(t) and the initial repeat loop.