Fancy messages?

by relaren

Back to Mechanic's Corner.

relaren2007-02-17 09:02:45
So, getting tired of constantly having to go DELMSG X, DELMSG X, DELMSG X? Why not turn them into clickable links? So much easier!

Clicking the number will delete that message while clicking the name will read the message.

Enjoy!

CODE
#REGEX {^\\#(\\d+) (\\a+): (\\d+)/(\\d+) (\\d+):(\\d+) \\"(.*)$} {#substitute {%ansi(grey)~#%ansi(high,yellow)~%1~%ansi(grey)" - "%ansi( brown)~%2~" "%ansi(high,red)%3~/%4~/%5~:%6 %ansi(white)%7%ansi(white)" "~"}}


That can put pasted straight into zMUD that can.
laeric2007-02-17 12:24:24
That's a very neat idea, Jeisha biggrin.gif

*goes head to head*

Here's the mushclient equivelent:

CODE

     enabled="y"
   expand_variables="y"
   keep_evaluating="y"
   match="^\\#(\\d+) (.*?)\\: (\\d+)\\/(\\d+) (\\d+)\\:(\\d+) \\"(.*?)(\\"|\\.\\.\\.)$"
   name="hyperlink_message"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
      ColourTell ('silver', 'black', '#')
  Hyperlink ('delmsg ' .. GetTriggerWildcard('hyperlink_message', 1), GetTriggerWildcard('hyperlink_message', 1), 'Click to delete msg #' .. GetTriggerWildcard('hyperlink_message', 1), 'blue', 'black', 0)
  ColourTell ('silver', 'black', ' ')
  Hyperlink ('rmsg ' .. GetTriggerWildcard('hyperlink_message', 1), GetTriggerWildcard('hyperlink_message', 2), 'Click to delete msg #' .. GetTriggerWildcard('hyperlink_message', 1), 'maroon', 'black', 0)
  ColourTell ('silver', 'black', ': ' .. GetTriggerWildcard('   hyperlink_message', 3) .. '/' .. GetTriggerWildcard('hyperlink_message', 4) .. ' ' .. GetTriggerWildcard('hyperlink_message', 5) .. ':' .. GetTriggerWildcard('hyperlink_message', 6) .. ' "' .. GetTriggerWildcard('hyperlink_message', 7) .. GetTriggerWildcard('hyperlink_message', 8))
  Note ('')

  


EDIT: For MUSH users, you do need to have scripting enabled, and lua set as your scripting language. Simply copy and paste that entire thing from, and including to , and click PASTE in your trigger's dialog.
laeric2007-02-17 12:43:01
More complete version:

#1 (system): 02/05 14:58 "Hello"
System has just left you message #1.
Message #1 Sent by: (system)

These triggers will add a nifty little (read) beside the second line, to become:

System has just left you message #1. (read)

and a (delete) beside the third line.

Message #1 Sent by: (system) (delete)

so you can click to read and delete, if the message isn't close to your latest read message for RM. Make sure you delete the trigger from the previous post before adding these three.

CODE

     enabled="y"
   group="misc-scripts"
   keep_evaluating="y"
   match="^Message \\#(\\d+)(\\s+)Sent by\\: (.*?)$"
   name="delete_message"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  ColourTell ('silver', 'black', 'Message #' .. GetTriggerWildcard("delete_message", 1) .. GetTriggerWildcard("delete_message", 2) .. 'Sent by: ' .. GetTriggerWildcard("delete_message", 3))
Hyperlink ('delmsg ' .. GetTriggerWildcard("delete_message", 1), ' (delete)', 'Click to read ' .. GetTriggerWildcard("delete_message", 1), 'maroon', 'black', 0)
Note ("")

  
     enabled="y"
   expand_variables="y"
   group="misc-scripts"
   keep_evaluating="y"
   match="^\\#(\\d+) (.*?)\\: (\\d+)\\/(\\d+) (\\d+)\\:(\\d+) \\"(.*?)(\\"|\\.\\.\\.)$"
   name="hyperlink_message"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  ColourTell ('silver', 'black', '#')
Hyperlink ('delmsg ' .. GetTriggerWildcard('hyperlink_message', 1), GetTriggerWildcard('hyperlink_message', 1), 'Click to delete msg #' .. GetTriggerWildcard('hyperlink_message', 1), 'blue', 'black', 0)
ColourTell ('silver', 'black', ' ')
Hyperlink ('rmsg ' .. GetTriggerWildcard('hyperlink_message', 1), GetTriggerWildcard('hyperlink_message', 2), 'Click to delete msg #' .. GetTriggerWildcard('hyperlink_message', 1), 'maroon', 'black', 0)
ColourTell ('silver', 'black', ': ' .. GetTriggerWildcard('   hyperlink_message', 3) .. '/' .. GetTriggerWildcard('hyperlink_message', 4) .. ' ' .. GetTriggerWildcard('hyperlink_message', 5) .. ':' .. GetTriggerWildcard('hyperlink_message', 6) .. ' "' .. GetTriggerWildcard('hyperlink_message', 7) .. GetTriggerWildcard('hyperlink_message', 8))
Note ('')

  
     enabled="y"
   group="misc-scripts"
   keep_evaluating="y"
   match="^(\\w+) has just left you message \\#(\\d+)\\.$"
   name="received_message"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  ColourTell ('silver', 'black', GetTriggerWildcard("received_message", 1) .. ' has just left you message #' .. GetTriggerWildcard("received_message", 2) .. '.')
Hyperlink ('rmsg ' .. GetTriggerWildcard("received_message", 2), ' (read)', 'Click to read ' .. GetTriggerWildcard("received_message", 2), 'blue', 'black', 0)
Note ("")

  
relaren2007-02-17 12:50:24
Very cute, though I cannot help but wince at the major size difference between the two scripts.

Good idea on the modified version, I think I will add that to the zMUD one a little later.