home *** CD-ROM | disk | FTP | other *** search
- ;%%%%%%%%%%%%%%%%%%%%%%%%
- ;script ircN
- ;version 7.20
- ;author Quietust
- ;email quietust@ircN.org
- ;url http://www.ircN.org
- ;%%%%%%%%%%%%%%%%%%%%%%%%
- on 1:SOCKLISTEN:identd {
- set %i.identd 0
- :start
- inc %i.identd
- set %j.identd identd. $+ %i.identd
- if ($sock(%j.identd) == $null) sockaccept %j.identd
- else goto start
- if ($mflag(options,n0,4) == 1) echo $colour(Other) -si2 *** Identd request from $sock(%j.identd).ip
- }
- on 1:SOCKREAD:identd.* {
- if ($sockerr > 0) return
- sockread %tmp.identd
- if ($sockbr == 0) return
- sockwrite -n $sockname %tmp.identd : USERID : $readini $mircini ident system : $readini $mircini ident userid
- if ($mflag(options,n0,4) == 1) echo $colour(Other) -si2 *** Identd replied: %tmp.identd : USERID : $readini $mircini ident system : $readini $mircini ident userid
- sockclose $sockname
- }
- on 1:START {
- var %x
- if (%firstuse) set %x $false
- else set %x $true
- if (%x) iecho Disabling mIRC identd, enabling ircN identd...
- .identd off
- if ($portfree(113)) socklisten identd 113
- set %dir $deltok($shortfn($mircdir),-1,92)
- titlebar [[ Not Connected ]] [[ $strip(%ver) ]]
- ddeset
- inc %uses
- if (%delogs == start) {
- if (%x) iecho Deleting logfiles...
- delog -q
- }
- verset
- isunset
- deltemp
- var %a, %b, %y, %z
- set %a 1
- if (%x) {
- iecho Scanning for possible viruses...
- while (%script(%a)) {
- set %z $ifmatch
- titlebar [[ Not Connected ]] [[ $strip(%ver) ]] - Virus Check: File %a of $script(0)
- if ($gettok(%z,-1,46) == ini) {
- iecho Possible .INI trojan found... Unloading!
- iecho All ircN-compatible script files should end in .mrc
- unload -rs %z
- set %b 1
- while (1) {
- set %y $root $+ $nopath(%z) $+ .b $+ $iif(%b == 1,ak,$cnum(%b))
- if ($exists(%y)) inc %b
- else break
- }
- .copy %z %y
- .remove %z
- iecho Moved %z to $root and renamed to $nopath(%y) to prevent possible reinfection.
- dec %a
- }
- inc %a
- }
- iecho Trojan check completed!
- }
- if (%x) iecho Unloading unnecessary files...
- set %ircii off
- if ($alias(irc2.als)) .unload -a irc2.als
- if ($script(irc2.mrc)) .unload -rs irc2.mrc
- if ($script(irc2-2.mrc)) .unload -rs irc2-2.mrc
- if ($script(ircii.mrc)) .unload -rs ircii.mrc
- if ($script(help.mrc)) .unload -rs help.mrc
- titlebar [[ Not Connected ]] [[ $strip(%ver) ]]
- if (%x) {
- iecho Loading necessary script files...
- default.setup
- iecho Welcome to ircN!
- }
- tsound welcome
- }
- on 1:CONNECT {
- if ($mflag(options,n0,27) == 1) sockclose identd
- titlebar [[ Connected: initializing ]] [[ $strip(%ver) ]]
- mode $me %umode
- if (%delogs == connect) delog -q
- set %backtime $ctime
- set %chandump off
- set %jstats off
- set %f11 on
- set %f12 on
- .timer 0 60 online
- if (%titlebar == on) .timertb 0 3 tb
- else titlebar
- write -c $queue1
- write -c $queue2
- .timer 0 2 queuemsg
- if ($sock(irc2.*,0)) {
- set %i 0
- :irc2
- inc %i
- if ($sock(irc2.*,%i)) {
- .timer 0 40 i2.notify $sock(irc2.*,%i)
- set %timer.i2notify. [ $+ [ $sock(irc2.*,%i) ] ] $ltimer
- goto irc2
- }
- }
- if (%lag != off) set %lag 0
- if ($server($server).group) {
- if ($server($server).group == dalnet) netset $server($server).group 10
- elseif ($server($server).group == undernet) netset $server($server).group 4
- elseif ($server($server).group == chatnet) netset $server($server).group 5
- elseif (($server($server).group == austnet) || ($server($server).group == galaxynet) || ($server($server).group == othernet)) netset $server($server).group 6
- else {
- set %vercheck on
- .quote version
- }
- }
- elseif ($network) {
- if ($network == dalnet) netset $network 10
- elseif ($network == undernet) netset $network 4
- elseif ($network == chatnet) netset $network 5
- elseif (($network == austnet) || ($network == galaxynet) || ($network == othernet)) netset $network 6
- else {
- set %vercheck on
- .quote version
- }
- }
- elseif (*.dal.net iswm $server) netset DALnet 10
- elseif (*.undernet.org iswm $server) netset Undernet 4
- elseif (*.austnet.org iswm $server) netset AustNet 6
- elseif (*.galaxynet.org iswm $server) netset GalaxyNet 6
- elseif (*.chatnet.org iswm $server) netset ChatNet 5
- elseif (*.othernet.org iswm $server) netset OtherNet 6
- else {
- set %vercheck on
- .quote version
- }
- if (%firstuse) {
- iecho Type $hc(/aj #ircN) now to add #ircN to autojoin...
- unset %firstuse
- set %firstjoin $true
- .save -rv vars.mrc
- }
- if (%awaytime != $null) {
- if (%stayaway == on) .quote away : $+ %awaymsg
- else unset %awaytime %awaymsg
- }
- iunset
- wcln
- cclr
- online
- splash
- tsound connect
- }
- on 1:DISCONNECT {
- if ($portfree(113)) socklisten identd 113
- if ($window(@Splash)) .timer 1 1 window -c @Splash
- titlebar [[ Not Connected ]] [[ $strip(%ver) ]]
- .timers off
- tsound disconnect
- if (%cookie) {
- .timer 1 600 unset %cookie
- set %cookie.timer $ltimer
- }
- }
- on 1:INPUT:# {
- if ((%inputcatch == on) || ($left($1,1) == $readini -n $mircini text commandchar) || ($0 == 0)) return
- if ((%nc == on) && ($right($1,1) == %nch) && ($1 != %nch) && ($chr(44) !isin $getleft($1)) && ($chr(40) !isin $getleft($1)) && ($chr(41) !isin $getleft($1))) {
- if ($nc($1,$chan)) say $ncomp($nc($1,$chan)) $2-
- else say $1-
- halt
- }
- else {
- say $1-
- halt
- }
- }
- on 1:JOIN:# {
- if ((%firstjoin) && ($nick == $me)) .timer 1 0 firstjoin
- if (%bt.dont.trigger == on) {
- inc %bt.dont.trigger.joins
- timoff %bt.dont.timer bt.dont.timer
- if (%bt.dont.trigger.joins > $sub(%numsplitnicks,%bt.maxjoins)) {
- unset %bt.dont.trigger %bt.dont.trigger.joins
- timoff %bt.dont.timer2 bt.dont.timer2
- }
- else {
- .timer 1 10 unset %bt.dont.trigger.joins
- set %bt.dont.timer $ltimer
- }
- }
- if ($nick == $me) {
- if ($findtok(%cyclechannels,$chan,1,44)) set %cyclechannels $remtok(%cyclechannels,$chan,1,44)
- set %joinedchans $addtok(%joinedchans,$chan,44)
- .who $chan
- }
- if (%colnick == on) colupdt $chan $nick
- if ((%auto == on) && ($nick != $me)) {
- if ($readini -n $td(onjoin.txt) $chan notice) qnotice $nick $readini -n $td(onjoin.txt) $chan notice
- if ($readini -n $td(onjoin.txt) $chan msg) qmsg $nick $readini -n $td(onjoin.txt) $chan msg
- if ($readini -n $td(onjoin.txt) $chan ctcp) qctcp $nick $readini -n $td(onjoin.txt) $chan ctcp
- }
- if (%info == on) {
- if ($infoline($usr($nick),$chan)) msg $chan %lb $+ $nick $+ %rb $infoline($usr($nick),$chan)
- elseif ($infoline($usr($nick))) msg $chan %lb $+ $nick $+ %rb $infoline($usr($nick))
- }
- if (($ulevel == 20) && ($sd($nick,$chan))) {
- if ($me isop $chan) {
- set %tmp $readini -n bans.ini $ulist($fulladdress,20,1) reason
- .quote mode $chan +b $ulist($fulladdress,20,1) $+ $crlf $+ kick $chan $nick :banned: $deltok(%tmp,1,32)
- }
- }
- if (($me isop $chan) && ($ulevel == 40)) {
- if (($chkflag($usr($nick),$chan,o)) && ((($chkflag($usr($nick),$null,b)) && (%opbot == on)) || ($chkflag($usr($nick),$chan,a)))) mode $chan +o $nick
- if ($chkflag($usr($nick),$chan,v)) mode $chan +v $nick
- if ($chkflag($usr($nick),$chan,k)) kbc $chan $nick ...and don't come back.
- }
- }
- on 1:QUIT {
- if (%autocycle == on) .timer 1 0 doquitcheck
- if (%netsplit == on) {
- if (($3) || ($2 == $null) || ($1 == $2) || (รก isin $1-) || ($ isin $1-) || (. !isin $2) || (. !isin $1) || (ircII* iswm $1)) return
- elseif (($1 == %split11) && ($2 == %split22)) {
- ns.nick $nick [ $1 ] $+ & $+ [ $2 ]
- inc %numsplitnicks
- if (%numsplitnicks > %bt.maxjoins) {
- set %bt.dont.trigger on
- .timer 1 900 unset %bt.dont.trigger
- timoff %bt.dont.timer2 bt.dont.timer2
- set %bt.dont.timer2 $ltimer
- }
- }
- elseif ((irc*.* iswm $1) || (irc*.* iswm $2) || (*.com iswm $1) || (*.com iswm $2) || (*.net iswm $1) || (*.net iswm $2) || (*.edu iswm $1) || (*.edu iswm $2) || (*.Org iswm $1) || (*.Org iswm $2)) {
- set %split11 $1
- set %split22 $2
- set %split2 $replace($2,*,irc)
- ns.serv $1 $2
- ns.nick $nick [ $1 ] $+ & $+ [ $2 ]
- if ($form(other,split)) {
- iecho $readini %formats other split
- if ($form(other,split2)) iecho $readini %formats other split2
- if ($form(other,split3)) iecho $readini %formats other split3
- if ($form(other,split4)) iecho $readini %formats other split4
- }
- else {
- iecho Netsplit detected at $hc($atime) between $hc($1) and $hc($2)
- iecho Press $hc(sF10) to see who split away.
- }
- set %f11cmd irc2 %split2 6667
- if ($form(other,splitjoin)) {
- iecho $readini %formats other splitjoin
- if ($form(other,splitjoin2)) iecho $readini %formats other splitjoin2
- }
- else iecho To join split ( $+ $hc(%split2) $+ ) in an irc2 session, press $hc(F11) $+ .
- .timer 1 240 wcln
- tsound split
- }
- else return
- }
- }
- on 1:CTCPREPLY:PING * {
- if ($left($2,1) == $) {
- iecho PING reply exploit detected from $hc($nick) $rbrk($address) $+ : $ac($2-)
- halt
- }
- elseif (($calc($2) !isnum) && ($2 != $null)) {
- iecho CTCP $hc(PING) $sc(reply) from $+ $hc($nick) $+ : $2-
- halt
- }
- elseif ($2 == $null) {
- iecho CTCP $hc(PING) $sc(reply) from $+ $hc($nick) $+ .
- halt
- }
- elseif ($2 isnum) {
- set %pt $abs($rrpt($sub($ticks,$2)))
- if (%pt <= 0) {
- if ($form(ctcpreplies,ping0)) iecho $readini %formats ctcpreplies ping0
- else iecho CTCP $hc(PING) $sc(reply) from $+ $hc($nick) $+ : 0 seconds
- }
- elseif ($form(ctcpreplies,ping)) iecho $readini %formats ctcpreplies ping
- else iecho CTCP $hc(PING) $sc(reply) from $+ $hc($nick) $+ : $iduration(%pt)
- set %ctcprrec [ $+ $nick $+ ( $+ $address $+ )] $1 $+ : $iduration(%pt)
- if ($nick != $me) && (%autoping == on) qnotice $nick Your ping reply was $iduration(%pt) $+ .
- unset %pt
- }
- halt
- }
- on 1:CTCPREPLY:* {
- if ($1- == $null) halt
- if ($chr(36) isin $1-2) {
- iecho Invalid CTCP reply detected from $hc($nick) $rbrk($address) $+ : $ac($1-)
- halt
- }
- if (($1 == LAGSTAT) && ($nick == $me) && (%lag != off)) {
- if ($2 isnum) {
- set %pt $abs($rrpt($sub($ticks,$2)))
- set %lag $iif(%pt < 0,0,%pt)
- halt
- }
- }
- set %ctcprrec [ $+ $nick $+ ( $+ $address $+ )] $1 $+ : $2-
- if ($form(ctcpreplies,other)) iecho $readini %formats ctcpreplies other
- else iecho CTCP $hc($1) $sc(reply) from $u($hc($nick)) $+ $cpms($2-)
- halt
- }
- on 1:BAN:# {
- if (($me isop $chan) && ($banmask iswm $ulist($banmask,40,1)) && ($chkflag($usrh($banmask),$chan,f)) && (($chkflag($usr($nick),$chan,m) == $false) || ($chkflag($usr($nick),$chan,b) == $false))) {
- if (%protdeop == on) mode $chan -ob $nick $banmask
- else mode $chan -b $banmask
- qnotice $nick Sorry, that hostmask ( $+ $usrh($banmask) $+ ) is protected.
- }
- if (($me isop $chan) && (%f11 == on) && ($nick != $me)) {
- if ($chan != $active) {
- if ($form(other,chanban)) iecho $readini %formats other chanban
- else iecho $hc(BAN) [ $+ $chan $+ ]: $rbrk($banmask) placed by $hc($nick) $+ .
- }
- if ($form(other,ban)) iecho $readini %formats other ban
- else iecho To remove ban press $hc(F11) $+ .
- set %f11 off
- .timer 1 7 set %f11 on
- set %f11cmd mode $chan -b $banmask
- }
- if ((%kickonban != on) || ($chkflag($usr($nick),$null,b))) return
- set %tmp.kb 0
- :start
- inc %tmp.kb
- set %tmpmask $ialchan($banmask,$chan,%tmp.kb)
- if (%tmpmask) {
- set %tmpnick $ialchan($banmask,$chan,%tmp.kb).nick
- if ($me isop $chan) {
- if ((%tmpnick == $me) && ($nick != $me)) .quote mode $chan -ob $nick $banmask $+ $crlf $+ kick $chan $nick : $+ %bankick
- elseif (%tmpnick == $me) .quote mode $chan -b $banmask
- elseif (%tmpnick == $nick) .quote mode $chan -ob $nick $banmask $+ $crlf $+ kick $chan $nick :insanity check -- user attempted to ban self
- elseif ($chkflag($usr(%tmpnick),$chan,f)) goto start
- elseif ($level(%tmpmask) != 20) {
- iecho $hc(%tmpnick) has been banned from $brkt($chan) by $sc($nick) $+ , kicking...
- .quote kick $chan %tmpnick :banned
- }
- }
- goto start
- }
- }
- on 1:UNBAN:# {
- if (($me isop $chan) && (%f11 == on) && ($nick != $me)) {
- if ($chan != $active) {
- if ($form(other,chanbanrem)) iecho $readini %formats other chanbanrem
- else iecho $hc(BAN) [ $+ $chan $+ ]: $rbrk($banmask) removed by $hc($nick) $+ .
- }
- if ($form(other,banrem)) iecho $readini %formats other banrem
- else iecho To redo ban press $hc(F11) $+ .
- set %f11 off
- .timer 1 7 set %f11 on
- set %f11cmd mode $chan +b $banmask
- }
- }
- on 1:INVITE:* {
- if (($chkflag($usrh($fulladdress),$null,b)) || ($chkflag($usrh($fulladdress),$null,m))) {
- if ($form(other,inviteajoin)) iecho $readini %formats other inviteajoin
- else iecho Autojoining $hc($chan) by the request of $hc($nick) $rbrk($address)
- join $chan
- }
- else {
- if (%f11 == on) {
- set %f11 off
- .timer 1 7 set %f11 on
- set %f11cmd join $chan
- set %f12cmd ckb $nick %ckb
- if ($com.opchannels($nick)) {
- if ($form(other,inviteopjoin)) {
- iecho $readini %formats other inviteopjoin
- if ($form(other,inviteopjoin2)) iecho $readini %formats other inviteopjoin2
- }
- else iecho To join $hc($chan) press $hc(F11) $+ , to kickban press $hc(F12) $+ .
- }
- else {
- if ($form(other,invitejoin)) {
- iecho $readini %formats other invitejoin
- if ($form(other,invitejoin2)) iecho $readini %formats other invitejoin2
- }
- else iecho To join $hc($chan) press $hc(F11) $+ .
- }
- }
- }
- tsound invite
- }
- on 1:TEXT:*:# {
- if ((%autoping == on) && ((ping me * iswm $1-) || (* ping me * iswm $1-) || (* ping me iswm $1-))) qctcp $nick PING $ticks
- if (($away) && (%announce == on)) {
- if (($me isin $1-) || ((%altnick1 isin $1-) && (%altnick1 != $null)) || ((%altnick2 isin $1-) && (%altnick2 != $null))) {
- if ($findtok(%knowaway,$nick,1,44) == $null) {
- set %knowaway $addtok(%knowaway,$nick,44)
- if (%saytype == notice) .notice $nick I am away, $b(%awaymsg) [log: $+ $upper(%msglog) $+ ] [page: $+ $upper(%pager) $+ ] $e-mail($email) $uin(%uin) Gone for $b($gone)
- elseif (%saytype == action) .describe $nick is away, $b(%awaymsg) [log: $+ $upper(%msglog) $+ ] [page: $+ $upper(%pager) $+ ] $e-mail($email) $uin(%uin) Gone for $b($gone)
- elseif (%saytype == channel) describe $chan is away, $b(%awaymsg) [log: $+ $upper(%msglog) $+ ] [page: $+ $upper(%pager) $+ ] $e-mail($email) $uin(%uin) Gone for $b($gone)
- }
- }
- }
- if ((%decrypt == on) && ($1 == ]) && ($2 != $null)) {
- crypt 1 %encryptpw $2-
- echo -ti2 $chan < $+ $pst($nick,$chan) $+ : $+ $hc(crypt) $+ : $+ $sc(%encryptpw) $+ > $result
- }
- if ((%chandump == on) && ($isvalidchan(%dchans,$chan))) echo %duchan < $+ $hc($nick) $+ : $+ $sc($chan) $+ > $1-
- if (($me isin $1-) || (%shortnick isin $1-)) {
- set %lsnick $nick
- if ($chan != $active) {
- set %tmp $1-
- if (%shownick == on) set %tmp $replace(%tmp,$me,$addtok($hc($me),,0))
- if (%showword == on) set %tmp $replace(%tmp,%shortnick,$addtok($hc(%shortnick),,0))
- if (%tmp == $1-) return
- else iiecho < $+ $nick $+ : $+ $sc($chan) $+ > %tmp
- }
- }
- }
- on 1:ACTION:*:# {
- if ((%chandump == on) && ($isvalidchan(%dchans,$chan))) echo %duchan * $hc($nick) $+ : $+ $sc($chan) $1-
- if (($me isin $1-) || (%shortnick isin $1-)) {
- set %lsnick $nick
- if ($chan != $active) {
- set %tmp $1-
- if (%shownick == on) set %tmp $replace(%tmp,$me,$hc($me))
- if (%showword == on) set %tmp $replace(%tmp,%shortnick,$hc(%shortnick))
- if (%tmp == $1-) return
- else iiecho * $nick $+ : $+ $sc($chan) %tmp
- }
- }
- }
- on 1:NOTICE:*:# {
- if ((%chandump == on) && ($isvalidchan(%dchans,$chan))) echo %duchan - $+ $hc($nick) $+ : $+ $sc($chan) $+ - $1-
- if (($me isin $1-) || (%shortnick isin $1-)) {
- set %lsnick $nick
- if ($chan != $active) {
- set %tmp $1-
- if (%shownick == on) set %tmp $replace(%tmp,$me,$hc($me))
- if (%showword == on) set %tmp $replace(%tmp,%shortnick,$hc(%shortnick))
- if (%tmp == $1-) return
- else iiecho - $+ $nick $+ : $+ $sc($chan) $+ - %tmp
- }
- }
- }
- on 1:TOPIC:# {
- if ($isvalidchan(%hchan,$chan)) {
- if (($me !isop $chan) && (t isin $chan($chan).mode)) return
- if ($nick != $me) {
- topic $chan %holdtopic. [ $+ [ $chan ] ]
- qnotice $nick Topic for $chan is HELD
- }
- else set %holdtopic. [ $+ [ $chan ] ] $chan($chan).topic
- }
- }
- #notify on
- on 1:NOTIFY { .quote userhost $nick }
- on 1:UNOTIFY {
- if ((%getnick == on) && (GetNick. isin $notify($nick).note)) {
- .quote nick $nick
- set %getnick off
- iecho Regained nickname $hc($nick) $+ , GetNick disabled.
- if ($notify($nick).note == GetNick.temp) .notify -r $nick
- else .notify $nick $deltok($notify($nick).note,$gettok($notify($nick).note,0,32),32)
- }
- elseif ($form(notify,left)) iecho $readini %formats notify left
- else iecho $hc($nick) has left IRC.
- halt
- }
- #notify end
-