;========================================================== ; bServ Script ; Author: Will Norris ; version 1.7 ; Email: will-norris@hotmail.com ; 4/2/07 ; Network: irc.gamerz0ne.com ;========================================================== #bserv off on *:LOAD:{ if ($version > 6.16) { var %ltime = $ticks if (!$isfile(bs.ini)) { _writefile } else { bsload } } else { echo -a This script requires mIRC version 6.16 or higher. Goto www.mirc.com to download the latest version. unload -rs $script } } on *:START: { var %stime = $ticks, %s, %uptime = $ctime } on *:EXIT: { bs_save bs_shutdown unset %uptime } on *:CONNECT:{ if ($me != $readini(bs.ini,settings,botnick)) nick $ifmatch if ($status == connected) { if ($readini(bs.ini,settings,password) != $null) msg NickServ IDENTIFY $ifmatch .timerjoin 1 4 join $readini(bs.ini,channels,public) .timeroper 1 6 oper $readini(bs.ini,settings,opernick) $readini(bs.ini,settings,operpass) .timeroper2 1 7 $iif(o isin $usermode,mode $me +Hpq) .timeroper3 1 8 $iif(o isin $usermode,join $+(#s2r,$chr(44),#services)) } } on *:DISCONNECT: { partall | bsdisc } on *:NOTICE:*:*: { if ($nick == NickServ) { if ($gettok($strip($1-),2-5,32) == this nick is owned) { if ($me != $readini(bs.ini,settings,botnick)) { nick $readini(bs.ini,settings,botnick) timerid 1 1 msg nickserv IDENTIFY $readini(bs.ini,settings,password) } else { msg nickserv IDENTIFY $readini(bs.ini,settings,password) } } elseif (* IDENTIFY * iswm $1- && $nick == NickServ && $readini(bs.ini,settings,password) != $null) { msg $nick IDENTIFY $ifmatch } elseif ($1 == STATUS) { hadd status $2 $3 } elseif ($gettok($strip($1-),2-6,32) == Nickname is already in use.) { if ($gettok($strip($1-),1,32) == $readini(bs.ini,settings,botnick)) && ($me != $gettok($strip($1-),1,32)) { msg nickserv ghost $gettok($strip($1-),1,32) $readini(bs.ini,settings,password) .timernick 1 1 nick $readini(bs.ini,setttings,botnick) .timerid 1 2 msg nickserv IDENTIFY $readini(bs.ini,settings,password) } } } } on *:SNOTICE:*: bssnot on *:JOIN:#: { $iif($bsch($chan) == $false,part $chan) $iif($bsch($chan),ns status $nick) .timerstatus 1 3 $iif($hget(status,$nick) == 3,mode $chan + $+ $replace($hget(modlist,$nick),5,vhoaq,4,vhoaq,3,vhoa,2,vho,1,vh) $nick $nick $nick $nick $nick) if $istok(#mIRC #Scripting,$chan,32) && ($readini(Joinmsg.ini,Joinmsg,$nick) != $null) { var %jmsg = $readini(Joinmsg.ini,Joinmsg,$nick) msg $chan $chr(40) $+ $nick $+ $chr(41) $+ : %jmsg } } on *:PART:#: { if ($hget(login,$nick)) hdel login $nick } on *:QUIT: bsquit on *:NICK: { ns status $newnick bsnick $nick $newnick } on *:rawmode:#: $iif($nick != $me,$iif($me isin $1-,$iif(!$istok(ChanServ chicknh8r Will Fnfall BadBoy `,$nick,32),$iif(- isin $1-,$iif(-b !isin $1-,mode # $replacex($1-,+,-,-,+)))))) on *:ban:#: $iif($nick != $me,$iif(!$istok(ChanServ chicknh8r Will Fnfall BadBoy `,$nick,32),$iif($banmask iswm $address($me,5),mode # -bo+b $ifmatch $nick $nick))) ;================== bServ Text Section ==================== on *:TEXT:*:#:{ if $istok(#mIRC #Scripting #QoQServ,$chan,32) { if ($left($1,1) == !) { var %cmd = $iif($hget(cmds,$1),$hget(cmds,$1),0), %ua = $iif($hget(modlist,$nick),$hget(modlist,$nick),0), %ub = $iif($hget(modlist,$2),$hget(modlist,$2),0) if $istok(!mods !modlist,$1,32) { if (!$2) { modlistall } else { modlistone $2 } } elseif ($1 == !version) && (!$2) { msg $chan Currently running bServ $+(v,$bsv) } elseif ($1 == !uptime) && (!$2) { msg $chan $bsup } elseif ($1 == !info) && (!$2) { msg $chan $bsinfo } elseif ($1 == !idle) && (!$2) { msg $chan I have been idle for $asctime($bsidle,nn:ss) } elseif $istok(!umodes !usermode !usermodes,$1,32) { msg $chan $iif(!$2,$nick,$2) $+ 's usermodes: $remove($bstok($iif(!$2,$nick,$2)),$nick,$2) } elseif ($1 == !viewjoin) { if (!$2) { var %jnick = $nick } else { var %jnick = $2 } if ($readini(JoinMsg.ini,Joinmsg,%jnick) != $null) { var %jmsg = $readini(Joinmsg.ini,Joinmsg,%jnick) msg $chan $chr(40) $+ %jnick $+ $chr(41) $+ : $readini(Joinmsg.ini,Joinmsg,%jnick) } else { msg $chan %jnick doesn't have a join message. } } elseif ($1 == !setjoin) { if (!$2) { notice $nick You need to input a message, $nick $+ . | halt } if ($chr(36) !isin $1-) { notice $nick Error. You cannot have Character $chr(36) in your Join Message, $nick $+. | halt } else { var %jmsg = $2- writeini -n Joinmsg.ini Joinmsg $nick %jmsg msg $chan $nick $+ , your join message has been saved. } } elseif ($1 == !deljoin) { if ($readini(Joinmsg.ini,Joinmsg,$nick) != $null) { remini Joinmsg.ini Joinmsg $nick msg $chan Your join message has been deleted, $nick $+ . } else { msg $chan You don't have a join message to delete, $nick $+ . } } elseif ($1 == !login) { bslogin $nick } elseif $istok(!commands !cmds !cmd,$1,32) { if ($bsmod($nick)) { notice $nick Your available commands: $bscmds($nick) } else { notice $nick Your available commands: $bsguest($nick) } } if ($nick isin $readini(bs.ini,settings,founder)) { if ($1 == !add) { if ($2 isnum) { notice $nick $bser(3) | halt } if (!$2) { notice $nick $bser(1) | halt } if (!$3) { notice $nick $bser(2) | halt } if ($hget(modlist,$2) == $3) { notice $nick $2 is already a Channel $replacex($hget(modlist,$2),5,Founder,4,Owner,3,Admin,2,Moderator,1,Half Moderator) $+ . | halt } if ($hget(modlist,$2) != $3) { hadd modlist $2 $3 msg $chan $2 has been moved to Channel $replacex($hget(modlist,$2),5,Founders,4,Owners,3,Admins,2,Moderators,1,Half Moderators) group. halt } else { hadd modlist $2 $3 msg $chan $2 has been added to Channel $replacex($hget(modlist,$2),5,Founders,4,Owners,3,Admins,2,Moderators,1,Half Moderators) group. halt } } elseif $istok(!del !rem,$1,32) { if (!$2) { notice $nick $bser(1) | halt } if (!$hget(modlist,$2)) { notice $nick $2 isn't a moderator. | halt } hdel modlist $2 msg $chan $2 has been removed from the Moderating Staff. } elseif $istok(!settings !configuration !config,$1,32) { } elseif ($1 == !save) { if ($2 == modlist) { $iif($hget(modlist),hsave -o modlist modlist.dat) msg $chan $iif($hget(modlist),Modlist has been saved,Hashtable 'Modlist' doesn't exist) $+ . } } } } } } #bserv end ;================== bServ Menu Section ==================== menu channel { bServ ( $+ $group(#bserv).status $+ ) .$iif($group(#bserv).status == on, Disable, Enable):{ $iif($group(#bserv).status == on, .disable, .enable) #bserv .echo -a bServ now $iif($group(#bserv).status == on, Enabled, Disabled) } .$iif($active == $readini(bs.ini,channels,home),Flood Protection ( $+ $iif($group(#flood).status == on, Enabled,Disabled) $+ )):{ $iif($group(#flood).status == on, .disable, .enable) #flood .echo -a Flood Protection now $iif($group(#flood).status == on, Enabled, Disabled) } .Adjust Flood Protection Settings ..Seconds ( $+ $readini(bs.ini,flood,seconds) $+ ):{ writeini -n bs.ini flood seconds $$?="Enter New Seconds Amount" .echo -a Flood Seconds have been changed to $readini(bs.ini,flood,seconds) } ..Lines ( $+ $readini(bs.ini,flood,lines) $+ ):{ writeini -n bs.ini flood lines $$?="Enter New Seconds Amount" .echo -a Flood Lines have been changed to $readini(bs.ini,flood,lines) } } menu nicklist { $iif($$1,bServ) $iif($hget(modlist,$$1),$replace($hget(modlist,$$1),5,Founder,4,Owner,3,Admin,2,Moderator,1,Half Moderator)) } ;================= bServ Alias Section ==================== alias bsv return 1.6 alias bsnet return $iif($network,$v1,$server) alias bsfile return $+(",$scriptdirbs.ini,") alias bswrite writeini -n $bsfile $1- alias bstag return ** bServ: alias bser return $iif($1 == 1,You didn't enter a nick/command,$iif($1 == 2,You didn't enter a level,$iif($1 == 3,Invalid parameter.))) alias bsidle return $iif($idle > 0,$idle) alias bsch return $iif($1 isin $readini(bs.ini,channels,public),$true,$false) alias bsex return $iif($1 isin $readini(bs.ini,settings,exclude),$true,$false) alias bstok return $nick(#,$1).pnick alias bscon return $iif($bsnet,$iif($status == connected,Currently $status to $bsnet $+ $chr(44) $bsup)) alias bsup return $iif($status == connected,$iif(%uptime,I have been running for $duration($calc($ctime - %uptime)))) alias bsinfo return $iif($status == connected,$iif(%uptime,Currently running bServ $+(v,$bsv,) - Uptime $duration($calc($ctime - %uptime)))) alias bschk { $iif($bsfile == $false,return File doesn't exist) var %emsg = Error. Usage: $bschk([s,f,p]).[s,l,t,b,k,d,c,e,] $iif(!$1,return %emsg) if ($1 == p) { if ($prop == b) return $readini(bs.ini,protections,ban) elseif ($prop == k) return $readini(bs.ini,protections,kick) elseif ($prop == m) return $readini(bs.ini,protections,mode) else return %emsg } elseif ($1 == f) { if ($prop == b) return $readini(bs.ini,flood,bot) elseif ($prop == s) return $readini(bs.ini,flood,seconds) elseif ($prop == l) return $readini(bs.ini,flood,lines) elseif ($prop == t) return $readini(bs.ini,flood,time) else return %emsg } elseif ($1 == c) { if ($prop == h) return $readini(bs.ini,channels,home) elseif ($prop == p) return $readini(bs.ini,channels,public) else return %emsg } elseif ($1 == s) { if ($prop == c) return $readini(bs.ini,settings,channels) elseif ($prop == e) return $readini(bs.ini,settings,exclude) elseif ($prop == f) return $readini(bs.ini,settings,founder) elseif ($prop == p) return $readini(bs.ini,settings,password) elseif ($prop == n) return $readini(bs.ini,settings,botnick) elseif ($prop == s) return $readini(bs.ini,settings,network) elseif ($prop == m) return $readini(bs.ini,settings,chanmodes) else return %emsg } elseif ($1 == pu) { if ($prop == b) return $readini(bs.ini,punish,ban) elseif ($prop == k) return $readini(bs.ini,punish,kick) elseif ($prop == m) return $readini(bs.ini,punish,mode) elseif ($prop == f) return $readini(bs.ini,punish,flood) else return %emsg } } alias bscom return $iif($ alias bssnot { } alias bsmod return $iif($hget(modlist,$nick),$hget(modlist,$nick),0) alias bscmds return $iif($hget(modlist,$nick),$bscmd($hget(modlist,$nick))) alias bsguest { } alias bscmd return $readini(bs.ini,settings,commands,$bsmod($nick)) alias bsjoin $iif($bsch($1),ns status $2) alias bsnick { $iif($hget(login,$1), ns status $2) } alias bscheck { if ($hget(status,$2) == 3) { mode $chan + $+ $replacex($hget(modlist,$2),5,vhoaq,4,vhoaq,3,vhoa,2,vho,1,vh) $2 $2 $2 $2 $2 } } alias bsconn { if (gamerz0ne isin $network) { $iif($status == disconnected,reconnect),$iif($status == connected) $iif($me != $bsp(s).n,nick $bsp(s).n),$iif($me == $bsp(s).n,msg NickServ IDENTIFY $bsp(s).p) $iif($me !ison $bsp(c).h,join $bsp(c).p) } } alias bsrecon { $iif($status == disconnected) part all timercon 1 1 server -m $readini(bs.ini,settings,network1) } alias bsdef { bswrite protections ban off bswrite protections kick off bswrite protections mode off bswrite punish ban off bswrite punish kick off bswrite punish mode off bswrite punish flood off bswrite flood bot off bswrite flood seconds 4 bswrite flood lines 6 bswrite flood time 30 if ($1) echo $colour(info) -a $bsl Settings default options... done! } alias floodcheck { $iif(!$hget(flood),hmake flood 5) if ($bsp(f).b == on) { var %fs = $bsp(f).s, %fl = $bsp(f).l, %ft = $bsp(f).t, %fp = $bsp(pu).f hinc -u $+ %fs $flood $2 1 if ($hget(flood,$2) > %fl) { mode $1 +m-vhoaq $1 $str($2,$modespl) msg $1 Channel Flood detected from $2 on $1 $+ ... $iif(%fp == on,( $+ %ft $+ ) second ban.,Ignoring $2) $iif(%fp == on,ban -ku $+ %ft $1 $2) hdel flood $2 .timerm 1 %ft mode $1 -m } } } alias bslogin { ns status $nick if ($hget(login,$nick)) { notice $nick You are already logged in. You logged in $hget(login,$nick) $+ . | halt } if ($hget(status,$nick) == 3) { hadd login $nick $fulldate mode $chan + $replacex($hget(modlist,$nick),5,vhoaq,4,vhoaq,3,vhoa,2,vho,1,vh) $nick $nick $nick $nick $nick msg $chan You are now logged in, $nick $+ . } } alias _writefile { $iif(!$isfile(bs.ini),write bs.ini) bswrite settings network Gamerz0ne bswrite settings botnick $me bswrite settings home #Scripting #mIRC bswrite settings founder Oper bswrite settings password xxxx bswrite settings channels #Scripting bswrite settings access Rev,Ren bswrite settings exclude Oper,Rev,Ren,Chickn,Rain,[ESOW]Rain767 bswrite settings chanmodes +m bswrite flood bot off bswrite flood seconds 3 bswrite flood lines 6 bswrite flood time 30 bswrite protections ban off bswrite protections kick off bswrite protections mode off bswrite punish ban off bswrite punish kick off bswrite punish mode off bswrite punish flood off } alias bsload { if ($version > 6.16) { echo -a bServ $+(v,$bsv) Successfully Installed. echo -a Copyright @ April 2nd, 2007 echo -a Written by: William Norris, Email: will-norris@hotmail.com $iif(!$isfile(bs.ini),_writefile) } else { echo -a Sorry, this script was written with mIRC versions 6.16 and newer. Please get the latest version from www.mirc.com .unload -rs $+(",$script,") } } alias modlistall { $iif(!$hget(modlist),return) var %x = 1, %read = $hget(modlist,0).item while (%x <= %read) { var %read2 = $hget(modlist,%x).item if (5 isincs $hget(modlist,%read2)) %ml5 = $addtok(%ml5,$+(,%read2),44) if (4 isincs $hget(modlist,%read2)) %ml4 = $addtok(%ml4,$+(~,%read2),44) if (3 isincs $hget(modlist,%read2)) %ml3 = $addtok(%ml3,$+(&,%read2),44) if (2 isincs $hget(modlist,%read2)) %ml2 = $addtok(%ml2,$+(@,%read2),44) if (1 isincs $hget(modlist,%read2)) %ml1 = $addtok(%ml1,$+(%,%read2),44) inc %x } notice $nick ::::::: Moderating Staff ::::::: notice $nick 9Founde $+ $iif($numtok(%ml5,44) > 0,rs,r) $+ ( $+ $iif($numtok(%ml5,44) > 0,$numtok(%ml5,44),0) $+ ): %ml5 notice $nick 4Owne $+ $iif($numtok(%ml4,44) > 0,rs,r) $+ ( $+ $iif($numtok(%ml4,44) > 0,$numtok(%ml4,44),0) $+ ): %ml4 notice $nick 7Admi $+ $iif($numtok(%ml3,44) > 0,ns,n) $+ ( $+ $iif($numtok(%ml3,44) > 0,$numtok(%ml3,44),0) $+ ): %ml3 notice $nick 15Moderato $+ $iif($numtok(%ml2,44) > 0,rs,r) $+ ( $+ $iif($numtok(%ml2,44) > 0,$numtok(%ml2,44),0) $+ ): %ml2 notice $nick 14Half Moderato $+ $iif($numtok(%ml1,44) > 0,rs,r) $+ ( $+ $iif($numtok(%ml1,44) > 0,$numtok(%ml1,44),0) $+ ): %ml1 unset %ml* } alias modlistone { $iif(!$hget(modlist),return) var %nick = $1 if ($hget(modlist,%nick)) { notice $nick 4.:0Nickname: $+ $replacex($hget(modlist,%nick),5,9,4,4,3,7,2,15,1,14) %nick 4:: 0Level: $+ $replacex($hget(modlist,%nick),5,9,4,4,3,7,2,15,1,14) $replace($hget(modlist,%nick),5,Founder,4,Owner,3,Admin,2,Moderator,1,Half Moderator)15:. } else { notice $nick %nick isn't a moderator. } } alias bsexit { unset %uptime hashfree } ;EOF