on *:TEXT:!cadd *:#:{
set %name #
if ($nick isop $chan) {
var %command_file = C:\Users\Randy\Documents\ExubotWebsite\ $+ $right(#,-1) $+ \commands.txt
var %website_file = C:\Users\Randy\Documents\ExubotWebsite\ $+ $right(#,-1) $+ \commands.html
var %cmd = $mid($1,2)
var %k = $+($network,-,$chan)
if ($ini(%command_file,%k,$2) >= 1) {
var %inusecadd = $rand(1,3)
if (%inusecadd == 1) { msg # /me $nick > Command already in use. }
if (%inusecadd == 2) { msg # /me $nick --> Command already in use. }
if (%inusecadd == 3) { msg # /me $nick -> Command already in use. }
}
else {
if (! isin $2) {
var %incorrect $2
var %correct $remove(%incorrect, $chr(33))
var %wrongcadd = $rand(1,3)
if (%wrongcadd == 1) { msg # /me $nick > Incorrect usage: Don't include "!" while setting the command " $+ $2 $+ " instead use " $+ %correct $+ " }
if (%wrongcadd == 2) { msg # /me $nick --> Incorrect usage: Don't include "!" while setting the command " $+ $2 $+ " instead use " $+ %correct $+ " }
if (%wrongcadd == 3) { msg # /me $nick -> Incorrect usage: Don't include "!" while setting the command " $+ $2 $+ " instead use " $+ %correct $+ " }
}
else {
writeini %command_file %k $2 $3-
write %website_file <tr> <td class="text-left"> ! $+ $2 </td> <td class="text-left"> $3- </td> </tr>
var %cadd = $rand(1,3)
if (%cadd == 1) { msg # /me $nick > The Command ! $+ $2 has been added to $right(#,-1) $+ 's command list: http://exudev.ca/ $+ $right(#,-1) $+ /commands.txt }
if (%cadd == 2) { msg # /me $nick --> The Command ! $+ $2 has been added to $right(#,-1) $+ 's command list: http://exudev.ca/ $+ $right(#,-1) $+ /commands.txt }
if (%cadd == 3) { msg # /me $nick -> The Command ! $+ $2 has been added to $right(#,-1) $+ 's command list: http://exudev.ca/ $+ $right(#,-1) $+ /commands.txt }
}
}
}
}
on *:TEXT:!cdel *:#:{
var %cmd = $mid($2,2)
if ($nick isop $chan) {
var %command_file = C:\Users\Randy\Documents\ExubotWebsite\ $+ $right(#,-1) $+ \commands.txt
var %website_file = C:\Users\Randy\Documents\ExubotWebsite\ $+ $right(#,-1) $+ \commands.html
var %k = $+($network,-,$chan)
var %t = $readini(%command_file,n,%k,%cmd)
if ($ini(%command_file,%k,$2) >= 1) {
remini %command_file %k $2
var %cdel = $rand(1,3)
if (%cdel == 1) { msg # /me $nick > The command ! $+ $2 has been found in $right(#,-1) $+ 's command list and has been deleted. %t }
if (%cdel == 2) { msg # /me $nick --> The command ! $+ $2 has been found in $right(#,-1) $+ 's command list and has been deleted. %t }
if (%cdel == 3) { msg # /me $nick -> The command ! $+ $2 has been found in $right(#,-1) $+ 's command list and has been deleted. %t }
}
else {
var %cdell = $rand(1,3)
if (%cdell == 1) { msg # /me $nick > Sorry, command ! $+ $2 could not be found. }
if (%cdell == 2) { msg # /me $nick --> Sorry, command ! $+ $2 could not be found. }
if (%cdell == 3) { msg # /me $nick -> Sorry, command ! $+ $2 could not be found. }
}
}
}
on *:TEXT:!commands:#:{
if ($read(C:\Users\Randy\Documents\ExubotWebsite\ $+ $right(#,-1) $+ \commands.txt)) {
var %clist = $rand(1,3)
if (%clist == 1) { msg # /me $nick > Command list: http://exudev.ca/ $+ $right(#,-1) $+ /commands.txt }
if (%clist == 2) { msg # /me $nick --> Command list: http://exudev.ca/ $+ $right(#,-1) $+ /commands.txt }
if (%clist == 3) { msg # /me $nick -> Command list: http://exudev.ca/ $+ $right(#,-1) $+ /commands.txt. }
}
else {
var %cnone = $rand(1,3)
if (%cnone == 1) { msg # /me $nick > No commands found. Use !cadd [command] [message] to add new commands (No Brackets) }
if (%cnone == 2) { msg # /me $nick --> No commands found. Use !cadd [command] [message] to add new commands (No Brackets) }
if (%cnone == 3) { msg # /me $nick -> No commands found. Use !cadd [command] [message] to add new commands (No Brackets) }
}
}
on $*:TEXT:m/\!.*/iS:#:{
var %command_file = C:\Users\Randy\Documents\ExubotWebsite\ $+ $right(#,-1) $+ \commands.txt
var %cmd = $mid($1,2)
if ($me == $nick) {
halt
}
var %k = $+($network,-,$chan)
var %t = $readini(%command_file,n,%k,%cmd)
if ($len(%t)) {
var %command = $rand(1,3)
if (%command == 1) { msg # /me > %t }
if (%command == 2) { msg # /me --> %t }
if (%command == 3) { msg # /me -> %t }
}
}