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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Triggers/script for keeping statistics of spells and displaying them?

Triggers/script for keeping statistics of spells and displaying them?

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


Posted by Quintosh   (2 posts)  [Biography] bio
Date Sun 24 Aug 2014 05:04 PM (UTC)

Amended on Sun 24 Aug 2014 08:00 PM (UTC) by Nick Gammon

Message
So hi, first of all I have to say that I'm not any good at doing these kind of things and most of my experience comes making more simpler triggers, and I just started using MUSHclient after I could no longer use my trusted zmud 7.04 (great sadness :< ) so I'm a bit unfamiliar with it.

What I want to do is to create a trigger/script that captures certain actions from the mud and keeps count of them so you could view them in some fancy boxes, here's a very simplified example what I had in mind:


+--------------------------------------------------------+
|hit messagebox  |spirit | elemental|beast|behemoth|demon|
+--------------------------------------------------------+
|reaves          |nmbrs of hits by beast type| | | |     |
+--------------------------------------------------------+
|tears           |   #   |   #      | #   |  #     |     |
+--------------------------------------------------------+
|viciously reaves|  #    |   #      |  #  |  #     |     |
+--------------------------------------------------------+



Something like that. So basicly what happens is that you cast a spell, and then some "minion" comes out from it, spirit elemental etc. And depending on how hard it hits, the hit messages change. What I want to do is somehow make a trigger to count the hits made by the separate "minions" and also make a command to view these statistics. An example of the hits:

The abominable elemental brutally slashes Willem hitting his torso with its monstrous claws, causing shards of bone and pieces of tissue to JOLT away!

or

The dreadful spirit tears Willem hitting his left foreleg with its horrible claws, causing bones to sparkle and break with the hit!

who hit and how hard and how many times.

[EDIT] Code tags added.
[Go to top] top

Posted by Quintosh   (2 posts)  [Biography] bio
Date Reply #1 on Sun 24 Aug 2014 05:17 PM (UTC)

Amended on Sun 24 Aug 2014 07:52 PM (UTC) by Nick Gammon

Message
Another thing that I want to do, with the similar statistical view is to make a counter to see what "minions" I draw out from the portals, elemental type and size of the minion".

few examples.

"A voltaic spirit of oppression appears from the yellow portal." where the 'spirit' part is the size of the minion, and the color part 'yellow' tells the type, which would be lightning in this case.

or

"A freezing elemental of destruction appears from the blue portal." Same thing, 'elemental' for the size, and 'blue' for the type, which would be cold.

the tablet would look something like this.


+---------------+-------+----+-----+------+
|         |Blue |Yellow |Red |White| Brown|
+---------+-----+-------+----+-----+------+
|Demon    |  #  |  #    | #  |  #  |  #   |
+------- -+-----+-------+----+-----+------+
|Behemoth |  #  |  #    | #  |  #  |  #   |
+-------- +-----+-------+----+-----+------+
|Beast    |  #  |  #    | #  |  #  |  #   |
+---------+-----+-------+----+-----+------+
|Elemental|  #  |  #    | #  |  #  |  #   |
+---------+-----+-------+----+-----+------+
|Spirit   |  #  |  #    | #  |  #  |  #   |
+---------+-----+-------+----+-----+------+


where the # are the number of the "minions" that appear from the portals. I have absolutely no clue how to even begin doing this, I could use all the help I can get, or if someone manages to build a working scripts for that, I might even give you some compensation :P

(edit. damn tablet got borked on submit and broke my fancy ascii, but I think you guys understand what I mean regardless)
[Go to top] top

Posted by Nick Gammon   Australia  (23,000 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sun 24 Aug 2014 07:59 PM (UTC)
Message
Quote:

(edit. damn tablet got borked on submit and broke my fancy ascii, but I think you guys understand what I mean regardless)


Template:codetag To make your code more readable please use [code] tags as described here.






Well, before you display those nice tables you have to collect the data. Make some simple triggers that match those messages, and display the results. This is the first step.

Here is an example to get you started:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="^An? (?&lt;element&gt;\w+) (?&lt;size&gt;\w+) of (?&lt;type&gt;\w+) appears from the (?&lt;portal&gt;\w+) portal\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>

Note ("element = %&lt;element&gt;")
Note ("size = %&lt;size&gt;")
Note ("type = %&lt;type&gt;")
Note ("portal = %&lt;portal&gt;")

</send>
  </trigger>
</triggers>



Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


Test output:


A voltaic spirit of oppression appears from the yellow portal.
element = voltaic
size = spirit
type = oppression
portal = yellow
A freezing elemental of destruction appears from the blue portal.
element = freezing
size = elemental
type = destruction
portal = blue

- Nick Gammon

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


9,586 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]