alias addon.clone-x {
if (($1 isnum) && ($2 isnum)) {
set %clone-x.fcol $1 | set %clone-x.bcol $2
linesep -s
echo *** Changed color scheme. Now it is 1,15 %clone-x.fcol $+ $colour(no) $+ , $+ $colour(back) (foreground), 1,15 %clone-x.bcol $+ $colour(no) $+ , $+ $colour(back) (background) | echo *** Example: $addon.clone-x.echo(#channel,$me,user@host,*!*us*@host,basher13) | echo *** Type '/addon.clone-x <forecolor> <backcolor>' to change the scheme (ex.: /addon.clone-x 00 12)
linesep -s
halt
}
if ($1) {
unset %clone-x.x | :z | inc %clone-x.x
set %clone-x.clone $address($nick($2,%clone-x.x),2)
if (%clone-x.clone == $null) { if (%clone-x.foundclones) goto cl.foundclones | unset %clone-x.x %cloneoj.isclone %clone-x.foundclones | return $false }
if (%clone-x.clone == $address($1,2)) { if ($nick($2,%clone-x.x) == $1) goto z | if (%clone-x.isclone) { set %clone-x.isclone %clone-x.isclone $+ , $nick($2,%clone-x.x) | set %clone-x.foundclones yes } | else { set %clone-x.isclone %clone-x.isclone $nick($2,%clone-x.x) | set %clone-x.foundclones yes } }
goto z
:cl.foundclones | echo $2 $addon.clone-x.echo($2,$1,$3,$mid($address($1,2),4,$calc($len($address($1,2)) - 3)),%clone-x.isclone) | unset %clone-x.x %clone-x.isclone %clone-x.foundclones | addon.clone-x.beep2 | return $true
}
linesep -s | echo *** Current color scheme: 1,15 %clone-x.fcol $+ $colour(no) $+ , $+ $colour(back) (foreground), 1,15 %clone-x.bcol $+ $colour(no) $+ , $+ $colour(back) (background) | echo *** Example: $addon.clone-x.echo(#channel,$me,user@host,*!*us*@host,c0ld) | echo *** Type '/addon.clone-x <forecolor> <backcolor>' to change the scheme (ex.: /addon.clone-x 00 12) | linesep -s
}
alias addon.clone-x.beep { linesep -s | if ($1 == on) set %clone-x.beep 1 | elseif ($1 == off) set %clone-x.beep 0 | echo *** $iif(%clone-x.beep,Addon will beep when a clone joins,Addon won't beep when a clone joins) | echo *** Type '/addon.clone-x.beep <on|off>' to turn on/off beeping when a clone joins | linesep -s }
alias addon.clone-x.beep2 if (%clone-x.beep) beep
alias addon.clone-x.cols return $+ %clone-x.fcol $+ , $+ %clone-x.bcol
on ^*:join:#:{ if ($nick == $me) goto x | if ($addon.clone-x($nick,$chan,$remove($address,!,~,*))) halt | :x }
on *:load:{ linesep -s | echo *** Loaded addon .:joinclones-scan:. Disturb by basher13 | echo *** Type '/addon.clone-x' to config color scheme | echo *** Type '/addon.clone-x.beep <on|off>' to turn on/off beeping when a clone joins | echo | linesep -s | set %clone-x.fcol $colour(back) | set %clone-x.bcol $colour(hi) | set %clone-x.beep 0 }
; in this alias, 'addon.clone-x.echo', you can change the join echo format.. just replace what you want, EXCEPT these identifiers:
; $1 ............................................................. #channel
; $2 ............................................................. nick that joins
; $3 ............................................................. address of nick
; $4 ............................................................. mask that identifies the clones
; $5- ............................................................ all the clones
; $addon.clone-x.cols ................................. color scheme
; $iif($chr(32) isin $5-,clones,clone) ............. exception: you can change it. you just must know that it is an identifier that check the number of clones. if the n. of clones is 1, it returns 'clone'. else, it returns 'clones'.
; ah.. don't forget the '$+'... $2($3) is wrong; $2 $+ ( $+ $3 $+ ) is right.
alias addon.clone-x.echo { return $addon.clone-x.cols $+ *** $2 ( $+ $3 $+ ) has joined $1 [ $+ $iif($chr(32) isin $5-,clones,clone) $+ ( $+ $4 $+ ): $5- $+ ] }