mIRC Home    About    Download    Register    News    Help

Topic Options
#262680 - 12/03/18 08:29 AM need help... SOCKET AUTO IDENTIFY NICK FOR BOT
FedEx Offline
Self-satisified door

Registered: 12/03/18
Posts: 3
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..

Top
#262683 - 13/03/18 08:34 AM Re: need help... SOCKET AUTO IDENTIFY NICK FOR BOT [Re: FedEx]
FedEx Offline
Self-satisified door

Registered: 12/03/18
Posts: 3
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...


Edited by FedEx (13/03/18 08:36 AM)

Top
#262686 - 13/03/18 11:27 AM Re: need help... SOCKET AUTO IDENTIFY NICK FOR BOT [Re: FedEx]
Loki12583 Offline
Hoopy frood

Registered: 22/01/04
Posts: 1244
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.

Top
#262687 - 13/03/18 12:33 PM Re: need help... SOCKET AUTO IDENTIFY NICK FOR BOT [Re: Loki12583]
FedEx Offline
Self-satisified door

Registered: 12/03/18
Posts: 3
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


Edited by FedEx (13/03/18 12:35 PM)

Top
#262688 - 13/03/18 04:38 PM Re: need help... SOCKET AUTO IDENTIFY NICK FOR BOT [Re: FedEx]
Loki12583 Offline
Hoopy frood

Registered: 22/01/04
Posts: 1244
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.

Top