Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
PigfarmerJr
Newbie


Joined: 18 Dec 2005
Posts: 4

PostPosted: Sun Dec 18, 2005 4:21 pm   

Please help with: Multi stab counter.
 
On Hidden Worlds we have up to a quad stab. I would like to keep track of how many single stabs, double stabs, triple stabs, and quad stabs.
Is there an easy way to do this.
The text from the mud for various stabs are as follows using the The Dali-Lama as any mobname. To further complicate things, out of a multistab you can have both hits and misses as shown below:

Single:
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back

Double:
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!

Triple:
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!

Quad
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back!
The Dali-Lama makes a strange sound, as you place The Master's Sickle in his back
Whiff:
The Dali-Lama quickly avoids your backstab, and you nearly sever your finger.

The whiff can be part or all of any of the above stabs.
_________________
You sure got a purty mouth.
Squeeeeeeeeeeeeeeeeal!!!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Dec 18, 2005 5:10 pm   
 
#CLASS BackStabTracker
#VARIABLE StabCount {0} {0}
#VARIABLE HitCount {0} {0}
#VARIABLE TotalCounts {}
#TRIGGER "StabCounter" {({makes a strange sound, as you place The Master's Sickle in his back!|quickly avoids your backstab, and you nearly sever your finger.})$} {StabCount=1;HitCount=%ends("%1","!")}
#COND {({makes a strange sound, as you place The Master's Sickle in his back!|quickly avoids your backstab, and you nearly sever your finger.})$} {#ADD StabCount 1;#ADD HitCount %ends("%1","!");#STATE StabCounter 1} {within|param=1}
#COND {*.501} {#ADDKEY TotalCounts Total {%eval(@TotalCounts.Total+1)};#ADDKEY TotalCounts {@StabCount} {%eval(%db(@TotalCounts,@StabCount)+1)};#ADDKEY TotalCounts Hits {@HitCount};#ADDKEY TotalCounts Swings {@StabCount};#ECHO Hit Rate: %eval(@TotalCounts.Hits*100/@TotalCounts.Swings) Stab Ratios 1:%eval(%db(@TotalCounts,"1")*100/@TotalCounts.Total) 2:%eval(%db(@TotalCounts,"2")*100/@TotalCounts.Total) 3:%eval(%db(@TotalCounts,"3")*100/@TotalCounts.Total) 4:%eval(%db(@TotalCounts,"4")*100/@TotalCounts.Total)} {alarm}
#CLASS 0

That should give a pretty good counter type of thing with some basic statisticals.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
PigfarmerJr
Newbie


Joined: 18 Dec 2005
Posts: 4

PostPosted: Wed Dec 21, 2005 6:36 pm   
 
Thank you.
However, i'm not getting it to give me how many of each stab i'm getting
Ie: how many singles, doubles, triples etc.
I already have a percentage of hit/miss of total stabs.
I was wondering if it was possible to recognize when a series of stabs took place on the game and keep track.

I guess I'm not getting it to either keep track of stabs or type of stabs as of yet. Although the variables show up in the editor they do not have a value other than 0 or 1

Thank you again for your time.
_________________
You sure got a purty mouth.
Squeeeeeeeeeeeeeeeeal!!!
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Dec 22, 2005 6:42 pm   
 
Same with me PigfarmerJr.
Dunno what the %ends part has to do with all this.

according to help ends:
Syntax: %ends(s1,s2)
true if s1 ends with s2
Examples:
#VAR LineFromMud "You are hungry."
#IF (%ends(@LineFromMud,".")) {#SAY not wrapped} {#SAY probably wrapped}
displays:
not wrapped

*shrug*
_________________
http://www.Aardwolf.com
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Dec 22, 2005 8:19 pm   
 
Reconfigured it for Aardwolf

