alias chatnetwerk {
var %p = 2000 | while (!$portfree(%p)) inc %p
if ($status != disconnected) server -n
scid $scon($scon(0)) server 127.0.0.1 %p
socklisten chatnetwerk.listen. $+ $scon($scon(0)) %p
sockopen chatnetwerk.srv. $+ $scon($scon(0)) irc.chatnetwerk.nl 6667
}
on *:sockopen:chatnetwerk.srv.*:{
echo -a 4Je bent nu verbonden met de server! =)
sockwrite -tn $sockname NICK $me $lf USER $me "s0ck.b0t" "irc.chatnetwerk.nl" :sockb0t_
}
on *:socklisten:chatnetwerk.listen.*:{
scid $gettok($sockname,-1,46)
sockaccept chatnetwerk.loc. $+ $cid
sockclose $sockname
}
on *:sockread:chatnetwerk.srv.*:{
scid $gettok($sockname,-1,46)
var %data
sockread %data
echo -a Inkomende data van: $sockname : %data
sockwrite -n chatnetwerk.loc. $+ $gettok($sockname,-1,46) %data
}
on *:sockread:chatnetwerk.loc.*:{
scid $gettok($sockname,-1,46)
var %d | sockread %d | tokenize 32 %d
if ($gettok(%d,1,32) isin NICK USER) return
else sockwrite -n chatnetwerk.srv. $+ $gettok($sockname,-1,46) %d
}
on *:sockclose:chatnetwerk.srv.*:{ sockclose chatnetwerk.loc. $+ $gettok($sockname,-1,46) | if ($scid($gettok($sockname,-1,46))) scid $gettok($sockname,-1,46) | disconnect }
that should get you started. the server keeps banning me tho. u should check into that. and there's no need for that join alias because mirc will do it anyway with this code. but ozzy's right. what's the point in this? if you want a sockbot, it's because you want to do something faster than you can do it having mirc process it all. if you want mirc to process it and show you a channel window, etc. you should just use the /server command and let mirc take care of that for you.