Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ Problems with logging notes.

Problems with logging notes.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Rivius   (99 posts)  Bio
Date Sun 20 Nov 2011 04:44 PM (UTC)
Message
1) I've noticed that if I omit a trigger from the log, then put in my own custom note while "sending to script" it will display the note twice. This goes away when I do "send to script (after omit)".

2)This bug is harder to reproduce with newer triggers for me and I honestly have tried (hair-pulling involved) to replicate it. But I have one trigger that omits from log and omits from output. I make it display a custom colournote from a pre-compiled script (ie. I enter a function name into the "script" field). For some reason, it shows up perfectly in the output but does not display at all in the log.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 20 Nov 2011 06:43 PM (UTC)
Message
There is a fairly complex sequence of events surrounding each line of text arriving from the MUD, which is documented here:

http://www.gammon.com.au/forum/?id=6554

For your case can you please show the trigger in question?

Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


And also the relevant part of the script? (the part the trigger calls)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rivius   (99 posts)  Bio
Date Reply #2 on Sun 20 Nov 2011 09:08 PM (UTC)
Message
Sure thing! The trigger in question:


  <trigger
   enabled="y"
   group="Core"
   match="^(?:\d+h)?(?:\, )?(?:\d+m)?(?:\, )?(?:\d+e)?(?:\, )?(?:\d+p)?(?:\, )?(?:\d+en)?(?:\, )?(?:\d+w)?(?:\, )?(?:(?:[1-5])mo)? ([elrxkdbpSsi<>]*)\-$"
   name="core_prompt"
   keep_evaluating="y"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   script="events.prompt"
   sequence="1000"
  >
  </trigger>


calls:


