|
rking351 Newbie
Joined: 04 Nov 2007 Posts: 7
|
Posted: Wed Feb 07, 2018 7:31 am
Help with script |
Hi,
I just switched from zmud to cmud but can't get the following trigger to work.
#var OldExp @NewExp
#var NewExp %1
#math ExpChange (@NewExp-@OldExp)
#math NewExpGoal (@ExpGoal-@NewExp)
#if (@ExpChange > 0) {#show -== @ExpChange ==-}
thanks! |
|
|
|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Wed Feb 07, 2018 10:30 am |
Sorry, I hope I haven't got this completely wrong, but try this:
Code: |
OldExp = @NewExp
NewExp = %1
#math ExpChange (@NewExp-@OldExp)
#math NewExpGoal (@ExpGoal-@NewExp)
#if (@ExpChange > 0) {#show -== @ExpChange ==-} |
Also can we see your pattern to make sure it's right too?
I'm assuming something like:
Code: |
You gain (%d) experience points! |
|
|
|
|
rking351 Newbie
Joined: 04 Nov 2007 Posts: 7
|
Posted: Thu Feb 08, 2018 1:54 am |
Hi,
thanks for your help. So my mud grants experience on weapon damage done. My prompt includes my experience in the following format.
- Exp: 308015615 >
Therefore after a round where I do weapon damage, my experience increases by the same amount of damage and the trigger shows amount of damage done in the format:
-= @ExpChange =-
Regards,
Richard |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Feb 08, 2018 2:29 am |
The issue is likely with the fact that this is a prompt trigger.
Open it up in the settings editor, then open up the bottom option panel, if it isn't already.
Make sure to uncheck on newline.
And then check on prompt. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Feb 08, 2018 2:36 am |
Oh, the #MATH command is deprecated.
We can also cut out some clutter in your .pkg file by using local variables for throwaway info:
Try changing it to:
#IF (@xp=%1) {#NOOP} {
$old=@xp
xp=%1
#PRINT {-== (@xp-$old) ==-}
} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|