mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
/debug [-cinpt] [N] [on | off | @window | filename] [identifier]
/debug N @moo, uses color N for messages


Let [N] support [N,M] or [N [M]], where M specifies a different color for outgoing messages from incoming messages. If M is not specified, then all messages are the same color as they are now.

/debug -p 1,4 @debug
Displays incoming messages in black, and outgoing messages in red.

This behavior cannot be replicated in script, given that control codes do not render in a debug output, but instead display printed glyphs for the control characters.

-
Alternately: Some way for a /debug -i $identifier() to return a value that defines that line's color, which can allow greater flexibility for highlighting and debugging errors.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I like this idea but given the syntax of /debug, it would be wiser to pass the value with a new switch, I believe your syntax isn't possible without breaking backward comp (a filename could be a number?).
I think /debug -hN[,M] solve both problem:
-inside the alias, a call to /debug -hN would set the line color to N
-when you use /debug initially, you can use /debug -hN,M to set the default in/out colors

Something very complete would be to be able to set control codes's position in text, so that control codes inside the original line wouldn't be displayed, but we could still display them in the window, for example inside the alias, calling /debug -s 5 2 would add a $chr(2) at position 5 in the final text and /debug -s 5 3,4,5 would add ^K4,5 at position 5, but this looks convoluted.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Whatever works. No need to make it so complex imho... If somebody wrote a script that names files 1,5 then they deserve to have their scripts broken.

A -h switch in combination with the -i switch, could instead signify the string returned by $identifier() begins with a line color number. As in: 05 -> :irc.efnet.org PING


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Thanks for adding this feature Khaled!

I am kind of curious why you chose -rN to specify the received-text color, instead of a switch for the sent or outgoing text color, given that received text is quite more regular than sent text. I feel users would be more inclined to want to bring attention to their sent text so that it stands out in the sea of received text.

As in /debug -ps4 @debug instead of /debug -r99 4 @debug, so that received text is just Normal Text color, and sent text is colored red.

(Hmm, will /debug even accept color index 99 as Normal Text color?)
((It doesn't look like it. Creating a black-on-black or white-on-white problem.))


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Right, I am not sure I see the difference. /debug -rN N allows you to set both colors while maintaining backwards compatibility. Are you saying that you would also like a switch to set the outgoing color?

Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
I'm just stating that the -r switch doesn't feel intuitive, since the -r switch alters the color of 99.9% of lines in a /debug window, relegating the default color to the marginally few outbound sent lines. I feel that people (at least myself) want to draw specific attention to lines that their client sends out, thus specifying a highlight color for sent lines only.

To do so, one must specify -r1 4 or -r99 4 ... (is 99 supposed to use Listbox Color in @debug windows?)

If /debug -pr99 4 @debug works, I'll take it. I'm just being whiny. smile


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Quote:
the -r switch doesn't feel intuitive

Okay, the -rN switch will be changed in the next beta to -rN,N to set the incoming and outgoing colors. The color 99 cannot be used for non-listbox windows.

Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
What is the correct way to retain the default 'Normal Text' coloration for incoming text, in this case then, if 99 can't be used? Because I can't tell if the debug alias will be used on somebody's black background or white background themes.

/alias debugg { window -aDoe2v @debug. $+ $cid | debug -ptr,4 @debug. $+ $cid } ; by Raccoon

This assures the debug window has a CID specific name, gets closed when the server is closed, has an editbox, can be set on desktop, and that debug lines are word-wrapped, timestamped, (and now: outgoing text is highlighted red).

I share this alias a lot. Especially with Twitch-bot writers.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Quote:
The color 99 cannot be used for non-listbox windows.


Would that be a bug?

Code:
//var %target @test | aline %target $time | aline 99 %target $time


If @test is a -l listbox @window, both numbers display as $color(listbox text) against background color of $color(listbox)
If @test is a non-listbox @window, the first line shows in $color(normal) and the second line shows as $color(listbox text) - both texts against background color of $color(background)

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Quote:
Would that be a bug?

No, the line commands have always allowed use of 99 as a listbox color. The /echo command and most other features have not. That said, I could change it so that it is consistent, however that would break any scripts that use it.

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Quote:
What is the correct way to retain the default 'Normal Text' coloration for incoming text, in this case then, if 99 can't be used? Because I can't tell if the debug alias will be used on somebody's black background or white background themes.

The only way to be sure is to test it out. Have you tested it out yet?

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Quote:
/alias debugg { window -aDoe2v @debug. $+ $cid | debug -ptr,4 @debug. $+ $cid } ; by Raccoon

Okay, I just noticed that you have used -r,4 in your example, which would not have worked in the next beta which expects -rN,N. I also notice that specifying 99 in /debug uses the listbox color. So, updating the original request a little bit: You want to be able to specify -rN,M, where N is the incoming and M is the outgoing color. We cannot use /debug N,M because that would break existing clients. Using a -r switch maintains backwards compatibility. You want to be able to use 99 as the normal color, which /debug does not currently support. And you want to be able to use "-rN," "-r,M" "-rN,M" and probably "-r," just in case. If a number is not specified, it should default to 99? Does this sound about right?

Update: Looking at this a little more, I don't think I have ever added a -switch that uses commas. While it can be implemented, it seems needlessly complicated and would work better if each number had its own switch. So -rN for received lines and -oN for outgoing lines.

Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Lol. I just want to set the outgoing text color apart, highlighted, from all the slew of incoming text. Never really cared how.

You created a switch to set the incoming text color. Show me how to work it smile


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Yes, -oNNrNN would be just fine. Thanks.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Is this feature now working the way you expected? Any issues?

Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Seems to work as expected. The normal N color still optionally sets a default color for debug messages from that $cid, while -oN sets the color for outgoing messages and -rN sets the color for received messages, and both the new switches override any default color that was set. That seems intuitive, and I'm already using it to debug monitor my script's behaviors.

Thank you!

ALIAS debugg { window -aDoe2v @debug. $+ $cid | .debug -pio4 @debug. $+ $cid $!+([,$time,],$chr(32),$1-) } ; by Raccoon 2018 mIRC v7.52


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard