#operscript on dialog operscript { title "OperScript by Rabbi" option dbu size -1 -1 285 180 button "ok",1, 10 10 10 10 box ,2, 2 2 280 175 list 3, 10 40 50 80 text "networks",4, 23 30 40 10 list 7, 60 40 60 80 text "glines",8, 80 30 40 10 button "del",9, 65 117 15 10 button "update",10, 94 117 20 10 edit "Info:",11, 5 10 270 10,read,autohs edit "Error:",12, 5 160 270 10,read,autohs list 13, 120 40 60 80 text "klines",14, 135 30 40 10 button "del",15, 125 117 15 10 button "update",16, 150 117 20 10 text "enter oper command to auto oper",17, 190 50 80 10 edit ,18, 190 60 80 10 button "add",19, 200 75 15 10 button "del",20, 230 75 15 10 button "help",21, 214 100 20 10 } on *:dialog:operscript:*:*: { if ($did == 0) && ($devent == init) { echo -a 10*** Welcome to OperScript by Rabbi *** echo -a 10*** It is a part of RsCrIpT *** echo -a 10*** Thanx for choosing it! *** echo -a $+($chr(3),1,$chr(44),$r(2,15),$chr(40),$chr(58),$chr(3),$chr(3),1,$chr(44),$r(2,15),$chr(40),$chr(58),$chr(3),$chr(3),1,$chr(44),$r(2,15),$chr(40),$chr(58),$chr(3),$chr(3),1,$chr(44),$r(2,16),$chr(40),$chr(58),$chr(3)) did -h $dname 1 var %x 1 while ($scid(%x)) { if ($scid(%x).network) && (!$istok($didtok($dname,3,32),$scid(%x).network,32)) { did -a $dname 3 $scid(%x).network } inc %x } } if ($did == 10) && ($devent == sclick) { if (!$did($dname,3).seltext) { var %error $input(please select any network,wo,you didnt select network!) } if ($did($dname,3).seltext) { set %glinelist $did($dname,3).seltext .remove $+(glines,%glinelist,.txt) did -i $dname 11 1 Info: updating gline list for $did($dname,3).seltext ..... did -r $dname 7 var %x 1 while ($scid(%x)) { if ($scid(%x).network == $did($dname,3).seltext) { scid %x stats g } inc %x } } } if ($did == 3) && ($devent == sclick) { if ($exists($+(glines,$did($dname,3).seltext,.txt))) { did -r $dname 7 var %x 1 while ($lines($+(glines,$did($dname,3).seltext,.txt)) >= %x) { did -a $dname 7 $gettok($read($+(glines,$did($dname,3).seltext,.txt),%x),1,32) inc %x } } if (!$exists($+(glines,$did($dname,3).seltext,.txt))) { did -o $dname 7 1 not available! ;did -o $dname 13 1 not available! did -i $dname 12 1 Error: gline list for $did($dname,3).seltext is not available } if ($exists($+(klines,$did($dname,3).seltext,.txt))) { did -r $dname 13 var %x 1 while ($lines($+(klines,$did($dname,3).seltext,.txt)) >= %x) { did -a $dname 13 $gettok($read($+(klines,$did($dname,3).seltext,.txt),%x),1,32) inc %x } } if (!$exists($+(klines,$did($dname,3).seltext,.txt))) { ;did -o $dname 7 1 not available! did -o $dname 13 1 not available! did -i $dname 12 1 Error: gline list for $did($dname,3).seltext is not available } if (% [ $+ [ $did($dname,3).seltext ] $+ [ pass ] ]) { did -i $dname 18 1 % [ $+ [ $did($dname,3).seltext ] $+ [ pass ] ] did -i $dname 11 1 Info: auto oper command for $did($dname,3).seltext has been added! click del to disable it! } if (!% [ $+ [ $did($dname,3).seltext ] $+ [ pass ] ]) { did -i $dname 18 1 not available! did -i $dname 12 1 Error: auto oper command for $did($dname,3).seltext is not available } } if ($did == 7) && ($devent == sclick) { did -i $dname 11 1 Info: $read($+(glines,$did($dname,3).seltext,.txt),w,$+(*,$did($dname,7).seltext,*)) } if ($did == 13) && ($devent == sclick) { did -i $dname 11 1 Info: $read($+(klines,$did($dname,3).seltext,.txt),w,$+(*,$did($dname,13).seltext,*)) } if ($did == 9) && ($devent == sclick) { if (!$did($dname,7).seltext) { var %sure $input(you didnt select any gline,wo,select any gline) } if ($did($dname,7).seltext) { set %rgline $did($dname,7).seltext var %sure $input(are you sure you want to remove this gline!,wyv,$did($dname,7).seltext) if (%sure == $yes) { did -d $dname 7 $did($dname,7).sel var %x 1 while ($scid(%x)) { if ($scid(%x).network == $did($dname,3).seltext) { scid %x gline $+(-,%rgline) write -dw $read($+(glines,$did($dname,3).seltext,.txt),w,$+(*,$did($dname,13).seltext,*)) } inc %x } } } } if ($did == 15) && ($devent == sclick) { if (!$did($dname,13).seltext) { var %sure $input(you didnt select any kline,wo,select any kline) } if ($did($dname,13).seltext) { set %rkline $did($dname,13).seltext var %sure $input(are you sure you want to remove this kline!,wyv,$did($dname,13).seltext) if (%sure == $yes) { did -d $dname 13 $did($dname,13).sel var %x 1 while ($scid(%x)) { if ($scid(%x).network == $did($dname,3).seltext) { scid %x kline $+(-,%rkline) write -dw $read($+(klines,$did($dname,3).seltext,.txt),w,$+(*,$did($dname,13).seltext,*)) } inc %x } } } } if ($did == 0) && ($devent == close) { unset %glinelist unset %klinelist unset %rkline unset %rgline } if ($did == 16) && ($devent == sclick) { if (!$did($dname,3).seltext) { var %error $input(please select any network,wo,you didnt select network!) } if ($did($dname,3).seltext) { set %klinelist $did($dname,3).seltext .remove $+(klines,%klinelist,.txt) did -i $dname 11 1 Info: updating kline list for $did($dname,3).seltext ..... did -r $dname 13 var %x 1 while ($scid(%x)) { if ($scid(%x).network == $did($dname,3).seltext) { scid %x stats k } inc %x } } } if ($did == 19) && ($devent == sclick) { if ($did($dname,18).text) && ($did($dname,3).seltext) { set % [ $+ [ $did($dname,3).seltext ] $+ [ pass ] ] $did($dname,18).text did -i $dname 11 1 Info: auto oper for $did($dname,3).seltext has been added with command $did($dname,18).text } if (!$did($dname,18).text) || (!$did($dname,3).seltext) { var %nopass $input(you didnt select network or didnt enter oper command!,wo,oper pass error) } } if ($did == 20) && ($devent == sclick) { if ($did($dname,18).text) && (% [ $+ [ $did($dname,3).seltext ] $+ [ pass ] ]) { unset % [ $+ [ $did($dname,3).seltext ] $+ [ pass ] ] did -r $dname 18 var %rpass $input(auto oper for $did($dname,3).seltext has been disabled!,wo,auto oper disabled!) } } if ($did == 21) && ($devent == sclick) { run http://www.unrealircd.com } } raw *:*: { if ($numeric == 223) && ($2 == G) { if ($dialog(operscript) && (%glinelist)) { did -a operscript 7 $3 write $+(glines,%glinelist,.txt) $3- } } if ($numeric == 219) && ($dialog(operscript)) { if (%glinelist) { did -i operscript 11 1 Info: gline list for $did(operscript,3).seltext has been updated! } if (%klinelist) { did -i operscript 11 1 Info: kline list for $did(operscript,3).seltext has been updated! } } if ($numeric == 481) && ($dialog(operscript)) { did -i operscript 12 1 Error: Permission Denied- You do not have the correct IRC operator privileges on $did(operscript,3).seltext } if ($numeric == 223) && ($2 == K) { if ($dialog(operscript) && (%klinelist)) { did -a operscript 13 $3 write $+(klines,%klinelist,.txt) $3- } } } on *:connect: { if (% [ $+ [ $network ] $+ [ pass ] ]) { % [ $+ [ $network ] $+ [ pass ] ] } } menu nicklist { .opercmd: ..kill: { kill $$1 $$?"enter reason" } ..gline: { kline $$1 $$?"enter duration" $$?"enter reason" } ..kline: { kline $$1 $$?"enter duration" $$?"enter reason" } } menu channel,status { .OperScript: { dialog -m operscript operscript } } #operscript end