|
gxyzod Beginner
Joined: 10 May 2012 Posts: 12
|
Posted: Fri Nov 16, 2012 8:17 pm
Action counter |
Dear all,
As with the previous topic I have another need: the creation of two counters that will keep track of the number of positive and failed backstabs I've done.
This is needed because to grow in the skill I need to keep a 50:50 ratio.
In case it is positive I get a message like "you have come out of the darkness and hit XXXX on his neck
If negative it says: "you have come out of the darkness and missed XXXX"
Any ideas are welcome,
Sasa |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Fri Nov 16, 2012 10:05 pm |
#TR {you have come out of the darkness and missed} {
$fail=(@backstab.fail+1)
#ADDKEY backstab Fail $fail
}
#TR {you have come out of the darkness and hit} {
$succeed=(@backstab.succeed+1)
#ADDKEY backstab Succeed $succeed
}
that should keep track of them in one database variable |
|
_________________ Discord: Shalimarwildcat |
|
|
|
gxyzod Beginner
Joined: 10 May 2012 Posts: 12
|
Posted: Fri Nov 16, 2012 11:13 pm |
Thanks for the prompt reply! It is really appriciated!
I created them as triggers right?
How can I retrieve the data? Thanks once again!
Sasa |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Nov 17, 2012 2:30 am |
As you can see in shalimar's code, you can reference them with @backstab.fail and @backstab.succeed. You could use a simple alias like this to display your ratio:
Code: |
#alias bsratio {$bsratio = (@backstab.succeed / %float(@backstab.succeed + @backstab.fail) * 100)
#print %format("Backstab success rate: &.2n%%", $bsratio)} |
|
|
|
|
gxyzod Beginner
Joined: 10 May 2012 Posts: 12
|
Posted: Sun Nov 18, 2012 8:53 pm |
Thanks a million, that really helped!
Can I still take advantage of your patience?
I'd like to set this counter also on the number of hits given and taken, but it becomes problematic when I have other people fighting in the room.
Is it possible to trigger an action when it sees a frase like this:
You hit XXX YYY ZZZ EEE with a LLLL and hurt him!
So basically masking different words in the phrase that could be the name of the victim, the race and the weapon used?
Thanks once again,
Sasa |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Sun Nov 18, 2012 8:58 pm |
#TR {You hit (%w) (%w) with (%w) and hurt {him|her}!} {
$race=%1
$victim=%2
$weapon=%3
}
And so on, that assumes race and victim are one word each |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|