[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Hrm...my hyperlinks aren't working for some reason?

Hrm...my hyperlinks aren't working for some reason?

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


Pages: 1 2  

Posted by Rivius   (99 posts)  [Biography] bio
Date Sun 01 May 2011 11:21 PM (UTC)

Amended on Sun 01 May 2011 11:23 PM (UTC) by Rivius

Message
Hyperlink("acorn_core_time_difference "..time_ms, string.format("%0.2f", time_ms), time_ms, "lightslategray", "", 0)


that's the hyperlink code and this is the alias:


  <alias
   enabled="y"
   group="Acorn Core"
   match="^acorn\_core\_time\_difference (.+)$"
   name="acorn_core_time_stamp_differences"
   ignore_case="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
	tmst = (tmst or 0)
	if tmst == 0 then
		tmst = %1
	else
		ui.message("Time difference: "..math.abs(%1-tmst).."seconds")
		if IsConnected() then
			Send("")
		end
		tmst = 0
	end
  </send>
  </alias>


I can see the hyperlink but it isn't clickable? What might the reason for this be? I remember this working when I used it in another worldfile a long time ago. The alias also seems to work when I run it...

also, related question but is there any way I can get rid of the underlines?
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 02 May 2011 06:21 AM (UTC)
Message
When I tried your Hyperlink line it worked (once I set up time_ms to be something). The hyperlink appeared and I could click on it.

As for the underline, see world configuration, MXP/Pueblo tab, and uncheck "Underline hyperlinks".

Template:version Please help us by advising the version of MUSHclient you are using. Use the Help menu -> About MUSHclient.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #2 on Mon 02 May 2011 07:14 AM (UTC)

Amended on Mon 02 May 2011 07:40 AM (UTC) by Rivius

Message
Using the latest version I think. 4.72.

I ran it using the command window, and it works fine, but when calling it from my script file, the hyperlink is unclickable. Strange...


function timestamp()
   local time_ms = GetInfo(232)
   Hyperlink("acorn_core_time_difference "..time_ms,    string.format("%0.2f", time_ms), time_ms, "lightslategray", "", 0)
end


Also, I unchecked and I still see the underlines. But it isn't essential, so nevermind about that.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Mon 02 May 2011 08:17 AM (UTC)
Message
Well I executed what you posted in the Immediate window, and then in the command window typed:


/timestamp ()


It still worked. So can you provide more detail? Is this function in a plugin? Where is it being called from? A trigger or what? Is the trigger in a plugin?

I vaguely remember some issue along these lines, I'll try to find it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #4 on Mon 02 May 2011 05:36 PM (UTC)

Amended on Tue 03 May 2011 03:57 AM (UTC) by Rivius

Message
Well, it's being called from a lua file and being run whenever the prompt is sent (on a trigger).
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Tue 03 May 2011 09:16 AM (UTC)
Message
In a plugin?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #6 on Tue 03 May 2011 11:12 AM (UTC)
Message
Nope. Just straight from a .lua file. All the code is in a file called ui.lua and is within a function called prompt(). I do ui.prompt() in the trigger code box, and everything shows but is strangely unclickable. What's strangest about this, is that I remember copy and pasting the exact same code elsewhere and having no issue.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Tue 03 May 2011 11:17 AM (UTC)
Message
You've lost me a bit there. This ui.lua file, is that the scripting file for the main world?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Tue 03 May 2011 11:18 AM (UTC)
Message
Template:bug

Please provide a summary of your world configuration:

  • Either use the scripting Immediate window (Ctrl+I) to execute: Debug ("summary")

    or

  • Install the Summary plugin (see "Summary" feature) and type "summary"

Then copy the resulting information from the output window, and paste into a Forum message.

You need version 4.55 onwards of MUSHclient to do this.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #9 on Wed 04 May 2011 04:45 PM (UTC)
Message
Nick Gammon said:

(summary)



-------------- MUSHclient summary --------------

MUSHclient version: 4.72
Compiled: Feb  5 2011.
Time now: Wednesday, May 04, 2011, 11:35 AM
Operating system: Windows XP
Libraries: Lua 5.1.4, PCRE 8.10, PNG 1.4.3, SQLite3 3.7.3, Zlib 1.2.5
World name: 'System', ID: 288d2606420aa0647a661d14
-- Scripting --
Script language: Lua, enabled: yes
Scripting active: yes
Script file: C:\Documents and Settings\Terry\My Documents\acorn\reference.lua
Lua sandbox is 5055 characters, DLL loading allowed: NO
Scripting prefix: '/'. External editor in use: NO.
Scripting for: 1.421887 seconds.
-- Triggers, aliases, timers, variables --
** Triggers: 31 in world file, triggers enabled: yes. [Triggers]
   29 enabled, 30 regexp, 2842 attempts, 23 matched, 0.002791 seconds.
** Aliases: 5 in world file, aliases enabled: yes. [Aliases]
   5 enabled, 4 regexp, 1018 attempts, 252 matched, 0.002114 seconds.
** Timers: 0 in world file, timers enabled: yes.
   0 enabled, 0 fired.
   Timers checked every 0.1 seconds.
** Variables: 22. [Variables]
-- MCCP --
MCCP not active.
-- Plugins (Processing order) --
ID: 29958808b1cf9a76642ed9b3, 'AcornGMCP', (Lua, 0.828 s) Enabled [Al Cb]
ID: bcd4c85623b51c11ec643123, 'Accelerators', (Lua, 0.103 s) Enabled [Cb]
** Plugins: 2 loaded, 2 enabled.
-- Comms --
Connect phase: 8 (Open). NAWS wanted: NO
Received: 12239 bytes (11 Kb)
Sent: 434 bytes (0 Kb)
Received 27 packets, sent 22 packets.
Total lines received: 193
This connection: Sent 16 lines, received 162 lines.
Telnet (IAC) received: DO: 0, DONT: 0, WILL: 5, WONT: 3, SB: 20 [Telnet]
-- MXP --
MXP active: NO, Pueblo mode: NO, Activated: No - never
MXP tags received: 0
MXP entities received: 0
MXP errors: 0
-- Commands --
Commands in command history: 7
Speed walking enabled: NO. Speed walking prefix: #
Command stacking enabled: yes. Command stack character: ';'
Accelerators defined: 15 [Accelerators]
-- Miniwindows --
** Miniwindows: 0 loaded, 0 shown.
-- Output window --
Output pixels: width 883, height: 740, font width: 7, font height: 16
               can show 126 characters, wrapping at column 80, height 46 lines.
Output buffer: 211 of 5000 lines.
-- Miscellaneous --
Logging: NO, tracing: NO
** SQLite3 databases: 0
Sound buffers in use: 0



Basically, I use multiple modules and my main lua file is reference.lua.
Ui.lua is where I do all my little ui stuff like messages, prompt modifications, etc.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Wed 04 May 2011 11:37 PM (UTC)
Message
Can you please generate the hyperlink line, then select that entire line (shift+double-click) and then go to the Display menu -> Text Attributes -> Line Info and paste what you get? I got this:


Line 444 (444), Thursday, May 05, 8:35:59 AM
 Flags = End para: YES, Note: YES, User input: no, Log: no, Bookmark: no
 Length = 10, last space = -1
 Text = "3073590.54"

2 style runs

1: Offset = 0, Length = 10, Text = "3073590.54"
 Action - send to MUD: "acorn_core_time_difference 3073590.5353358"
 Hint: "3073590.5353358"
 Flags = Hilite: no, Underline: YES, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=119, G=136, B=153
 Background colour RGB   : R=0, G=0, B=0

2: Offset = 10, Length = 0, Text = ""
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Custom colour: 4 (Custom5)

10 columns in 2 style runs

------ (end line information) ------



In particular I am looking for the "Action - send to MUD" line.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #11 on Thu 05 May 2011 12:27 AM (UTC)

Amended on Thu 05 May 2011 12:56 AM (UTC) by Rivius

Message
What's supposed to happen when you click "line info"? It isn't adding anything to my clipboard.


EDIT: Nevermind, I figured it out. For some reason it wasn't opening the Note window, so I had to manually open it myself.


Line 89 (89), Wednesday, May 04, 7:46:17 PM
 Flags = End para: no, Note: YES, User input: no, Log: no, Bookmark: no
 Length = 52, last space = 51
 Text = "[30527.34|100%h|100%m|100%e|10p|100%en|100%w] elrx- "

16 style runs

1: Offset = 0, Length = 1, Text = "["
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

2: Offset = 1, Length = 8, Text = "30527.34"
 No action.
 Flags = Hilite: no, Underline: YES, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=119, G=136, B=153
 Background colour RGB   : R=0, G=0, B=0

3: Offset = 9, Length = 1, Text = "|"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

4: Offset = 10, Length = 5, Text = "100%h"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=0, G=128, B=0
 Background colour RGB   : R=0, G=0, B=0

5: Offset = 15, Length = 1, Text = "|"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

6: Offset = 16, Length = 5, Text = "100%m"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=0, G=128, B=0
 Background colour RGB   : R=0, G=0, B=0

7: Offset = 21, Length = 1, Text = "|"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

8: Offset = 22, Length = 5, Text = "100%e"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=0, G=128, B=0
 Background colour RGB   : R=0, G=0, B=0

9: Offset = 27, Length = 1, Text = "|"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

10: Offset = 28, Length = 3, Text = "10p"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=0, G=128, B=0
 Background colour RGB   : R=0, G=0, B=0

11: Offset = 31, Length = 1, Text = "|"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

12: Offset = 32, Length = 6, Text = "100%en"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=0, G=128, B=0
 Background colour RGB   : R=0, G=0, B=0

13: Offset = 38, Length = 1, Text = "|"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

14: Offset = 39, Length = 5, Text = "100%w"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=0, G=128, B=0
 Background colour RGB   : R=0, G=0, B=0

15: Offset = 44, Length = 2, Text = "] "
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=192, G=192, B=192
 Background colour RGB   : R=0, G=0, B=0

16: Offset = 46, Length = 6, Text = "elrx- "
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=255, G=255, B=0
 Background colour RGB   : R=0, G=0, B=0

52 columns in 16 style runs

------ (end line information) ------
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Thu 05 May 2011 04:17 AM (UTC)
Message
Hmm.


2: Offset = 1, Length = 8, Text = "30527.34"
 No action.
 Flags = Hilite: no, Underline: YES, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=119, G=136, B=153
 Background colour RGB   : R=0, G=0, B=0


That has "No action" but is underlined. Well that narrows it down. It's not that it is marked as a hyperlink, it isn't. It's just underlined. Now why is that I wonder?

Can I see the code that inserts that into the line in greater detail? It might be some sort of style-run change that is causing it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rivius   (99 posts)  [Biography] bio
Date Reply #13 on Thu 05 May 2011 04:31 AM (UTC)
Message
Sure!


function prompt() --Draws the prompt in all its prettiness.
	local time_ms = GetInfo(232) 
	local powerfract = ( tonumber(acorn.power)/ tonumber(GetVariable("acorn_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("acorn_core_time_difference "..time_ms, string.format("%0.2f", time_ms), "Click to get difference.", "lightslategray", "", 0)
	ColourTell("silver", "", "|")
	ColourTell(ColourFract(acorn.hpfract), "", string.format("%d", (acorn.hpfract*100)).."%h")
	ColourTell("silver", "", "|")
	ColourTell(ColourFract(acorn.mpfract), "", string.format("%d", (acorn.mpfract*100)).."%m")
	ColourTell("silver", "", "|")
	ColourTell(ColourFract(acorn.epfract), "", string.format("%d", (acorn.epfract*100)).."%e")
	ColourTell("silver", "", "|")
	ColourTell(ColourFract(powerfract), "", acorn.power.."p")
	ColourTell("silver", "", "|")
	ColourTell(ColourFract(acorn.enfract), "", string.format("%d", (acorn.enfract*100)).."%en")
	ColourTell("silver", "", "|")
	ColourTell(ColourFract(acorn.wpfract), "", string.format("%d", (acorn.wpfract*100)).."%w")
	ColourTell("silver", "", "] ")
	ColourTell(flagcolour, "", events.prompt_flags.."- ")
	
	if acorn.paused == "true" then
		ColourTell("darkred", "", "(", "crimson", "", "p", "darkred", "", ")" )
	end

	if affs.current["stunned"] then
		ColourTell("goldenrod", "", "(", "gold", "", "stn", "goldenrod", "", ")" )
	end
	
	if affs.current["asleep"] then
		ColourTell("royalblue", "", "(", "cornflowerblue", "", "slp", "royalblue", "", ")" )
	end
	
	if affs.slow() then
		ColourTell("darkslateblue", "", "(", "slateblue", "", "slow", "darkslateblue", "", ")" )
	end
	
	
end


That's the entire function.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Fri 06 May 2011 07:00 AM (UTC)
Message
I notice the line ends with a ColourTell.

Can you finish of the line, for example:


print ""


I wonder if it is something to do with the line not being completed.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


44,992 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]