mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2018
Posts: 3
F
FedEx Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Mar 2018
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..

Joined: Mar 2018
Posts: 3
F
FedEx Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Mar 2018
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...

Last edited by FedEx; 13/03/18 08:36 AM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.

Joined: Mar 2018
Posts: 3
F
FedEx Offline OP
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Mar 2018
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

Last edited by FedEx; 13/03/18 12:35 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.


Link Copied to Clipboard