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 ➜ General ➜ Color activated triggers

Color activated triggers

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


Posted by Adam Petersen   (17 posts)  Bio
Date Fri 28 Mar 2003 11:36 PM (UTC)
Message
i cant get it to work so im posting here


I need to make a trigger to go "Drink mana" when my mana number goes yellow.


3338h, 3152m ex-

338h is health
3152m is mana

they can be green yellow or red depending on the number

please help me get it to work
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 29 Mar 2003 12:17 AM (UTC)
Message
You can make a colour-activated trigger, but it matches on the first character of the matching text, in this case the hp and not the mana.

The simple solution would be to call a small script that simply decides to do it based on the number of mana points, rather than the colour, and probably do something like disable the trigger and set a timer to re-enable it in 5 seconds, so you don't drink the potion too many times in quick succession.

eg. something like this:


<triggers>
  <trigger
   enabled="y"
   match="*h, *m ex-"
   name="CheckPrompt"
   script="DoPrompt"
   sequence="100"
  >
  </trigger>
</triggers>


The script subroutines you would need are:


sub DoPrompt (name, line, wildcards)
dim count
  count = CInt (wildcards (2))  ' mana points
  if count < 2000 then
     world.Send "drink mana"
     world.EnableTrigger "CheckPrompt", 0
     world.addtimer "prompt_timer", 0, 0, 5, "", 1 + 4 + 1024 + 16384, "PromptTimer"
  end if
end sub

sub PromptTimer (name)
    world.EnableTrigger "CheckPrompt", 1
end sub




- Nick Gammon

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

Posted by Adam Petersen   (17 posts)  Bio
Date Reply #2 on Sat 29 Mar 2003 12:47 AM (UTC)
Message
umm,yeah i was more hoping for sometihng simple because i have no idea how do do that, i dont understand, im challenged in that area. heh, sorry

I use version 3.20 if that makes any difference either, if you could explain step by step how to put that into place or have a simpler way that wouold be great! thanks
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.


13,138 views.

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.