Constant running timer
Posted: Sun May 27, 2012 10:59 pm
hey guys, its me again (woohoo!) lol....anyways im currently trying to create a magical system, where characters get rewarded a magical tool if their skills are over a certain level. id like to make it so that they can only create one magical tool a day through a timer....(the rest of the script is fine creation wise and random chance wise of items)
right now i have it set up so that if they successfully create a magical tool, this timer starts up. but it doesnt work =\ it compiles fine but completely skips the program and doesnt start the timer
(this is glowtimer.src)
this is using the constant "const glow_timer := ReadGameClock();" found in the glowies.inc file.
i would then like to make an if statement at the very start of the function that created the magical item, to....well for example
i would like to make a script that is run after they make a magical tool (glowie), that doesnt let that single character make another glowie until 24 hours is up(so theya re rewarded one glowie a day if they meet the skills requirement), however i feel im going the wrong way about doing a timer for a single character....would anyone have any idea's on how to do this?
if you need more info about what im trying to do, just ask
thanks in advance, mat
right now i have it set up so that if they successfully create a magical tool, this timer starts up. but it doesnt work =\ it compiles fine but completely skips the program and doesnt start the timer
(this is glowtimer.src)
Code: Select all
include ":glowies:glowies";
program glowtimer (character)
glowiestimer(character);
endprogram
function glowiestimer(character)
SendSysMessage(character, "The glowtimer has started");
repeat
sleep (1);
glow_timer := glow_timer + 1;
until (glow_timer == glow_timer + 86400);
SendSysMessage(character, "the glow_timer is now at 1 day");
if (glow_timer := glow_timer + 86400)
glow_timer := ReadGameClock();
endif
SendSysMessage(character, "the glow_timer is now restarted");
endfunctioni would then like to make an if statement at the very start of the function that created the magical item, to....well for example
Code: Select all
if (glow_timer == 1 day)
return;
endifif you need more info about what im trying to do, just ask
thanks in advance, mat