I want to call a procedure after every 25-30 minutes , please help me with it
I want to call a procedure after every 25-30 minutes , please help me with it
Simba Code:program new;
{$i SRL/SRL.scar}
procedure Name;
begin
end;
procedure MainLoop;
var T : Integer;
begin
MarkTime(T);
Wait(1500000); // Waits 25 minutes in milliseconds(?)
if (TimeFromMark(T) < 1500000) then Name;
end;
begin
MainLoop;
end.
This is very rough and probably won't work. But it's an idea that you can build off of. Someone will probably provide you with a better procedure though.
E: Realized I used a global variable instead of a local for T. I wonder why...
Last edited by RISK; 12-02-2011 at 04:44 AM.
Please explain, What does MarkTime do and i will make my own method
MarkTime(T) will start recording the time that has passed since the mark was made.
Try this for an example:
Simba Code:program new;
{$i SRL/SRL.scar}
var T : Integer;
procedure MainLoop;
begin
MarkTime(T);
Wait(1500); // Waits 1.5 seconds in milliseconds(?)
Write(TimeFromMark(T));
end;
begin
MainLoop;
end.
Simba Code:Procedure LetsWait;
var
T: Integer;
begin
MarkTime(T);
While (TimeFromMark(T) < 1500000) do //1 minute = 60000, so 25 minutes = 1500000
Wait(1);
Writeln('25 minutes is up!');
end;
Obviously multiple ways of doing it.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
k thank you , got it
There are currently 1 users browsing this thread. (0 members and 1 guests)