|
hykou Wanderer
Joined: 29 Apr 2004 Posts: 63 Location: USA
|
Posted: Fri Aug 13, 2004 3:23 am
did i do something wrong? |
Code: |
#VAR EXPTNL
#VAR Level
#VAR Exp
#VAR Tnl
#VAR QP
#VAR Complete
#TRIGGER {* You have * experience points and need (*) to advance.} {@EXPTNL = %replace( "%1", ",")}
#TRIGGER {Total Level: (%d)} {#MATH Level (%1 + 1)}
#TRIGGER {You receive (*) experience points.} {@Exp = %replace( "%1", ",");#MATH Tnl (@EXPTNL/@Exp);#MATH EXPTNL (@EXPTNL-@Exp)}
#TRIGGER {Quest Points: (*) ~((*) quests~)} {@QP = %replace( "%1", ",");@Complete = %replace( "%2", ",")}
#ST Experience needed to level @Level~: @EXPTNL I will get there in @tnl kills. @QP Quest Points |
its supposed to put my exp tnl and calculate how many kills of the same exp tnl on the status bar, as well as quest points, and quests. now my problem is when i receive this line "You receive 1,349 experience points." or any set amoutn of exp, it doesnt put the right amount of exp tnl on the status bar... it puts about 700 exp lower.
heres the lines that set the triggers off...
You receive 1,349 experience points.
* You have 33,448 experience points and need 10,552 to advance.
and heres an example of it all
Experience needed to level 7: 3476 I will get there in 0 kills. 0 Quest Points <--- whats on status before the kill
Experience needed to level 7: 942 I will get there in 1 kills. 0 Quest Points <--- whats on after
You receive 1,267 experience points. <--- thats what i got for exp
thank you |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Fri Aug 13, 2004 4:05 am |
First, the * character will always be interpreted as a wildcard by Zmud, even if it is what the trigger fires on, so you need to use %2 in your first trigger.
The main problem I see throughout is for just about every non-MATH variable assignment, you are using @varname. The @ symbol expands the variable(gives its value), so pretty much all it does is try to set a value to a value which can't be done.
For example:
#TRIGGER {* You have * experience points and need (*) to advance.} {@EXPTNL = %replace( "%1", ",")}
should be
#TRIGGER {* You have * experience points and need (*) to advance.} {EXPTNL = %replace( "%1", ",")}
One other concern I have which I hope someone with more experience with me can answer. Wouldn't using, for example, {EXPTNL = %number(%2)} work much better at getting rid of the comma in a captured number? |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Fri Aug 13, 2004 3:07 pm |
#TRIGGER {^~* You have * experience points and need (%n) to advance.$} {#VAR EXPTNL %1}
#TRIGGER {^You receive (%n) experience points.$} {Exp=%1;#MATH EXPTNL @EXPTNL-@Exp;#MATH Tnl @EXPTNL/@Exp}
#TRIGGER {Quest Points: (%n) ~((%n) quests~)} {QP=%1;Complete=%2} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Aug 13, 2004 6:26 pm |
Small modifications:
#TRIGGER {^~* You have %n experience points and need (%n) to advance.$} {#VAR EXPTNL %1}
#TRIGGER {^You receive (%n) experience points.$} {Exp=%1;#MATH EXPTNL @EXPTNL-@Exp;#MATH Tnl ((@EXPTNL/@Exp) + %if( @EXPTNL\@Exp, 1, 0))}
Adds 1 whenever the division leaves a remainder. |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
|
|
|
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
|
|