Advertisement
Majeye

mIRC - Add/Remove command

Feb 12th, 2015
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.72 KB | None | 0 0
  1. on *:text:!addcom *:#: {
  2.   if ($nick isop #) {
  3.     var %r = $read(# $+ commands.txt,ns,$2)
  4.     if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) is already exist into the database! | return }
  5.     write # $+ commands.txt $2-
  6.     msg $chan /me + Command $2 has been added to the database!
  7.   }
  8. }
  9. on *:text:!delcom *:#: {
  10.   if ($nick isop #) {
  11.     var %r = $read(# $+ commands.txt,ns,$2)
  12.     if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
  13.     write -dl $+ $readn # $+ commands.txt
  14.     msg $chan /me - Command $2- has been deleted from the database!
  15.   }
  16. }
  17. on *:text:!editcom & *:#: {
  18.   if ($nick isop #) {
  19.     var %r = $read(# $+ commands.txt,ns,$2)
  20.     if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
  21.     write -l $+ $readn # $+ commands.txt $2-
  22.     msg $chan /me -> Command $2 has been updated!
  23.   }
  24. }
  25. ON *:TEXT:*:#: {
  26.   var %owner $right(#,-1)
  27.   tokenize 32 $strip($1-,burci)
  28.   if ($read(# $+ commands.txt, nts, $1)) {
  29.     var %com = $v1
  30.     var %com = $replace(%com,@user@,$iif($2,$2,?),@nick@,$nick,@target@,$target)
  31.     if (-ul=mod == $gettok(%com,1,32)) && (!$mod($nick)) { msg $chan Sorry $nick $+ , you cannot use this command. | return }
  32.     if (-ul=reg == $gettok(%com,1,32)) && (!$mod($nick)) && (!$regular($nick)) { msg $chan Sorry $nick $+ , you cannot use this command. | return }
  33.     if (-ul=own == $gettok(%com,1,32)) && ($nick != %owner) { msg $chan Sorry $nick $+ , you cannot use this command. | return }
  34.     msg $chan $iif(-ul=mod == $gettok(%com,1,32) || -ul=reg == $gettok(%com,1,32) || -ul=own == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
  35.   }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement