קוד PHP:
; ———————————————————————————————————————————————————————
; —— Clone scanner 1.8
; —— Author: foobar (Ken on irc.lucidchat.net)
; —— Usage: Scan and kick clones
; ————————————————————
; —— What it does:
; This snippet can either return, echo, or display clones from a channel.
; There is also the ability to kick clones; see below.
; ————————————————————
; —— Syntax: $clone(#) $clone(*!*@*[,#])
; $clone(*!*@*[,#]) : returns all clones for address *!*@* (and on chan # if specified - # not required)
; $clone(#) : returns the results or $false
; ———————————————————————————————————————————————————————
alias clone {
var %error = echo -atc ctcp * /clone:
if ($wildtok($1,#*,1,32)) {
var %cchan = $gettok($1-,$findtok($1-,$v1,32),32)
if (!$chan(%cchan)) {
%error Not a valid channel.
halt
}
if (!$ialchan(*,%cchan,0)) who %cchan
var %x = 1
while ($nick(%cchan,%x)) {
var %cget = $address($v1,2)
if ($ialchan(%cget,%cchan,0) > 1) && ($nick(%cchan,%x) !isin $read(clone.txt,1)) {
bwrite clone.txt -1 -1 $+($left($regsubex($str(~,$ialchan(%cget,%cchan,0)),/~/g,$+($ialchan(%cget,%cchan,\n).nick,$chr(32))),-1),$chr(40),%cget,$chr(41),$chr(44))
}
inc %x
}
bread clone.txt 0 $file(clone.txt).size &cdump
if (!$bfind(&cdump,0,$chr(44))) {
if ($isid) return $false
else %error No clones found
return
}
.remove clone.txt
return $left($replace($bvar(&cdump,1,$bvar(&cdump,0)).text,-,$chr(32)),-1)
}
if (*!*@* iswm $1) {
var %cchan = $iif($2 && $chan($2),$2,$active), %cget = $1
if ($ialchan(%cget,%cchan,0) > 1) {
return $regsubex($str(~,$v1),/~/g,$+($ialchan(%cget,%cchan,\n).nick,$chr(32)))
}
else return $false
}
else return ERR_PARAMS
}
raw 352:*:haltdef
raw 315:*:haltdef
on me:*:join:who #
on *:join:#:{
if ($clone($wildsite)) echo -atc CTCP * —› CLONES: $v1
}
on ^*:hotlink:CLONES*:#:$iif($me isop #,return,halt)
on *:hotlink:CLONES*:#:{
var %cline = $gettok($hotline,$+($calc($gettok($hotlinepos,1,32) +1),-),32), %x = 1
while ($gettok(%cline,%x,32)) {
if ($me != $v1) kick # $v2
inc %x
}
}
menu channel {
-
Clone scanner:echo -a $clone(#)
}