Irc-Companion — File Browser
Irc-Companionv10.78 / Irc-Companionv10.78 / IrcCompanion / IRC-Companion.mrc
IRC-Companion.mrc — 105.65 KB — Download this file
;Thanks to, nightquest and source for their suggestions and bug reports.
;Special thanks to nightquest for his help with the beautiful GUI of the dialogs.
;Voted the most useful script in 2007
;Voted best spam shield in 2007
;;;;;
;blacklist added. Use /blacklist user and /blacklist -r user/address
;/black to open the dialog. double click to delete addresses
;;;;;;;;;;;;;;;;;;;;;;;;;
;The dialog is clickable intelligent. For example double click on a channel or network, it will either identify you to the channel join the network or oper you
;-depending on what window you are in.
;double click the main dialog for surprise options.
;;;;;;;;;;;;;;;;;;;;;;;;
;credits
;a special thankyou to hixxy for allowing me to implement his paste control into the script.
;Special care has been taken not to change or hijack the users mIRC's GUI, i strongly believe in letting the user choose his theme.
;this script can be used alongside any theme a user may choose.
;all suggestions/bugs made via the bug dialog will be attended to within 48 hours.
;irc companion logo hosted on http://img120.imageshack.us/my.php?image=irccomplogowp7.png
;Irc-Companion The Operating System for IRC.
;contact irccompanion@gmail.com
;final supported version.
;
;signed, Weaver AKA Shy AKA spyder IRC.hackthissite.org #help Gedalya Shalom.
;Concept, created by weaver. 01/12/2005
;coded by Weaver.
;copyright
;If you need any scripting help please join our forums on http://recelate.net/forums/ where we will deal with your request
;if you are good enough to become a moderator and reply to users questions please do so.
;######################################################################
;#Irc-Companion, is designed to assist,protect and aid you whilst you #
;#are on IRC, it can do just about anything whilst providing constant #
;#and silent protection on IRC. From showing you the irc opers and ban#
;#& kick protection, to clone scanning and highlighting users who are #
;#set to away,it will assist and aid in almost every decision you make#
;#on IRC. Some features you may never know about, but be assured that #
;#Irc-Companion will become integral to your mIRC experience. ; ; ; ; #
;#Many Thanks to those at mirc.com for their advice and assistance. #
;#I Hope you enjoy your IRC-experience with irc-companion. #
;######################################################################
alias irc_comp_version { return 10.78 }
#events off
;
#events end
on *:start: {
set -e %loadtime $ticks
if ($findfile($mircdir,irc*,0,1) >= 1) { irc_comp_upgrade1 }
irc_comp_start
irc_comp_motd
if (%irc_welcome) { irc_welcome | unset %irc_welcome }
}
alias -l irc_comp_start {
noop $findfile($scriptdir,irccomp_*,0,1,irc_comp_hload $nopath($1-))
noop $findfile($scriptdir,irc_comp_*,0,1,irc_comp_hload $nopath($1-))
if (!$isfile($ircdir(irc_complogo.png))) {
var %quest = $?!="Fatal error, the irc companion logo file (irc_complogo.png) is missing from the mIRC directory. This will cause many errors in the script. $&
the logo can be downloaded from image shack and should be placed in the $scriptdir(irc_complogo.png) as irc_complogo.png Should i open your browser to link to the image file?",
if (%quest == $true) run http://img120.imageshack.us/img120/2144/irccomplogowp7.png
}
if ($group(#events) == on) { win }
.cnick on
irc_comp_quote
echo $color(info) -s * Irc-Companion (ver $irc_comp_version $+ ) successfully loaded in $calc(($ticks - %loadtime) / 1000) seconds.
unset %loadtime
if (%irc_comp_greet) { echo -s * $$read($ircdir(icquotes.txt)) }
if ($status != connected) irc_comp_aconnect
}
alias -l irc_comp_hload {
if (!$hget($1)) .hmake $1 10
$iif($isfile($ircdir($1)),.hload $1 $ircdir($1))
}
alias ircdir { return $qt($+($scriptdir,$1)) }
on *:connect: {
if (!$hget(irccomp_aconnect,$network)) {
.hadd -m irccomp_aconnect $network $server
.hsave irccomp_aconnect $ircdir(irccomp_aconnect)
}
if $isfile($ircdir($+(irccomp_autocsid.,$network))) { irc_comp_cs_id }
if !$timer(awaychk) { .timerawaychk 0 180 away.names }
$+(.timerwhochanserv,$network) 1 3 /if ($status == connected) who chanserv
if ($group(#lag.check) == on) { lag.chk }
set -e $+(%,irc_comp_ocheck,$cid) 1
if $($+(%,irc.comp.oper.,$network),2) { irc_comp_oper }
if $isfile($ircdir($+(irccomp_ajoin.,$network))) { $+(.timerajoin,$network,$cid) 1 2 irc_comp_ajoin }
if ($group(#events) == on) { write.events }
$+(.timerechosp,$network) 1 2 { echo $color(info) -s * /Irc companion: Spam protection shield is $iif($($+(%,spamprotect,.,$network),2),active,turned off) on $+($network,.) }
if $($+(%,irc_comp_id_con,_,$network),2) {
if $($+(%,irc_comp_ident,_,$network),2) { $iif($hget(irc_comp_modes, $+ $network),$v1,.msg nickserv identify)) $($+(%,irc_comp_ident,_,$network),2) }
}
}
on !*:rawmode:#: {
if ($1 == -r) { unset %irc_comp_identified* }
if ($group(#events == on)) && ($2 == $me) {
win
aline 12 @events $timestamp
aline @events $chan
aline @events You were given 4 $+ $left($1,2) $+ status by $+(7,$nick,) $iif($scon(0) > 1, on $network $+ .)
aline @events -
}
}
ctcp *:*:*: {
if $($+(%,spamprotect,.,$network),2) { inc -u12 $+(%,ctcpfld,$network) }
if ($($+(%,ctcpfld,$network),2) > 6) {
idialog Shield has detected a CTCP flood on $+($network,:) Auto Ignoring CTCP's for five minutes.
.ignore -tu300 @
echo $color(info) -a * /Irc Companion: 7,1Shield: Setting other protective modes...
mode $me +RT
.flood +c on
}
if ($group(#events) == on) {
win
aline @events $timestamp
echo @events 4CTCP detected from $+($nick,.) $iif($scon(0) > 1, on $network $+ .)
aline @events $1-
aline @events $chr(160)
}
}
on ^*:text:*:#: {
var %line = $strip($1-),%notify = $iif($me isin %line,$true)
if ($istok(%line,away,32)) { $+(.timeraway,$wildsite) 1 3 away.names }
if $($+(%,spy,$nick,$cid),2) {
if (!$window($+(@spy,$chr(44),$nick,$chr(44),$cid))) { spy $nick }
echo 4 -t $chan $+(<,$nick,>,$chr(32),$1-)
echo -e $+(@spy,$chr(44),$nick,$chr(44),$cid) 4 $+ $timestamp $+($nick,:) $+($chan,:,$chr(32),$1-)
haltdef
}
if (%notify) {
if ($group(#events) == on) {
win
beep 3 3 @events
echo -f @events $timestamp
aline 12 @events $chan
aline @events 4HIGHLIGHT TRACKER: $iif($scon(0) > 1, on $network $+ .)
aline 7 @events $+($nick,:)
aline -p @events %line
aline @events $chr(160)
}
if (%irc_comp_hlight) {
if ($active == $chan) && ($appactive) || ($($+(%,irc_comp,highlight.,$wildsite),2) >= 3) { return }
$iif($appactive = $true,echo -a * $timestamp 4Highlight $nick in $chan said $qt(%line),systray $nick $chan $qt(%line)))
inc -u10 $+(%,irc_comp,highlight.,$wildsite)
}
}
}
on *:action:*:#: {
var %action = $strip($1-),%notify = $iif($istok($1-,$me,32),$true)
if (away isin %action) || (back isin %action) { $+(.timeraway,$cid) 1 4 away.names }
if $($+(%,spy,$nick,$cid),2) {
if (!$window($+(@spy,$chr(44),$nick,$chr(44),$cid))) { spy $nick }
aline -e $+(@spy,$chr(44),$nick,$chr(44),$cid) 4 $+ $timestamp 12 $+($chr(32),$chan,:,$chr(32),$chr(42),$chr(32),$nick,:,$chr(32),%action)
}
if (%notify) {
if ($group(#events) == on) {
aline 12 @events $timestamp
aline 12 @events $chan
aline @events 4ACTION Tracker $iif($scon(0) > 1, on $network $+ .)
aline 12 @events $nick $1-
aline @events $chr(160)
}
if (%irc_comp_hlight) {
if ($active == $chan) && ($appactive) || ($($+(%,irc_comp,highlight.,$wildsite),2) >= 3) { return }
$iif($appactive = $true,echo -a * $timestamp 4Action highlight $nick in $chan * $qt(%action),systray $nick $chan $qt(%action)))
inc -u10 $+(%,irc_comp,highlight.,$wildsite)
}
}
}
on *:notice:*:?: {
if ($nick == nickserv) {
if $regex($1-,/(changed|registered)/g) { $+(.timerwho,$me,$cid) 1 3 who $me }
var %inf = $hget(irc_comp_modes, $+ $network)
if ($istok($1-,identify,32)) {
if $($+(%,irc_comp_id_con,_,$network),2) { return }
if !$($+(%,irc_comp_ident,_,$network),2) { $+(.timerns,$network) 1 4 idialog You were asked to provide a nickserv password. $&
no nickserv password has been set for $+(network,$chr(44)) please use F4 to set one.
return
}
if $($+(%,irc_comp_ident,_,$network),2) { $iif($hget(irc_comp_modes, $+ $network),$v1,.msg nickserv identify)) $($+(%,irc_comp_ident,_,$network),2) }
$+(.timer_regchk,$me,$network) 1 3 who $me
if $($+(%,irc_comp_chanserv_,$network),2) { irc_comp_cs_id | unset $+(%,irc_comp_chanserv_,$network),2) }
}
}
if ($nick == chanserv) && ($isfile($ircdir($+(irccomp_autocsid.,$network)))) && (Password authentication isin $1-) {
set -e $+(%,irc_comp_chanserv_,$network) 1
$+(.timerchanserv,$network,$cid) 1 4 { idialog I attempted to identify to chanserv with your settings, $&
but you are not identified to nickserv. I will re-attempt when you ident to nickserv }
}
if ($right($nick,4) == serv) || ($cnick($nick).color) { return }
if $($+(%,spamprotect,.,$network),2) { inc -u10 $+(%,noticefld,$network) }
if ($($+(%,noticefld,$network),2) > 6) {
echo $color(info) -a * /Irc Companion: has detected a Notice flood on $+($network,:) Auto Ignoring Notices's for two minutes and taking protective measures.
.ignore -nu120 @ | mode $me +R
silence + $+ $wildsite
}
if ($group(#events) == on) {
win
aline 12 @events $timestamp
aline @events Private 7NOTICE detected from 12 $nick $iif($scon(0) > 1, on $network $+ .)
aline -p 4 @events $$1-
aline @events $chr(160)
}
}
#oper on
on ^*:snotice:*: {
if (o isin $usermode) {
if (!$window($+(@,Server.,$network))) { window -kenv $+(@,Server.,$network) }
var %notice = $1-,%color = $iif($istok(%notice,client,32),$color(info)),%whois = $iif($istok(%notice,/whois,32),$true)
aline -hp $+(@,Server.,$network) $logstamp $+ $iif(%color,%color,4) $+ $remove($1-,*** Notice -- $+ $Chr(32))
if (%whois) { echo $color(info) -a 4* /Irc companion: $logstamp $2 $3 did a 4/whois on you, please check your server notice window for more information. }
halt
}
}
#oper end
#banprotection on
on !*:ban:#: {
if ($banmask iswm $address($me,5)) {
var %op_status = $iif(($me isop # || o isin $usermode),$true)
if (%op_status) {
mode # -ob $nick $banmask
ban -k # $nick 2 Ban protection
if (e isin $chanmodes) { mode $chan +ee $me $address($me,2) }
}
if ($group(#events) == off) return
aline @events $timestamp
aline 5 @events $chan
aline @events 4BAN TRACKER $iif($scon(0) > 1, on $network $+ .)
aline @events you were $upper(banned) by 7 $nick
aline @events Attempting to rectify...
aline @events $chr(160)
}
}
#banprotection end
on *:kick:#: {
if $($+(%,spy,$knick,$cid),2) { aline -p 4 $+(@spy,.,$knick,.,$cid) $timestamp $knick has been kicked from $chan by $nick $1- }
if $($+(%,spy,$nick,$cid),2) { aline -p 4 $+(@spy,$chr(44),$nick,$chr(44),$cid) $nick has kicked $knick from $chan }
if ($knick == $me) {
inc -u10 $+(%,kick,$cid)
var %chan = $chan
if ($($+(%,kick,$cid),2) <= 3) { $+(.timerkick,%chan,$cid) 1 3 if $me !ison %chan join -n %chan }
if ($active != %chan) { echo $color(info) -a * /Irc Companion: You were kicked from $chan by $nick }
if ($group(#events) == on) {
win
aline 5 @events $chan
aline 12 @events $timestamp
aline 4 @events $upper(kick tracker) $iif($scon(0) > 1, on $network $+ .)
aline @events you were $upper(kicked) by 7 $nick $1-
aline @events Attempting to rectify...
aline @events $chr(160)
}
}
if $($+(%,spy,$nick,$cid),2) {
if (!$window($+(@spy,$chr(44),$nick,$chr(44),$cid))) { spy $nick }
echo -e $+(@spy,$chr(44),$nick,$chr(44),$cid) 4 $+ $timestamp $nick $1-
}
}
on me:*:join:#: {
set -u7 $+(%,spamcheck,.,$network) 1
if !$timer(awaychk) { .timerawaychk 0 180 away.names }
}
on !*:join:#: {
$+(.timerjoincheck,$wildsite,$cid) 1 3 irc_join_check $nick $chan
if $($+(%,spy,$nick,$cid),2) { aline -hp 2 $+(@spy,$chr(44),$nick,$chr(44),$cid) $timestamp $nick has joined $chan }
if (!%irc_comp_blacklist) {
var %op_status = $iif(($me isop # || o isin $usermode),$true)
if (%op_status) {
var %reason = $iif($gettok($hget(irc_comp_blacklist,$address($nick,2)),4-,32),$v1,no reason)
if ($hfind(irc_comp_blacklist,$address($nick,2))) { ban -k # $nick 2 blacklisted, %reason | inc %irc_comp_kick }
}
}
}
on !*:part:#: { if $($+(%,spy,$nick,$cid),2) { aline -hp 4 $+(@spy,$chr(44),$nick,$chr(44),$cid) $timestamp $nick has left $chan 12 $+ $1- } }
raw 366:*: {
if $($+(%,spamcheck,.,$network),2) {
if ($nick($2,0) < 650) { $+(.timerwho,$2,$cid) 1 3 if ($me ison $$2) who $$2 }
else idialog Due to large amount of users on $2 no attempt will be made to get the user addresses as it may d/c you, your scanners will be affected. to do it manually type /who $2
}
}
on *:nick: {
$+(.timerwho,$newnick,$network,$cid) 1 5 who $newnick
if $($+(%,ircop,$cid,.,$nick),2) { unset $+(%,ircop,$cid,.,$nick) }
if $($+(%,spy,$nick,$cid),2) {
unset $+(%,spy,$nick,$cid),2)
set -e $+(%,spy,$newnick,$cid),2) 1
aline $+(@spy,$chr(44),$nick,$chr(44),$cid) -
aline 7 $+(@spy,$chr(44),$nick,$chr(44),$cid) $timestamp $nick has now changed to $+($newnick,.) auto tracking $+($newnick,...)
aline $+(@spy,$chr(44),$nick,$chr(44),$cid) -
echo $color(info) -a * /Irc Companion: 9,1Spyed on user $nick has changed nicks, following new nick $newnick
renwin $+(@spy,$chr(44),$nick,$chr(44),$cid) $+(@spy,.,$newnick,.,$cid) | titlebar $+(@spy,.,$newnick,.,$cid) Spy module: currently spying on 4 $+ $newnick $+ $network
}
}
on *:op:#: {
if (!%irc_comp_blacklist) && ($opnick == $me) {
var %i = 1,%c = 1
while ($nick(#,%i)) {
var %addr = $address($v1,2)
if ($v1 != $me) && ($hfind(irc_comp_blacklist,%addr)) { $iif((%c > 5),.timer 1 %c) ban -k # $nick(#,%i) 2 Blacklisted, $gettok($hget(irc_comp_blacklist,%addr),4-,32) | inc %c }
inc %i
}
}
}
on *:quit: {
if $query($nick) { echo $color(info) -t $query($nick) /Irc-Companion: * $nick $+([,$address,]) has now quit. }
inc -u1 $+(%,quit,$network,$active)
if $($+(%,ircop,$cid,.,$nick),2) { set -e $+(%,ircop,$cid,.,$nick) This oper has now quit $network at $timestamp with the the quit message $1- }
if (%usrname) && ($nick == %usrname) { nick %usrname | echo $color(info) -a * /Irc Companion: Auto changed back to $+(%usrname,.) Please identify if %usrname is password protected | unset %usrname }
if ($($+(%,quit,$network,$active),2) == 7) { echo $color(info) -a * /Irc companion: Possible 7NetSplit or server crash detected on 4 $+ $network $+ , please check your 4lag status in the titlebar and be prepared to 4PING out. }
if $($+(%,spy,$nick,$cid),2) {
aline 7 $+(@spy,$chr(44),$nick,$chr(44),$cid) -
aline -hp 12 $+(@spy,$chr(44),$nick,$chr(44),$cid) $timestamp $nick has quit $+(IRC,:) 7 $+ $1-
aline 7 $+(@spy,$chr(44),$nick,$chr(44),$cid) -
}
}
on 1:input:@raw: {
if ($left($1,1) == /) {
aline @raw $+(4,<<,$chr(32),$1-)
raw $remove($1-,$chr(47))
haltdef
}
}
#lag.check on
on 1:active:*: {
if ($activecid != $lactivecid) && ($status == connected) {
if ($dialog(favourites)) { dialog -x favourites }
titlebar Checking lag to $+($network,...)
irc_comp_lag
}
}
on ^*:pong: {
var %irc_comp_lag = $calc($ctime - $2)
titlebar %irc_comp_lag $iif((%irc_comp_lag > 1),secs,sec) $+($chr(32),lag,$chr(32),to,$chr(32),$network,:) $iif((%irc_comp_lag > 3),Alert please check your connection on $network as a significant lag has been detected.)
if (%irc_comp_lag > 1000) { idialog * I have detected a possible conflict with another lag script which causes errors, i am auto disabling Irc-Companions lag script to prevent confusion and error messages.. | lag.stat | return }
if (%irc_comp_lag > 3) && !$($+(%,lag1,$cid),2) {
set -u2000 $+(%,lag1,$cid) done
raw pong $rand(100,9999)
if ($active ischan) { echo $color(info) -a * /Irc Companion: Lag Alert: You have a %irc_comp_lag seconds lag to $+($network,:) please check your connection, 14(note this could be due to a proxy or to excess text being sent to $+($server,.) $+ ) $iif(%irc_comp_lag > 60,4Fatal error: you may be about to ping out.) }
if ($window(@events)) { aline -p @events $timestamp Lag Alert: You have a %irc_comp_lag seconds lag to $+($network,:) please check your connection, > 14(note this could be due to a proxy or to excess text being sent $+($server,.) $+ ) $iif(%irc_comp_lag > 60,4Fatal error: you may be about to ping out.) }
}
haltdef
}
alias -l irc_comp_lag /if ($status == connected) .quote ping $ctime
alias -l lag.chk { $+(.timerlag,$network) 0 $rand(7,15) irc_comp_lag }
#lag.check end
alias -l lag.stat {
if ($group(#lag.check) == off) {
.enable #lag.check
titlebar Checking lag to $+($network,...)
lag.chk
}
else {
.timerlag* off
.disable #lag.check
titlebar
}
}
alias -l oper.stat {
if ($group(#oper) == off) {
.enable #oper
echo $color(info) -a * /Irc Companion: Server notice window on
}
else {
echo $color(info) -a * /Irc Companion: Server notice window off
.disable #oper
}
}
alias -l botnet.stat {
if $($+(%,botcheck,.,$network),2) {
unset $+(%,botcheck,.,$network)
echo $color(info) -a * /Irc Companion: Botnet check has not been turned 4off for $+($network,.)
}
else {
set $+(%,botcheck,.,$network) on
echo $color(info) -a * /Irc companion: Botnet check has not been turned 9on for $+($network,.)
}
}
on *:disconnect: {
titlebar
if $($+(%,irc_comp_chanserv_,$network),2) { unset $+(%,irc_comp_chanserv_,$network),2) }
unset $+(%,ircop,$cid,*) $+(%,quitchk,$cid) %serverovrld
if $hget(irc_comp_modes) { .hsave irc_comp_modes $ircdir(irc_comp_modes) }
if $hget($+(irccomp_autocsid,.,$network)) { .hsave $+(irccomp_autocsid.,$network) $ircdir($+(irccomp_autocsid.,$network)) }
if $hget($+(irccomp_ajoin.,$network)) { .hsave $+(irccomp_ajoin.,$network) $ircdir($+(irccomp_ajoin.,$network)) }
if ($hget(irccomp_aconnect)) { .hsave irccomp_aconnect $ircdir(irccomp_aconnect) }
away.names
if ($network) && ($group(#events) == on) {
win
aline -ep @events You have disconnected from 4 $+ $network $+ at 7 $+ $time $+
}
}
raw 315:*: {
if ($window(@raw)) aline -p @raw 5 $numeric $+ $1-
haltdef
}
raw 352:*: {
haltdef
if ($3 == services) && ($6 == chanserv) { set -e $+(%,chanserv,$network) 1 }
if ($window(@raw)) { aline -p @raw 5 $numeric $+ $1- }
if (r isin $7) && ($6 == $me) { set -e $+(%,irc_comp_identified.,$me,$network,$cid) 1 }
if ($3 == services) { return }
if ($chr(42) isin $7) { al.ev $1- }
if (G isin $7) {
if $comchan($6,0) { .cnick -s1 $$address($6,5) 14 }
if $window($+(@spy,.,$$6,.,$cid)) { aline -n $+(@spy,.,$$6,.,$cid) $6 is set to 14AWAY status. }
}
}
raw 306:*: { if ($1 == $me) .cnick -s1 $address($me,5) 14 }
raw 305:*: { if ($1 == $me) .cnick -r $address($me,5) }
alias away.names {
while ($cnick(1).color == 14) { .cnick -r 1 }
var %i = 1
while ($scon(%i)) {
scid $scon(%i)
if ($status == connected) .timer 1 1 who +aM
inc %i
}
}
alias -l al.ev {
if (!$var($+(ircop,$cid,*),0)) { echo $color(info) -a * /Irc companion: Found $+ $opercol $+ Irc Operators on $+($network,$chr(44)) coloring them $+ $opercol $+ $col($opercol) $+ in the nick list. 14(this will take a few seconds). }
if !$($+(%,ircop,$cid,.,$$6),2) && ($group(#events) == on) { echo -e @events $upper(irc operator) found on $+($server,:) 4 $6 - Spotted on, $iif($chans($6),$v1,no channels yet) }
set -e $+(%,ircop,$cid,.,$$6) Spotted on, $iif($chans($$6),$v1,no channels yet)
if ($comchan($6,0)) { .cnick $address($6,5) $opercol }
}
alias coper {
var %input = $remove($1,$chr(3))
if (%input !isnum 1-15) { echo $color(info) -a * /coper insufficient parameters, please use numbers 1 to 15. | return }
var %i = $cnick(0),%col = $opercol | while (%i) { if ($cnick(%i).color == %col) .cnick $cnick(%i) %input | dec %i }
set %irc_oper_color %input
echo $color(info) -a * /Irc Companion: Irc operator color change to $+ %input $+ $col(%input) $+ successful, this will take a few moments to fully implement.
inc %i
while $var($+(ircop,$cid,.,*),%i) { irc.cmp.cline $gettok($ifmatch,2,46) $opercol | inc %i }
$+(.timercoper,$network,$cid) 1 3 if ($status == connected) who +R
}
alias -l opercol return $iif(%irc_oper_color,$v1,7)
;
alias blacklist {
if (!$hget(irc_comp_blacklist)) { .hmake irc_comp_blacklist 20 }
if (!$1) { black | return }
if ($1 == -r) {
var %addr = $iif($comchan($2,0),$address($2,2),$2)
if ($hfind(irc_comp_blacklist,%addr)) {
.hdel irc_comp_blacklist %addr
$iif(!$dialog(irc_blacklist),echo $iif((%irc_comp_blacklist),14,$color(info)) * /blacklist: %addr deleted from your blacklist.,did -ra irc_blacklist 3 %addr deleted)
.hsave irc_comp_blacklist $ircdir(irc_comp_blacklist)
return
}
else { echo $iif((%irc_comp_blacklist),14,$color(info)) * /blacklist: %addr not found | return }
}
if (!$comchan($1,0)) || ($1 == $me) { echo $iif((%irc_comp_blacklist),14,$color(info))-a * /blacklist: $iif(($1 == $me),you cannot blacklist yourself,no such user as $1)) | return }
if (!$hget(irc_comp_blacklist)) { .hmake irc_comp_blacklist 10 }
var %addr = $address($1,2),%msg = $iif($hfind(irc_comp_blacklist,%addr),updated,added)
if (%addr == $null) { echo $color(info) -a * /blacklist: error user not in ial, please wait a few seconds & retry. | return }
.hadd irc_comp_blacklist %addr $replace($fulldate,$chr(32),$chr(160)) $network $1 $iif($2,$2-)
.hsave irc_comp_blacklist $ircdir(irc_comp_blacklist)
var %reason = $gettok($hget(irc_comp_blacklist,%addr),4-,32)
if ($dialog(irc_blacklist)) { update.blacklist }
echo $iif((%irc_comp_blacklist),14,$color(info)) -a * /blacklist: %addr was %msg on the blacklist. $+([,$iif(%reason,%reason,no reason given),])
if (!%irc_comp_blacklist) && ($me isop $$chan) { ban -k $$chan $1 2 $+([,$iif(%reason,%reason,no reason given),]) }
}
alias -l logdate { return $replace($gettok($fulldate,1-3,32),$chr(32),$chr(44)) }
alias -l win { if (!$window(@events)) window -ikzn @Events | font @events 12 arial bold | titlebar @events Irc-Companion version $irc_comp_version events window for $+($me,:) }
alias -l raw.win { if (!$window(@raw)) window -Czked @raw 100 50 690 460 | .enable #rawlog | font @raw 12 arial bold | titlebar @raw Irc-Companion window for all the raw replies on $+($network,.) | echo $color(info) -s * /Irc companion: $timestamp Raw Window opened. }
alias -l irc_join_check { if ($1 ison $2) who $1 }
alias -l write.events {
if (!$window(@events)) || ($status != connected) return
aline @events You are connected to 4 $server $network At $time on $date on port $port $iif($port < 6667,WARNING: You are using a port not made for IRC please check your connection configuration.)
aline @events The server IP is $+($serverip,:)
aline @events $iif(!$var($+(spamprotect,.,$network,),0),14Spam Protection Shield is not active on $+($network,.),Spam Protection Shield is 9active on $+($network,.))
aline @events $iif($($+(%,irc_comp_ident,_,$network),2),You have a 4NickServ password set with $network,14You do not have a NickServ password set on $network)
if ($ssl == $true) { aline @events Your connection is 4secure. | aline @events $chr(160) }
else { aline @events 4WARNING: Your connection to $+(7,$network,) is 4insecure. | aline @events $chr(160) }
}
#oper on
raw 381:*: {
if $($+(%,irc_comp_ocheck,$cid),2) {
echo $color(info) -s * /Irc companion: Welcome Irc_Operator: IRC-Companion will now load your oper modules.
unset $+(%,irc_comp_ocheck,$cid)
}
}
#oper end
raw 474:*: {
if (!$irc_comp_chanserv) { echo $color(info) -a * /Irc Companion: Cannot use 4ChanServ to get you into $2 $+ , as 4ChanServ does not exist on this $+(network,.) | return }
if (!$($+(%,bcheck.,$network,$2),2)) { echo $color(info) -s * /Irc companion: Attempting to unban you from $2 using 4ChanServ. }
inc -u20 $+(%,bcheck.,$network,$2) 1
if ($($+(%,bcheck.,$network,$2),2) < 3) {
chanserv unban $$2
$+(.timerunban,$$2,$cid) 1 $rand(2,5) /join -n $2
}
else echo $color(info) -a * /Irc companion: You don't seem to have 4ChanServ access to $+($2,$chr(44)) giving up...
}
raw 473:*: {
if (!$irc_comp_chanserv) { echo $color(info) -a * /Irc Companion: Cannot use 4ChanServ to get you into $2 $+ , as 4ChanServ does not exist on this $+(network,.) | return }
if (!$($+(%,bcheck.,$network,$2),2)) { echo $color(info) -s * /Irc companion: Attempting to invite you from $2 using 4ChanServ. }
inc -u20 $+(%,incheck.,$network) 1
if ($($+(%,incheck.,$network),2) < 3) {
chanserv invite $2
$+(.timerinv,$2,$cid) 1 $rand(2,5) /join -n $2
}
else echo $color(info) -a * /Irc Companion: You don't seem to have 4ChanServ access to $+($2,$chr(44)) giving up...
}
raw 475:*: {
if (!$irc_comp_chanserv) { echo $color(info) -a * /Irc Companion: Cannot use 4ChanServ to get you into $2 $+ , as 4ChanServ does not exist on this $+(network,.) | return }
if (!$($+(%,bcheck.,$network,$2),2)) { echo $color(info) -s * /Irc companion: Attempting to clear modes from $2 using 4ChanServ. }
inc -u20 $+(%,ccheck.,$network) 1
if ($($+(%,ccheck.,$network),2) < 3) {
chanserv clear $2 modes
$+(.timercc,$2,$cid) 1 $rand(2,5) /join -n $2
}
else echo $color(info) -a * /Irc Companion: You don't seem to have 4ChanServ access to $+($2,$chr(44)) giving up...
}
raw 432:*: {
if (%irccomp_nmchange > 3) return
inc -u10 %irccomp_nmchange
$+(.timer,nick_change,$cid) 1 2 { echo $color(info) -a * /Irc Companion: Auto appending a $qt(_) to the end of your nick as $me is not being accepted on $+($network,.) }
.nick $+($me,_)
}
raw 433:*: {
if ($status != connected) {
if (%name > 5) return
set -e %usrname $me
var %tempname = $+($me,_)
inc -u8 %name
if ($window(@events)) { aline @events 4,1Irc-Companion: Auto changed nicks to $+(%tempname,:) $+ , i will auto change your nick back to %usrname when its available on $+($server,.) }
.nick %tempname
$+(.timer_irc_comp_echo,$network) 1 4 { echo $color(info) -s * /Irc companion: auto changing nicks to %tempname as %usrname is currently being used on $+($server,:), i will auto change your nick back to %usrname when its available on $+($server,.) }
}
}
raw 263:*: {
if (!%serverovrld) { echo -es 4,1IRC-Companion is temporarily disabling coloring users 14Grey that are set to away on $+($network,:) as $server is overloaded and cannot send the correct information }
set -e %serverovrld 1
haltdef
}
#rawlog off
raw *:*: { if ($window(@raw)) aline -p @raw 5 $numeric $+ $1- }
#rawlog end
on *:load: {
irc_comp_dl
if ($version < 6.21) {
idialog Irc-companion cannot work with $version of mIRC please update to make full use of the script. Unloading script in 5 seconds...
.timerunload 1 4 unload -rs $script
return
}
set %irc_welcome 1
if (!$isfile($ircdir(notes.txt))) { write -c $ircdir(notes.txt) }
irc.var.replace
irc_comp_upgrade1
echo $color(info) -s * /Irc companion: Enough space for script, You have $freespace amount of free space on $upper(drive) $+($left($mircdir,2))
echo $color(info) -s * /Irc companion: Please note that 14away users are refreshed every 3 minutes or when an /away action or nick-change is done in any channel. On some servers it may not work.
echo $color(info) -s * /Irc companion: Please note the shortcut key F4 to open the main dialog. Please restart client to ensure fully functional install.
}
on *:unload: {
if ($dialog(Irc-Companion_Bug)) { dialog -x Irc-Companion_Bug }
if (!%comp_reload) {
timerlag* off
timeraway* off
echo $color(info) -s * Saving nickserv passwords to prevent loss.
save.ident
echo $color(info) -s * /Irc companion: Initiating a clean uninstall...
if ($hget(addr)) { hfree addr }
echo $color(info) -s * /Irc companion: freeing hash tables
hfree -w irccomp*
titlebar
if ($window(@events)) { window -c @events }
echo $color(info) -s * /Irc companion: Unsetting Variables...
unset %irccomp* %regname %notes.* %spamprotect.* %chanserv* %hlight %regname %loadtime
.remove $ircdir(notes.txt)
var %quest1 = $?!="Do you wish to remove all files created by Irc-Companion"
if (%quest1 == $true) { return $findfile($scriptdir,irc*,0,1,if ($nopath($1-) != irc-companion) .remove $qt($1-)) }
idialog Please restart your client to ensure full uninstall. some files may be still present in $scriptdir but can be manually deleted.
echo $color(info) -s * /Irc companion: signed, Weaver
var %quest = $input(Would you like to tell us why you have unloaded the script?,qy,Error reports will be looked at and acted upon)
if (%quest == $true) {
.timer 1 1 /.reload -rs $ircdir(irc-companion.mrc)
dialog -m Irc-Companion_Bug Irc-Companion_Bug
did -ra Irc-Companion_Bug 7 Thank you for using irc-companion.
did -ra Irc-Companion_Bug 1 Please type your reason for unloading irc-companion here...
}
}
}
alias irc_comp_upgrade1 {
noop $findfile($mircdir,irc*,0,1,if ($nopath($1-) != irc-companion.mrc) .copy -o $qt($1-) $qt($scriptdir $+ $v1)))
noop $findfile($mircdir,irc*,0,1,if ($nopath($1-) != irc-companion.mrc) .remove $qt($1-))
}
alias -l irc.var.replace {
var %i = 1
while ($var(%irc.comp.ident.*,%i)) { set $replace($v1,$chr(46),$chr(95)) $eval($v1,2) | unset $v1 | inc %i }
}
alias -l col {
if ($1 !isnum 1-15) return
var %color = black,darkblue,darkgreen,red,brown,purple,orange,yellow,green,teal,lightblue,darkblue,pink,darkgrey,lightgrey
return $$gettok(%color,$1,44)
}
alias freespace {
var %spc = $disk($left($mircdir,1)).free,%freespc = $bytes(%spc,3).suf
return %freespc
}
alias -l spam {
if (!$network) return
if $($+(%,spamprotect,.,$network),2) {
unset $+(%,spamprotect,.,$network),2)
echo $color(info) -a * /Irc companion: 14,1Shield: Spam protection has now been turned OFF for $+($network,.)
return
}
set $+(%,spamprotect,.,$network) on
echo $color(info) -a * /Irc companion: 7,1Shield: Protective Shield has now been activated for $+($network,.)
}
alias -l spy {
if ($1 == $me) { echo $color(info) -a * /Irc companion: Error you cannot spy on yourself. | return }
if (!$window($+(@spy,$chr(44),$$1,$chr(44),$cid))) {
window -kzn $+(@spy,$chr(44),$$1,$chr(44),$cid) 100 50 690 460
if ($cnick($1).color != 14) { irc.cmp.cline $1 4 }
echo $color(info) -a * /Irc companion: 11,1Spy window has now been opened for $+($$1,:)
if !$($+(%,spy,$$1,$cid),2) && ($active ischan) { sline -r $1 }
set -e $+(%,spy,$$1,$cid),2) 1
titlebar $+(@spy,$chr(44),$$1,$chr(44),$cid) Spy module: currently spying on $1 $+($network,:) $iif($var($+(ircop,$cid,.,$1),0),$upper($1 is an Irc-Operator)) | font $+(@spy,$chr(44),$$1,$chr(44),$cid) 12 arial bold
aline -p $+(@spy,$chr(44),$$1,$chr(44),$cid) Spy module opened for $+(4,$1,:,) at $+(7,$timestamp,) 12> $irc_comp_idle($$1)
aline $+(@spy,$chr(44),$$1,$chr(44),$cid) -
who $1
}
}
alias -l unspy {
if $($+(%,spy,$$1,$cid),2) {
if ($cnick($1).color != 14) irc.cmp.cline $1
window -c $+(@spy,$chr(44),$$1,$chr(44),$cid)
unset $+(%,spy,$$1,$cid),2) 1
echo $color(info) -a * /Irc companion: Spy module for $$1 is now closed.
}
else echo -a 7,1There is no spy module set for $$1 to close.
}
alias -l comban {
if (!$comchan($$1,0)) || ($1 == $me) { return }
var %i 1
while ($comchan($$1,%i)) { if ($me isop $v1 || o isin $usermode) ban -k $comchan($$1,%i) $$1 2 $$iif($2,$2-,ban Protection) | inc %i }
}
alias -l restart.query {
var %quest = $?!="It is highly recommended that you restart mIRC to enable full functionality of Irc-Companion. Would you like to restart now?"
if (%quest == $true) { exit -nr }
}
alias -l irc.cmp.cline {
if (!$comchan($1,0)) return
var %i 1,%col $2
while ($comchan($1,%i)) { cline $iif($2,%col $comchan($1,%i) $1,-r $comchan($1,%i) $1) | inc %i }
}
alias -l irc_comp_echo {
if ($1 == -s) echo -es 4,1Irc-Companion: $2-
else echo -eha 4,1Irc-Companion: $1-
}
alias -l chans {
if (!$comchan($1,0)) { return }
var %i = 1,%chans
while ($comchan($1,%i)) { %chans = %chans $+($v1,$chr(32)) | inc %i }
return %chans
}
alias -l irc_comp_idle {
if (!$comchan($1,0)) return
var %i = 1,%string
while $comchan($1,%i) { %string = %string $+(,5,$v1,) idle $duration($nick($v1,$1).idle) $+ . | inc %i }
return %string
}
alias -l irc-comp-bckup {
filter -cff $qt($script) $ircdir(irc-companion.backup.txt)
if ($active == @events) { idialog Script has successfully backed up, it can be found in $ircdir(irc-companion.backup.txt) | return }
}
alias -l spy.save {
var %win $1,%user $2,%file = $+(spy,%user,.txt),%msg $iif($isfile($ircdir(%file)),re-saved,saved)
filter -cbwf %win $ircdir(%file)
idialog log has now been %msg in the mIRc directory as $ircdir(%file)
}
alias -l clone.save {
var %win $1,%file = $+(clonelog,%win,.txt),%msg $iif($isfile($ircdir(%file)),re-saved,saved)
filter -cbwf %win $ircdir(%file)
idialog log has now been %msg in $ircdir(%file)
}
alias -l oper.save {
var %win $1,%file = $+(operlog,.,$logdate,.txt),%msg $iif($isfile($ircdir(%file)),re-saved,saved)
filter -cbwf %win $ircdir(%file)
idialog log has now been %msg in $ircdir(%file)
}
alias -l events.save {
var %win = @events,%file = $+(events.log,.,$logdate,.txt)),%msg = $iif($isfile($ircdir(%file)),re-saved,saved)
write -c $ircdir(%file)
filter -wk %win _es
idialog Events log has now been %msg in $ircdir(%file)
}
alias -l _es { write $ircdir($+(events.log,.,$logdate,.txt)) $strip($1) }
alias -l gison { if ($group($1) == on) { return $true } | return $false }
alias -l vison { if (%irc_comp_hlight) { return $true } | return $false }
alias -l irc_comp_chanserv { if $($+(%,chanserv,$network),2) { return $true } | return $false }
;i was looking for an identifier that did this and could not find one, hence made my own.
alias -l isnetwork {
var %i = 1
while $scon(%i) { if ($scon(%i).network == $1) return $true | inc %i }
}
alias -l norep.read {
if !$isfile($$1) { return }
:begin
var %x = $read($1)
if (%x != %read) { set %read %x | return %x }
else { goto begin }
}
menu channel {
-
.ShowDesktop: ShowDesktop
.Menu
..Irc-Companion Auto Config. (F4 Key): /irc_comp_nickserv
..Notes (F5 Key):/dialog -m $str(notes $+ $chr(32),2))
..Bug/suggestion Report: dialog -m $str(Irc-Companion_Bug $+ $chr(32),2))
-
.Scanners
..$iif($status == connected,Clonescan $chan): clonescan $chan
..$iif($var($+(ircop,$cid,.,*),0),$style(1) Oper scan $network,$style(2) Oper scan $network)): opers
.. -
..$iif(!$window(@raw),$style(1) Raw window,$style(2) Raw window)): raw.win
}
menu menubar {
-
.Irc Companion
..Irc-Companion Auto Config. (F4 Key): /irc_comp_nickserv
..Notes (F5 Key):/dialog -m $str(notes $+ $chr(32),2))
..Bug/suggestion Report: dialog -m $str(Irc-Companion_Bug $+ $chr(32),2))
-
}
menu @events {
ShowDesktop: ShowDesktop
Clear history: clear $active
Restart mIRC: exit -nr
.$iif($gison(#events),Turn events off) : { .disable #events | window -c @events }
.$iif(!$gison(#events),Turn events ON) : { .enable #events | win | write.events }
.Open mIRC directory: run .
.$iif($isfile($ircdir($+(events.log,.,$logdate,.txt))),Re-Save log,Save $+($logdate,'s) log): { events.save }
.$iif($isfile($ircdir($+(events.log,.,$logdate,.txt))),Delete $+($logdate,'s) log): remove $ircdir($+(events.log,.,$logdate,.txt)))
.$iif($isfile($ircdir(irc-companion.backup.txt)),Re-Backup Irc-Companion,Back Irc-Companion): irc-comp-bckup
.$iif(%regname,Re-register,Register): register
.Check for updates: { idialog Checking for updates... (Current version is $irc_comp_version $+ ) | irc_comp_version_check }
.About: { adialog The events window logs all hightlights/actions/modes done to you. This is especially useful for those who like to know what happened during their idle time, and after some use becomes somewhat mandatory. }
}
menu @spy* {
Close spy module for $gettok($active,2,44) : unspy $gettok($active,2,44)
Clear history: clear $active
$iif($isfile($ircdir($+(spy,$gettok($active,2,44),.txt))),Re-save log,Save log) : { spy.save $active $gettok($active,2,44) }
$iif($isfile($ircdir($+(spy,$gettok($active,2,44),.txt))),Delete saved log file) : { remove $ircdir($+(spy,$gettok($active,2,44),.txt))) }
About: { adialog The spy module has many uses & is great for tracking a single user on busy channels or a user you just want to log. The users text will also be highlighted red in all channel windows. }
}
menu @raw {
Clear Window: clear $active
Open Debug Window for $network: .debug -p $+(@debug,$chr(32),$network) | titlebar $+(@debug,$chr(32),$network) Hello $+($me,$chr(44)) Debug window is useful to see commands sent to and fro between the client and server.
About: adialog This window shows all raw replies sent from the server prefixed in color with the raw number. Irc-Companion does halt one raw number and this window will show it in-case you ever have a need, or you are a scripter that want to know the numerics of raw replies.
}
menu @server.* {
.Clear: clear $active
.About: adialog The server window will catch all the server notices (if you are an irc operator) and place them in its own window. This sort of window is a must for all opers. It will also colour the client connections/exits in a different color depending on your settings. For you $me it would be $col($color(info)) $+ .
}
menu @IrcCompanion-Changes {
Close: close -@ $active | $iif($dialog(irc_comp_nickserv),did -e $v1 44)
Delete saved history: irc_ques_hist
About: adialog The log makes sure every last change is tracked and recorded to ensure constant security of your passwords and information. It will record every last change on the specific option selected to prevent an endless accumulating log.
}
alias irc_ques_hist {
var %quest = $?!=" Hello $+($me,$chr(44)) are you sure you want to delete all saved history? This will perm delete all your passwords and can not be retrieved."
if (%quest) { write -c $ircdir(irccompnickserv.txt) | clear @IrcCompanion-Changes }
}
menu nicklist {
$iif(!$($+(%,spy,$1,$cid),2),Spy $1,Unspy $1): $iif(!$($+(%,spy,$1,$cid),2),spy $1,unspy $1)
$iif(($ialchan($address($1,2),$chan,0) > 1),Kick-Ban users $ialchan($address($1,2),$chan,0) Clones)): cloneban $chan $address($1,2)
$iif(!$hfind(irc_comp_blacklist,$address($1,2)),Blacklist $1,Remove $1 from blacklist): $iif(!$hfind(irc_comp_blacklist,$address($1,2)),Blacklist $1,blacklist -r $address($1,2))
}
menu query {
Close: close -m $query($active)
Silence: { silence + $+ $$address($query($active),2) | close -m $query($active) }
$iif(!$window($+(@spy,.,$1,.,$cid)),Spy $1)): spy $1
$iif($window($+(@spy,.,$1,.,$cid)),Unspy $1)): unspy $1
Ban user from all chans: comban $query($active)
}
menu status {
.ShowDesktop: ShowDesktop
-
.Irc CompanionSettings
..Irc-Companion Auto Config: /irc_comp_nickserv
..Bug/suggestion Report: dialog -m Irc-Companion_Bug Irc-Companion_Bug
..Notes:/dialog -m Notes Notes
.-
..Check for updates: { echo $color(info) -a * /Irc companion: Checking for updates... 14(Current version is $irc_comp_version $+ ) | irc_comp_version_check }
..$iif(!$window(@raw),$style(1) Raw window,$style(2) Raw window)): raw.win
.-
.Unload It
..Unload IRC companion Right Now
...Seriously, Do It!
....Really really do it?
.....Click Here to Unload the Script: {
.unload -rs " $+ $script $+ "
-
}
}
on 1:close:@events: if ($group(#events == on)) { .timerwin 1 3 /win }
on 1:close:@raw: { .disable #rawlog | idialog Raw window now closed. }
on 1:close:@IrcCompanion-Changes: { if ($dialog(irc_comp_nickserv)) did -e $v1 44 }
on ^*:open:?: {
$+(.timerwho,$nick,$network) 1 3 /who $nick
var %line = $strip($1-)
if $($+(%,spamprotect,.,$network),2) {
;these regex expressions has possibly made this the best spam shield available as of the release of this script.
if $regex(%line,/(http:|#|fuck|love|shit|join|sex|www|com|channel|org|asl)/g) || ($regex(%line,/\b(\w++)(?:.+\b\1\b){9}/i)) || ($regex(%line,/(.)\1{10}/i)) || $($+(%,spamcheck,.,$network),2) {
echo $color(info) -s * /Irc companion: 7,1Shield: $timestamp Message has been 4blocked from $nick $+([,$wildsite,],:) $+(7,[,$iif($chans($nick),$v1,Spam Relay Bot),],) as it has matched a known spam pattern.
haltdef
}
}
if ($+($,decode) isin %line) { echo $color(info) -a * /Irc companion: 7,1Shield: Possible $+($,decode) virus attempt from $+($nick,:) $+ , please ignore private message instructions from $+($nick,:) }
inc -u12 $+(%,queryflood,$network) 1
if ($($+(%,queryflood,$network),2) >= 4) {
.ignore -pu60 *
mode $me +RT
silence + $+ $wildsite
echo $color(info) -a * /Irc companion: 4,1Shield: $timestamp Query window flood detected on $+($network,:) Setting Protective mode +R. auto closing spam query windows and ignoring messages for 60 seconds...
close -m
haltdef
}
}
;
alias -l opers {
if ($status != connected) { idialog ERROR, your are not connected to $iif($network,$+($network,.),to a server) | return }
if !$var($+(ircop,$cid,.,*),0) { idialog No opers yet found on $+($network,:) | return }
if (!$dialog(irc_oper)) { dialog -m irc_oper irc_oper }
var %c = 1
while $var($+(ircop,$cid,.,*),%c) {
did -a irc_oper 2 $gettok($ifmatch,2,46)
irc.cmp.cline $gettok($ifmatch,2,46) $opercol
inc %c
}
did -ra irc_oper 1 $var($+(ircop,$cid,.,*),0) irc operators found
}
alias -l oper.msg {
if ($1) {
if $($+(%,opermsg,$cid),2) { idialog Error, you can only msg opers once every two minutes. | return }
if !$var($+(ircop,$cid,.,*),0) { idialog No opers yet found on $+($network,:) | return }
var %num = $var($+(ircop,$cid,.,*),0)
if (o isin $usermode) { idialog Hello $+($me,$chr(44)) you are already an IRC operator and could not possibly need any help. An emergencies should be dealt with by yourself. Irc companion's offers you apologies. | return }
var %quest = $?!="Do you wish to msg %num opers? (emergency use only)"
if (%quest == $true) {
var %c 1
while $var($+(ircop,$cid,.,*),%c) { .msg $gettok($ifmatch,2,46) $1- | inc %c }
idialog All opers on $network sent the message, $+($$1-,:) $iif(($var($+(ircop,$cid,.,*),0) > 10),You are likley to quit from excess flood due the large amount of messages)
set -u125 $+(%,opermsg,$cid) 1
}
}
else idialog no message sent.
}
alias clonescan {
if (!$1) || ($1 !ischan) { return }
if ($hget(addr)) hfree addr
var %users = $nick($1,0)
if $chan($$1).inwho { idialog $iif(%users > 600,no user addresses have been stored as the channel is very large $+ $chr(44) (Type /who $1 to do it manually),user addresses for $1 are still being retrieved $+ $chr(44) please try again soon.) | return }
if (!$dialog(irc_clone)) { dialog -m irc_clone irc_clone }
var %i = 1,%chan = $1,%time = $ticks,%addr
while ($nick(%chan,%i)) {
var %smask = $address($v1,2)
if ($ialchan(%smask,%chan,0) > 1) && (!$hget(addr,%smask)) {
hadd -m addr %smask 1
did -a irc_clone 2 Found ( $+ $ialchan(%smask,%chan,0) $+ ) Clones in $+($chr(40),%chan,$chr(41)) from $gettok(%smask,2,64)
var %cnt = 1
while ($ialchan(%smask,%chan,%cnt)) {
did -a irc_clone 2 $chr(42) $+(%cnt,.) $gettok($v1,1,33) $iif(($gettok($v1,1,33) == $me), $+($chr(40),You yourself are a clone?,$chr(41)))
inc %cnt
}
did -a irc_clone 2 -
}
inc %i
}
if (!$hget(addr)) { did -a irc_clone 2 No clones found on %chan | did -b irc_clone 2 }
else {
did -ra irc_clone 3 Scan completed in $calc(($ticks - %time) / 1000) seconds.
did -a irc_clone 1 Scanned %users users, $hget(addr,0).item cloned addresses found on %chan
}
}
alias -l kick.clones {
if ($1 !ischan) return
if ($hget(addr,0).item < 1) { idialog Error, no 4clones to ban on $+($1,.) | return }
if (!$hget(addr)) { idialog 4Error all 7clones have been banned, Please rescan. | return }
if $hget(addr,0).item >= 12 { echo $1 4,1Irc-Companion 4WARNING: you are banning $hget(addr,0).item users, due to the large amount this may cause you to 4disconnect due to excess flood. }
var %c = 1,%chan = $1
while ($hget(addr,%c).item) { cloneban %chan $v1 $hget(table,%c).data | inc %c }
idialog All clones on %chan now being banned.
}
alias -l cloneban {
var %i = 1,%cha = $iif($1,$1,$active),%ban = $2
if ($me !isop %cha) { idialog Error, you need to be opped on $+(%cha,.) | return }
ban %cha %ban
while ($nick(%cha,%i)) {
if (%ban iswm $ial($nick(%cha,%i))) {
if ($nick(%cha,%i) != $me) { ban -k %cha $nick(%cha,%i) Clone, host matches %ban }
}
inc %i
}
}
;
alias -l icemail { return $+($rand(a,z),$rand(a,z),$rand(a,z),$rand(a,z),@,$rand(a,z),$rand(a,z),$rand(a,z),$rand(a,z),.com)) }
alias -l systray {
var %nick = $1,%chan = $2,%msg = $strip($3-)
noop $tip(NH- $+ $network,$network,Highlight in %chan,,,,,)
noop $tip(NH- $+ $network,$network,"[ $+ %nick $+ ] %msg $+ ",,,,,)
}
alias showdesktop {
var %temp $qt(Show Desktop.scf)
write %temp [Shell] $crlf Command=2 $crlf IconFile=explorer.exe,3 $crlf [Taskbar] $crlf Command=ToggleDesktop
run %temp
.remove %temp
}
alias -l save.ident {
var %i = 1
write -c $ircdir(nickservPasswords.txt)
while $var(%irc_comp_ident_*,%i) { write $ircdir(nickservPasswords.txt) $v1 $($+($v1),2) | inc %i }
idialog Saved current NickServ passwords in $ircdir(nickservPasswords.txt)
}
alias -l register {
var %tempregname = $?="Enter Your Name Here:"
if (%tempregname == $null) { idialog Registration NOT CHANGED. $iif(%regname,Script remains Registered to %regname) | return }
idialog This Script is now registered to: $+(<,%tempregname,>)
set %regname %tempregname
}
;many thanks to hixxy for allowing this snippet into irccompanion
alias -l makepoststring {
bset -t &poststring 1 $1
var %line = 1,%lines = $cb(0)
while (%line <= %lines) {
bset -t &poststring $calc($bvar(&poststring,0) + 1) $+($urlencode($iif($cb(%line) != $null,$v1,$chr(32))),%,0A)
inc %line
}
}
alias paste {
if (!$0) { return $false }
if (!%irccomp_pastecontrol.lines) { %irccomp_pastecontrol.lines = 5 }
if ($cb(0) > %irccomp_pastecontrol.lines) {
if (!%pastecontrol.website) { %pastecontrol.website = pasthis.com }
pasteweb %irccomp_paste.website /msg $1
}
else { msg $1 $replace($2-,$cr,%,$lf,$,$chr(1),$chr(123),$chr(255),$chr(125)) }
}
alias pasteweb {
if ($1 == pasthis.com) {
if ($sock(pastecontrol.pasthis)) { return $false }
sockopen pastecontrol.pasthis %pastecontrol.website 80
sockmark pastecontrol.pasthis $2-
}
}
alias -l urlencode { return $regsubex($1,/([^A-Z0-9_\-])/gi,% $+ $base($asc(\t),10,16,2)) }
alias -l websites { return pasthis.com }
#pastecontrol on
on *:input:*:{
if ($inpaste) {
haltdef
irc_comp_paste $1-
}
}
#pastecontrol end
alias -l irc_comp_paste { .timer -dh 1 0 paste $target $replace($1-,%,$cr,$,$lf,$chr(123),$chr(1),$chr(125),$chr(255)) }
on *:sockopen:pastecontrol.pasthis:{
if ($sockerr) { idialog * Error connecting to $+(%pastecontrol.website,$chr(44)) the website maybe down, Please try later. | return }
makepoststring $+(lifetime=max&private=0&title=IrcCompanion-AutoPaste%20by%20,$me,&nickname=,$me,&text=)
sockwrite -n $sockname POST /mirc/ HTTP/1.1
sockwrite -n $sockname Host: pasthis.com
sockwrite -n $sockname Accept: */*
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
sockwrite -n $sockname Content-Length: $bvar(&poststring,0)
sockwrite -n $sockname
sockwrite $sockname &poststring
}
on *:sockread:pastecontrol.pasthis:{
var %data
sockread %data
if (Pasthis-URL: * iswm %data) {
if ($sock($sockname).mark != $null) { $v1 $gettok(%data,2,32) }
}
elseif (Pasthis-Message: * iswm %data) { echo -a * Paste control: $gettok(%data,2-,32) }
}
;
alias credits { mq.start }
alias mq.start {
unset %mq.*
if (!$dialog(credits)) { dialog -m credits credits }
set %mq.point 0
.timer.mq -mh 0 170 mq.disp
}
alias mq.disp {
if ($dialog(credits)) {
var %mq.title = Irc-Companion (the operating system for auto identify) Credits, Nightquest a good friend & advisor, Source my only real irc companion, Silent-Shadow the master, $&
www.mirc.com especially qwerty,genius_at_work for their time and expertise, Hixxy for the pastecontrol i could not resist adding that feature, last but not least my soul mate who shall remain nameless... $str($chr(160),120)
inc %mq.point 1
if (%mq.point > $len(%mq.title)) set %mq.point 1
if ($mid(%mq.title,%mq.point,1) == $chr(32)) inc %mq.point 1
var %mq.disp = $right(%mq.title,$calc($len(%mq.title) - %mq.point)) $left(%mq.title,%mq.point)
did -ra credits 1 %mq.disp
}
else mq.stop
}
alias mq.stop {
unset %mq.*
.timer.mq off
}
alias f4 { irc_comp_nickserv }
alias -l irc_comp_nickserv {
if ($dialog(irc_comp_nickserv)) { return }
if !$hget(irccomp_aconnect) { irc_comp_hload irccomp_aconnect 5 }
dialog -hm irc_comp_nickserv irc_comp_nickserv
}
dialog credits {
title "Irc-Companion credits /credits"
size -1 -1 437 147
option pixels
edit "", 1, 27 41 385 65, read autohs autovs return center limit 0
icon 3, 103 4 221 21, irc_complogo.png, 0
button "OK", 4, 373 126 47 16, ok
box "Credits", 2, 15 24 406 92
}
dialog irc_comp_nickserv {
title "Irc Companion identify"
size -1 -1 228 148
option dbu
tab "NickServ", 13, 0 0 226 125
tab "ChanServ", 14
tab "Oper", 15
tab "AutoJoin", 16
tab "Settings", 47
box "NickServ Actions && save changes", 9, 116 16 106 26, tab 13
box "Networks", 4, 4 16 106 106, tab 13
list 1, 8 24 98 78, tab 13 vsbar size sort
button "Remove", 2, 8 104 37 12, tab 13
button "Add", 3, 68 104 37 12, tab 13
text "Password", 5, 116 68 31 8, tab 13
edit "", 6, 116 76 106 10, tab 13 read
button "Change Pass", 7, 120 24 37 12, tab 13
button "Register", 8, 180 24 37 12, tab 13
button "Generate Pass", 10, 116 88 41 12, tab 13 flat
button "Set Pass", 11, 184 88 37 12, tab 13 flat
text "Ident Command", 67, 116 44 39 8, tab 13
edit "", 68, 116 52 106 10, tab 13
button "Apply", 69, 184 112 37 12, tab 13 disable
box "Channels", 18, 116 16 106 74, tab 14
box "Networks", 19, 4 16 106 106, tab 14
button "Remove", 20, 8 104 37 12, tab 14
button "Add", 21, 68 104 37 12, tab 14
text "Password", 22, 116 92 25 8, tab 14
edit "", 23, 116 100 106 10, tab 14 read
button "Add/edit", 27, 184 112 37 12, tab 14
list 29, 8 24 98 78, tab 14 vsbar size sort
list 12, 120 24 98 46, tab 14 vsbar size sort
button "Remove", 25, 120 72 37 12, tab 14
button "Add", 24, 180 72 37 12, tab 14
box "Networks", 30, 4 16 106 106, tab 15
button "Remove", 32, 8 104 37 12, tab 15
button "Add", 33, 68 104 37 12, tab 15
text "Password and modes", 34, 116 52 61 8, tab 15
edit "", 35, 116 60 106 10, tab 15 read
button "Add/Edit", 39, 184 76 37 12, tab 15
list 41, 8 24 98 78, tab 15 vsbar size sort
text "Username", 31, 116 24 25 8, tab 15
edit "", 36, 116 32 106 10, tab 15
list 26, 8 24 98 70, tab 16 vsbar size sort
box "Networks", 28, 4 16 106 106, tab 16
button "Remove", 37, 8 104 37 12, tab 16
button "Add", 38, 68 104 37 12, tab 16
box "Channels", 40, 116 16 106 106, tab 16
button "Remove", 42, 120 104 37 12, tab 16
button "Add", 43, 180 104 37 12, tab 16
list 45, 120 24 98 78, tab 16 vsbar size sort
check "Automatically Connect on Startup", 46, 8 94 98 10, tab 16
check "Ban Protection", 49, 4 20 55 7, tab 47
check "Events", 50, 4 44 50 7, tab 47
check "Nick Highlight w/ Tray Notification", 51, 4 92 90 7, tab 47
check "Lag detector", 52, 4 68 50 7, tab 47
check "Spam Protection", 53, 120 44 50 7, tab 47
check "Server Notices", 54, 120 20 50 7, tab 47
button "Check for updates", 55, 172 112 49 12, tab 47
text "When someone bans you, this will remove said ban, and do the same to them.", 57, 10 28 105 14, tab 47
text "This opens a Window that has all events thats happens to you displayed in it.", 56, 10 52 105 14, tab 47
text "This displays the amount of lag in seconds, for the current network in your titlebar.", 58, 10 76 105 14, tab 47
text "If you're in another window, and someone says your name, this will let you know!", 59, 10 100 105 14, tab 47
text "This handy tool is an oper window, helps clean up all that Server Notice spam.", 48, 126 28 97 14, tab 47
text "Getting spammed alot? activate the multi-network SMART spam shield.", 60, 126 52 97 14, tab 47
edit "", 63, 192 84 26 10, tab 47 read
edit "", 64, 192 96 26 10, tab 47 read
text "Latest version", 61, 152 85 37 8, tab 47
text "Current version", 65, 149 97 41 8, tab 47
check "Auto paste to web", 62, 120 65 55 10, tab 47
text "Paste text longer then", 66, 126 75 55 8, tab 47
edit "", 72, 181 74 19 10, tab 47
text " lines.", 73, 200 75 20 8, tab 47
button "Okay", 17, 189 134 37 12, ok
button "History", 44, 3 134 37 12
edit "", 71, 44 130 140 17, read multi center
button "tips", 70, 192 14 32 9, tab 47
link "Forums", 74, 2 116 29 8, tab 47
check "Identify on connect", 75, 164 63 56 8,hide tab 13
}
dialog Irc-Companion_Bug {
title "Irc-Companion Bug/suggestions"
size -1 -1 304 244
option pixels
edit "", 1, 8 68 289 126, multi return vsbar limit 0
text "", 3, 12 195 168 17
button "Send", 4, 232 216 65 25
button "Updates", 5, 4 216 67 25
edit "", 2, 8 24 288 21
text "Reply Address (Optional) guaranteed reply", 6, 12 4 210 16
text "Bug/Suggestion Report", 7, 12 48 238 16
icon 8, 93 216 119 21, irc_complogo.png, 0
}
dialog about_irc_comp {
title "About Irc-Companion"
size -1 -1 124 117
option dbu
icon 1, 0 0 123 23, irc_complogo.png, 0 noborder
button "OK", 2, 44 96 37 12, ok default
text "Irc-Companion v10.67", 3, 0 24 125 8, center
text "The Operating System for IRC", 4, 0 32 125 8, center
text "Copyright © 2005-2008 Gadi Shalom", 5, 0 44 125 8, center
text "All Rights Reserved", 6, 0 52 125 8, center
text "For more information and updates visit:", 7, 0 72 125 8, center
link "http;//recelate.net/", 8, 36 80 50 8
text "", 12, 4 60 115 8, center
menu "File", 9
item "Latest News", 10, 9
item "Credits", 11, 9
}
alias about { dialog -m about_irc_comp about_irc_comp }
alias f5 { dialog -m notes notes }
dialog Notes {
title "Irc-Companion Notes"
icon irccomp_notes_Icon.ico, 0
size -1 -1 205 140
option dbu
edit "", 1, 1 1 203 139, autohs autovs multi return hsbar vsbar
menu "File", 2
item "New", 3, 2
item "Save", 4, 2
item "Close" 5, 2
menu "Help", 7
item "About", 8, 7
}
dialog Notes_About {
title "About"
size -1 -1 313 209
option pixels notheme
icon 2, 8 8 40 40, notes_icon.ico, 0
text "Author: NightQuest on behalf of Irc-Companion", 3, 56 8 243 18
text "Date Created: 12-10-2006", 4, 56 33 137 17
text "Reason:", 1, 59 56 46 17
text "Notes was created because people copy/paste all the time, especially on chat programs, such as mIRC. Personally, I had had enough, and needed a simple 'app' that was always open, and automatically saved my work ('notepad' did not). so I decided to make this little addon for Irc-Companion Enjoy. :)", 5, 56 72 249 97
button "OK", 6, 240 176 65 25, ok
link "www.recelate.net", 7, 10 183 95 17
}
dialog irc_blacklist {
title "Irc-Companion Blacklist /black"
size -1 -1 320 256
option pixels
box "Blacklist", 1, 17 16 287 172
list 2, 27 31 267 145, vsbar size sort
text "", 3, 8 189 305 19, center
text "", 4, 8 210 305 41, center
check "Enable", 9, 261 3 57 17
menu "File", 5
item "Add user", 7, 5
item "Add mask", 10, 5
item "Delete user", 8, 5
item "Delete all", 6, 5
item "break", 13, 5
item "Close", 14, 5
menu "Help", 11
item "About", 12, 11
}
dialog irc_comp_info {
title "Irc-Companion Information"
size -1 -1 171 63
option dbu notheme
icon 1, 39 1 93 14, irc_complogo.png, 0
button "OK", 2, 145 51 23 10, ok
text "", 3, 24 20 123 28, center
button "Credits", 5, 140 1 28 6
button "Intro", 4, 1 1 28 6
}
dialog irc-comp_update {
title "Update"
size -1 -1 342 233
option pixels
icon 1, 41 12 261 40, irc_complogo.png, 0
text "", 2, 45 59 252 39, nowrap center
link "Download new script file", 4, 107 206 128 16, disable
edit "", 3, 33 138 277 55, read autohs autovs multi center
button "OK", 5, 150 107 43 20, ok flat
}
dialog irc_quote {
title "Irc-Companion Quote"
size -1 -1 309 175
option pixels
box "Full Current Quote", 1, 21 5 267 130
icon 2, 88 143 133 16, irc_complogo.png, 0
text "", 7, 30 22 249 99, center
menu "File", 3
item "Get new quote", 6, 3
item "Amsg quote to channels", 8, 3
item "Set quote as nickserv greet", 4, 3
item "Open Sidebar", 11, 3
item "break", 15, 3
item "Open favourites", 10, 3
item "Save to favourites", 9, 3
item "break", 16, 3
item "Close", 5, 3
menu "Help", 12
item "About", 13, 12
}
dialog sidebar.quote {
title "Quote Sidebar /qbar"
size -1 -1 309 91
option pixels
box "Quotes", 1, 10 5 289 80
text "", 2, 15 17 279 59
}
dialog favourites {
title "favourites /favourites"
size -1 -1 624 363
option pixels
box "Favourites", 1, 24 13 576 327
list 2, 41 33 543 296, hsbar vsbar size
icon 3, 242 340 140 15, irc_complogo.png, 0
check "Show random quote on startup", 5, 426 0 174 17, multi
menu "File", 4
item "Delete Quote", 6, 4
item "Close", 7, 4
}
dialog irc_comp_news {
title "Latest News /irc_news"
size -1 -1 728 499
option pixels
icon 1, 178 2 372 34, irc_complogo.png, 0
text "Latest News", 2, 314 44 100 17, center
box "", 3, 38 64 653 389
edit "", 4, 52 77 625 359, read autohs autovs multi return hsbar vsbar center
button "OK", 5, 681 470 40 25, ok flat
menu "File", 6
item "Refresh", 7, 6
}
dialog about_info {
title "About Information"
size -1 -1 386 200
option pixels
edit "", 1, 20 25 347 138, read multi center
box "", 2, 11 10 364 164
button "Credits", 3, 3 179 65 16
button "OK", 4, 330 180 44 15, ok default
}
dialog irc_clone {
title "Irc-Companion CloneScanner /clonescan #channel"
size -1 -1 255 166
option dbu
box "Clones", 1, 10 2 235 152
list 2, 19 11 217 143, hsbar vsbar
text "", 3, 33 156 188 9, center
menu "File", 7
item "Ban all clones from highlighted list", 8, 7
item "Kick All clones", 9, 7
item "Add to blacklist", 12, 7
item "break", 10, 7
item "Close", 11, 7
menu "Help", 4
item "About", 5, 4
}
dialog irc_oper {
title "operscan"
size -1 -1 130 131
option dbu
box "", 1, 11 0 108 103
list 2, 17 9 96 96, vsbar sort
text "", 3, 10 105 110 23, center
menu "File", 4
item "Message all opers", 7, 4
item "Change color of opers", 10, 4
item "break", 9, 4
item "Close", 8, 4
menu "Help", 5
item "About", 6, 5
}
dialog irc_tips {
title "Dialog"
size -1 -1 172 73
option dbu
box "Tips", 1, 11 11 150 48
icon 2, 55 1 61 11, irc_complogo.png, 0
button ">", 4, 72 61 28 10
text "", 3, 15 18 141 36, center
}
dialog welcome {
title "Welcome"
size -1 -1 190 144
option dbu
icon 1, 17 8 155 90, welcome.png, 0
box "Welcome", 2, 11 1 167 103
edit "", 3, 6 112 177 12, read
button "OK", 4, 162 130 22 10, ok flat default
}
alias irc_welcome { wel.start }
on *:dialog:welcome:init:0: wel.start
alias wel.start {
unset %mq.*
if (!$dialog(welcome)) { dialog -m welcome welcome }
set %mq.point 0
.timerwelmq -mh 0 130 wel.disp
}
alias -l wel.disp {
if ($dialog(welcome)) {
var %mq.title = $str($chr(160),80) Welcome $iif($me,$me,user) to Irc Companion version $+($irc_comp_version,$chr(44)) Thank you for loading the script. It will take care of all your identify and password needs on IRC. This includes nickserv chanserv irc operator modules and a freindly autojoin. It has user friendly intelligent dialogs which can be accessed by the F4 key. $&
It will attempt to assist you on IRC in an unobtrusive manner in numerous ways. It also has many features that can be toggled on or off at the users discretion.
inc %mq.point 1
if (%mq.point > $len(%mq.title)) set %mq.point 1
if ($mid(%mq.title,%mq.point,1) == $chr(32)) inc %mq.point 1
var %mq.disp = $right(%mq.title,$calc($len(%mq.title) - %mq.point)) $left(%mq.title,%mq.point)
did -ra welcome 3 %mq.disp
}
else wel.stop
}
alias -l wel.stop {
unset %mq.*
.timerwelmq off
}
;
on *:dialog:irc_tips:init:0: { did -a irc_tips 3 $norep.read($ircdir(comp_tips.txt)) }
on *:dialog:irc_tips:sclick:4: { did -ra irc_tips 3 $norep.read($ircdir(comp_tips.txt)) }
on *:dialog:irc_tips:close:0: unset %read
;
alias irc_news { dialog -m irc_comp_news irc_comp_news }
alias -l idialog {
if ($dialog(irc_comp_info)) { dialog -x irc_comp_info }
var %inf = $strip($1-)
dialog -m irc_comp_info irc_comp_info
did -ra irc_comp_info 3 %inf
}
alias -l udialog {
if ($dialog(irc-comp_update)) { dialog -x irc-comp_update }
dialog -m irc-comp_update irc-comp_update
did -ra irc-comp_update 2 $strip($1-)
}
alias -l adialog {
if ($dialog(about_info)) { dialog -x about_info }
dialog -m about_info about_info
did -ra about_info 1 $strip($1-)
}
alias qbar {
if (!$dialog(sidebar.quote)) dialog -m sidebar.quote sidebar.quote
else idialog Error, sidebar is already open.
}
alias black {
if (!$dialog(irc_blacklist)) dialog -m irc_blacklist irc_blacklist
else idialog Error, blacklist is already open.
}
;
on *:dialog:irc_oper:sclick:2: {
did -a irc_oper 3 $($+(%,ircop,$cid,.,$did(2).seltext),2)
if ($active ischan) && ($did(2).seltext ison $active) { sline $active $did(2).seltext }
}
on *:dialog:irc_oper:dclick:2:.msg nickserv info $did(2).seltext all
on *:dialog:irc_oper:menu:7:oper.msg $?="Enter message":
on *:dialog:irc_oper:menu:6: {
adialog It is sometimes useful to know who irc operators are. $iif(o isin $usermode,[even though you are one yourself.]) Irc Companion colors all irc operators in orange in channel text & in the nick list. This scanner shows the user a list of irc operators found. $&
It should be noted that irc operators can hide their modes & irc companion will not be able to detect them. It should also be noted that on some networks irc operators have very itchy trigger fingers and may $&
gline you just for messaging them, so please take care when using this dialog. Irc Companion will try to detect such threats and keep you safe on irc, but care should be taken by the user not to spam or provoke irc operators.
}
on *:dialog:irc_oper:menu:8:dialog -x irc_oper
on *:dialog:irc_oper:menu:10: {
var %input = $$input(Please enter colour number,eo,Oper scanner),44)
if (%input) { coper %input }
}
;
on *:dialog:irc_clone:sclick:2: {
var %useraddress = $gettok($did(2).seltext,-1,32)
did $iif($hget(addr,$+(*!*@,%useraddress)),-e,-b) irc_clone 8
if ($did(2).seltext != $chr(45)) && ($comchan(%useraddress,0)) { sline $gettok($did(1),-1,32) %useraddress }
if ($did(2).seltext != $chr(45)) && (!$hget(addr,$+(*!*@,%useraddress))) && (!$comchan(%useraddress,0)) {
var %line = $did(2).seltext
if ($gettok(%line,-1,32) != irc.) { did -o irc_clone 2 $did(irc_clone,2).sel %line has now left the channel,changed nick or quit irc. }
}
}
on *:dialog:irc_clone:dclick:2: {
if ($comchan($gettok($did(2).seltext,-1,32),0)) {
whois $gettok($did(2).seltext,-1,32)
if $($+(%,chanserv,$network),2) { .msg nickserv info $gettok($did(2).seltext,-1,32) all }
}
}
on *:dialog:irc_clone:menu:5: {
adialog Irc-Companion clone scanner uses a unique engine to scan for clones and presents them in a clear concise fashion to the user. One also has options to kick clones, $&
kick specific clones or add them to a blacklist. The option to kick all clones from a specific address will only be available when you have highlighted the beginning of a list otherwise it will be disabled. $&
double clicking a user will /whois the selected user. When clones who have quit are highlighted irc-companion will automatically delete them, this ensures constant clarity for the user. It has also been tested $&
on channels with 1000's of users to ensure results on even the largest of channels.
}
on *:dialog:irc_clone:menu:8: {
if (!$did(2).seltext) { idialog Error, you have no clone highlighted. | return }
var %op_status = $iif(($me isop $gettok($did(1),-1,32) || o isin $usermode),$true)
if (%op_status) cloneban $gettok($did(1),-1,32) $gettok($did(2).seltext,-1,32)
else idialog Error, you are not opped on $gettok($did(1),-1,32)
}
on *:dialog:irc_clone:menu:9: {
var %op_status = $iif(($me isop $gettok($did(1),-1,32) || o isin $usermode),$true)
if (%op_status) kick.clones $gettok($did(1),-1,32)
else idialog Error, you are not opped on $gettok($did(1),-1,32)
}
on *:dialog:irc_clone:menu:11: {
dialog -x irc_clone
if ($hget(addr)) { .hfree addr }
}
on *:dialog:irc_clone:menu:12: {
var %input = $gettok($did(2).seltext,-1,32),%res = $iif($comchan(%input,0),$address(%input,2),$+(*!*@,%input))
if ($hget(addr,%res)) {
if ($hget(irc_comp_blacklist,%res)) { idialog Error, %res already blacklisted. | return }
.hadd irc_comp_blacklist %res $replace($fulldate,$chr(32),$chr(160)) $network n/a repeated cloning.
idialog %res now added to blacklist. This will activate the next time they join channels or when you are opped on any common channel.
.hsave irc_comp_blacklist $ircdir(irc_comp_blacklist)
}
}
on *:dialog:irc_clone:close:0: { if ($hget(addr)) .hfree addr }
;
on *:dialog:irc_comp_info:sclick:5:mq.start
on *:dialog:about_info:sclick:3:mq.start
on *:dialog:irc_comp_info:sclick:4:irc_welcome
;
on *:dialog:about_irc_comp:init:0: {
did -ra about_irc_comp 12 $iif((%regname),Registered to %regname,unregistered version.))
}
;
on *:dialog:irc_quote:init:0:did -ra irc_quote 7 %irc_comp_quote
on *:dialog:irc_quote:menu:4: {
if ($status == connected) .msg nickserv set greet %irc_comp_quote
else idialog Error, Please connect to a network.
}
on *:dialog:irc_quote:menu:5: dialog -x irc_quote
on *:dialog:irc_quote:menu:6: {
if ($sock(irc_comp_quote)) sockclose irc_comp_quote
did -ra irc_quote 7 $iif($left($did(7),2) == re,Re-requesting new quote... apologies for the delay,Requesting new quote...)
irc_comp_quote
}
on *:dialog:irc_quote:menu:8: {
if ($status == connected) $iif($left($did(7),2) == re,idialog Error no quote please retry when the quote updates.,amsg $did(7))
else idialog Error, you are not connected to a server.
}
on *:dialog:irc_quote:menu:9: {
if (!$isfile($ircdir(icquotes.txt))) write -c $ircdir(icquotes.txt)
var %quote = $did(7)
if (!$read($ircdir(icquotes.txt),w,%quote)) {
write $ircdir(icquotes.txt) %quote
idialog Saved, you now have $lines($ircdir(icquotes.txt)) quotes saved.
}
else idialog Error, You already have that quote saved.
}
on *:dialog:irc_quote:menu:13: {
adialog Some people have asked me, why did you create a quote theme alongside irc-companion? I tell them that we sometimes waste too much time on irc chatting aimlessly & the quote system is a small way of channelling positivity into the user. $&
There is also an option to save your favourite (/favourites) quotes. Many famous successful people have been known to keep encouraging quotes in their offices & private work space to keep their spirits up and the mind constantly happy & positive. I hope this does the same for all of you.
}
;
on *:dialog:favourites:init:0: did $iif(%irc_comp_greet,-c,-u) favourites 5
on *:dialog:irc_quote:menu:10:favourites
on *:dialog:favourites:menu:6: {
if (!$did(2).seltext) { idialog Error, Please select quote | return }
write -dl $+ $gettok($did(2).seltext,1,32) $ircdir(icquotes.txt)
did -r favourites 2
filter -fonp $ircdir(icquotes.txt) favourites 2
}
on *:dialog:favourites:menu:7:dialog -x favourites
alias favourites {
if (!$isfile($ircdir(icquotes.txt))) { idialog Error, favourites file not found. | return }
if ($dialog(irc_comp_nickserv)) dialog -k irc_comp_nickserv irc_comp_nickserv
if ($dialog(irc_quote)) { dialog -x irc_quote }
if (!$dialog(favourites)) { dialog -m favourites favourites }
filter -fonp $ircdir(icquotes.txt) favourites 2
did -z favourites 2
}
on *:dialog:favourites:dclick:2: { if ($status == connected) && ($active ischan) msg $active $$gettok($$did(2).seltext,2-,32) }
on *:dialog:favourites:sclick:5: {
if (!$isfile($ircdir(icquotes.txt))) { idialog, Error, please first save some quotes. | return }
if ($did(5).state == 1) set %irc_comp_greet on
else unset %irc_comp_greet
}
;;
on *:dialog:irc_quote:menu:11: {
if ($dialog(irc_quote)) { dialog -x irc_quote }
qbar
}
;
on *:dialog:sidebar.quote:init:0: {
did -ra sidebar.quote 2 %irc_comp_quote
sidebar.scroll
.timerquotesidebar 0 4 sidebar.scroll
.timeroo 1 1 idialog Sidebar now open, please drag to preferred position on screen. Double click the dialog to msg quote to the active channel.
}
on *:dialog:sidebar.quote:dclick:*: { if ($active ischan && $status == connected) msg $active $did(2) }
alias -l sidebar.scroll {
if ($dialog(sidebar.quote)) irc_comp_quote
else .timerquotesidebar off
}
;
on *:dialog:about_irc_comp:menu:11: mq.start
on *:dialog:about_irc_comp:menu:10: dialog -m irc_comp_news irc_comp_news
;
on *:dialog:irc_blacklist:init:0: {
if (!%irc_comp_kick) set %irc_comp_kick 0
did -ra irc_blacklist 1 Blacklist, $hget(irc_comp_blacklist,0).item users
update.blacklist
did -ra irc_blacklist 3 $iif(%irc_comp_kick,$v1,No) total users kicked
did $iif(%irc_comp_blacklist,-u,-c) irc_blacklist 9
var %i = 12
while (%i) { if (%i != 9) did $iif(%irc_comp_blacklist,-b,-e) irc_blacklist %i | dec %i }
}
on *:dialog:irc_blacklist:sclick:2: {
did -ra irc_blacklist 1 Blacklist, $hget(irc_comp_blacklist,0).item users
var %reason = $strip($hget(irc_comp_blacklist,$did(2).seltext))
did -ra irc_blacklist 3 Added on $+($gettok(%reason,1,32),.)
did -ra irc_blacklist 4 Net: $+($gettok(%reason,2,32),.) Nick (at the time): $+($gettok(%reason,3,32),$chr(44)) $iif($gettok(%reason,4-,32),$v1,No reason given)
}
on *:dialog:irc_blacklist:dclick:2: {
blacklist -r $did(2).seltext
did -d irc_blacklist 2 $did(irc_blacklist,2).sel
did -ra irc_blacklist 1 Blacklist, $hget(irc_comp_blacklist,0).item users
did -r irc_blacklist 4
}
on *:dialog:irc_blacklist:menu:6: {
var %quest = $input(Are you sure you want to delete your entire blacklist?,qy,Hi $me please note that deleted items cannot be retrieved.)
if (%quest == $true) {
if ($hget(irc_comp_blacklist)) { .hfree irc_comp_blacklist }
if ($isfile($ircdir(irc_comp_blacklist))) { .remove $ircdir(irc_comp_blacklist) }
.hmake irc_comp_blacklist 10
update.blacklist
did -ra irc_blacklist 1 Blacklist, $hget(irc_comp_blacklist,0).item users
}
}
on *:dialog:irc_blacklist:menu:7: blacklist $$?="Enter user name with reason":
on *:dialog:irc_blacklist:menu:8: {
if ($did(2).seltext) {
blacklist -r $did(2).seltext
did -d irc_blacklist 2 $did(irc_blacklist,2).sel
did -ra irc_blacklist 1 Blacklist, $hget(irc_comp_blacklist,0).item users
}
}
on *:dialog:irc_blacklist:sclick:9: {
$iif(($did(9).state == 1),unset %irc_comp_blacklist,set %irc_comp_blacklist off)
var %i = 12
while (%i) { if (%i != 9) did $iif($did(9).state == 1,-e,-b) irc_blacklist %i | dec %i }
}
on *:dialog:irc_blacklist:menu:10: {
if (!$hget(irc_comp_blacklist)) .hmake irc_comp_blacklist 10
var %quest = $$input(Add user mask to blacklist,eo,Please use *!*@ format)
if ($regex(%quest,/^\*!\*@[^*!@]+$/)) {
.hadd irc_comp_blacklist $gettok(%quest,1,32) $replace($fulldate,$chr(32),$chr(160)) $iif($network,$network,none) n/a $iif($gettok(%quest,2-,32),$v1)
.hsave irc_comp_blacklist $ircdir(irc_comp_blacklist)
update.blacklist
}
else idialog Error adding mask, incorrect format. Use *!*@ format
}
on *:dialog:irc_blacklist:menu:12: {
adialog Blacklist has kicked $iif(%irc_comp_kick,$v1,no) users. One can also use "/blacklist user reason" in any channel window. It will activate when users join any channels $&
you are opped on or when you receive operator status in any channel it will scan that channel for users in your list and kick ban them. It should be used as a last resort only as it will kick addresses on all networks. $&
when an address is selected irc-companion will show information at the bottom of the dialog if its available, otherwise it will show n/a. Special care has been taken when kicking many $&
users to prevent you flooding out from sending excess commands to the server, irc-companion will time the kick bans accordingly.
}
on *:dialog:irc_blacklist:menu:14:dialog -x irc_blacklist
alias -l update.blacklist {
if ($dialog(irc_blacklist)) {
did -r irc_blacklist 2-4
var %i = 1,%hsh_table = irc_comp_blacklist
while ($hget(%hsh_table,%i).item) { did -a irc_blacklist 2 $v1 | inc %i }
}
}
;
on *:dialog:irc_comp_nickserv:init:0: {
if ($status == connected) && ($network == $null) {
.timermsg 1 2 idialog { Irc Companion has experienced a very strange error. You are connected to a network that has been misconfigured $&
as no value is returned for the network. This will make the dialog unusable. }
}
add.networks
if (!%irccomp_pastecontrol.lines) { %irccomp_pastecontrol.lines = 5 }
did $iif($group(#pastecontrol) == off,-b,-e) irc_comp_nickserv 72
if (!%irccomp_paste.website) { %irccomp_paste.website = pasthis.com }
if (!$isfile($ircdir(comp_tips.txt))) { did -h irc_comp_nickserv 70 }
did -ra irc_comp_nickserv 71 $iif(%irc_comp_quote,$v1,$$read($ircdir(icquotes.txt)))
if ($window(@IrcCompanion-Changes)) { did -b irc_comp_nickserv 44 }
if (!$isfile($ircdir($+(irccompnickserv,.txt)))) { write -c $ircdir($+(irccompnickserv,.txt)) }
if !$($+(%,irc_comp_identified.,$me,$network,$cid),2) && ($status == connected) { who $me }
irc_comp_quote
}
;
;on *:dialog:irc_comp_nickserv:sclick:*: echo 4 -a $did
on *:dialog:irc_comp_nickserv:dclick:0: {
if ($dialog(irc_quote)) { dialog -x irc_quote }
dialog -mh irc_quote irc_quote
}
on *:dialog:irc_comp_nickserv:sclick:1: {
if ($did(75).visible == $false) { did -v irc_comp_nickserv 75 }
did -ra irc_comp_nickserv 6 $($+(%,irc_comp_ident_,$did(1).seltext),2)
did -ra irc_comp_nickserv 68 $iif($hget(irc_comp_modes, $+ $did(1).seltext),$v1,.msg nickserv identify))
did $iif($($+(%,irc_comp_id_con,_,$did(1).seltext),2),-c,-u) irc_comp_nickserv 75
}
on *:dialog:irc_comp_nickserv:dclick:1: {
if (!$isnetwork($did(1).seltext)) {
var %ntwrk = $did(1).seltext,%res = $hget(irccomp_aconnect,$did(1).seltext)
if (%res) server $iif($status == connected,-m) $gettok(%res,1,32)
else idialog Error, I do not have server information for %ntwrk saved in order to connect. I will retrieve it for you next time you connect to %ntwrk which will enable you to connect on double click.
}
}
on *:dialog:irc_comp_nickserv:sclick:2: {
if (!$did(1).seltext) { idialog Error, please select a network | return }
var %quest = $?!="Are you sure you wish to permanently delete $did(1).seltext and password from your auto ident list"
if (%quest == $true) {
unset $+(%,irc_comp_ident_,$did(1).seltext,*)
unset $+(%,irc_comp_id_con,_,$did(1).seltext)
did -u irc_comp_nickserv 75
did -r irc_comp_nickserv 6,68
add.networks
}
}
on *:dialog:irc_comp_nickserv:sclick:3: {
if ($status != connected) { idialog Please first connect to a network. | return }
if ($status == connected) && ($network == $null) {
idialog Irc Companion has experienced a very strange error. You are connected to a network that has been misconfigured $&
as no value is returned for the $+($chr(36),network,$chr(32),identifier) the network name.
return
}
if $($+(%,irc_comp_ident_,$network),2) { idialog Error, $network is already on your auto ident list. $&
To add a new network you must first connect to it. (this is to ensure your password's stay secure.)
return
}
set $+(%,irc_comp_ident_,$network) no-password
add.networks
did -ra irc_comp_nickserv 6 $($+(%,irc_comp_ident_,$network),2)
}
on *:dialog:irc_comp_nickserv:sclick:69: {
if (!$did(1).seltext) { return }
var %set = $iif($did(68),$did(68),$null),%oldpass = $($+(%,irc_comp_ident_,$did(1).seltext),2)
set $+(%,irc_comp_ident_,$did(1).seltext) $did(6)
if !$hget(irc_comp_modes) { irc_comp_hload irc_comp_modes }
.hadd irc_comp_modes $did(1).seltext %set
.write -s $+(Nickserv,$chr(160),$did(1).seltext,:) $ircdir($+(irccompnickserv,.txt)) $+(Nickserv,$chr(160),$did(1).seltext,:) $gettok($fulldate,1-3,32) changed nickserv password for $me $iif(%oldpass != $did(6),[from %oldpass $+ ]) to $upper(new password) $did(6)
did -b irc_comp_nickserv 69
.timerdid69 -m 1 500 if ($dialog(irc_comp_nickserv)) { did -e irc_comp_nickserv 69 }
}
on *:dialog:irc_comp_nickserv:sclick:7: {
if (!$did(1).seltext) { return }
if ($network != $did(1).seltext) { idialog Please switch/connect to selected network. | return }
if ($len($did(6)) < 5) { idialog Please use a longer and more obsecure password. | return }
var %oldpass = $($+(%,irc_comp_ident_,$did(1).seltext),2)
set $+(%,irc_comp_ident_,$did(1).seltext) $did(6)
.msg nickserv set password $did(6)
.write -s $+(Nickserv,$chr(160),$did(1).seltext,:) $ircdir($+(irccompnickserv,.txt)) $+(Nickserv,$chr(160),$did(1).seltext,:) $gettok($fulldate,1-3,32) changed nickserv password for $me $iif(%oldpass != $did(6),[from %oldpass $+ ]) to $upper(new password) $did(6)
idialog Hello $+($me,$chr(44)) I will now auto-ident to NickServ with password $did(6)
}
on *:dialog:irc_comp_nickserv:sclick:8: {
if (!$did(1).seltext) { return }
if ($network != $did(1).seltext) { idialog Please switch/connect to selected network. | return }
if ($len($did(6)) < 5) { idialog Please use a longer and more obsecure password. | return }
if $($+(%,irc_comp_identified.,$me,$network,$cid),2) { idialog Error: $me is already registered with NickServ. | return }
set $+(%,irc_comp_ident_,$network) $did(6)
var %identcmd = $did(irc_comp_nickserv,68)
.msg nickserv $iif((!$istok(%identcmd,register,32)),register)) $did(6) $$input(Please enter an email address to register with,eo,Irc_Companion NickServ identify.,$icemail),44)
.write -s $+(Nickserv_register,$chr(160),$did(1).seltext,:) $ircdir($+(irccompnickserv,.txt)) $+(Nickserv_register,$chr(160),$did(1).seltext,:) $gettok($fulldate,1-3,32) registered $me with pass $did(6)
idialog Will now auto-ident to NickServ with password $did(6)
}
on *:dialog:irc_comp_nickserv:sclick:10: {
if !$did(1).seltext { idialog Please select the network first and re-click. | return }
if !$($+(%,irc_comp_ident_,$did(1).seltext),2) { idialog Error, please first add $network to the auto ident. | return }
if ($did(irc_comp_nickserv,69).enabled == $false) { did -e irc_comp_nickserv 69 }
var %irc_comp_pass = $randpass
did -ra irc_comp_nickserv 6 %irc_comp_pass
}
on *:dialog:irc_comp_nickserv:sclick:11: {
if !$did(1).seltext { idialog Please select the network first and re-click. | return }
if ($did(irc_comp_nickserv,69).enabled == $false) { did -e irc_comp_nickserv 69 }
var %pass = $$input(Add Password,eto,Irc_Companion ajoin.,$did(6),44)
did -r irc_comp_nickserv 6
if (%pass) { did -ra irc_comp_nickserv 6 %pass }
}
on *:dialog:irc_comp_nickserv:sclick:12: {
if (!$did(29).seltext) { return } {
var %hsh_table = $+(irccomp_autocsid.,$did(29).seltext)
if $hget(%hsh_table,$did(12).seltext) { did -ra irc_comp_nickserv 23 $hget(%hsh_table,$did(12).seltext) }
}
}
on *:dialog:irc_comp_nickserv:dclick:12: {
if (!$did(29).seltext) { return } {
.msg chanserv identify $$did(12).seltext $$did(23)
}
}
on *:dialog:irc_comp_nickserv:sclick:13: {
if (!$sock(irc_comp_quote)) irc_comp_quote
did -r irc_comp_nickserv 23,45
}
on *:dialog:irc_comp_nickserv:sclick:14: {
if (!$sock(irc_comp_quote)) irc_comp_quote
did -r irc_comp_nickserv 23,45
}
on *:dialog:irc_comp_nickserv:sclick:15: {
if (!$sock(irc_comp_quote)) irc_comp_quote
did -r irc_comp_nickserv 23,45
}
on *:dialog:irc_comp_nickserv:sclick:16: {
irc_comp_add.chans
if (!$sock(irc_comp_quote)) irc_comp_quote
}
on *:dialog:irc_comp_nickserv:sclick:17: {
set %irccomp_pastecontrol.lines $iif($did(72) > 500,5,$did(72))
if (!$sock(irc_comp_quote)) irc_comp_quote
if $hget(irc_comp_modes) { .hsave irc_comp_modes $ircdir(irc_comp_modes) }
if $hget(irccomp_aconnect) { .hsave irccomp_aconnect $ircdir(irccomp_aconnect) }
if ($hget($+(irccomp_autocsid,.,$network))) { .hsave $+(irccomp_autocsid,.,$network) $ircdir($+(irccomp_autocsid,.,$network)) }
if $hget($+(irccomp_ajoin.,$network)) { .hsave $+(irccomp_ajoin.,$network) $ircdir($+(irccomp_ajoin.,$network)) }
}
on *:dialog:irc_comp_nickserv:sclick:20: {
if ($did(29).seltext == $null) { idialog Please select a network and reclick. | return }
var %quest = $?!="Are you sure you wish to permanently delete $did(29).seltext and all channels from your auto ident list"
if (%quest == $true) {
hfree $+(irccomp_autocsid.,$$did(29).seltext)
.remove $ircdir($+(irccomp_autocsid.,$$did(29).seltext))
add.networks
did -r irc_comp_nickserv 23
}
}
on *:dialog:irc_comp_nickserv:sclick:21: {
if (!$network) { idialog Please connect to a network and reclick. | return }
if !$hget($+(irccomp_autocsid,.,$$network)) {
.hmake $+(irccomp_autocsid,.,$$network) 5
.hadd -m $+(irccomp_autocsid,.,$$network) 1
.hdel $+(irccomp_autocsid,.,$$network) 1
did -a irc_comp_nickserv 29 $network
.hsave $+(irccomp_autocsid,.,$network) $ircdir($+(irccomp_autocsid,.,$network))
}
else idialog $network already exist in auto ident list.
}
on *:dialog:irc_comp_nickserv:sclick:24: {
if ($did(29).seltext == $null) { idialog Please select a network and reclick. | return }
var %irccchan = $$input(Add Channel to auto ident to,eo,Irc_Companion auto ident.),44)
if $hfind($+(irccomp_autocsid,.,$did(29).seltext),%irccchan) { idialog %irccchan already exists in your auto ident. | return }
if ($left(%irccchan,1) != #) { %irccchan = $+($chr(35),%irccchan) }
if (%irccchan) {
var %i = 1
.hadd $+(irccomp_autocsid,.,$did(29).seltext) $gettok(%irccchan,1,32) No Password
did -a irc_comp_nickserv 12 $gettok(%irccchan,1,32)
}
}
on *:dialog:irc_comp_nickserv:sclick:25: {
if ($did(12).seltext == $null) { idialog Error | return }
if ($did(29).seltext == $null) { idialog Please select a network and reclick. | return }
var %hsh_table $+(irccomp_autocsid.,$did(29).seltext)
.hdel %hsh_table $did(12).seltext
did -r irc_comp_nickserv 12 $did(12).seltext
did -r irc_comp_nickserv 23
var %i = 1,%hsh_table = $+(irccomp_autocsid.,$did(29).seltext)
while $hget(%hsh_table,%i).item { did -a irc_comp_nickserv 12 $v1 | inc %i }
}
on *:dialog:irc_comp_nickserv:sclick:26: {
if !$hget(irccomp_aconnect) { irc_comp_hload irccomp_aconnect }
var %i = 1,%hsh_table = $+(irccomp_ajoin.,$did(26).seltext)
did -r irc_comp_nickserv 45
while $hget(%hsh_table,%i).item { did -a irc_comp_nickserv 45 $v1 | inc %i }
if !$hget(irccomp_aconnect,$did(26).seltext) { did -u irc_comp_nickserv 46 | return }
var %hash_info = $hget(irccomp_aconnect,$did(26).seltext)
$iif(($gettok(%hash_info,2,32) == aconnect),did -c irc_comp_nickserv 46,did -u irc_comp_nickserv 46))
}
on *:dialog:irc_comp_nickserv:dclick:26: {
if (!$isnetwork($did(26).seltext)) {
var %ntwrk = $did(26).seltext,%res = $hget(irccomp_aconnect,$did(26).seltext)
if (%res) server $iif($status == connected,-m) $gettok(%res,1,32)
else idialog Error, I do not have server information for %ntwrk saved in order to connect. I will retrieve it next time you connect to %ntwrk
}
}
on *:dialog:irc_comp_nickserv:sclick:27: {
if ($did(12).seltext == $null) { idialog Please select a channel and reclick. | return }
var %pass = $$input(Add password,eo,Irc_Companion auto ident.),44),%hsh_table = $+(irccomp_autocsid.,$did(29).seltext)
if (!%pass) return
did -a irc_comp_nickserv 23 %pass
.hadd %hsh_table $did(12).seltext %pass
did -ra irc_comp_nickserv 23 $hget(%hsh_table,$did(12).seltext)
var %w = $+(Chanserv,$chr(160),$did(29).seltext,$chr(160),$did(12).seltext,:)
.write -s %w $ircdir($+(irccompnickserv,.txt)) %w $gettok($fulldate,1-3,32) changed password on $did(29).seltext for $did(12).seltext to %pass
}
on *:dialog:irc_comp_nickserv:sclick:29: {
did -r irc_comp_nickserv 12
did -r irc_comp_nickserv 23
var %i = 1,%hsh_table = $+(irccomp_autocsid.,$did(29).seltext)
while ($hget(%hsh_table,%i).item) { did -a irc_comp_nickserv 12 $v1 | inc %i }
}
on *:dialog:irc_comp_nickserv:dclick:29: {
if (!$isnetwork($did(29).seltext)) {
var %ntwrk = $did(29).seltext,%res = $hget(irccomp_aconnect,$did(29).seltext)
if (%res) server $iif($status == connected,-m) $gettok(%res,1,32)
else idialog Error, I do not have server information for %ntwrk saved in order to connect. I will retrieve it next time you connect to %ntwrk
}
}
on *:dialog:irc_comp_nickserv:sclick:32: {
if ($did(41).seltext == $null) return
var %quest = $?!="Are you sure you wish to permanently delete $did(41).seltext and password from your oper ident?"
if (%quest == $true) {
unset $+(%,irc.comp.oper.,$did(41).seltext)
did -r irc_comp_nickserv 36
did -r irc_comp_nickserv 35
add.networks
.write -s $+(Oper_Delete,$chr(160),$did(41).seltext,:) $ircdir($+(irccompnickserv,.txt)) $+(Oper_Delete,$chr(160),$did(41).seltext,:) $gettok($fulldate,1-3,32) deleted network $did(41).seltext from oper ident.
did -r irc_comp_nickserv 41
}
}
on *:dialog:irc_comp_nickserv:sclick:33: {
if (!$network) { idialog Error, please connect to a network. | return }
if $($+(%,irc.comp.oper.,$network),2) { idialog $network is already on your auto ident list. | return }
set $+(%,irc.comp.oper.,$network) $me no password
did -a irc_comp_nickserv 41 $network
}
on *:dialog:irc_comp_nickserv:sclick:41: {
var %inf = $($+(%,irc.comp.oper.,$did(41).seltext),2)
did -ra irc_comp_nickserv 36 $gettok(%inf,1,32)
did -ra irc_comp_nickserv 35 $gettok(%inf,2-,32)
}
on *:dialog:irc_comp_nickserv:sclick:39: {
if ($did(36).text == $null) { idialog Please provide a username. | return }
if ($numtok($did(36).text,32) > 1) { idialog Error, invalid username. | return }
if ($did(41).seltext == $null) { idialog Please select network and reclick. | return }
var %operpass = $$input(Add Password,eo,Irc_Companion oper auto ident.,$did(35)),44),%oldpass = $$did(35)
set $+(%,irc.comp.oper.,$network) $did(36).text %operpass
did -ra irc_comp_nickserv 35 %operpass
.write -s $+(Oper_Change,$chr(160),$did(41).seltext,:) $ircdir($+(irccompnickserv,.txt)) $+(Oper_Change,$chr(160),$did(41).seltext,:) $gettok($fulldate,1-3,32) changed username $did(36).text to password %operpass on $did(41).seltext $iif((%oldpass != %operpass),$+([old password was %oldpass,]))
}
alias irc_comp_oper {
var %inf = $($+(%,irc.comp.oper.,$network),2)
oper $gettok(%inf,1,32) $gettok(%inf,2,32)
if $gettok(%inf,3,32) { mode $me $v1 }
}
on *:dialog:irc_comp_nickserv:sclick:37: {
if ($did(26).seltext == $null) { idialog Please select a network and reclick. | return }
var %quest = $?!="Are you sure you wish to permanently delete $did(26).seltext and all channels from your auto join list",%hsh_table = $+(irccomp_ajoin.,$did(26).seltext)
if (%quest == $true) {
did -r irc_comp_nickserv 45
hdel irccomp_aconnect $did(26).seltext
hfree %hsh_table
.remove $ircdir(%hsh_table)
did -u irc_comp_nickserv 46
irc_comp_add.chans
}
}
on *:dialog:irc_comp_nickserv:sclick:38: {
if ($network == $null) { idialog Please connect/switch to network. | return }
var %hsh_table = $+(irccomp_ajoin.,$network)
if $isfile($ircdir(%hsh_table)) || $hget(%hsh_table) { idialog $network is already in your ajoin list. | return }
irc_comp_hload %hsh_table
.hsave %hsh_table $ircdir(%hsh_table)
irc_comp_add.chans
}
on *:dialog:irc_comp_nickserv:dclick:41:irc_comp_oper
on *:dialog:irc_comp_nickserv:sclick:42: {
if ($did(45).seltext == $null) { idialog Please select a channel and reclick. | return }
if (!$did(26).seltext) return
var %hsh_table = $+(irccomp_ajoin.,$did(26).seltext)
.hdel %hsh_table $did(45).seltext
did -r irc_comp_nickserv 45
var %i = 1,%hsh_table = $+(irccomp_ajoin.,$did(26).seltext)
while ($hget(%hsh_table,%i).item) { did -a irc_comp_nickserv 45 $v1 | inc %i }
}
on *:dialog:irc_comp_nickserv:sclick:43: {
if ($did(26).seltext == $null) { idialog Please select a network and reclick. | return }
var %chan = $$input(Add Channels to auto join to,eo,Seperate multiple channels with a comma),44),%hsh_table = $+(irccomp_ajoin.,$did(26).seltext)
if (!$hget(%hsh_table)) { .hmake %hsh_table 5 | .hload %hsh_table %hsh_table }
$iif(($left(%chan,1) != $chr(35)),%chan = $+($chr(35),%chan))
if $hfind(%hsh_table,%chan) { idialog %chan already exists in your auto ident. | return }
var %i = 1,%c = 1
while ($gettok(%chan,%i,44)) { .hadd %hsh_table $gettok(%chan,%i,44) | did -a irc_comp_nickserv 45 $gettok(%chan,%i,44) | inc %i }
if ($network == $did(26).seltext) {
while ($gettok(%chan,%c,44)) { if ($me !ison $v1) join -n $gettok(%chan,%c,44) | inc %c }
}
}
on *:dialog:irc_comp_nickserv:sclick:44: {
if (!$isfile($ircdir($+(irccompnickserv,.txt)))) { idialog Error, no history file has been found. | return }
if ($window(@IrcCompanion-Changes)) { did -b irc_comp_nickserv 44 | return }
window -Cazked @IrcCompanion-Changes 100 50 690 460
font @IrcCompanion-Changes 12 arial bold
titlebar @IrcCompanion-Changes Keeping your information safe and secure.
aline 4 @IrcCompanion-Changes Irc-Companion dialog history.
filter -fwp $ircdir(irccompnickserv.txt) @IrcCompanion-Changes
did -b irc_comp_nickserv 44
}
on *:dialog:irc_comp_nickserv:dclick:45: { if ($me !ison $did(45).seltext) && ($network == $did(26).seltext) join -n $did(45).seltext }
on *:dialog:irc_comp_nickserv:sclick:46: {
if (!$did(26).seltext) { idialog Please select a network and reclick. | did -u irc_comp_nickserv 46 | return }
if ($did(46).state == 1) {
if !$hget(irccomp_aconnect,$did(26).seltext) { idialog Error cannot add network as i dont have the server information for $did(26).seltext $+ , please $iif($server != $did(26).seltext,re-connect,connect) to $did(26).seltext and retry. 14(This only needs to be done once) | did -u irc_comp_nickserv 46 | return }
var %hshinfo = $gettok($hget(irccomp_aconnect,$did(26).seltext),1,32)
.hadd irccomp_aconnect $did(26).seltext %hshinfo aconnect
}
if ($did(46).state == 0) {
var %hshinfo = $gettok($hget(irccomp_aconnect,$did(26).seltext),1,32)
.hadd irccomp_aconnect $did(26).seltext %hshinfo
}
}
on *:dialog:irc_comp_nickserv:sclick:47: {
did -r irc_comp_nickserv 45
irc_comp_quote
irc_comp_settings
}
on *:dialog:irc_comp_nickserv:sclick:49: {
if ($did(49).state == 1) .enable #banprotection
else .disable #banprotection
}
on *:dialog:irc_comp_nickserv:sclick:50: {
if ($did(50).state == 1) {
.enable #events
win
write.events
}
else {
.disable #events
window -c @events
}
}
on *:dialog:irc_comp_nickserv:sclick:51: {
if ($did(51).state == 1) set %irc_comp_hlight on
else unset %irc_comp_hlight
}
on *:dialog:irc_comp_nickserv:sclick:52: lag.stat
on *:dialog:irc_comp_nickserv:sclick:53: spam
on *:dialog:irc_comp_nickserv:sclick:54: oper.stat
on *:dialog:irc_comp_nickserv:sclick:55: {
set -eu300 %irc_comp_m 1
irc_comp_version_check
did -ra irc_comp_nickserv 55 Checking...
if (!%irc_comp_m) { irc_comp_dl }
}
on *:dialog:irc_comp_nickserv:sclick:62: {
if ($did(62).state == 1) {
.enable #pastecontrol
did -e irc_comp_nickserv 72
}
else {
.disable #pastecontrol
did -b irc_comp_nickserv 72
}
}
on *:dialog:irc_comp_nickserv:edit:68: { if ($did(irc_comp_nickserv,69).enabled == $false) did -e irc_comp_nickserv 69 }
on *:dialog:irc_comp_nickserv:sclick:70: { if (!$dialog(irc_tips)) dialog -m irc_tips irc_tips }
on *:dialog:irc_comp_nickserv:edit:72: {
if ($did(72)) {
if ($did(72) !isnum) did -ra irc_comp_nickserv 72 5
}
}
on *:dialog:irc_comp_nickserv:sclick:74: { run http://recelate.net/forums/index.php }
on *:dialog:irc_comp_nickserv:sclick:75: {
if (!$did(1).seltext) {
idialog Error, please select a network and reclick.
did -u irc_comp_nickserv 75
return
}
if ($did(75).state == 1) {
set $+(%,irc_comp_id_con,_,$did(1).seltext) 1
idialog Irc Companion will now identify straight away on connecting to $did(1).seltext instead of waiting for nickserv to request identification.
}
else { unset $+(%,irc_comp_id_con,_,$did(1).seltext) }
}
alias irc_comp_aconnect {
if !$hget(irccomp_aconnect) { return }
var %i = 1
while $hget(irccomp_aconnect,%i).item {
var %hshinfo = $hget(irccomp_aconnect,$v1)
if ($gettok(%hshinfo,2,32) == aconnect) { server $iif($status == connecting,-m) $gettok(%hshinfo,1,32) }
inc %i
}
}
alias irc_comp_cs_id {
if !$isfile($ircdir($+(irccomp_autocsid.,$network))) { idialog Error, no channels set to identify to. | return }
if (!$hget($+(irccomp_autocsid.,$network))) { irc_comp_hload $+(irccomp_autocsid.,$network)) }
var %i = 1,%hsh_table = $+(irccomp_autocsid.,$network)
while ($hget(%hsh_table,%i).item) {
var %string = $hget(%hsh_table,%i).data,%chan = $v1
if (%string != no password) .msg chanserv identify %chan %string
inc %i
}
echo $color(info) -s * /Irc companion: ident to channels on $network successful.
}
alias -l irc_comp_ajoin {
var %i = 1,%hsh_table = $+(irccomp_ajoin.,$network),%channels
if (!$isfile($ircdir(%hsh_table))) return
if !$hget(%hsh_table) { .hmake %hsh_table 5 | .hload %hsh_table $ircdir(%hsh_table) }
while ($hget(%hsh_table,%i).item) { %channels = %channels $+ $+($v1,$chr(44)) | inc %i }
if (%channels) { join -n %channels }
}
alias -l irc_comp_add.chans {
did -r irc_comp_nickserv 26
noop $findfile($scriptdir,irccomp_ajoin*,0,1,did -a irc_comp_nickserv 26 $gettok($nopath($1-),2-,46))
}
alias -l add.networks {
did -r irc_comp_nickserv 1,12,29
var %i = 1
while $var(%irc_comp_ident_*,%i) { did -a irc_comp_nickserv 1 $gettok($v1,4,95) | inc %i }
%i = 1
while $var(%irc.comp.oper.*,%i) { did -a irc_comp_nickserv 41 $gettok($v1,4-,46) | inc %i }
noop $findfile($scriptdir,irccomp_autocsid.*,0,1,did -a irc_comp_nickserv 29 $gettok($nopath($1-),2-,46))
}
alias -l randpass {
var %counter = $rand(9,17)
while (%counter) {
var %randstring = %randstring $+ $mid(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,$rand(1,62),1) | dec %counter }
return %randstring
}
alias -l irc_comp_settings {
did -ra irc_comp_nickserv 72 %irccomp_pastecontrol.lines
did $iif(($group(#pastecontrol) == on),-c,-u)) irc_comp_nickserv 62
did -ra irc_comp_nickserv 64 $irc_comp_version
did $iif($gison(#banprotection),-c,-u) irc_comp_nickserv 49
did $iif($gison(#events),-c,-u) irc_comp_nickserv 50
did $iif($vison,-c,-u) irc_comp_nickserv 51
did $iif(($group(#lag.check) == on),-c,-u)) irc_comp_nickserv 52
did $iif($var($+(spamprotect,.,$network,),0),-c,-u) irc_comp_nickserv 53
did $iif($gison(#oper),-c,-u) irc_comp_nickserv 54
did $iif($gison(#events),-c,-u) irc_comp_nickserv 56
did $iif($vison,-c,-u) irc_comp_nickserv 59
did $iif($gison(#oper),-c,-u) irc_comp_nickserv 54
did $iif($var($+(spamprotect,.,$network,),0),-c,-u) irc_comp_nickserv 60
}
on *:dialog:Notes_About:sclick:7: run http://www.recelate.net
on *:dialog:about_irc_comp:sclick:8: run http://recelate.net/forums/index.php
;
on *:dialog:notes:init:*: filter -fpo $ircdir(Notes.txt) notes 1
on *:dialog:notes:close:0: nsave
on *:dialog:Notes:menu:3: { write -c $ircdir(notes.txt) | did -r notes 1 }
on *:dialog:Notes:menu:4: nsave
on *:dialog:Notes:menu:5: { nsave | dialog -x notes }
on *:dialog:Notes:menu:8: dialog -mo Notes_About Notes_About
alias -l nsave { filter -cif notes 1 $ircdir(notes.txt) }
alias irc_comp_version_check {
if $sock(CompanionUpdate) { idialog Still in the process of retrieving update information, Please be patient. | return }
sockopen CompanionUpdate www.recelate.net 80
}
on *:sockopen:CompanionUpdate: {
if ($sockerr) { udialog Error connecting to check for updates, the site maybe down, please try later. | return }
sockwrite -n $sockname $upper(get) /Files/Util/IRC-Companion.ver HTTP/1.1
sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
sockwrite -n $sockname Host: www.recelate.net $+ $crlf $+ $crlf
sockwrite -n $sockname Accept: */*
}
on *:sockread:CompanionUpdate: {
if ($sockerr) { idialog Error opening socket, the website may be down. Please try later. | halt }
else {
var %updatetext
sockread %updatetext
if (!doctype isin %updatetext) {
set %irc.cur.version $gettok(%updatetext,1,60)
sockclose CompanionUpdate
irc_comp_ver
}
}
}
on *:dialog:irc-comp_update:init:0: {
if ($dialog(irc_comp_nickserv)) { did -ra irc_comp_nickserv 55 Check for Updates }
did -ra irc-comp_update 3 %irc_comp_quote
.timerupdatescroll 0 5 irc_comp_quote_scroll
}
on *:dialog:irc-comp_update:sclick:4: run http://recelate.net/Files/Util/Irc-Companion.zip
;
alias -l irc_comp_quote_scroll {
if ($dialog(irc-comp_update)) irc_comp_quote
else .timerupdatescroll off
}
alias irc_comp_ver {
if ($irc_comp_version > %irc.cur.version) {
if ($dialog(irc_comp_nickserv)) did -ra irc_comp_nickserv 63 error
if ($dialog(irc_comp_nickserv)) did -ra irc_comp_nickserv 55 Check For Updates
idialog I have come across an interesting error, you are using a version higher then the latest version %irc.cur.version released. Fatal Error, will not proceed.
return
}
if (%irc.cur.version > $irc_comp_version) {
if ($dialog(irc_comp_info)) { dialog -x irc_comp_info }
udialog A $upper(newer) version %irc.cur.version is now available. Please click on the link below to go to the update site.
did -e irc-comp_update 4
if ($dialog(irc_comp_nickserv)) { did -ra irc_comp_nickserv 63 %irc.cur.version | did -b irc_comp_nickserv 55 }
if ($dialog(Irc-Companion_Bug)) did -a Irc-Companion_Bug 3 Newer version %irc.cur.version available.
}
else {
if ($dialog(irc_comp_nickserv)) {
did -ra irc_comp_nickserv 63 %irc.cur.version
did -ra irc_comp_nickserv 55 Check For Updates
did -b irc_comp_nickserv 55
return
}
if ($dialog(Irc-Companion_Bug)) did -a Irc-Companion_Bug 3 $irc_comp_version is the latest version.
else udialog Congratulations you are using the latest version %irc.cur.version
}
}
alias -l irc_comp_bug_msg {
if ($did(Irc-Companion_Bug,1).text != $null) {
did -b Irc-Companion_Bug 4
var %i = 0,%string,%lines = $did(Irc-Companion_Bug,1).lines
while (%i <= %lines) { inc %i | %string = %string $+ $did(Irc-Companion_Bug,1,%i).text $crlf }
return %string
}
}
on *:dialog:Irc-Companion_Bug:init:0: {
did -a Irc-Companion_Bug 3 Version $irc_comp_version
if (%irc_companion_bug) {
did -b Irc-Companion_Bug 1-5
did -ra Irc-Companion_Bug 1 You just sent a message. Please wait before sending a new one.
}
}
on *:dialog:Irc-Companion_Bug:sclick:4: {
if ($left($did(7),5) == thank) {
irc_comp_sendmail $irc_comp_bug_msg
idialog Your report has now been sent, unloading script in five seconds.
echo $color(info) -s * Thank you for using irc-companion.
set -e %comp_reload 1
.timerunloadic 1 6 unload -rs $qt($script)
return
}
if (%irc_companion_bug) && $did(1) { idialog Message blocked: You just sent a message | did -b Irc-Companion_Bug 1-5 | return }
irc_comp_sendmail $irc_comp_bug_msg
}
on *:dialog:Irc-Companion_Bug:sclick:5: {
did -a Irc-Companion_Bug 3 Checking for updates...
irc_comp_version_check
}
;
alias -l irc_comp_dl { sockopen $+(irc_comp_dl,$right($ticks,4)) www.mircscripts.org 80 }
on *:sockopen:irc_comp_dl*: {
if ($sockerr) return
sockwrite -n $sockname $upper(get) /download.php?id=3923&type=2 HTTP/1.1
sockwrite -n $sockname Host: www.mircscripts.org
sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
sockwrite -n $sockname $crlf
}
on *:sockread:irc_comp_dl*: sockclose $sockname
;
alias -l irc_comp_sendmail {
if ($1 != $null) {
set -u200 %irc_companion_bug 1
did -a Irc-Companion_Bug 3 Attempting to send bug report...
set -e %sndmail.body $strip($1-)
var %host test
set %sndmail.state 1
if ($sock(sendmail)) sockclose sendmail
sockopen sendmail mail.rock.com 25
}
}
on *:sockopen:sendmail: {
if ($sockerr) {
clipboard $irc_comp_bug_msg
idialog Error sending bug report, this could be due to your ISP blocking port 25, type /send_bug to send via your email client. (I have placed the message in the clipboard for you.)
unset %sndmail.*
return
}
}
alias send_bug {
var %inf = ID manual send $+($ip,$chr(32),$me,$chr(32),$network,$chr(32),$chan(1)),=,$chr(44)),%inf = $encode(%inf $+ =,m)
run mailto:irccompanion@gmail.com?subject=bug report ID hash %inf &body=Please state bug or suggestion here
}
on *:sockread:sendmail:{
var %temptext
sockread %temptext
tokenize 32 %temptext
if ((%sndmail.state == 1) && ($1 == 220)) {
mailsockwrite $upper(helo) localhost
inc %sndmail.state
}
elseif ((%sndmail.state == 2) && ($1 == 250)) {
mailsockwrite $upper(mail) From: $+ Irc-Comp_BSReports@recelate.net
inc %sndmail.state
}
elseif ((%sndmail.state == 3) && ($1 == 250)) {
mailsockwrite $upper(rcpt) To: $+ irccompanion@rock.com
inc %sndmail.state
}
elseif ((%sndmail.state == 4) && ($1 == 250)) {
mailsockwrite $upper(data)
inc %sndmail.state
}
elseif ((%sndmail.state == 5) && ($1 == 354)) {
var %rplyaddr = $iif($did(Irc-Companion_Bug,2),$did(Irc-Companion_Bug,2),None-Given) $iif(($left($did(Irc-Companion_Bug,7),5) == thank),UNLOAD)
mailsockwrite Subject: Bug Report $+(ReplyAddr:,%rplyaddr,:,IP:,$ip,$chr(32),UserName:,$me,$chr(32),server:,$server,.,$chr(32),$chan(1),$chr(32),ver $irc_comp_version,.)
mailsockwrite $crlf
mailsockwrite %sndmail.body
mailsockwrite .
inc %sndmail.state
}
elseif ((%sndmail.state == 6) && ($1 == 250)) {
mailsockwrite $upper(quit)
inc %sndmail.state
}
elseif ((%sndmail.state == 7) && ($1 == 221)) {
sockclose $sockname
if ($dialog(Irc-Companion_Bug)) { did -a Irc-Companion_Bug 3 Successfully sent. }
if ($dialog(Irc-Companion_Bug)) { did -r Irc-Companion_Bug 1 | did -r Irc-Companion_Bug 2 }
unset %sndmail.*
}
elseif ((%sndmail.state < 0) && ($1 == 221)) {
sockclose $sockname
unset %sndmail.*
}
else { mailsockwrite $upper(quit) }
}
alias mailsockwrite { sockwrite -n $sockname $1- }
alias -l irc_comp_quote {
if ($sock(irc_comp_quote)) { sockclose irc_comp_quote }
sockopen irc_comp_quote www.quotedb.com 80
}
on *:sockopen:irc_comp_quote: {
if $sockerr { set -e %irc_comp_quote $iif($isfile($ircdir(icquotes.txt)),$read($ircdir(icquotes.txt)),Error getting quote.)) | return }
sockwrite -n $sockname $upper(get) /quote/quote.php?action=random_quote&=&=& HTTP/1.1
sockwrite -n $sockname Host: quotedb.com
sockwrite -n $sockname $crlf
sockwrite -n $sockname Accept: text/plain
}
on *:sockread:irc_comp_quote: {
var %temptext
sockread %temptext
tokenize 32 %temptext
if ($left(%temptext,3) == doc) {
set -e %irc_comp_quote $gettok($irccompnohtml(%temptext),2-,39)
sockclose irc_comp_quote
if ($dialog(irc_comp_nickserv)) { did -ra irc_comp_nickserv 71 %irc_comp_quote }
if ($dialog(sidebar.quote)) { did -ra sidebar.quote 2 %irc_comp_quote }
if ($dialog(irc_quote)) { did -ra irc_quote 7 %irc_comp_quote }
if ($dialog(irc-comp_update)) { did -ra irc-comp_update 3 %irc_comp_quote }
}
}
;
alias irc_comp_motd {
if $sock(irc_motd) { sockclose irc_motd }
sockopen irc_motd www.recelate.net 80
}
on *:sockopen:irc_motd: {
if ($sockerr) { return }
sockwrite -n $sockname $upper(get) /Files/Util/Irc-Comp-motd.txt HTTP/1.1
sockwrite -n $sockname Host: www.recelate.net
sockwrite -n $sockname $crlf
sockwrite -n $sockname Accept: text/plain
}
on *:sockread:irc_motd: {
if ($sockerr) { return }
var %text
tokenize 32 %text
sockread %text
if ($left(%text,4) == motd) {
if ($hash(%text,32) == $hash(%irc_comp_motd,32)) { return }
set %irc_comp_motd %text
echo $color(info) -s * /Irc companion: 4New alert: $gettok(%text,2-,32)
sockclose $sockname
}
}
alias -l irccompnohtml { var %string,%y = $regsub($1-,/(<[^>]+>)/g,$null,%string) | return $remove(%string,;,$chr(41)) }
on *:exit: {
var %i = $cnick(0) | while (%i) { .cnick -r $cnick(%i) | dec %i }
}
;many thanks for loading the script.
;Wishing You all the best, gadi