|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Wed Aug 13, 2008 6:51 pm
Looking under the hood |
How do see what's going on in the script engine? I often have an idea that something is running that shouldn't be but I know of no way to see what's going on, like how many threads are active and so on.
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Wed Aug 13, 2008 6:53 pm |
Use the #Debug window or type #Thread on the command line.
|
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Wed Aug 13, 2008 7:27 pm |
#thread reveals nothing to me. I get no result at all - is like I didn't type anything. As for the script debugger I only see what communication is going on, right? I wan't to see if there is a loop or something.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Aug 13, 2008 7:48 pm |
#THREAD Returns the number of current active threads, so you should get at least 1 listing back for the main session window.
How are you running the command?
As for the debugger you can select Messages from the menu to select what messages you see. I don't think there's a way to see if a given loop is executing at a particular time unless it's in a separate alias. You should be able to see if you have a circular calling pattern based on the aliases triggers etc. being executed.
What exactly are you trying to debug? What are you trying to detect in the loop? |
|
_________________ Asati di tempari! |
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Wed Aug 13, 2008 8:36 pm |
I just type #thread at the prompt. And I don't see anything. No output at all.
What I am trying to figure out is exactly what is going on sometimes. I get strange exceptions sometimes and I would like to know if something is running that should not be running. Like a loop or something. |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Wed Aug 13, 2008 9:03 pm |
Typing #THREAD at command line should output at least 1 thread running (main thread).
Here is CMUD output for untitled session:
Code: |
Threads:
# ID Window Name Status Script
-------------------------------------------------------------------------------------------------
1 [u] untitled running
|
|
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Wed Aug 13, 2008 9:19 pm |
Well, it ain't happening for me. Any suggestions why that may be?
|
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Wed Aug 13, 2008 9:28 pm |
Hmm... Have you black text on the black screen? Have you attached your command line to the child window? I can only guess...
|
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Aug 13, 2008 9:44 pm |
Go into your Preferences and make sure you have the "Use threads for command line" option checked. Although even with this option disabled it should still be displaying "No threads running".
Do you have the command messages turned off? What happens if you type "#ALIAS" to display all of your aliases? Does that show anything? |
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Thu Aug 14, 2008 8:41 pm |
Zugg wrote: |
Go into your Preferences and make sure you have the "Use threads for command line" option checked. Although even with this option disabled it should still be displaying "No threads running". |
Is checked
Zugg wrote: |
Do you have the command messages turned off? What happens if you type "#ALIAS" to display all of your aliases? Does that show anything? |
Nothing happens when typing #ALIAS either. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Aug 14, 2008 9:03 pm |
The reason why is because you have "Show information messages" not ticked under Preferences->Scripting. Check that box, and you'll see the messages.
Quite annoying, though, because it also fires everytime CMUD opens a file, writes to it, and closes it. Sigh.
Charneus |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Aug 15, 2008 12:03 am |
It shouldn't be displaying information messages when you *write* to a file...just when you open or close it. Because that's important information for most people.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Aug 15, 2008 2:46 am |
You're right - it doesn't display the write. That happened when I had echo triggers, too. It'd be nice if we could differentiate between what we want shown and what we don't care for... but I think that would be too great a burden to actually code that.
Just bothers me that I have to see it spammed every other line (I'm capturing channels to their individual text files). :P
Charneus |
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Fri Aug 15, 2008 8:13 pm |
Now I get messages. I wonder why that wasn't enabled.
|
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Fri Aug 15, 2008 8:38 pm |
Now I know what charneaus mean. Is annoying to see information every time I remove a trigger. I may have unchecked the option on purpose earlier to get rid of the info - of course not knowing what I was also disabling.
Perhaps you could make it so that these things could be enabled for themselves? That is if there is ever a reason to disable being able to see threads... |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Fri Aug 15, 2008 9:02 pm |
Sorry if I offend someone, but seeing occasional dark blue text on black background really isn't that *big* of a deal, even more so as
sometimes that information could be very important not to miss.
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Aug 15, 2008 9:24 pm |
Not offended at all. In fact, I'd be inclined to agree with you if the following wasn't true.
1. It's not dark blue, it's cyan.
2. It's not occasional, it's every other line at times.
Again, I'm logging channel chats to individual files. I have roughly 8 channels active that log information, if not more. Every time someone chats on a channel, it displays: File 1 opened... Closing file 1... Or something similar to that.
Other than that slight annoyance, yeah, I wouldn't mind. :p
Charneus |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Fri Aug 15, 2008 9:55 pm |
Well, I haven't changed anything myself and since I installed CMud(Pro), it has always been dark blue.
Maybe the color differs in comparison to usual CMud or something?
Regardless there should be an option where you could change the color of info messages. Just set it to something less annyoing (like dark blue :p)
On the other matter, I have to agree with Zugg. That and at the end of the day, writing something you can just as easily capture into
separate window into a file is completely your initiative. But thats semantics already really.
Maybe to keep separate groups of people happy there really should be some sort of option to let the user choose what they want to see
and what not. But I'm willing to bet its damn hard to code nor is it really need tbh.
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Aug 16, 2008 2:40 am |
Prog, to illustrate how annoying it can be, take a look at this image:
Note the timestamps on that - very close to each other. Even if the color was in dark blue, it'd still be rather annoying.
I realize that I could easily capture it into a separate window and use triggers from that. The thing is, I don't want to. I don't care to, at the very least. I used to have multiple windows, and had everything captured to there, but now it's just easier for me to keep it there and log it.
Why don't I log the entire session, you might ask? Because I really don't want to deal with battle spam, room spam, and other things that don't pertain to chats. *shrug*
But then again, that's just me. Maybe it's not annoying to you. More power to you if it's not.
Charneus |
|
|
|
Tarn GURU
Joined: 10 Oct 2000 Posts: 873 Location: USA
|
Posted: Sat Aug 16, 2008 2:56 am |
charneus wrote: |
Prog, to illustrate how annoying it can be, take a look at this image:
*snip*
Note the timestamps on that - very close to each other. Even if the color was in dark blue, it'd still be rather annoying.
I realize that I could easily capture it into a separate window and use triggers from that. The thing is, I don't want to. I don't care to, at the very least. I used to have multiple windows, and had everything captured to there, but now it's just easier for me to keep it there and log it.
|
I'm kind of late to the discussion, which appears to have sidetracked.
For your specific problem, why do you continually open and close the files? Why not just open it and then do writes to it, closing it only when the session is over?
-Tarn |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Aug 16, 2008 3:19 am |
Well, a couple of reasons. Looking over my channels, I see that I have 20 channels open.
Second reason is this - while I could do it with SWITCH statements, I don't care to. The channels have tags (you can't see them because they've been psubbed out). These tags make it that much easier to capture/log channels. Here is what it looks like:
{chan ch=gossip} blah gossips 'blah blah'
{chan ch=gclan} blah: blah blah blah blah
{chan ch=auction} Soandso is auctioning off blah blah blah
and so forth. Therefore, my trigger is merely #TRIGGER {(~{chan ch=(%w)~}) (*)} {#FILE 1 %concat( %2, ".txt");#WRITE 1 %time( ""[""mmm dd yy HH:nn:ss""]"") %stripansi( %3);#CLOSE 1;#PSUB {} %x1}
So that's why the files have to be continually opened. And again, while I could do #SWITCH (%2) ("gossip") {#WRITE 1 blah blah blah} ("gclan") {#WRITE 2 blah blah blah}, it's just not feasible to do so...
Charneus |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sat Aug 16, 2008 3:57 am |
As a side idea you can always have them #CAPTURED to non docked/displayed windows that are #LOG'ging.
Or #CAPTURE them to a non docked/displayed window that spams the open/close |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Aug 16, 2008 4:08 am |
And slow down the opening of CMUD? I'd rather not. I don't WANT extra windows open, regardless of it being shown or not. I had problems with multiple windows last time, and while I know what the problem was, I can't be bothered to fix it. Plus, I shouldn't have to create extra stuff just to not see the information messages.
The point is moot. This thread has gone far away from what the original poster had wanted information on. I keep show information off, and now I wish I hadn't said anything at all about the annoyance of that incident.
Charneus |
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Sat Aug 16, 2008 8:35 am |
I use a lot of: create triggers and variables, do something, remove triggers and variables. For me it's not only annoying seeing a line every time I remove something - it's not acceptable. I have scripts I run all the time that removes like 20 elements in a row so I have to disable the option and turn it on only when really needed.
I just don't see why I have to get the (for me) totally irrelevant message that I removed something. It's not like it tells me when I create a trigger or a variable. |
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Sat Aug 16, 2008 8:41 am |
By the way, I'm not sure I really am looking under the hood with this thread command. There are definitely things going on I cannot see which makes CMUD blow up the hard way (not responding suddenly). Suddenly my script stops running (is different places and not every times - some times it runs for quite a while). I cannot see anything than there is the current thread running. There are some temporarily variables and triggers that indicates that something stopped in the middle of doing something but I can't really tell what's going on...
|
|
|
|
|
|