|
Ruderion Novice
Joined: 12 Jan 2003 Posts: 33 Location: Netherlands
|
Posted: Wed Oct 06, 2004 6:18 pm
#math creating classes |
I have a trigger set up to count the number of improvements on my skills.
Like this
#TR {You have become better at (*)!} {#math %1 @%1+1}
It works fine for skills like brew and scribe but when i improve at a skill with 2 words like enhanced damage and fast healing things go wrong. A new class is created named '@enhanced' with a variable in it named '@enhanced' and a value of 'damage'.
How do i prevent something like this to happen without setting up a special trigger for every skill? |
|
_________________ Ruderion |
|
|
|
Bowie Newbie
Joined: 06 Oct 2004 Posts: 1
|
Posted: Wed Oct 06, 2004 8:02 pm |
Hmm...Can think of two ways:
1.) #TR {You have become better at (*)!} {#VAR SkillName %replace("%1"," ","");#MATH @SkillName (@{@SkillName}+1)
2. #TR {You have become better at (*)!} {#MATH {%1}...not sure how to finish this one, I tried a few ways and cant get a multiword variable to work in the #MATH command.
1 just uses a new variable which strips the spaces from the name, 2 /should/ be able to make multiword variables work...some how. Hope this helps. |
|
|
|
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Wed Oct 06, 2004 8:06 pm |
You need to keep it simple.
#TRIGGER {You have become better at (*)!} {
skillname = %replace( %1, " ", "_")
#addkey skills @skillname [%db( @skills, @skillname) + 1]
}
The above trigger stores the data in a variable record. As you see it replaces whitespace with an underscore. |
|
|
|
Ruderion Novice
Joined: 12 Jan 2003 Posts: 33 Location: Netherlands
|
Posted: Wed Oct 06, 2004 8:50 pm |
of course. Should have thought about that myself. And with that database variable it is a lot easier to keep track of all the values. Thanks!
|
|
_________________ Ruderion |
|
|
|
|
|