Code:
#CLASS BackStabTracker
#VARIABLE StabCount {0} {0}
#VARIABLE HitCount {0} {0}
#VARIABLE TotalCounts {}
#TRIGGER "StabCounter" {({ Your backstab pimpslaps | Your backstab misses })} {StabCount=1;HitCount=1}
#COND {({ Your backstab pimpslaps| Your backstab misses})} {#ADD StabCount 1;#ADD HitCount 1;#STATE StabCounter 1} {within|param=1}
#COND {+.5} {#ADDKEY TotalCounts Total {%eval(@TotalCounts.Total+1)};#ADDKEY TotalCounts {@StabCount} {%eval(%db(@TotalCounts,@StabCount)+1)};#ADDKEY TotalCounts Hits {@HitCount};#ADDKEY TotalCounts Swings {@StabCount};#ECHO Hit Rate: %eval(@TotalCounts.Hits*100/@TotalCounts.Swings) Stab Ratios 1:%eval(%db(@TotalCounts,"1")*100/@TotalCounts.Total) 2:%eval(%db(@TotalCounts,"2")*100/@TotalCounts.Total) 3:%eval(%db(@TotalCounts,"3")*100/@TotalCounts.Total) 4:%eval(%db(@TotalCounts,"4")*100/@TotalCounts.Total)} {alarm}
#CLASS 0


You plunge your dagger deep into a magma worm's back!
[1] Your backstab pimpslaps a magma worm! [543]
[1] Your backstab pimpslaps a magma worm! [504]
[1] Your backstab misses a magma worm! [0]
[1] Your backstab pimpslaps a magma worm! [531]
3045/3045M 3292/3382V 2449X 0Q Me: 99% Enemy: 75% NESW>
[2] a magma worm's flaming bite misses you. [0]
[6] Your pierce pimpslaps a magma worm! [1539]
3045/3045M 3292/3382V 2449X 0Q Me: 99% Enemy: 56% NESW>
[6] Your pierce pimpslaps a magma worm! [1536]
3045/3045M 3292/3382V 2449X 0Q Me: 99% Enemy: 38% NESW>
You spray a magma worm with a huge rotting Kobold gland.
Your Spray <-:-> ASPHYXIATES <-:-> a magma worm! [139]
Your Spray <-:-> ASPHYXIATES <-:-> a magma worm! [139]
A magma worm turns pale and appears weakened.
3045/3045M 3247/3382V 2449X 0Q Me: 99% Enemy: 35% NESW>
[3] Your pierce pimpslaps a magma worm! [845]
3045/3045M 3247/3382V 2449X 0Q Me: 99% Enemy: 25% NESW>
You spray a magma worm with a huge rotting Kobold gland.
Your Spray <-:-> ASPHYXIATES <-:-> a magma worm! [131]
3045/3045M 3202/3382V 2449X 0Q Me: 99% Enemy: 23% NESW>
[1] a magma worm's flaming bite misses you. [0]
[6] Your pierce pimpslaps a magma worm! [1501]
3045/3045M 3320/3382V 2449X 0Q Me: 99% Enemy: 6% NESW>
You spray a magma worm with a huge rotting Kobold gland.
Your Spray -=- VAPORIZES -=- a magma worm! [114]
3045/3045M 3275/3382V 2449X 0Q Me: 99% Enemy: 5% NESW>
[2] Your pierce pimpslaps a magma worm! [546]
A magma worm is slain by a final deadly stab!!
You receive 0 experience points.
A magma worm spills its guts all over the floor.
You get a gold coin from the perforated corpse of a magma worm.

