on $*:TEXT:/^[!@](set|del)?event/Si:#:{
if ($regex($1,/^[!@]setevent/Si)) && ($nick($chan,$nick,oh)) {
var %a $gettok($2-,0,32)
if ($2 !isnum 1-159) && ($(,$ $+ $gettok($1-,0,32)) !isnum 1-159) {
while (%a) {
if ($gettok($2-,%a,32) isnum 1-159) { var %world $v1 }
dec %a
}
if (!%world) var %world Not set.
}
else var %world $iif($(,$ $+ $gettok($1-,0,32)) isnum 1-159,$v1,$2)
notice $nick The event for $chan is set to: $remove($2-,%world) $chr(124) At world: %world
hadd -m Event $chan $+($remove($2-,%world),~,%world)
}
if ($regex($1,/^[!@]delevent/Si)) && ($nick($chan,$nick,oh)) {
if (!$hget(Event, $chan)) notice $nick There is no event set for $qt($chan)
else {
hdel Event $chan
notice $nick The event for $qt($chan) is unset
}
}
if ($regex($1,/^[!@]event/Si)) {
if (!$hget(Event, $chan)) notice $nick There is no event set for $qt($chan)
else {
notice $nick The current event is: $qt($gettok($hget(Event, $Chan),1,126)) $chr(124) On world: $qt($gettok($hget(Event, $chan),2,126))
}
}
}
on *:JOIN:#:{
if ($hget(Event, $chan)) notice $nick The current event is: $qt($gettok($hget(Event, $Chan),1,126)) $chr(124) at world: $qt($gettok($hget(Event, $chan),2,126))
}
on *:Start:{
hmake Event
hload Event Event.txt
}
on *:EXIT:{
hsave Event Event.txt
}