Global messages on timer

Posted by Solo on Sat 21 Mar 2009 12:34 AM — 8 posts, 31,158 views.

#0
Relatively new to coding for smaug, was wondering two things. One I was wanting to display the layer value on objects specifically armor when you analyze it, and two, is there any way to code in a timer that sends a global message or forces the player to perform certain actions. IE reading a hfile or something along those lines.
#1
Ok I figured out the layer thing by myself. Felt kinda dumb afterward. But still having trouble with the timer function. Any help or a pointer in the right direction would be appreciated.
USA #2
Do you want to echo this stuff at same intervals?
#3
Yes, was looking to do it roughly every 30 to 45 minutes.
USA #4
During the update tick function in update.c, you could do an ifcheck on the current real time and then perform whatever is needed. I think the function is char_update?
#5
Ok I went into update.c and added an if check, under char_update. But its not doing what its supposed to do.

if ( (current_time % 1800) == 0 )
{
do_help( ch, "voteinfo" );
}

Now, if I'm not mistaken, this should, every 30 minutes, every character should have the voteinfo hfile displayed. I am I missing something?
USA #6
Try it in the char_check function. That one is called more frequently.
USA #7
You should probably add in a config option to turn that off as I would never play a game that spams me to vote every 30 minutes. That's just a personal preference though.

To me, that's just poor taste and makes the mud look bad. Again, just my personal opinion.