Register forum user name 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Keeping track of my empty vials

Keeping track of my empty vials

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


Pages: 1  2 

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #15 on Mon 03 May 2010 06:31 AM (UTC)

Amended on Mon 03 May 2010 06:32 AM (UTC) by Twisol

Message
Your first problem is that there's no way to put anything in that table. Remember, plugins are entirely separate from eachother and the world. Each plugin has its own separate script space, so 'vials' in the plugin is a different variable from 'vials' in the world.

I think you'll want a pair of aliases for this:

<aliases>
  <alias
   match="^\s*setvial\s+(\d+)\s+(\w+)\s*$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>vials["%1"] = "%2"</send>
  </alias>
  
  <alias
   match="^\s*unsetvial\s+(\d+)\s*$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>vials["%1"] = nil</send>
  </alias>
</aliases>


Usage:
setvial 123456 health
unsetvial 123456

Add that XML to the plugin file.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
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.


35,518 views.

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

It is now over 60 days since the last post. This thread is closed.     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.