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.
 Entire forum ➜ MUSHclient ➜ General ➜ Strange format of output

Strange format of output

Posting of new messages is disabled at present.

Refresh page


Pages: 1  2 

Posted by JY.Chang   Taiwan  (15 posts)  Bio
Date Reply #15 on Fri 16 Dec 2011 05:28 AM (UTC)

Amended on Fri 16 Dec 2011 03:03 PM (UTC) by JY.Chang

Message
It is awesome! My skill list looks better than before, thank you veeeeery much!

I have one more question, is it possible to show those skills in the original colors? Maybe it is possible for miniwindow, but how does it works on output?
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #16 on Fri 16 Dec 2011 09:25 PM (UTC)
Message
Template:faq=33 Please read the MUSHclient FAQ - point 33.


Basically you work out what column you are interested in (eg. by searching or finding the length of what you have) and then use the methods there to find the colour at that column. Then you can use ColourTell ... ColourTell .. etc. to colour each part.

- Nick Gammon

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

Posted by JY.Chang   Taiwan  (15 posts)  Bio
Date Reply #17 on Sat 17 Dec 2011 05:04 AM (UTC)

Amended on Sat 17 Dec 2011 05:42 AM (UTC) by JY.Chang

Message
Thank you for your reply, and I have tried to make what I want but failed... I need a favor, please.
The trigger below which calls the function "sklist":
^(.*)\s+\: (\d+)(.*)\s+\: (\d+)$


and the match pattern, for example:(the colour part was in bold)
淨化術 Cleanse               : 6699 星光杖法 Starlight wand      : 3959


The function "sklist":
function sklist(name, line, wildcards, styles)

  col_1 = string.find (line, Trim (wildcards[1]))
  col_2 = string.find (line, Trim (wildcards[3]))
  style_1 = GetStyle (styles, col_1)
  style_2 = GetStyle (styles, col_2)

  ColourTell (
  "RGBColourToName(style_1.textcolour)", "", string.format ("%-28s : ", Trim (wildcards[1])), 
  "silver", "", string.format ("%4d ",wildcards[2]), 
  "RGBColourToName(style_2.textcolour)", "", string.format ("%-28s : ", Trim (wildcards[3])), 
  "silver", "", string.format ("%4d", wildcards[4])
  )
end


The error message is:
[string "Script file"]:3: attempt to index local 'wildcards' (a nil value)
stack traceback:
	[string "Script file"]:3: in function 'sklist'
	[string "Trigger: "]:2: in main chunk
	[C]: in function 'Simulate'
	[string "Command line"]:1: in main chunk


I'm pretty new in programming, so I have no idea about the script above is feasible or not.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #18 on Sat 17 Dec 2011 05:31 AM (UTC)
Message
Can you show the exact trigger?

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.


- Nick Gammon

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

Posted by JY.Chang   Taiwan  (15 posts)  Bio
Date Reply #19 on Sat 17 Dec 2011 05:44 AM (UTC)
Message
The exact trigger is:
<triggers>
  <trigger
   enabled="y"
   match="^(.*)\s+\: (\d+)(.*)\s+\: (\d+)$"
   omit_from_output="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>sklist ()</send>
  </trigger>
</triggers>
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #20 on Sat 17 Dec 2011 10:26 PM (UTC)
Message
No, you have to do it like this, otherwise sklist function does not get any arguments (which accounts for why wildcards was nil):


<triggers>
  <trigger
   enabled="y"
   match="^(.*)\s+\: (\d+)(.*)\s+\: (\d+)$"
   omit_from_output="y"
   regexp="y"
   script="sklist"
   sequence="100"
  >
  </trigger>
</triggers>


- Nick Gammon

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

Posted by JY.Chang   Taiwan  (15 posts)  Bio
Date Reply #21 on Sun 18 Dec 2011 01:44 AM (UTC)
Message
Oh, that is how it is. I will try again to figure it out and thank you for your help Nick. :)
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.


58,949 views.

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

Posting of new messages is disabled at present.

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.