Is it possible to add a decimal point to trigger sequences?

Posted by Graceecat on Wed 20 Aug 2008 07:55 PM — 6 posts, 23,746 views.

Taiwan #0
I wish the sequences of triggers all have a decimal point on them!

Are you able to add this function to mush? Is it easy?

Thank you anyway!


USA #1
Yes, it is. If the match is a regular expression, then the decimal point needs to be escaped.

i.e:
HP: 93.65%

"^HP: (\d+\.\d+)%$" will match it.

^ is start of line.
$ is end of line.
( ) means capture this (to %1, %2...)
\d is a number
\. is a literal period. ( . is any character to regexps)
+ is one or more of the previous so \d+ will match 1,11,111 etc)

read
http://www.gammon.com.au/scripts/doc.php?general=regexp

for complete information.
USA #2
I think he might have meant adding a decimal point to the sequence numbers of the triggers, which I believe is not possible.
Australia Forum Administrator #3
The sequence is defined as an integer in the range 0 to 10000 - rather than adding decimal points, just resequence things a bit. The exact numbers don't count, just the order.

For example, this small Lua script would multiply each sequence number for all your triggers by 10.


tl = GetTriggerList()
if tl then
  for k, v in ipairs (tl) do 
    seq = GetTriggerOption (v, "sequence")
    SetTriggerOption (v, "sequence", seq * 10)
  end  -- for
end -- if we have any triggers


Now assuming you don't already have a sequence number over 1000 this now gives you 9 extra gaps between your previous sequence numbers to slot things into.

Just copy and paste that into the Immediate window (Ctrl+I) to run it.
Amended on Wed 20 Aug 2008 09:36 PM by Nick Gammon
Taiwan #4
I wish the interface look more beautiful. This is very important to me! So I firmly wanna let the sequence numbers all have a decimal point... Could you teach me this complicated procedure to beautify my mush? Thank you everyone again and thank nick knew what my question was.

Amended on Sun 24 Aug 2008 08:09 AM by Graceecat
USA #5
There isn't a procedure to have decimal points in the sequence number, unless you're willing to edit the MUSHclient source code and recompile it yourself. :-)