[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  want to modify this script slighly

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: want to modify this script slighly
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Sat 07 May 2005 08:29 PM (UTC)  quote  ]

Amended on Sat 07 May 2005 08:32 PM (UTC) by Flannel

Message
Change the trigger to this:
^\(.*\)\s+(\d+)/(\d+)\s+hit,\s+\d+/\d+\s+move\s+(?!a .*)(.*)$
What that does is match on anything EXCEPT where the last bit is 'a (anything)'. Assuming, of course, that only pets have that format.

Edit:
Why do you have that trigger twice? It does different things too. Thats... odd.
How does the two trigger thing work exactly?
Anyway, that's not important. I guess you need to change them both then.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by BraG   (1 post)  [Biography] bio
Date Sat 07 May 2005 06:59 PM (UTC)  quote  ]
Message
Nick wrote me this heal script a long time ago and I've had a lot of success with it but I would like to make a slight modification...

Basically when I type "group" I see something to this effect"

"Your group consists of:
( Head) 846/740 hit, 192/192 move Jim
(Front) 579/579 hit, 154/154 move Joe
(Front) 539/550 hit, 160/160 move Bob
(Front) 562/562 hit, 160/160 move Jay
(Front) 323/323 hit, 109/109 move Yens"

The script then automatically calculates which person is missing the most hit points and I just type an alias to heal that person... The problem is if there is a "pet" in the group it kind of changes the output,

"(Front) 323/323 hit, 109/109 move a beautiful pegasus"

Basically if that case happens I just want to ignore the pet, which are generally in the form "a horse", "a water elemental", "a whatever"...

Here's the script...


<triggers>

  <trigger
   enabled="y"
   match="Your group consists of:"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable &quot;person&quot;, &quot;&quot;
SetVariable &quot;hp&quot;, 999999999</send>
  </trigger>

  <trigger
   custom_colour="2"
   enabled="y"
   match="^\(.*\)\s+(\d+)/\d+\s+hit,\s+\d+/\d+\s+move\s+(.*)$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>if %1 &lt; CLng (GetVariable (&quot;hp&quot;)) then
  SetVariable &quot;hp&quot;, %1
  SetVariable &quot;person&quot;, &quot;%2&quot;
end if
</send>
  </trigger>

</triggers>

<aliases>
  <alias
   match="--heal"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>if GetVariable (&quot;person&quot;) &lt;&gt; &quot;&quot; _
  and GetVariable (&quot;hp&quot;) &lt;&gt; 999999999 then
 Send &quot;cast 'full heal' &quot; &amp; GetVariable (&quot;person&quot;)
end if</send>
  </alias>
</aliases>


and


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="^\(.*\)\s+(\d+)/(\d+)\s+hit,\s+\d+/\d+\s+move\s+(.*)$"
   regexp="y"
   send_to="12"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  <send>if %2 &gt; 0 then  ' don't divide by zero!
  if (100 * %1 / %2) &lt; CLng (GetVariable (&quot;hp&quot;)) then
    SetVariable &quot;hp&quot;, 100 * %1 / %2  ' save percentage
    SetVariable &quot;person&quot;, &quot;%3&quot;
  end if
end if
</send>
  </trigger>
</triggers>

[Go to top] 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.


1,267 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]