From: Rasta Magician
@Coh3n: I'm in china ATM, and can't really have a test run. Could you perhpas post an example of what it is debugging?
Also, having just re-read one of garrett's post about usefulness of debug..
we can easily change the character that it uses to show what it means. Or add a character as gamer suggested. (Just not colored)
(v) - ok
(e) - error (user)
(s) - script error
(f) - script fail
~RM
China!? Jesus, where haven't you been? It's like every other week you're in a different country. I'm a little jealous. :rolleyes: When do you plan on coming to Canada? :D And yeah, I'll post what it does… probably would have been easier for me to do that in the first place….
E: Here's a small bit:
[PHP]
SRL Compiled in 15 msec
SMART Initialized.
Loaded: Server 152, Members: False, Signed: True, Super Detail: False.
Setting up MSI took 109 ms.
MSI_SetupPlayer
(10:05:41 AM) : [ ] MSI_SetupPlayer
MSI_BestTool
(10:05:45 AM) : [ ] – MSI_BestTool
CurrentSkill level: 88
(10:05:46 AM) : [ ] —- CurrentSkill level: 88
MSI_BestTool: 25
(10:05:46 AM) : [ ] —- MSI_BestTool: 25
MSI_FindTool
(10:05:46 AM) : [ ] – MSI_FindTool
Found DTM: Rune Hatchet.
(10:05:47 AM) : [ ] —- Found DTM: Rune Hatchet.
MSI_FindTool: Successfully Found Tool - Rune Hatchet
(10:05:47 AM) : [ ] —- MSI_FindTool: Successfully Found Tool - Rune Hatchet
MSI_FindObjectsIn
(10:05:48 AM) : [ ] – MSI_FindObjectsIn
MSI_FindObjectsTPA
(10:05:48 AM) : [ ] —- MSI_FindObjectsTPA
Not enough points!
(10:05:48 AM) : [ ] —— Not enough points!
Not enough points!
(10:05:48 AM) : [ ] —— Not enough points!
Not enough points!
(10:05:48 AM) : [ ] —— Not enough points!
Not enough points!
(10:05:48 AM) : [ ] —— Not enough points!
Not enough points!
(10:05:48 AM) : [ ] —— Not enough points!
MSI_FindObjectsTPA: True
(10:05:48 AM) : [ ] —— MSI_FindObjectsTPA: True
11 objects found!
(10:05:48 AM) : [ ] —- 11 objects found!
MSI_FindObjectsIn
(10:05:51 AM) : [ ] —- MSI_FindObjectsIn
MSI_FindObjectsTPA
(10:05:51 AM) : [ ] —— MSI_FindObjectsTPA
MSI_FindObjectsTPA: True
(10:05:51 AM) : [ ] ——– MSI_FindObjectsTPA: True
2 objects found!
(10:05:51 AM) : [ ] —— 2 objects found!
MSI_FindObjectsIn
(10:05:53 AM) : [ ] —— MSI_FindObjectsIn
MSI_FindObjectsTPA
(10:05:53 AM) : [ ] ——– MSI_FindObjectsTPA
Not enough points!
(10:05:53 AM) : [ ] ———- Not enough points!
Not enough points!
(10:05:53 AM) : [ ] ———- Not enough points!
Not enough points!
(10:05:53 AM) : [ ] ———- Not enough points!
Not enough points!
(10:05:53 AM) : [ ] ———- Not enough points!
Not enough points!
(10:05:53 AM) : [ ] ———- Not enough points!
MSI_FindObjectsTPA: True
(10:05:53 AM) : [ ] ———- MSI_FindObjectsTPA: True
13 objects found!
(10:05:53 AM) : [ ] ——– 13 objects found!
MSI_FindObjectsIn
(10:05:57 AM) : [ ] ——– MSI_FindObjectsIn
MSI_FindObjectsTPA
(10:05:57 AM) : [ ] ———- MSI_FindObjectsTPA
Not enough points!
(10:05:57 AM) : [ ] ———— Not enough points!
Not enough points!
(10:05:57 AM) : [ ] ———— Not enough points!
MSI_FindObjectsTPA: True
(10:05:57 AM) : [ ] ———— MSI_FindObjectsTPA: True
1 objects found!
(10:05:57 AM) : [ ] ———- 1 objects found!
[/PHP]
It just looks like it's duplicating each line with just a normal Writeln. I'll have more time later too look into it, if you haven't. I like this debugging and it'll be quite useful when it's perfect. :D
E2: Oh, this line, we should make it debug the tool name. :)
[PHP]
(10:05:46 AM) : [ ] —- MSI_BestTool: 25
[/PHP]
E3: Okay I found why it was duplicating… it was the status() at the beginning of MSI_Debug. I commented it out for now. Something I just noticed… the '—' gradually gets longer and longer, I'm assuming because the CurDebugLevel doesn't get Dec()'d somewhere.
E4: The decrementing issue it fixed from what I tested. It's an improvement nonetheless. I also went through the files to see if there were any MSI_CloseHeaders missing. There were a few instances in the object functions where it would exit and therefore unable to Dec() CurrDebugLevel. I didn't use try..finally statements there, but you may want to change that.
E5: What do you think about this? This is the Simba time stamp. I just added this line to the mainloop in RunMe.scar and commented out the time in MSI_Debug.
SetScriptProp(SP_WriteTimeStamp, [True]);
[PHP]
[0:00:00]: SRL Compiled in 16 msec
[0:00:00]: SMART Initialized.
Loaded: Server 152, Members: False, Signed: True, Super Detail: False.
[0:00:01]: Setting up MSI took 94 ms.
[0:00:01]: ** REFLECTION HOOKS OUTDATED **
[0:00:01]: [ ] MSI_SetupPlayer
[0:00:05]: [ ] – MSI_BestTool
[0:00:06]: [ ] —- CurrentSkill level: 88
[0:00:06]: [ ] – MSI_BestTool: Rune Hatchet
[0:00:06]: [ ] – MSI_FindTool
[0:00:07]: [ ] —- Found DTM: Rune Hatchet.
[0:00:07]: [ ] – MSI_FindTool: Successfully Found Tool - Rune Hatchet
[0:00:07]: [ ] – MSI_AutoObjects
[0:00:07]: [ ] —- MSI_FindObjectsIn
[0:00:07]: [ ] —— MSI_FindObjectsTPA
[0:00:07]: [ ] ——– Not enough points!
[0:00:07]: [ ] ——– Not enough points!
[0:00:07]: [ ] ——– Not enough points!
[0:00:07]: [ ] ——– Not enough points!
[0:00:07]: [ ] ——– Not enough points!
[0:00:07]: [ ] ——– Not enough points!
[0:00:07]: [ ] —— MSI_FindObjectsTPA: True
[0:00:07]: [ ] —— 14 objects found!
[0:00:08]: [ ] —— MSI_FindObjectsTPA
[0:00:08]: [ ] ——– Not enough points!
[0:00:08]: [ ] —— MSI_FindObjectsTPA: True
[0:00:09]: [ ] —- MSI_FindObjectsIn: True
[0:00:09]: [ ] —- MSI_FindObjectsTPA
[0:00:09]: [ ] —- MSI_FindObjectsTPA: True
[/PHP]
I think it can be set to display the actual time rather than the runtime, but I like the runtime. :)