on *:TEXT:*:#:{
if ($1 == !setevent) {
if (($nick isop $chan) || ($nick ishop $chan)) {
if ($2) {
if ($v1 == syntax) {
notice $nick Proper SYNTAX !setevent [-nrca] < N/EVENT >
notice $nick Switches: $&
-n Means NEW, Clears existing events, and starts a new with the new specified event. $&
-r Means REMOVE, Removes N'th event from the event list. $&
-c Means CLEAR, Clears existing events. $&
-a Means ADD, Adds a new event to an existing list of events. $&
NOTE: If you specify NO switches, it assumes you want to start one. if one is already in effect, you will need to use the -a switch to add a new event to the list.
halt
}
if ($left($v1,1) == -) {
if (n isin $2) {
if ($ini(events.ini,$chan) != 0) {
if ($3) {
remini events.ini $chan
writeini events.ini $chan 1 $3-
notice $nick event line reset, new event added.
halt
}
else { notice $nick invalid syntax refer to !setevent syntax | halt }
}
else { notice $nick There is currently no events set, You cannot clear a non-existant event line. | halt }
}
if (c isin $2) {
if ($ini(events.ini,$chan) != 0) { remini events.ini $chan | notice $nick all events have been removed. }
else { notice $nick There is currently no events set, You cannot clear a non-existant event line. }
}
if (a isin $2) {
if ($ini(events.ini,$chan,0) >= 1) { writeini events.ini $chan $calc($ini(events.ini,$chan,0) + 1) $3- | notice $nick an event has been added to the events list }
else { notice $nick There is currently no events set, You cannot add to a non-existant event line. }
}
if (r isin $2) {
if ($ini(events.ini,$chan) != 0) {
if (($3) && ($3 isnum)) {
if ($ini(events.ini,$chan,$3)) {
remini events.ini $chan $3
set $+(%,fixini,.,$nick) $3
while ($($+(%,fixini,.,$nick),2) < $calc($ini(events.ini,$chan,0) + 1)) {
writeini events.ini $chan $($+(%,fixini,.,$nick),2) $readini(events.ini,$chan,$calc($($+(%,fixini,.,$nick),2) +1))
remini events.ini $chan $calc($($+(%,fixini,.,$nick),2) + 1)
inc $+(%,fixini,.,$nick) 1
}
if ($ini(events.ini,$chan,0) == 0) { notice $nick last of the events removed. event line terminated | remini events.ini $chan }
else { notice $nick You have removed the $ord($3) event. }
}
}
else { notice $nick Wrong use of the -r switch! SYNTAX: !setevent -r <number> }
}
else { notice $nick There is currently no events set, You cannot remove an event from a non-existant event line. }
}
}
else {
if ($ini(events.ini,$chan,0) >= 1) { notice $nick There is already a set of events running, referr to "!setevent syntax" for more information }
else { notice $nick You've started a new event line. | writeini events.ini $chan 1 $2- }
}
}
else {
notice $nick Proper SYNTAX !setevent [-nrca] < N/EVENT >
notice $nick Switches: $&
-n Means NEW, Clears existing events, and starts a new with the new specified event. $&
-r Means REMOVE, Removes N'th event from the event list. $&
-c Means CLEAR, Clears existing events. $&
-a Means ADD, Adds a new event to an existing list of events. $&
NOTE: If you specify NO switches, it assumes you want to start one. if one is already in effect, you will need to use the -a switch to add a new event to the list.
halt
}
}
}
if ($1 == !sesyntax) {
notice $nick Proper SYNTAX !setevent [-nrca] < N/EVENT >
notice $nick Switches: $&
-n Means NEW, Clears existing events, and starts a new with the new specified event. $&
-r Means REMOVE, Removes N'th event from the event list. $&
-c Means CLEAR, Clears existing events. $&
-a Means ADD, Adds a new event to an existing list of events. $&
NOTE: If you specify NO switches, it assumes you want to start one. if one is already in effect, you will need to use the -a switch to add a new event to the list.
halt
}
if ($1 == !esyntax) {
notice $nick Proper SYNTAX !events [-n] [N]
notice $nick Switches: -n means NUMBER, returns N'th event. if you specify -n N is manditory.
}
if ($1 == !events) {
if (!$ini(events.ini,$chan)) { notice $nick there is currently no events set. | halt }
if ($2) {
if ($2 == -n) {
if (($3 isnum) && ($3 <= $ini(events.ini,$chan,0))) {
notice $nick $ord($3) event from $chan $+ 's event line.
notice $nick $3 $+ . $readini(events.ini,$chan,$3)
}
else { notice $nick invalid syntax OR you chose a number above the amount of listed events. refer to "!events syntax" }
}
if ($2 == syntax) {
notice $nick Proper SYNTAX !events [-n] [N]
notice $nick Switches: -n means NUMBER, returns N'th event. if you specify -n N is manditory.
}
}
else {
if ($ini(events.ini,$chan,0) >= 1) {
notice $nick Events for $chan
set $+(%,yah,.,$nick) 0
while ($($+(%,yah,.,$nick),2) < $ini(events.ini,$chan,0)) {
inc $+(%,yah,.,$nick) 1
notice $nick $+($($+(%,yah,.,$nick),2),.) $readini(events.ini,$chan,$($+(%,yah,.,$nick),2))
}
else { notice $nick there is no events set on $chan }
}
}
}
}