Jump to content

Sockets help needed


Spike1506

Recommended Posts

Hi i wanna make a socket connection for IRC-D but i have this code now

alias chatnetwerk {
 sockclose chatnetwerk
 sockopen chatnetwerk irc.chatnetwerk.nl 6667
} 
on *:sockopen:chatnetwerk:{ 
 echo -a 4Je bent nu verbonden met de server! =)
 sockwrite -tn $sockname NICK $me
 sockwrite -tn $sockname USER Sockbot "Sockbot" "irc.chatnetwerk.nl" :Sockbot made by Spike1506
}

on *:sockread:chatnetwerk:{ 
 var %data
 sockread %data
 tokenize 32 %data
 echo -a Inkomende data van: $sockname : %data 
 if ($1 == PING) { 
   sockwrite -tn $sockname PONG $2
 }
}

alias join {
 sockwrite -tn chatnetwerk JOIN : $+ $1-
}

 

but it doesnt show me a room window.. etc. etc.

 

could someone help me please? sad.gif

Link to comment
Share on other sites

thats cause you have this alias

 

alias join {

sockwrite -tn chatnetwerk JOIN : $+ $1-

}

 

and its not called

 

also why not just join mirc no need for socks for ircd, as mirc will join without

Link to comment
Share on other sites

Hi i wanna make a socket connection for IRC-D but i have this code now

 

...

 

but it doesnt show me a room window.. etc. etc.

 

could someone help me please? sad.gif

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.

Edited by vexation
Link to comment
Share on other sites

  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...