|
Jewsh Newbie
Joined: 02 Jul 2007 Posts: 3
|
Posted: Mon Jul 02, 2007 2:27 am
Help with a off the wall trigger. |
I am new to CMud/ZMud and only have a basic understanding of the commands involved. I am hoping someone here can help me out on something I am trying to do. I am trying to calculate only certain lines in a fight and have it total them all up to let me now how many I had that round. I am not sure if this is even possible, I tried looking through the help and support files but I didn't understand most of it.
This is what a round looks like.
Your felling the oak !!! RIPS OPEN A JUGULAR !!! on a guest!
Your cleave !!! PUNCTURES A LUNG !!! in a guest!
Your blow crushes a guest's windpipe!
Your felling the oak ^^^ GETS GORINAC ^^^ on a guest!
Your felling the oak !!! RIPS OPEN A JUGULAR !!! on a guest!
Your felling the oak !!! RIPS OPEN A JUGULAR !!! on a guest!
You rend a huge opening in a guest's armor!
Your felling the oak ^^^ GETS GORINAC ^^^ on a guest!
A guest climbs back to her feet.
You reverse a guest's attack and flow into a counter strike!
Your counterattack devastates a guest!
You reverse a guest's attack and flow into a counter strike!
Your counterattack devastates a guest!
A guest's beating devastates you!
8 hit X 532 damage = [4256] damage given
1 hit X 31 damage = [31] damage taken
A guest looks close to death.
Jewsh is bleeding slightly.
The lines in the bold are the ones I am trying to total up. So that the end of my round will look something like this:
Your counterattack devastates a guest!
A guest's beating devastates you!
8 hit X 532 damage = [4256] damage given
1 hit X 31 damage = [31] damage taken
A guest looks close to death.
Jewsh is bleeding slightly.
Total Gorinacs this round: 2
The bolded part is the outcome I am looking for. Is this possible and if so, how? Thanks for helping a nublet out. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jul 02, 2007 9:38 am |
This is definitely possible. Try this. I wasn't sure which parts of the line stay the same and which parts change, so you might need to add or take away wildcards. Read the Pattern Matching topic.
#var Gorinacs 0
#trig {Your felling the oak ~^~^~^ GETS GORINAC ~^~^~^ on *} {#add Gorinacs 1}
#trig {%d hit X %d damage ~= ~[%d~] damage taken} {#echo Total Gorinacs this round: @Gorinacs;#var Gorinacs 0}
#alias ResetGorin {#var Gorinacs 0} |
|
|
|
Jewsh Newbie
Joined: 02 Jul 2007 Posts: 3
|
Posted: Mon Jul 02, 2007 10:56 am |
Sweet, I will have to try this when I get home tonight. I really do appreciate the help. Is there like a scripting in Z/CMud for dummies? When I read the help files in the support section or on CMud itself I feel like a doof because I don't understand what it's saying all the commands are for. :\
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jul 02, 2007 11:34 am |
That's the problem really... you won't understand what a lot of the commands are for until you think of a problem where they'd be useful and ask someone. A lot of the concepts are pretty opaque if you're new to scripting in general.
That said, try the support library. Some of the articles there are useful. Ignore the complex ones like the COM interface and read the book chapters and overview topics. |
|
|
|
Jewsh Newbie
Joined: 02 Jul 2007 Posts: 3
|
Posted: Mon Jul 02, 2007 3:44 pm |
So when i go to make a new trigger this is how I want it to look?
Patern is : Your * ~^~^~^ GETS GORINAC ~^~^~^ on *
Line 1: #var Gorinacs 0
Line 2: #trig {Your * ~^~^~^ GETS GORINAC ~^~^~^ on *} {#add Gorinacs 1}
Line 3: #trig {%d hit X %d damage ~= ~[%d~] damage taken} {#echo Total Gorinacs this round: @Gorinacs;#var Gorinacs 0}
Line 4: #alias ResetGorin {#var Gorinacs 0}
Hopefully I will get the hang of this soon so I can stop pestering you. :P |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jul 02, 2007 6:53 pm |
Indeed no - just paste what I posted on the command line and press enter. The #trig command creates triggers and the #alias command creates aliases. It should make everything for you.
|
|
|
|
|
|