; snotice ; ini for settings, text for snomask levels, 1 = SNO_OLDSNO ; check a snomask level ; change window to use 160 ; change to usermode addon ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SNOTICE.INI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alias -l snotice.ini { !return snotice.ini } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SNOTICE.LOAD ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alias snotice.load { if ($hget(snotice)) { !hfree snotice } !var %x = 1 while ($ini($snotice.ini,settings,%x) != $null) { !hadd -m snotice $ifmatch $readini($snotice.ini,settings,$ifmatch) !inc %x } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SNOTICESETTING ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; prop: snomask, connect alias snoticesetting { if ($1) || ($hget(snotice,$server)) || ($hget(snotice,$network)) { !var %target = $ifmatch if ($prop == snomask) { !return $gettok(%target,1,32) } elseif ($prop == connect) { !return $gettok(%target,2,32) } elseif ($prop == window) { !return $gettok(%target,3,32) } else { !return %target } } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SNOMASK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alias snomask { !return $hget(snotice,$+(@snomask,$cid)) } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SNOTICE.WHAT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alias snotice.what { if ($1 == 1) { !return SNO_OLDSNO } elseif ($1 == 2) { !return SNO_SERVKILL } elseif ($1 == 4) { !return SNO_OPERKILL } elseif ($1 == 8) { !return SNO_HACK2 } elseif ($1 == 16) { !return SNO_HACK3 } elseif ($1 == 32) { !return SNO_UNAUTH } elseif ($1 == 64) { !return SNO_TCPCOMMON } elseif ($1 == 128) { !return SNO_TOOMANY } elseif ($1 == 256) { !return SNO_HACK4 } elseif ($1 == 512) { !return SNO_GLINE } elseif ($1 == 1024) { !return SNO_NETWORK } elseif ($1 == 2048) { !return SNO_IPMISMATCH } elseif ($1 == 4096) { !return SNO_THROTTLE } elseif ($1 == 8192) { !return SNO_OLDREALOP } elseif ($1 == 16384) { !return SNO_CONNEXIT } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; START EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on *:start:{ snotice.load } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CONNECT EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on *:connect:{ if ($snoticesetting($null).connect) && ($snoticesetting($null).snomask) { pushuser +s $ifmatch } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; USERMODE EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on *:usermode:{ if (o isin $1) && (o isin $gettok($usermode,1,32)) && ($snoticesetting($null).snomask) && ($ifmatch != $snomask) { pushuser +s $ifmatch } if (s isincs $1) && (s !isincs $gettok($usermode,1,32)) { !hdel snotice $+(@snomask,$cid) if ($window($+(@snotice_,$cid))) { !titlebar $+(@snotice_,$cid) current snomask } } elseif (s isincs $1) && (s isincs $gettok($usermode,1,32)) && ($snoticesetting($null).window) && (!$window($+(@snotice_,$cid))) { !window -nmv $+ $iif($gettok($readini($mircini,options,n1),8,44),E,e) $+(@snotice_,$cid) } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW 008 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 008 :: Server notice mask () raw 008:$(& & : Server notice mask &): { if ($2 != 0) { !hadd -m snotice $+(@snomask,$cid) $2 !var %x = 14, %y = $2, %s while (%x >= 0) { if ($calc(%y - 2^ %x) >= 0) { !var %y $ifmatch !echo -i2 $+ $iif(!$window($+(@snotice_,$cid)),s) $+(@snotice_,$cid) SNOMASK set: $calc(2^ %x) $+ $str($chr(160),$calc(7- $len($calc(2^ %x)))) $snotice.what($calc(2^ %x)) !var %s = $addtok(%s,$calc(2^ %x),32) } !dec %x } if ($window($+(@snotice_,$cid))) { !titlebar $+(@snotice_,$cid) current snomask $2 } } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SNOTICE EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on ^*:snotice:*:{ if (s isincs $gettok($usermode,1,32)) && ($window($+(@snotice_,$cid))) { !echo $color(notice) -ti2 $ifmatch $+(-,$nick,-) $1- !window -g1 $ifmatch !haltdef } } ; end dialog snotice { title "SNOTICE" size -1 -1 144 184 option dbu check "1 SNO_OLDSNO", 1, 5 33 56 10 check "2 SNO_SERVKILL", 2, 5 42 59 10 check "4 SNO_OPERKILL", 3, 5 51 66 10 check "8 SNO_HACK2", 4, 5 60 62 10 check "16 SNO_HACK3", 5, 5 69 55 10 check "32 SNO_UNAUTH", 6, 5 78 58 10 check "64 SNO_TCPCOMMON", 7, 5 87 66 10 check "128 SNO_TOOMANY", 8, 5 96 62 10 check "256 SNO_HACK4", 9, 5 105 54 10 check "512 SNO_GLINE", 10, 5 114 53 10 check "1024 SNO_NETWORK", 11, 5 123 62 10 check "2048 SNO_IPMISMATCH", 12, 5 132 71 10 check "4096 SNO_THROTTLE", 13, 5 141 66 10 check "8192 SNO_OLDREALOP", 14, 5 150 70 10 check "16384 SNO_CONNEXIT", 15, 5 159 69 10 button "Add", 16, 89 10 24 10 button "Delete", 17, 115 10 24 10 button "Apply", 18, 94 151 37 12 button "Close", 19, 94 166 37 12, default ok button "Select all", 20, 94 100 37 12 combo 21, 3 10 84 59, size drop button "Select default", 22, 94 114 37 12 box "masks", 23, 0 25 78 158 box "Network / Server", 24, 0 1 143 24 box "", 25, 82 93 61 51 box "settings", 26, 82 25 61 68 check "set on connect", 27, 87 33 51 10 check "@snotice window", 28, 87 51 51 10 check "set on oper up", 29, 87 42 51 10 text "snomask:", 31, 5 170 23 8 edit "", 32, 33 170 28 10, read box "", 35, 82 144 61 39 button "Save default", 30, 94 128 37 12 }