mIRC Home    About    Download    Register    News    Help

Print Thread
Relay script messing up on Mirc auto split message #255917 03/12/15 02:55 AM
Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
I made what I think is a nice multi-network/multi-channel relay script. I have one bug that I need to get rid of though. I have a debug window with an alias setup to catch messages sent by the bot from other scripts (snippet below). The problem is when the "split long channel/query messages" option is on that debug alias picks up the second part of the message that Mirc splits and then relays that again.

Is there a way to check if a PRIVMSG was created by Mirc splitting a long line or would my best bet be to turn that option off and manually split long lines in my script?

window -h $+(@,relay_scripts.,$cid)
.debug -in $+(@,relay_scripts.,$cid) relay_scripts


http://scripting.pball.win
My personal site with some scripts I've released.
Re: Relay script messing up on Mirc auto split message [Re: pball] #255918 03/12/15 03:34 AM
Joined: Jul 2006
Posts: 3,729
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,729
If mirc splits, you get two privmsg, you would want to catch them both no? I don't really get the issue? why do you say "again" when you're not making it clear it relays the second part once?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Relay script messing up on Mirc auto split message [Re: Wims] #255919 03/12/15 04:46 AM
Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
Let's see if I can explain it better.

When a script on the bot replies to a trigger with a long message. That message is intercepted by the relay script using a debug @window with an alias. That alias takes the message and relays it to another network/chan. When Mirc sends the relayed message it splits it. The first part is ignored by code in the debug intercept but the second split part is seen as a new message and is relayed again. Not to mention Mirc also sends the split part of the original message. So it ends spamming the split part a few times.



I've come up with a way to split the message myself so I can turn the auto line splitting off. The one problem with that is the bots reply on the server of origin will not be split. Because the original script is sending the message and my relay script is only copying it to other nets/chans. Can you halt the message during the alias called by the debug window. If I can do that I can process the message completely myself.


http://scripting.pball.win
My personal site with some scripts I've released.
Re: Relay script messing up on Mirc auto split message [Re: pball] #255924 03/12/15 02:48 PM
Joined: Jul 2006
Posts: 3,729
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,729
I'm sorry but it's still unclear, when I try to send a long line from the editbox (but let's assume it's the same as /msg from your script), it produces two (let's assume the split gives two parts) PRIVMSG in the debug window, this is correct and I can only assume that a /debug -i alias would properly catch those two PRIVMSG and try to /msg them somwhere else.

I could assume the origin server has the same line limit as the destination server and you have more or less the same length for your host in both servers etc, meaning it shouldn't split any of these relayed messages.

Now you're saying that it does 'resplit' them? So my assumptions above would be wrong but as far as your script is concerned, it relayed correctly, no?

But now comes my confusion, you say:

Quote:
The first part is ignored by code in the debug intercept
To me this means the first PRIVMSG in the debug alias is not caught properly? That would be a bug, either in your script or with mIRC..?

Quote:
but the second split part is seen as a new message and is relayed again
This is just non sense to me, it is suggesting you're first catching the whole messages with the first PRIVMSG, which is impossible if a split happens, and then that there is still a second PRIVMSG with the correct 'second part' of the split, which would explain why you say it sends that second part again, but this is all impossible unless your script is buggy or mIRC is.
Your screenshot is useless to say the least, can you provide a real example and/or the debug of what is actually passed to your alias (it looks like there might be a bug here, i didn't try this), the best would be to pastebin your script entirely so we can test it, with the exact first whole line you're sending.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net