I want to add an option where the player fill in an amount of time to auto before taking a short break to reduce randoms, how would I do this
I want to add an option where the player fill in an amount of time to auto before taking a short break to reduce randoms, how would I do this
At sea with the navy - not very active
You could do something like this:
SCAR Code:program TimerDemo;
// This doesn't compile, but I think it conveys the point(?)
var time : integer;
procedure DoStuff;
begin
// do stuff
end;
begin
MarkTime(time);
repeat //main loop
if (time > 60000) then
begin
LogOut;
wait(randomrange(10000, 20000);
LoginPlayer;
MarkTime(time);
end;
DoStuff;
until // whenever you want
end.
Might not be the most efficient way, but I'm pretty sure it will work just fine. In my example, the script logs you out every min, waits 10-20 secs, then logs you back in and repeats.
NOTE: be careful doing this, if you log out too frequently, you will get banned... it does take care of randoms though.
Current Project - Superheater :: Mithril Bars - Should be ready for Members application soon
ty
is marktime in ms?
At sea with the navy - not very active
I agreee with....
SCAR Code:program TimerDemo;
// This doesn't compile, but I think it conveys the point(?)
var time : integer;
procedure DoStuff;
begin
// do stuff
end;
begin
MarkTime(time);
repeat //main loop
if (time > 60000) then
begin
LogOut;
wait(randomrange(10000, 20000);
LoginPlayer;
MarkTime(time);
end;
DoStuff;
until // whenever you want
end.
Oh yea, forgot that TimeFromMark(); part, sorry. And, yes, it's in ms.
Current Project - Superheater :: Mithril Bars - Should be ready for Members application soon
awesome, and do you need to reset the value for marktime or does it automatically revert to 0 when markTime is called?
At sea with the navy - not very active
MarkTime doesn't reset it to 0, it copies in the current SystemTime. Which is why you have to use TimeFromMark.
But as long as you call MarkTime each time a player would log in (or whenever you need it) it should be fine.
MarkTime(time); would store the current time in the "time" variable. That's why you need to use TimeFromMark(time); to get the difference, (TimeFromMark(time) would take the current time, and subtract the time at which you marked the time)... Thus getting you the total time elapsed.
So, assuming I understand your question, no you don't need to reset marktime.
Current Project - Superheater :: Mithril Bars - Should be ready for Members application soon
ahh I see kewl thx guys
At sea with the navy - not very active
There are currently 1 users browsing this thread. (0 members and 1 guests)