Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:TEXT:!commands *:#: {
- tokenize 32 $strip($1-)
- var %chc = $chr(35) $+ $nick
- if ($chan = %chc) || ($nick isop #) {
- if ($2 == list) {
- var %command_file = commandslist.ini
- var %x = $ini(%command_file,$chan,0)
- if (!%x) { msg $chan $nick -> No custom commands available | return }
- var %kk = ''
- if (%x) {
- msg $chan $nick -> Sending a query of all available custom commands for $chan
- while (%x) {
- var %kk = $ini(%command_file,$chan,%x)
- var %comtxt = $readini(%command_file,n,$chan,%kk)
- if (mod=true isin $gettok(%comtxt,1,32)) { var %kk = %kk (Mods) }
- var %text = %text %kk
- dec %x
- }
- msg $chan $nick -> Custom commands available %text
- }
- }
- elseif ($2 == total) {
- var %command_file = commandslist.ini
- var %t = $ini(%command_file,$chan,0)
- if (%t) { msg $chan $nick -> Total commands are %t }
- elseif (!%t) { msg $chan $nick -> There is NOT any custom command available }
- }
- elseif ($2 == clearlist) {
- if (%chc = $chan) || ($nick == aotik) {
- var %command_file = commandslist.ini
- var %x = $ini(%command_file,$chan,0)
- if (!%x) { msg $chan $nick -> No custom commands available | return }
- var %kk = ''
- if (%x) {
- while (%x) {
- var %kk = $ini(%command_file,$chan,%x)
- remini %command_file $chan %%kk
- dec %x
- }
- msg $chan $nick -> Custom commands list has been cleared
- }
- }
- else { msg $chan $nick -> This command is only for channel owners }
- }
- else { msg $chan $nick -> Wrong command list parameter, use list or clearlist }
- }
- }
- on *:TEXT:!addcommand *:#: {
- tokenize 32 $strip($1-)
- if ($istok(%botcommands,$2,44)) { msg $chan $nick -> Error, This command $qt($2) is already exist on the bot, you cannot add this command! | return }
- var %chc = $chr(35) $+ $nick
- if ($chan = %chc) || ($nick isop #) {
- var %command_file = commandslist.ini
- if ($left($2,1) !== !) { msg $chan $nick -> You must add ! before any command! (E.g: ! $+ $2 $+ ) | return }
- if ($ini(%command_file,$chan,$2)) { msg $chan $nick -> Command $2 already exists }
- else {
- writeini %command_file $chan $2 $3-
- msg $chan $nick -> $2 has been added $iif(($3 == mod=true),(Channel Moderators command only))
- }
- }
- }
- on *:TEXT:!editcommand *:#: {
- tokenize 32 $strip($1-)
- var %chc = $chr(35) $+ $nick
- if ($chan = %chc) || ($nick isop #) {
- var %command_file = commandslist.ini
- if ($left($2,1) !== !) { msg $chan $nick -> You must add ! before any command! (E.g: ! $+ $2 $+ ) | return }
- if ($ini(%command_file,$chan,$2)) {
- remini %command_file $chan $2
- writeini %command_file $chan $2 $3-
- msg $chan $nick -> $2 has been edited to $iif($3 == mod=true,(Channel Moderators only) $4-,$3-)
- }
- else { msg $chan $nick -> Command $2 could not be found }
- }
- }
- on *:TEXT:!delcommand *:#: {
- tokenize 32 $strip($1-)
- var %chc = $chr(35) $+ $nick
- if ($chan = %chc) || ($nick isop #) {
- if ($left($2,1) !== !) { msg $chan $nick -> You must add ! before any command! (E.g: ! $+ $2 $+ ) | return }
- var %command_file = commandslist.ini
- if ($ini(%command_file,$chan,$2)) {
- remini %command_file $chan $2
- msg $chan $nick -> Command $2 has been deleted
- }
- else { msg $chan $nick -> Command $2 could not be found }
- }
- }
- ON *:TEXT:*:#: {
- var %command_file = commandslist.ini
- var %t = $readini(%command_file,n,$chan,$strip($1))
- var %t = $replace(%t,@user@,$nick,@chan@,$chan)
- tokenize 32 %t
- if ($1 == mod=true) && (%t) {
- var %text = $2-
- if ($nick !isop $chan) { msg $chan $nick -> Error, You are NOT an channel moderator! | return }
- if (!%text) { return }
- msg $chan %text
- }
- elseif ($1 !== mod=true) && (%t) {
- var %text = $1-
- if (!%text) { return }
- msg $chan %text
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement