Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
rking351
Newbie


Joined: 04 Nov 2007
Posts: 7

PostPosted: 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!
Reply with quote
boblinski
Novice


Joined: 05 Dec 2005
Posts: 49
Location: New Zealand

PostPosted: 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!
Reply with quote
rking351
Newbie


Joined: 04 Nov 2007
Posts: 7

PostPosted: 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
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net