How to make a !commands or !cmd command - 12/10/14 09:38 AM
How would i make a !commands or !cmd command which will list the commands the bot has.
ON !*:TEXT:!commands:#: { msg $chan [ $+ $nick $+ ]: Available commands are: !commands }
ON !*:TEXT:!commands:#: { msg $chan [ $+ $nick $+ ]: Available commands are: !commands }
ON !*:TEXT:!commands:#: { var %f = commands.txt if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return } if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return } msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait... var %t = $lines(%f) var %i = 1 while (%i <= %t) { var %r = $read(%f,nt,%i) msg $chan [# $+ %i $+ ]: Command: $+ %r $+ inc %i } msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ %t $+ ) }
ON !*:TEXT:!commands:#: { var %f = commands.txt if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return } if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return } msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait... var %t = $lines(%f) var %i = 1 while (%i <= %t) { var %r = $read(%f,nt,%i) msg $chan [# $+ %i $+ ]: Command: $+ %r $+ inc %i } msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ %t $+ ) }
ON !*:TEXT:!commands:#: { var %f = commands.txt if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return } if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return } msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait... var %t = $lines(%f) var %i = 1 while (%i <= %t) { var %r = $read(%f,nt,%i) var %g = $gettok(%r,1,32) var %com = $addtok(%com,%g,32) inc %i } if (%com) { msg $chan [ $+ $nick $+ ]: All the available commands are: $+ %com $+ } elseif (!%com) { msg $chan [ $+ $nick $+ ]: There is NOT any command available on the file! | return } msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ $numtok(%com,32) $+ ) }
ON !*:TEXT:!commands:#: { var %f = commands.txt if (!$isfile(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command available since now, file is NOT exist! | return } if (!$lines(%f)) { msg $chan [ $+ $nick $+ ]: There is NOT any command avaialable since now, file is EMPTY! | return } msg $chan [ $+ $nick $+ ]: Starting now the list with all the commands that are available on the channel, Please wait... var %t = $lines(%f) var %i = 1 while (%i <= %t) { var %r = $read(%f,nt,%i) var %g = $gettok(%r,1,32) var %com = $addtok(%com,%g,32) inc %i } if (%com) { msg $chan [ $+ $nick $+ ]: All the available commands are: $+ %com $+ } elseif (!%com) { msg $chan [ $+ $nick $+ ]: There is NOT any command available on the file! | return } msg $chan [ $+ $nick $+ ]: End of command list. - (Total Commands: $+ $numtok(%com,32) $+ ) }