function prompt(name, line, wildcards, styles)
	--If less than two colours, it is an illusion.
	if (#styles < 2) then
		return
	end
	
	prompt_flags = wildcards[1] -- Sets the retrieved flags.
	
	local no_prompt = prompt_actions["no_prompt"]
	
	if not balances.onbal then
		events.tvar_clear("balance_action")
	end
	
	balances.prompt() -- Updates balance stats.
	events.balance() -- Runs balance event.
	affs.recklessness_check() -- Are we a little too crazy?
	inventory.pipe_check()
	
	
	affs.checks()
	
	-- Execute all actions lined up for the prompt.
	for name,action in pairs (prompt_actions) do
		if type(action) == "function" then
			action()
		elseif type(action) == "string" and #action > 0 then
			Execute(action)
		end
		prompt_actions[name] = nil
	end
	pvars = {}
	
	-- Cures your afflictions.
	curing.routine()
	
	if not no_prompt then
		ui.prompt() -- Draws the acorn prompt.
	end
	
	if (#affs.last_cures > 0) then
		Note()
		local c = string.gsub(table.concat(affs.last_cures, ", "), "_", " ")
		ColourNote("white", "", "cleared: ", "silver", "", c)
	end
	affs.last_cures = {}
	
	core.prev_hp, core.prev_mp, core.prev_ep = core.hp or 0, core.mp or 0, core.ep or 0
end


The above function called the ui function (which redraws the prompt)


function prompt() --Draws the prompt in all its prettiness.
	local time_ms = GetInfo(232) 
	local powerfract = ( tonumber(core.power)/ tonumber(GetVariable("vitals_maxpow")) )
	
	local flagcolour = "yellow" --Just colours the flags based on balance status.
	if not (balances.onbal) or (affs.prone) then
		flagcolour = "silver"
	end
	
	ColourTell("silver", "", "[")
	Hyperlink("time_stamp_difference "..time_ms, string.format("%0.2f", time_ms), "Click to get difference.", "lightslategray", "", 0)
	ColourTell("silver", "", "|")
	if not affs.get("recklessness") then
		ColourTell(colourfract(core.hpfract), "", string.format("%d", (core.hpfract * 100)).."%h")
		ColourTell("silver", "", "|")
		ColourTell(colourfract(core.mpfract), "", string.format("%d", (core.mpfract * 100)).."%m")
		ColourTell("silver", "", "|")
		ColourTell(colourfract(core.epfract), "", string.format("%d", (core.epfract * 100)).."%e")
		ColourTell("silver", "", "|")
		ColourTell(colourfract(powerfract), "", core.power.."p")
	else
		ColourTell("chartreuse", "", "Reckless")
	end
	ColourTell("silver", "", "|")
	ColourTell(colourfract(core.enfract), "", string.format("%d", (core.enfract * 100)).."%en")
	ColourTell("silver", "", "|")
	ColourTell(colourfract(core.wpfract), "", string.format("%d", (core.wpfract * 100)).."%w")
	ColourTell("silver", "", "] ")
	ColourTell(flagcolour, "", events.prompt_flags.."- ")

	if core.is_paused() then
		ColourTell("darkred", "", "(", "crimson", "", "psd", "darkred", "", ")" )
	end

	if affs.get("stunned") then
		ColourTell("goldenrod", "", "(", "gold", "", "stn", "goldenrod", "", ")" )
	end
	
	if affs.get("asleep") then
		ColourTell("royalblue", "", "(", "cornflowerblue", "", "slp", "royalblue", "", ")" )
	end
	
	if affs.slow() then
		local c = "slateblue"
		if events.tvars["slow_block"] then
			c = "plum"
		end
		ColourTell("darkslateblue", "", "(", c, "", "slow", "darkslateblue", "", ")" )
	end
	
	if affs.get("jinx") then
		ColourTell("darkorange", "", "(", "orange", "", "jinx", "darkorange", "", ")" )
	end
	
	if #mapper.autowalking > 0 then
		ColourTell("darkgray", "", "(", "silver", "", "moving - "..mapper.autowalking[1], "darkgray", "", ")" )
	elseif events.tvars["autowalk_arrived"] then
		events.tvar_clear("autowalk_arrived")
		ColourTell("darkgray", "", "(", "silver", "", "arrived", "darkgray", "", ")" )
	end
	
	point_changes()
end




Also, thank you for that link. I'll be studying this now :)
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 21 Nov 2011 03:53 AM (UTC)
Message
Rivius said:

For some reason, it shows up perfectly in the output but does not display at all in the log.


Well you have omit from log.

What is the problem exactly? What is the "it" that shows up perfectly?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rivius   (99 posts)  Bio
Date Reply #4 on Mon 21 Nov 2011 06:20 AM (UTC)
Message
The redrawn note as shown in the last function. Appears in the output, doesn't in the log.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 21 Nov 2011 07:15 PM (UTC)
Message
Are you logging notes?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rivius   (99 posts)  Bio
Date Reply #6 on Mon 21 Nov 2011 08:07 PM (UTC)

Amended on Mon 21 Nov 2011 08:19 PM (UTC) by Rivius

Message
I am. That appears to be the only note that does not get logged properly.

Here are my log settings:

http://imageshack.us/f/42/logsettings.png/

Compare this log generated by the built in log command:
http://dl.dropbox.com/u/16429247/logtest.html

with my select and "Copy as HTML" produced log from the buffer:

http://dl.dropbox.com/u/16429247/logtest2.html

(there's a little more in this log due to me selecting a bit higher up, but you can compare the corresponding parts).


If it's any help, this was on 4.77 (I also experience this on 4.79)



Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #7 on Mon 21 Nov 2011 10:21 PM (UTC)
Message
I am wondering if all those ColourTells are being followed by a Note or other line-terminating function.

Possibly with the line not "officially" terminated, the logging gets bypassed.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rivius   (99 posts)  Bio
Date Reply #8 on Tue 22 Nov 2011 05:26 AM (UTC)

Amended on Tue 22 Nov 2011 05:27 AM (UTC) by Rivius

Message
Wow! Your hypothesis was correct. Adding a Note() to the function makes it appear in the log once again. That explains why sometimes it would show up and sometimes it wouldn't, since depending on whether you lost health or not, it would add an extra note at the bottom with additional info.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


31,263 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.