100% found this document useful (1 vote)
459 views

Dex Script

This document contains code for an IRC bot that connects to multiple servers and channels using aliases. It identifies enemies based on nick and host and kicks them from channels. It can open/close sockets, join/part channels, and clear/list stored enemy nicks and hosts. The bot maintains connections across servers to monitor channels and remove enemies.

Uploaded by

banderaz_13
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
459 views

Dex Script

This document contains code for an IRC bot that connects to multiple servers and channels using aliases. It identifies enemies based on nick and host and kicks them from channels. It can open/close sockets, join/part channels, and clear/list stored enemy nicks and hosts. The bot maintains connections across servers to monitor channels and remove enemies.

Uploaded by

banderaz_13
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

alias -l shift.

nick { return banderaz|1 banderaz|2 banderaz|3 banderaz|4 banderaz|


5 banderaz|6 banderaz|7 banderaz|8 banderaz|9 banderaz|10 banderaz|11 banderaz|12
banderaz|13 banderaz|14 banderaz|15 banderaz|16 banderaz|17 banderaz|18 banderaz|
19 banderaz|20 }
alias -l shift.iden { return gue ughh jauh aku maniak kamu chatter maunya kepala
rela Indonesia jiwaku ampera iki ini c belajar from aku bagi }
alias -l shift.serv { return irc.plasa.com irc.plasa.com irc.plasa.com
irc.plasa.com irc.plasa.com irc.plasa.com irc.plasa.com irc.plasa.com
irc.plasa.com irc.plasa.com irc.telkom.net.id irc.telkom.net.id irc.telkom.net.id
irc.telkom.net.id irc.telkom.net.id irc.telkom.net.id irc.telkom.net.id
irc.telkom.net.id irc.telkom.net.id irc.telkom.net.id }
alias -l shift.port { return 6667 6667 6667 6667 6667 6667 6667 6667 6667 6667
6667 6667 6667 6667 6667 6667 6667 6667 6667 6667 }
alias -l shift.pass { return indonet01 indonet02 indonet03 indonet04 indonet05
indonet06 indonet11 indonet14 indonet15 indonet19 elnus4 elnus13 elnus18 elnus22
elnus23 elnus24 elnus27 elnus32 elnus34 elnus35 }
alias -l shift.base { return #rampok }
alias -l shift.chan { return #war }

on *:start:{ .fullname [#0,1tH3# #4,0DaRk# #9,0kN!ghT#] }

on *:exit:{
hfree -w enemy.*
unsetall
}

ctcp *:version:*:{
ctcpreply $nick version [#0,1tH3# #4,0DaRk# #9,0kN!ghT#]
}

on *:sockopen:*:{
if ($sockerr > 0) {
echo -s $chr(35) $+ $findtok($shift.nick,$sockname,32) could not connect to
the server
sockclose $sockname
halt
}
echo -s $chr(35) $+ $findtok($shift.nick,$sockname,32) connected: $sockname
sockwrite -nt $sockname $1- nick $sockname
sockwrite -nt $sockname user $gettok($shift.iden,$findtok($shift.nick,
$sockname,32),32) x x :[#0,1tH3# #4,0DaRk# #9,0kN!ghT#]
sockwrite -nt $sockname pass $gettok($shift.pass,$findtok($shift.nick,
$sockname,32),32)
}

on *:sockclose:*:{
if (!%c) {
var %k = $findtok($shift.nick,$sockname,32)
.timershift $+ %k 1 $calc(%k * 5) sockopen $gettok($shift.nick,%k,32)
$gettok($shift.serv,%k,32) $gettok($shift.port,%k,32)
echo -s $chr(35) $+ %k started, socket has been opened
if (%e) {
if ($sock($gettok($shift.nick,%e,32))) { sockwrite -nt $gettok($shift.nick,
%e,32) part $shift.chan }
while (%e <= $numtok($shift.nick,32)) {
if (%e == $numtok($shift.nick,32)) { set %e 0 }
if ($sock($gettok($shift.nick,$calc(%e + 1),32))) {
sockwrite -nt $gettok($shift.nick,$calc(%e + 1),32) join $shift.chan
set %e $calc(%e + 1)
break
}
inc %e
}
}
}
}

on *:sockread:*:{
:shift.read
sockread -f %shift
if ($sockbr == 0) return
tokenize 32 %shift
if (($2 == mode) && ($3 == $shift.chan) && ($sockname isin $5)) {
if (-o isin $4) { sockwrite -nt $sockname ChanServ op $shift.chan $sockname }
var %j = $nick($shift.chan,0)
while %j {
if ($hfind(enemy.nick,$nick($shift.chan,%j),0,W)) { sockwrite -nt $sockname
kick $shift.chan $nick($shift.chan,%j) :[#0,1tH3# #4,0DaRk# #9,0kN!ghT#] }
dec %j
}
}
elseif (($2 == join) && ($shift.chan isin $3)) {
if ($hfind(enemy.host,$gettok($mid($1,2,$len($1)),2,$asc(@)),0,W)) {
if (($gettok($mid($1,2,$len($1)),1,33) != $sockname) &&
($gettok($mid($1,2,$len($1)),1,33) != $me)) { sockwrite -nt $sockname kick
$shift.chan $gettok($mid($1,2,$len($1)),1,33) :[#0,1tH3# #4,0DaRk# #9,0kN!ghT#] }
}
elseif ($hfind(enemy.nick,$gettok($mid($1,2,$len($1)),1,33),0,W)) {
if (($gettok($mid($1,2,$len($1)),2,$asc(@)) !iswm $address($sockname,5)) &&
($gettok($mid($1,2,$len($1)),2,$asc(@)) !iswm $address($me,5)) && (!
$hfind(enemy.host,$gettok($mid($1,2,$len($1)),2,$asc(@)),0,W))) { hadd -m
enemy.host $gettok($mid($1,2,$len($1)),2,$asc(@)) }
sockwrite -nt $sockname kick $shift.chan $gettok($mid($1,2,$len($1)),1,33) :
[#0,1tH3# #4,0DaRk# #9,0kN!ghT#]
}
}
elseif (($2 == kick) && ($3 == $shift.chan) && ($4 == $sockname) || ($4 == $me))
{
if (($gettok($mid($1,2,$len($1)),1,33) != $sockname) &&
($gettok($mid($1,2,$len($1)),1,33) != $me) && (!$hfind(enemy.nick,
$gettok($mid($1,2,$len($1)),1,33),0,W))) { hadd -m enemy.nick
$gettok($mid($1,2,$len($1)),1,33) }
if (($gettok($mid($1,2,$len($1)),2,$asc(@))) &&
($gettok($mid($1,2,$len($1)),2,$asc(@)) !iswm $address($sockname,5)) &&
($gettok($mid($1,2,$len($1)),2,$asc(@)) !iswm $address($me,5)) && (!
$hfind(enemy.host,$gettok($mid($1,2,$len($1)),2,$asc(@)),0,W))) { hadd -m
enemy.host $gettok($mid($1,2,$len($1)),2,$asc(@)) }
if (%e) {
if ($sock($gettok($shift.nick,%e,32))) { sockwrite -nt $gettok($shift.nick,
%e,32) part $shift.chan }
while (%e <= $numtok($shift.nick,32)) {
if (%e == $numtok($shift.nick,32)) { set %e 0 }
if ($sock($gettok($shift.nick,$calc(%e + 1),32))) {
sockwrite -nt $gettok($shift.nick,$calc(%e + 1),32) join $shift.chan
set %e $calc(%e + 1)
break
}
inc %e
}
}
}
elseif ($2 == 001) {
sockwrite -nt $sockname join $shift.base
if ((%e) && ($gettok($shift.nick,%e,32) !ison $shift.chan)) {
sockwrite -nt $sockname join $shift.chan
set %e $findtok($shift.nick,$sockname,32)
}
}
elseif ($2 == 451) {
sockwrite -nt $sockname $1- nick $sockname
sockwrite -nt $sockname user $gettok($shift.iden,$findtok($shift.nick,
$sockname,32),32) x x :[#0,1tH3# #4,0DaRk# #9,0kN!ghT#]
sockwrite -nt $sockname pass $gettok($shift.pass,$findtok($shift.nick,
$sockname,32),32)
sockwrite -nt $sockname join $shift.base
if ((%e) && ($gettok($shift.nick,%e,32) !ison $shift.chan)) {
sockwrite -nt $sockname join $shift.chan
set %e $findtok($shift.nick,$sockname,32)
}
}
elseif (($1 == ping || $2 == ping)) { sockwrite -nt $sockname pong $2- }
goto shift.read
}

raw 482:*:{ haltdef }


raw 442:*:{ haltdef }
raw 404:*:{ haltdef }
raw 403:*:{ haltdef }
raw 441:*:{ halt }
raw 442:*:{ halt }

menu status,channel,nicklist,query {
SoniWar
.Socket
.. $+ $iif(($me !ison $shift.base),$style(2)) Open:{
var %a = 1
while (%a <= $numtok($shift.nick,32)) {
if (!$sock($gettok($shift.nick,%a,32))) {
.timershift $+ %a 1 $calc(%a * 5) sockopen $gettok($shift.nick,%a,32)
$gettok($shift.serv,%a,32) $gettok($shift.port,%a,32)
echo -s $chr(35) $+ %a started, socket has been opened
}
inc %a
}
unset %c
}
.. $+ $iif(($me !ison $shift.base),$style(2)) Close:{
var %b = 1
set %c %b
while (%b <= $numtok($shift.nick,32)) {
if ($sock($gettok($shift.nick,%b,32))) {
sockclose $gettok($shift.nick,%b,32)
echo -s $chr(35) $+ %b stopped, socket has been closed
}
inc %b
}
.timershift* off
unset %e
}
.Shifter
.. $+ $iif(((%e) || ($me !ison $shift.base) || ($me !ison $shift.chan)),
$style(2)) Join:{
var %d = 1
while (%d <= $numtok($shift.nick,32)) {
if ($sock($gettok($shift.nick,%d,32))) {
sockwrite -nt $gettok($shift.nick,%d,32) join $shift.chan
set %e %d
break
}
inc %d
}
}
.. $+ $iif((!%e),$style(2)) Part:{
sockwrite -nt $gettok($shift.nick,%e,32) part $shift.chan
unset %e
}
.. $+ $iif((!%e),$style(2)) Cycle:{
if ($sock($gettok($shift.nick,%e,32))) { sockwrite -nt $gettok($shift.nick,
%e,32) part $shift.chan }
while (%e <= $numtok($shift.nick,32)) {
if (%e == $numtok($shift.nick,32)) { set %e 0 }
if ($sock($gettok($shift.nick,$calc(%e + 1),32))) {
sockwrite -nt $gettok($shift.nick,$calc(%e + 1),32) join $shift.chan
set %e $calc(%e + 1)
break
}
inc %e
}
}
.Enemy
.. $+ $iif((($menu == status) || ($menu == query) || (!%e)),$style(2)) Kick:{
if ($menu == nicklist) {
if (($$1 != $gettok($shift.nick,%e,32)) && ($$1 != $me)) {
if (!$hfind(enemy.nick,$$1,0,W)) { hadd -m enemy.nick $$1 }
if (($ial($$1).host) && (!$hfind(enemy.host,$ial($$1).host,0,W))) { hadd
-m enemy.host $ial($$1).host }
sockwrite -nt $gettok($shift.nick,%e,32) kick $shift.chan $$1 :[#0,1tH3#
#4,0DaRk# #9,0kN!ghT#]
}
}
elseif ($menu == channel) {
var %input = $?="Enter plain or wildcard nick:"
if ((%input) && (%input !iswm $gettok($shift.nick,%e,32)) && (%input !iswm
$me)) {
if (!$hfind(enemy.nick,%input,0,W)) { hadd -m enemy.nick %input }
if (($ial(%input).host) && (!$hfind(enemy.host,$ial(%input).host,0,W)))
{ hadd -m enemy.host $ial(%input).host }
var %f = $nick($shift.chan,0)
while %f {
if ($hfind(enemy.nick,$nick($shift.chan,%f),0,W)) { sockwrite -nt
$sock($gettok($shift.nick,%e,32)) kick $shift.chan $nick($shift.chan,%f) :
[#0,1tH3# #4,0DaRk# #9,0kN!ghT#] }
dec %f
}
}
}
}
.. $+ $iif(((!$hget(enemy.nick)) && (!$hget(enemy.host))),$style(2)) Clear:{
hfree -w enemy.*
if ($gettok($shift.nick,%e,32) ison $shift.chan) { sockwrite -nt
$gettok($shift.nick,%e,32) privmsg $shift.chan :#0,9[`CLEAR`] }
else {
var %g = 1
while (%g <= $numtok($shift.nick,32)) {
if ($sock($gettok($shift.nick,%g,32))) {
sockwrite -nt $gettok($shift.nick,%g,32) privmsg $shift.base :[#0,1tH3#
#4,0DaRk# #9,0kN!ghT#]
break
}
inc %g
}
}
}
.. $+ $iif(((!$hget(enemy.nick)) && (!$hget(enemy.host))),$style(2)) List:{
var %h = $hget(enemy.nick,0).item
while (%h) {
echo -s $hget(enemy.nick,%h).item
dec %h
}
var %i = $hget(enemy.host,0).item
while (%i) {
echo -s $hget(enemy.host,%i).item
dec %i
}
}
}
}

You might also like