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 ➜ Plugins ➜ Status line from prompt, using new partial-line plugin callback

Status line from prompt, using new partial-line plugin callback

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


Pages: 1  2 

Posted by Tarbor   (5 posts)  Bio
Date Reply #15 on Fri 27 Feb 2004 09:40 AM (UTC)
Message
I know plugin variables are meant to be local -
But in this special case it would be nice to pass the information gathered from the prompt like current hitpoints to my main script file...

Is there any way to accomplish this?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #16 on Fri 27 Feb 2004 08:54 PM (UTC)
Message
Not directly. Why do that? Do you want to do something with the number in the main world that can't be done in the plugin? What would that be?

If you must, what you could do is make (say) a 1-second timer, that does a GetPluginVariable, thus pulling the number from the plugin, rather than pushing it to the main script.

However my suggestion is to take whatever processing you want to do in your main script file, and move that to a plugin, either the one which does the partial-line plugin callback, or another one.

If you put it into another one the partial-line plugin can do a CallPlugin to tell the other plugin about the new prompt data.

- Nick Gammon

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

Posted by Gore   (207 posts)  Bio
Date Reply #17 on Mon 01 Mar 2004 04:14 AM (UTC)
Message
I don't think I understand how this works.. say I have this for code:

Quote:
<triggers>
  <trigger
   enabled="y"
   group="echos"
   keep_evaluating="y"
   match="^(\d+?)h\, (\d+?)m .*?"
   regexp="y"
   script="echo_health"
   sequence="100"
  >
  </trigger>
</triggers>

SUb Echo_Health (a,b,wildcard)
  dim health, mana
  health = wildcard(1)
  mana = wildcard(2)
  World.ColourNote "black", "white", "Health: " & health & " Mana: " & mana
End Sub


Could you explain how I could use the partial-line plugin callback to make this happen before a new-line comes through?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #18 on Mon 01 Mar 2004 07:48 PM (UTC)
Message
Well, you don't use a trigger, you use a plugin script, and do a regular expression parse (or a straight compare) inside the plugin, along the lines of the example I gave.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


79,998 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.