mIRC Homepage
Posted By: FedEx need help... SOCKET AUTO IDENTIFY NICK FOR BOT - 12/03/18 08:29 AM
hello guys... need help here..
how to write code in sockread or sockopen, when my registed bot nick connect to IRC.. the socket auto identify the registed bot nick and change the nick..?

sorry for my bad english..
currently my code is this...

on *:sockread:bot: {
sockread -f %temp
tokenize 32 %temp
if ($sockerr > 0) { echo -s *** ERROR $+([,$sock($sockname).wsmsg,].) | halt }
if ($1 == PING) { sockwrite -n $sockname PONG $2- }
if ($2 == 376) {
echo @Report SocketBot - %botnick1 is CONNECTED.
.timerNICK 1 5 sockwrite -n $sockname NICK %botnick1 %botpass1
.autojoin %botchan
}
else { return }
}



is there any simple coding for this, insted of using RAW...
Not if you want to keep it in sockets. You could act a server and allow mIRC to connect to itself as a client, then relay its messages to the actual server. But that sort of defeats the point I'd imagine.
Originally Posted By: Loki12583
Not if you want to keep it in sockets. You could act a server and allow mIRC to connect to itself as a client, then relay its messages to the actual server. But that sort of defeats the point I'd imagine.


can you teach me or give some simple example or coding bro..? btw.. im running background bot in my client bro... i dont really get what you mean.. sorry.. frown
You can have a listening socket that mIRC connects to as if it were a normal server. You forward these messages to the socket connection you have to the external server. This means you don't have to send RAW yourself, mIRC does it like any other connection. But then it means the bot is not running in the background.

Code:
/help /socklisten


If you want to handle the sockets yourself of course there is no way to avoid dealing with the protocol.
© mIRC Discussion Forums