From: the root of all evil Subject: Timed Events Here's a simple way to add an event system, it's a little hairy to code if you're not familiar with linked lists, but the concept is easy and you should be able to tweak it to suit your needs... You need: An event_data structure... I use: struct event_data { struct char_data *ch; /* char this event happens to */ int cmd; /* command number */ char *args; /* typed in args */ int count; /* pulses to event completion */ struct event_data *next; /* next command event in list */ }; A global linked list of events waiting to happen. A fuction, event_activity(), to execute or disrupt the events. Now, inside of commands, ACMD(whatever), that I want to be delayed, I call them with SCMD_DELAY (which I have defined as 0, which is the default), If the subcmd is SCMD_DELAY, I'll call a function called add_event() using args that are already available inside of the command's function like ch, cmd and argument, then I just give it a timer for how long until the event is supposed to be executed and return. If the subcmd is not SCMD_DELAY (which means it got called from event_activity) then I assume the event is up and just execute the command normally. The function event_activity() is called from comm.c, along with the rest of the PULSE stuff like mobile_activity(), every second and just cycles the event_list and checks if any should be executed, if so, it calls the cmd and removes the event from the queue. Here's what my event_activity() function looks like... void event_activity(void) { struct event_data *event, *temp; int i; for (event = event_list, i=0; icount; if (event->count < 1) { ((*cmd_info[event->cmd].command_pointer) (event->ch, event->line, event-> cmd, SCMD_EXECUTE)); REMOVE_FROM_LIST(event, event_list, next); --event_top; } event = event->next; } } Not sure if this response was actually helpful, or just confusing... :) Goodluck, -Skylar