At no point was the report done. TotalCounts was never updated until i specifically did the part that called for it on the command line. (made the mistake of pressing enter a few times to many and the report kept updating with #'s

A question on this, what about if it was dynamically created? (think thats the phrase I am looking for.)
Like say my 1st backstab of the game gives me:

Hit Rate: 100 Stab Ratios 4:100

2nd gives me

Hit Rate: 100 Stab Ratios 2:50 4:50

Reason for this is that there is also more than 4 backstab hits, more than 5 more than 6...depends on luck and dex. So a dynamiclly made one would be nice.

At times there is a TOTAL miss on backstabs and all ya get is
Your backstab misses the Gardener of Babylon. [0]

Note: no [1] before it

Also, note that the Hit Rate never seemed to change, even with that miss in the posted example i gave.
_________________
http://www.Aardwolf.com
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Dec 23, 2005 8:38 am   
 
Evidently the alarm state is not firing correctly. Just change it to a pattern type and make the pattern blank so it fires on the next line received.

#CLASS BackStabTracker
#VARIABLE StabCount {0} {0}
#VARIABLE HitCount {0} {0}
#VARIABLE TotalCounts {}
#TRIGGER "StabCounter" {({makes a strange sound, as you place The Master's Sickle in his back!|quickly avoids your backstab, and you nearly sever your finger.})$} {StabCount=1;HitCount=%ends("%1","!")}
#COND {({makes a strange sound, as you place The Master's Sickle in his back!|quickly avoids your backstab, and you nearly sever your finger.})$} {#ADD StabCount 1;#ADD HitCount %ends("%1","!");#STATE StabCounter 1} {within|param=1}
#COND {} {#ADDKEY TotalCounts Total {%eval(@TotalCounts.Total+1)};#ADDKEY TotalCounts {@StabCount} {%eval(%db(@TotalCounts,@StabCount)+1)};#ADDKEY TotalCounts Hits {@HitCount};#ADDKEY TotalCounts Swings {@StabCount};#ECHO Hit Rate: %eval(@TotalCounts.Hits*100/@TotalCounts.Swings) Stab Ratios 1:%eval(%db(@TotalCounts,"1")*100/@TotalCounts.Total) 2:%eval(%db(@TotalCounts,"2")*100/@TotalCounts.Total) 3:%eval(%db(@TotalCounts,"3")*100/@TotalCounts.Total) 4:%eval(%db(@TotalCounts,"4")*100/@TotalCounts.Total)}
#CLASS 0


The point of using %ends in my first post was that the '.' and '!' were short little ways to identify between hits and misses, and would give a result of 0 for a miss and a result of 1 for a hit. This allowed me to shortcut the script a bit instead of using some ugly #IF construct.

In anycase, all scripts I write here are untested unless otherwise stated. So there likely are some small bugs.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Dec 23, 2005 4:12 pm   
 
Vijilante wrote:
The point of using %ends in my first post was that the '.' and '!' were short little ways to identify between hits and misses, and would give a result of 0 for a miss and a result of 1 for a hit. This allowed me to shortcut the script a bit instead of using some ugly #IF construct.
Oh, i got ya.
I took the missing ! to be a bad copy/paste.
And that the miss msg started at the "Whiff:"
_________________
http://www.Aardwolf.com
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Dec 23, 2005 4:22 pm   
 
Sad Still not reporting Sad
You plunge your dagger deep into a fish's back!
[1] Your backstab pimpslaps a fish! [665]
[1] Your backstab pimpslaps a fish! [692]
[1] Your backstab pimpslaps a fish! [608]
[1] Your backstab pimpslaps a fish! [727]
3092/3092M 3428/3428V 1354X 0Q Me: 99% Enemy: 81% SWD>
[2] a fish's bite misses you. [0]
[2] Your pierce pimpslaps a fish! [637]
Vampirella screams "WHY YOU LITTLE....!" as she attacks a fish!
Vampirella's pierce <-+-><-*-> CREMATES <-*-><-+-> a fish! [235]
[3] Vampirella's pierce pimpslaps a fish! [710]
3092/3092M 3428/3428V 1354X 0Q Me: 99% Enemy: 70% SWD>
Vampirella utters the words, 'gpabrae ay uqz'.
Vampirella's shard of ice <-==-><-==-> SHATTERS <-==-><-==-> a fish! [323]
Vampirella's shard of ice <-==-><-==-> SHATTERS <-==-><-==-> a fish! [327]
Vampirella's shard of ice <*><-:-><*> SLAUGHTERS <*><-:-><*> a fish! [340]
3092/3092M 3428/3428V 1354X 0Q Me: 99% Enemy: 63% SWD>
[1] a fish's bite pimpslaps you! [48]
[3] Your pierce pimpslaps a fish! [904]
[4] Vampirella's pierce pimpslaps a fish! [981]
3092/3092M 3428/3428V 1354X 0Q Me: 98% Enemy: 49% SWD>
Vampirella utters the words, 'gpabrae ay uqz'.
Vampirella's shard of ice <-==-><-==-> SHATTERS <-==-><-==-> a fish! [314]
Vampirella's shard of ice <-><-=-><-> EXTERMINATES <-><-=-><-> a fish! [298]
Etc etc more fighting

This time it's not even updating the StabCount & HitCount vars...weird..all i did was change the #cond {} and used what I had before which WAS updating them..
Question the #cond {}, does that mean that it's expecting a BLANK line? or just any text? Cause it could be either my prompt or another attack that happens after the last backstab hit
_________________
http://www.Aardwolf.com
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Dec 24, 2005 12:39 am   
 
Try it with looplines and a param of 1. I never really documented the usage of a blank pattern with the various options since I found it quite by accident. So I often forget which ones it actually works with. If you still can't get it I will make some effort to do a little debug testing on my original version this weekend.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Tue Dec 27, 2005 3:08 pm   
 
it just seems like the
#COND {({ Your backstab pimpslaps| Your backstab misses})} {#ADD StabCount 1;#ADD HitCount 1;#STATE StabCounter 1} {within|param=1}
is never even being triggered.
I can change the StabCount & HitCount vars to 0 and the initial backstab will change them back to 1, but after that nothing happens.
Thought I'd go another route with it:
Code:
#VAR backstabmsg {~[1~] Your backstab pimpslaps (%*)~! ~[(%d)~]|Your backstab misses (%*)~. ~[0~]} {_nodef} "BackStabTracker2"
#VAR HitCount {1} {0} "BackStabTracker2"
#VAR StabCount {1} {0} "BackStabTracker2"
#VAR TotalCounts {} {_nodef} "BackStabTracker2"
#TRIGGER "StabCounter" ({@backstabmsg}) {StabCount=1;HitCount=1} "BackStabTracker2" {notrig}
#COND {{@backstabmsg}} {#ADD StabCount 1;#ADD HitCount 1;#STATE StabCounter 1} {within|param=1}
#COND {{!@backstabmsg}} {#ADDKEY TotalCounts Total {%eval(@TotalCounts.Total+1)};#ADDKEY TotalCounts {@StabCount} {%eval(%db(@TotalCounts,@StabCount)+1)};#ADDKEY TotalCounts Hits {@HitCount};#ADDKEY TotalCounts Swings {@StabCount};#ECHO Hit Rate: %eval(@TotalCounts.Hits*100/@TotalCounts.Swings) Stab Ratios 1:%eval(%db(@TotalCounts,"1")*100/@TotalCounts.Total) 2:%eval(%db(@TotalCounts,"2")*100/@TotalCounts.Total) 3:%eval(%db(@TotalCounts,"3")*100/@TotalCounts.Total) 4:%eval(%db(@TotalCounts,"4")*100/@TotalCounts.Total)}
No success there either :(
_________________
http://www.Aardwolf.com
Reply with quote
Dodgester
Wanderer


Joined: 17 Nov 2005
Posts: 65

PostPosted: Tue Dec 27, 2005 5:03 pm   
 
How about setting up a variable that counts how many times you have attempted for that particular round and another trigger on your prompt to record into the appropriate variable of what you attempted and to reset the round count to 0. I have had to do similiar things to know when to dirt kick, quaff a healing potion, and also put in a backlog ticker variable to prevent having a backlog of various commands sent to the mud site.

I also have one trigger setup to know when I need to stand up during a fight, but included in it, rather than having to possibly end up standing up multiple times, it only sends it one time based on another variable that I have setup rather if the command has been sent or not and if it has been sent, has it been executed yet.

Sincerely,

Dodgester
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Dec 28, 2005 9:06 am   
 
You might have to add a #SET in here, at least it won't hurt. I still haven't done any debugging on this though.
#ADD HitCount 1;#SET StabCounter 1 0;#STATE StabCounter 1
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Wed Dec 28, 2005 12:41 pm   
 
Sorry, Vij, still not working.
Still is not adding.
working on something else with it now. me and #conds never seem to mix well.
Tho I WOULD rather have THIS version working....so far my different one is taking hella more work than i thought it would ;-)
_________________
http://www.Aardwolf.com
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Wed Dec 28, 2005 2:33 pm   
 
Quick question Vij regarding this part:
Code:
#ADDKEY TotalCounts Total {%eval( @TotalCounts.Total+1)}
#ADDKEY TotalCounts {@StabCount} {%eval( %db( @TotalCounts, @StabCount)+1)}
#ADDKEY TotalCounts Hits {@HitCount}
#ADDKEY TotalCounts Swings {@StabCount}
#ECHO Hit Rate: %eval( @TotalCounts.Hits*100/@TotalCounts.Swings)
I just want to verify, that your intention was to work only on the CURRENT backstab and not an overall.
I backstabbed 5 mobs and pretty much had a total of 24 hits, but on my last one i checked and the hitcount/stabcount in was set to 4 in each and that was what I had hit for last.

EDIT:
K, fixed that part up for over all:
#ADDKEY TotalCounts Hits {%eval( %db( @TotalCounts, Hits)+@HitCount)}
#ADDKEY TotalCounts Swings {%eval( %db( @TotalCounts, Swings)+@StabCount)}
_________________
http://www.Aardwolf.com
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net