Advertisement
SaNCaK

mIRC Mute ban

Feb 3rd, 2014
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.45 KB | None | 0 0
  1. menu nicklist {
  2.   -
  3.   .Mute
  4.   ..$iif(!$hget(MuteEnforce,$+($network,$chan,$address($$1,2))),$style(2)) RemoveMute $$1: {
  5.     var %mask $+($network,$chan,$address($$1,2))
  6.     hdel MuteEnforce %mask
  7.     if ($timer(%mask).com) {
  8.       $v1
  9.       .notice $$1 Your ban has been lifted early! You may now speak in $+($chan,.) Please try not to repeat the same activity that caused you to be muted.
  10.       $+(.timer,%mask) off
  11.     }
  12.     else mode $chan -b $+(m:,$address($$1,2))
  13.   }
  14.   ..Mute $$1
  15.   ...3 Minutes:mute $$1 180 $$?="Reason for Muting $$1"
  16.   ...5 Minutes:mute $$1 300 $$?="Reason for Muting $$1"
  17.   ...10 Minutes:mute $$1 600 $$?="Reason for Muting $$1"
  18.   ...30 Minutes:mute $$1 1800 $$?="Reason for Muting $$1"
  19.   ...60 Minutes:mute $$1 3600 $$?="Reason for Muting $$1"
  20.   ...Set Time: {
  21.       var %length $$?="Length of ban in minutes"
  22.       mute $$1 $calc(%length * 60) $$?="Reason for Muting $$1"
  23.     }
  24. }
  25. alias -l mute {
  26.   var %nick $$1
  27.   if (%nick ison $chan) && ($regex($nick(#,$me).pnick,/[~&!@%]/)) {
  28.     ialcheck %nick
  29.     var %usermodes $replace($remove($nick(#,%nick).pnick,%nick),~,q,&,a,!,a,@,o,%,h,+,v), %addy $iif($address(%nick,2),$v1,%nick)
  30.     mode $chan $+(+b-,%usermodes) $+(m:,%addy) $str($+(%nick,$chr(32)),$len(%usermodes))
  31.     hadd -m MuteEnforce $+($network,$chan,%addy) mute
  32.     if ($$2 isnum) {
  33.       $+(.timer,$network,$chan,%addy) 1 $$2 removeMute $+($network,$chan,%addy) $chan $+(-b+,%usermodes) $+(m:,%addy) $str($+(%nick,$chr(32)),$len(%usermodes))
  34.       msg $chan $+(,%nick,) You have been Muted! Duration: $duration($2) Reason: $iif($3-,$3-,Intolerable Behavior!)
  35.     }
  36.     else msg $chan %nick You have been Muted! $+(Reason:,$iif($2-,$2-,Intolerable Behavior!))
  37.   }
  38.   else echo -a Error: Either %nick is not on $chan or you do not have the correct privileges to use the mute command.
  39. }
  40. alias -l ialcheck {
  41.   if (!$ial($1)) .who $1
  42. }
  43. alias -l removeMute {
  44.   if ($($+($,$0),2) !ison $2) mode $2 -b $4
  45.   else mode $2-
  46.   hdel MuteEnforce $1
  47. }
  48. alias -l parseMode {
  49.   tokenize 32 $1
  50.   var %start 1, %finish $len($1), %+-, %modes -1, %location $+(parseMode,$chr(3),$network,$chr(3),$chan)
  51.   while (%start <= %finish) {
  52.     if ($mid($1,%start,1) isin +-) { %+- = $replace($v1,+,1,-,-1) | inc %modes }
  53.     elseif ($mid($1,%start,1) isin qaohvb) {
  54.       var %mode $+($v1,$($+($,$calc(%start - %modes)),2))
  55.       hadd -m %location %mode $calc($hget(%location,%mode) + %+-)
  56.     }
  57.     inc %start
  58.   }
  59.   var %hash $regsubex($regsubex($str(.,$hget(%location,0).item),/(.)/g,$+($hget(%location,\n).data,$hget(%location,\n).item,$chr(32))),/(\b0[^\s]*)/g,)
  60.   if ($hget(%location)) hfree $v1
  61.   var %count 1, %max $numtok(%hash,32), %return, %temp
  62.   while (%count <= %max) {
  63.     %temp = $gettok(%hash,%count,32)
  64.     %return = $+(%return,$chr(32),$iif($left(%temp,1) == -,$+(-,$mid(%temp,3)),$+(+,$mid(%temp,2))))
  65.     inc %count
  66.   }
  67.   return %return
  68. }
  69. On !*:rawmode:#: {
  70.   checkMutes $network $chan $parsemode($1-)
  71. }
  72. alias -l checkMutes {
  73.   var %network $1, %chan $2, %modes $3-
  74.   tokenize 32 %modes
  75.   checkMute %network %chan $*
  76. }
  77. alias -l checkMute {
  78.   var %mode $left($3,2), %target $mid($3,3)
  79.   if ((%mode isincs +v+h+o+a+q) && ($hget(MuteEnforce,$+($1,$2,$address(%target,2))))) mode $2 $replace(%mode,+,-) %target
  80.   elseif ((%mode == -b) && ($hget(MuteEnforce,$+($1,$2,$gettok(%target,-1,58))))) mode $chan +b %target
  81. }
  82. ;Syntax /m Nick TimeinMinutes Reason
  83. alias m mute $$1 $iif($2 isnum,$calc($2 * 60),180 $2) $3-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement