mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,144
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
I have a bot which connect to irc servers using socket (socket name are of the form bot.<id_name>, running on my main mIRC. For each network, I open a @bot.<id_name> custom window to display received messages (like /debug but I don't echo what I'm sending myself)
I have this line of code:
Code:
on *:sockclose:bot*:echo @bot $+ $mid($sockname,4) sockclose event $sockerr 
Yesterday at 2am one of the server I was connected to was not stable and I disconnected both with my main connection with mIRC and the socket. The sockclose event above triggered but instead of displaying the debug message to the @bot.<id_name>, it displayed in status window.

If the window @bot.<id_name> were not open for some reasons, mIRC would have displayed in status: "@bot.<id_name> sockclose event 3" with the window's name included, but instead, I got only "sockclose event 3", which makes me think there is a bug.

But today I unplugged my ethernet cable to try to reproduce but it correctly displayed the line in @bot.<id_name>, so I can't just reproduce by getting the event to trigger.

If you look at the source code, is there any way for /echo to parse the output window as a valid custom @window, but to end up displaying in status instead?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Quote:
is there any way for /echo to parse the output window as a valid custom @window, but to end up displaying in status instead?

As far as I can tell, this is not possible. If the command is using the format "/echo @window text" and the @window name is removed from the line, this means the window has been found and will be used.

Joined: Jul 2006
Posts: 4,144
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Well I triple checked and I'm positive it happened, the echo is right there in my log file for the status window. I don't really run other's people script which would be the only way for some obfuscated code to display this echo without me being able to find such code easily, and I'm sure that line of code is what displayed the line, I'm sure the window was open too (otherwise the echo would include its name anyway).

One thing, the full line of code is actually:

on *:sockclose:bot*:echo @bot $+ $mid($sockname,4) sockclose event $sockerr | ;.timer $+ $sockname -o 1 10 mircbotconnect $mid($sockname,4) $unsafe($sock($sockname).mark)

And I know you don't really approve of this usage (I recently learnt that even /* */ can be used between commands on one line!), so maybe this comment could have caused the behavior..? Just thought I would mention it.


I'll leave this code as it is and wait for another similar disconnection and see how it goes.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard