Basically
That's a quick example, but something like that?Code:procedure srl; var TIME : Integer; begin MarkTime(TIME); repeat Blah; Blah; until TimeFromMark(TIME) > 15000 then ClearPreviousMarktime; RestartProcedure; end;
Basically
That's a quick example, but something like that?Code:procedure srl; var TIME : Integer; begin MarkTime(TIME); repeat Blah; Blah; until TimeFromMark(TIME) > 15000 then ClearPreviousMarktime; RestartProcedure; end;
Thick As Blood
SCAR Code:procedure DoThis;
var
T: integer;
begin
while(....) do
begin
MarkTime(T);
repeat
//....
until(..)
end;
end;
~RM
MarkTime does the same as TIME := GetSystemTime; and TimeFromMark does (GetSystemTime - TIME) so it knows the time passed since TIME was set.
Ce ne sont que des gueux
So there's no command to get the marktime to reset itself?
Thick As Blood
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
SCAR Code:if ((Total[2] mod TakeBreaksEvery) = 0) then
begin
T := GetSystemTime;
WriteLn(TheTime + ' Taking a break for ' + IntToStr(BreakFor) + ' minute(s)...');
LI := LoggedIn2;
if (LI) then
LogOut;
Sleep(BreakFor * 60000);
WriteLn('Done breaking.');
if (LI) then
InitPlayer;
IncEx(TimeStarted, GetSystemTime - T);
end;
Having two counters and adding the difference in time to the first mark will allow you to, but that is just one example of the possibilities, that one is used to not have the time you spend breaking affect the loads per hour.
SCAR Code:procedure srl;
var
TIME : Integer;
begin
MarkTime(TIME);
repeat
Blah;
Blah;
until TimeFromMark(TIME) > 15000 then
ClearPreviousMarktime;
RestartProcedure;
end;
to
SCAR Code:procedure srl;
var
TIME : Integer;
begin
MarkTime(TIME);
repeat
Blah;
Blah;
until TimeFromMark(TIME) > 15000 then
MarkTime(Time); //reset?
RestartProcedure;
end;
Yeah, u did, just splainin' some more ;P
Ce ne sont que des gueux
Hmm, as has been said there's a dozen ways to do it.
I did another way for a rather simple script, basically the other way round to the above.
Procedure 1 grabs the time and adds a bit on to mark a point in the future.
Procedure 2 is one of many loops but on its way this one constantly checks if the current System Time has reached the System Time +60000 that was saved earlier.Code:Stopwatch := (GetSystemTime + 60000); // Timer
If Stopwatch hasn't been matched by the current System Time, it waits.Code:if GetSystemTime < Stopwatch then begin Wait(100); // Staller end
The next time Procedure 1 comes around it resets Stopwatch to systemtime + 60000 again, Procedure 2 carries on checking if it's been reached yet... and the loops spin on.
Last edited by Treehopper; 11-23-2009 at 01:10 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)