#mortalkombatSINGLE on
alias -l serv { return irc.plasa.com irc.telkom.net.id irc.indo.net.id irc.big.net.id irc.jatara.net.id irc.citra.net.id irc.uii.net.id irc.jmn.net.id }
alias sx { sockwrite -nt $1- }
alias F1 hfree -sw foes | unset %kicker | .set %jn 0
alias F2 .set %warbot $iif($?="Bot Name?",$v1,MORTALKOMBAT) | /warbot %warbot irc.plasa.com
alias F3 /sockwrite -nt * part %c
alias F4 /sockwrite -nt $sock(*,1) join %c
alias F7 hfree -sw warbot_* | hfree -sw foes | unset %k | set %c $iif($?="War Channel?",$v1,#hell) | /sockclose *
alias warbot {
var %nick $1, %serv = $2, %sockname = $+(warbot_,%nick)
if $regex($2,^(.*).*)$) { var %serv $regml(1), %port = $regml(2) }
elseif $regex($2,^(.*)$) { var %serv $regml(1), %port = 6667 }
.sockclose %sockname | .sockopen %sockname %serv %port
sockmark %sockname Connecting
hadd -m %sockname me %nick
}
on *:sockopen:warbot_*:{
var %me = $hget($sockname,me)
var %user $lower($regsubex(%me,/\W/g,))
sx $sockname NICK %me
sx $sockname user %user * * : 4,1\ 10M 4\ 1,10ORTAL 4,1\ 10,1KOMBAT 4,1\
.sockmark %sockname *
.inc %nserv
}
on *:sockread:warbot_*:{
if ($sockerr > 0) { return }
var %me = $hget($sockname,me)
sockread -f %raw
if ($sockbr == 0) { return }
if ($gettok(%raw, 1, 32) == PING) { sockwrite -n $sockname PONG $gettok(%raw,2-,32) }
if ($gettok(%raw, 2, 32) == 376) {
echo 4 -a $sockname Successfully Connected...
.timer -mc 3 30 sx $sock(warbot_*,1).name join %c
}
if ($gettok(%raw, 2, 32) == 433) {
/warbot %warbot $+ _ $gettok($serv,%nserv,32)
sz
}
if ($gettok(%raw, 2, 32) == ERROR) { sz $sockname }
if ($gettok(%raw, 2, 32) == KICK) && ($hget($sockname,me) == $gettok(%raw,4,32)) {
var %bn = $sock(*,0) | .inc %jn | if (%jn > %bn) { .set %jn 1 }
.set %k $gettok($right(%raw,-1),1,33)
.inc %mekick
if (%nserv > { .set %nserv 1 }
if (%mekick >= 3) {
/F3
.unset %mekick
/warbot %warbot $gettok($serv,%nserv,32)
halt
}
if (!$hfind(foes,%k,0)) { hadd -m foes %k }
if (!$hfind(foes,$mask($gettok(%raw,1,32),2),0)) { hadd -m foes $mask($gettok(%raw,1,32),2) }
sx $sock(warbot_*,1).name join %c
}
if ($gettok(%raw, 2, 32) == 401) { halt }
if ($gettok(%raw, 2, 32) == 441) { halt }
if ($gettok(%raw, 2, 32) == JOIN) && ($pos(%raw,$hget($sockname,me),1) > 0) { sx $sock(warbot_*,1).name $eval(kick %c %k $1) : $+ 4,1\ 10M 4\ 1,10ORTAL 4,1\ 10,1KOMBAT 4,1\ }
if ($gettok(%raw, 2, 32) == JOIN) {
var %n = $gettok($right(%raw,-1),1,33)
if ($hfind(foes,$mask($gettok(%raw,1,32),2),0)) { sx $sock(warbot_*,1).name $eval(kick %c %n $1) : $+ 4,1\ 10M 4\ 1,10ORTAL 4,1\ 10,1KOMBAT 4,1\
}
}
}
alias sz {
var %n = $sockname
sockclose %n | /echo -a %n Remote Quit
sockopen %n $gettok($serv,%nserv,32) 6667
}
#mortalkombatSINGLE end
alias -l serv { return irc.plasa.com irc.telkom.net.id irc.indo.net.id irc.big.net.id irc.jatara.net.id irc.citra.net.id irc.uii.net.id irc.jmn.net.id }
alias sx { sockwrite -nt $1- }
alias F1 hfree -sw foes | unset %kicker | .set %jn 0
alias F2 .set %warbot $iif($?="Bot Name?",$v1,MORTALKOMBAT) | /warbot %warbot irc.plasa.com
alias F3 /sockwrite -nt * part %c
alias F4 /sockwrite -nt $sock(*,1) join %c
alias F7 hfree -sw warbot_* | hfree -sw foes | unset %k | set %c $iif($?="War Channel?",$v1,#hell) | /sockclose *
alias warbot {
var %nick $1, %serv = $2, %sockname = $+(warbot_,%nick)
if $regex($2,^(.*).*)$) { var %serv $regml(1), %port = $regml(2) }
elseif $regex($2,^(.*)$) { var %serv $regml(1), %port = 6667 }
.sockclose %sockname | .sockopen %sockname %serv %port
sockmark %sockname Connecting
hadd -m %sockname me %nick
}
on *:sockopen:warbot_*:{
var %me = $hget($sockname,me)
var %user $lower($regsubex(%me,/\W/g,))
sx $sockname NICK %me
sx $sockname user %user * * : 4,1\ 10M 4\ 1,10ORTAL 4,1\ 10,1KOMBAT 4,1\
.sockmark %sockname *
.inc %nserv
}
on *:sockread:warbot_*:{
if ($sockerr > 0) { return }
var %me = $hget($sockname,me)
sockread -f %raw
if ($sockbr == 0) { return }
if ($gettok(%raw, 1, 32) == PING) { sockwrite -n $sockname PONG $gettok(%raw,2-,32) }
if ($gettok(%raw, 2, 32) == 376) {
echo 4 -a $sockname Successfully Connected...
.timer -mc 3 30 sx $sock(warbot_*,1).name join %c
}
if ($gettok(%raw, 2, 32) == 433) {
/warbot %warbot $+ _ $gettok($serv,%nserv,32)
sz
}
if ($gettok(%raw, 2, 32) == ERROR) { sz $sockname }
if ($gettok(%raw, 2, 32) == KICK) && ($hget($sockname,me) == $gettok(%raw,4,32)) {
var %bn = $sock(*,0) | .inc %jn | if (%jn > %bn) { .set %jn 1 }
.set %k $gettok($right(%raw,-1),1,33)
.inc %mekick
if (%nserv > { .set %nserv 1 }
if (%mekick >= 3) {
/F3
.unset %mekick
/warbot %warbot $gettok($serv,%nserv,32)
halt
}
if (!$hfind(foes,%k,0)) { hadd -m foes %k }
if (!$hfind(foes,$mask($gettok(%raw,1,32),2),0)) { hadd -m foes $mask($gettok(%raw,1,32),2) }
sx $sock(warbot_*,1).name join %c
}
if ($gettok(%raw, 2, 32) == 401) { halt }
if ($gettok(%raw, 2, 32) == 441) { halt }
if ($gettok(%raw, 2, 32) == JOIN) && ($pos(%raw,$hget($sockname,me),1) > 0) { sx $sock(warbot_*,1).name $eval(kick %c %k $1) : $+ 4,1\ 10M 4\ 1,10ORTAL 4,1\ 10,1KOMBAT 4,1\ }
if ($gettok(%raw, 2, 32) == JOIN) {
var %n = $gettok($right(%raw,-1),1,33)
if ($hfind(foes,$mask($gettok(%raw,1,32),2),0)) { sx $sock(warbot_*,1).name $eval(kick %c %n $1) : $+ 4,1\ 10M 4\ 1,10ORTAL 4,1\ 10,1KOMBAT 4,1\
}
}
}
alias sz {
var %n = $sockname
sockclose %n | /echo -a %n Remote Quit
sockopen %n $gettok($serv,%nserv,32) 6667
}
#mortalkombatSINGLE end
No comments:
Post a Comment