Okay, I think that this is the finished code.
*I changed it to !mail so that it won't conflict if other people have addons that use !post.
It is set up so that it will save 5 messages for each person--until they pick them up or until you clear them.
Also I took out the host only option as op status does not register consistenly in whisper, and I removed the on-screen !mail posting to prevent multiple mail bots getting programed with the same message from the main screen.
I'll post it in the addon section also.
Gwen
on *:INPUT:?: {
if (%mcstonnce !== On) && (!mail isin $1) { .ctcpreply $nick TIME CE Global Message Centre is Off.
}
if (%mcstonnce == On) {
if (!mail isin $1) {
if (%mcstonnce == On) && ($2 == $null) { msg $nick You have attempted to activate Global Message Center, please include a Nickname and Message when you post a message.
halt
}
if (%mcstonnce == On) && ($3 == $null) { msg $nick You have attempted to activate Global Message Center, please include a Nickname and Message when you post a message.
halt
}
if ($2 isin %postnick5 [ $+ [ $2 ] ] ) {
.ctcpreply $nick TIME Messages for $2 are full.
.ctcpreply $nick TIME Your message has NOT been saved, please try again after $2 has received all of their current messages.
halt
}
if ($2 isin %postnick4 [ $+ [ $2 ] ] ) {
set %postnick5 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.ctcpreply $nick TIME You set the following message: $2-
halt
}
if ($2 isin %postnick3 [ $+ [ $2 ] ] ) {
set %postnick4 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.ctcpreply $nick TIME You set the following message: $2-
halt
}
if ($2 isin %postnick2 [ $+ [ $2 ] ] ) {
set %postnick3 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.ctcpreply $nick TIME You set the following message: $2-
halt
}
if ($2 isin %postnick [ $+ [ $2 ] ] ) {
set %postnick2 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.ctcpreply $nick TIME You set the following message: $2-
halt
}
else {
set %postnick [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.ctcpreply $nick TIME You set the following message: $2-
halt
}
}
}
}
on *:INPUT:#: {
if (%mcstonnce !== On) && (!mcinfo isin $1) {
msg $chan CE Global Message Centre is Currently Off.
}
if (%mcstonnce == On) && (!mcinfo isin $1) {
msg $chan To leave a short message for someone whisper the bot: !mail Nickname Message. For example: !mail Gwen I missed you today. Make sure to use the EXACT Nickname and CE Global Message Centre will leave the person your short message.
}
if (!mail isin $1) { /msg $chan $nick you can only send mail by whispering the bot. Type !mcinfo for more details.
}
if ($nick isin %postnick [ $+ [ $nick ] ]) && (!mail !isin $1) { /msg $chan (e) --> $nick your mail will be posted privately in a moment.
.ctcpreply $nick TIME %postnick [ $+ [ $nick ] ]
/unset %postnick [ $+ [ $nick ] ]
}
if ($nick isin %postnick2 [ $+ [ $nick ] ]) && (!mail !isin $1) {
.ctcpreply $nick TIME %postnick2 [ $+ [ $nick ] ]
/unset %postnick2 [ $+ [ $nick ] ]
}
if ($nick isin %postnick3 [ $+ [ $nick ] ]) && (!mail !isin $1) {
.ctcpreply $nick TIME %postnick3 [ $+ [ $nick ] ]
/unset %postnick3 [ $+ [ $nick ] ]
}
if ($nick isin %postnick4 [ $+ [ $nick ] ]) && (!mail !isin $1) {
.ctcpreply $nick TIME %postnick4 [ $+ [ $nick ] ]
/unset %postnick4 [ $+ [ $nick ] ]
}
if ($nick isin %postnick5 [ $+ [ $nick ] ]) && (!mail !isin $1) {
.ctcpreply $nick TIME %postnick5 [ $+ [ $nick ] ]
/unset %postnick5 [ $+ [ $nick ] ]
}
}
on *:text:*!mail*:#: {
if (%mcstonnce == On) {
/msg $chan $nick you can only send mail by whispering the bot. Type !mcinfo for more details.
}
}
on *:text:*:#: {
if (%mcstonnce !== On) && (!mcinfo isin $1) {
msg $chan CE Global Message Centre is Currently Off.
}
if (%mcstonnce == On) && (!mcinfo isin $1) {
msg $chan To leave a short message for someone whisper the bot: !mail Nickname Message. For example: !mail Gwen I missed you today. Make sure to use the EXACT Nickname and CE Global Message Centre will leave the person your short message.
}
if (%mcstonnce == On) && (!mail !isin $1) {
if ($nick isin %postnick [ $+ [ $nick ] ]) { /msg $chan (e) --> $nick your mail will be posted privately in a moment.
.ctcpreply $nick TIME %postnick [ $+ [ $nick ] ]
/unset %postnick [ $+ [ $nick ] ]
}
if ($nick isin %postnick2 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME %postnick2 [ $+ [ $nick ] ]
/unset %postnick2 [ $+ [ $nick ] ]
}
if ($nick isin %postnick3 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME %postnick3 [ $+ [ $nick ] ]
/unset %postnick3 [ $+ [ $nick ] ]
}
if ($nick isin %postnick4 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME %postnick4 [ $+ [ $nick ] ]
/unset %postnick4 [ $+ [ $nick ] ]
}
if ($nick isin %postnick5 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME %postnick5 [ $+ [ $nick ] ]
/unset %postnick5 [ $+ [ $nick ] ]
}
}
}
on *:text:*!mail*:?: { if ($nick == $me) halt
if (%mcstonnce == On) && ($2 == $null) { msg $nick You have attempted to activate Global Message Center, please include a Nickname and Message when you post a message.
halt
}
if (%mcstonnce == On) && ($3 == $null) { msg $nick You have attempted to activate Global Message Center, please include a Nickname and Message when you post a message.
halt
}
if (%mcstonnce !== On) { .ctcpreply $nick TIME CE Global Message Centre is Off.
}
if (%mcstonnce == On) {
if ($2 isin %postnick5 [ $+ [ $2 ] ] ) {
.msg $nick for $2 are full.
.msg $nick Your message has NOT been saved, please try again after $2 has received all of their current messages.
halt
}
if ($2 isin %postnick4 [ $+ [ $2 ] ] ) {
set %postnick5 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.msg $nick You set the following message: $2-
halt
}
if ($2 isin %postnick3 [ $+ [ $2 ] ] ) {
set %postnick4 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.msg $nick You set the following message: $2-
halt
}
if ($2 isin %postnick2 [ $+ [ $2 ] ] ) {
set %postnick3 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.msg $nick You set the following message: $2-
halt
}
if ($2 isin %postnick [ $+ [ $2 ] ] ) {
set %postnick2 [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.msg $nick You set the following message: $2-
}
else {
set %postnick [ $+ [ $2 ] ] Mail from $nick $asctime(dd/mm/yyyy hh:nn TT) : $2-
.msg $nick You set the following message: $2-
}
}
}
on *:text:*:?: {
if (%mcstonnce !== On) && (!mcinfo isin $1) {
msg $nick CE Global Message Centre is Currently Off.
}
if (%mcstonnce == On) && (!mcinfo isin $1) {
msg $nick To leave a short message for someone whisper the bot: !mail Nickname Message. For example: !mail Gwen I missed you today. Make sure to use the EXACT Nickname and CE Global Message Centre will leave the person your short message.
}
if (%mcstonnce == On) && (!mail !isin $1) {
if ($nick isin %postnick [ $+ [ $nick ] ]) {
if ($nick !== $me) /msg $nick $nick private mail has been sent to you on the main screen. For more details type !mcinfo
.ctcpreply $nick TIME %postnick [ $+ [ $nick ] ]
/unset %postnick [ $+ [ $nick ] ]
}
if ($nick isin %postnick2 [ $+ [ $nick ] ]) {
;.msg $nick $nick private mail has been sent to you on the main screen. For more details type !mcinfo
.ctcpreply $nick TIME %postnick2 [ $+ [ $nick ] ]
/unset %postnick2 [ $+ [ $nick ] ]
}
if ($nick isin %postnick3 [ $+ [ $nick ] ]) {
;.msg $nick $nick private mail has been sent to you on the main screen. For more details type !mcinfo
.ctcpreply $nick TIME %postnick3 [ $+ [ $nick ] ]
/unset %postnick3 [ $+ [ $nick ] ]
}
if ($nick isin %postnick4 [ $+ [ $nick ] ]) {
;.msg $nick $nick private mail has been sent to you on the main screen. For more details type !mcinfo
.ctcpreply $nick TIME %postnick4 [ $+ [ $nick ] ]
/unset %postnick4 [ $+ [ $nick ] ]
}
if ($nick isin %postnick5 [ $+ [ $nick ] ]) {
;.msg $nick $nick private mail has been sent to you on the main screen. For more details type !mcinfo
.ctcpreply $nick TIME %postnick5 [ $+ [ $nick ] ]
/unset %postnick5 [ $+ [ $nick ] ]
}
}
}
on *:JOIN:#: {
if (%mcjoininfo == On) && (%mcstonnce == On) { .ctcpreply $nick TIME CE Global Message Centre is On. Type !mcinfo for more info.
}
if (%mcstonnce == On) {
if ($nick isin %postnick [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME $nick you have mail. To pick up your message type hi onto the main screen.
halt
}
if ($nick isin %postnick2 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME $nick you have mail. To pick up your message type hi onto the main screen.
halt
}
if ($nick isin %postnick3 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME $nick you have mail. To pick up your message type hi onto the main screen.
halt
}
if ($nick isin %postnick4 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME $nick you have mail. To pick up your message type hi onto the main screen.
halt
}
if ($nick isin %postnick5 [ $+ [ $nick ] ]) {
.ctcpreply $nick TIME $nick you have mail. To pick up your message type hi onto the main screen.
halt
}
}
}
menu * {
-
Message Centre -> is ( %mcstonnce ) and join message -> is ( %mcjoininfo )
.Instructions: {
/echo $color(info2 text) -at To use message centre you or other chat room users can whisper the bot, or type onto the main screen: !mail Nickname Message.
/echo $color(info2 text) -at The message will be sent to the person when they join the room, speak in the room, or whisper the bot.
/echo $color(info2 text) -at *Make sure to use the EXACT nickname, with all its characters.
/echo $color(info2 text) -at For example: !mail Gwen I just wanted to say hi.
/echo $color(info2 text) -at *Please only leave short messages.
/echo $color(info2 text) -at You have the option to only allow hosts/owners to send messages, or everyone.
/echo $color(info2 text) -at Clear the messages on a regular basis.
}
.-
.On -> is ( %mcstonnce ): /set %mcstonnce On | /echo $color(info2 text) -at Message Centre is now On.
.Off: /set %mcstonnce Off | /echo $color(info2 text) -at Message Centre is now Off.
.-
.Clear Messages: /unset %postnick* | /echo $color(info2 text) -at All the messages are cleared.
.-
.On-join Info Message On -> is ( %mcjoininfo ): /set %mcjoininfo On | /echo $color(info2 text) -at People will be notified when they join that Message Centre is On, and they will be given instructions to use it.
.On-join Info Message Off: /set %mcjoininfo Off | /echo $color(info2 text) -at On-join Message Info is Off.
-
}