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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Strange format of output

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Strange format of output

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2 

Posted by JY.Chang   Taiwan  (15 posts)  [Biography] bio
Date Reply #15 on Fri 16 Dec 2011 05:28 AM (UTC)  quote  ]

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?
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #16 on Fri 16 Dec 2011 09:25 PM (UTC)  quote  ]
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
[Go to top] top

Posted by JY.Chang   Taiwan  (15 posts)  [Biography] bio
Date Reply #17 on Sat 17 Dec 2011 05:04 AM (UTC)  quote  ]

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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #18 on Sat 17 Dec 2011 05:31 AM (UTC)  quote  ]
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
[Go to top] top

Posted by JY.Chang   Taiwan  (15 posts)  [Biography] bio
Date Reply #19 on Sat 17 Dec 2011 05:44 AM (UTC)  quote  ]
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>
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #20 on Sat 17 Dec 2011 10:26 PM (UTC)  quote  ]
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
[Go to top] top

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


2,348 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]