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
ballin
Newbie


Joined: 03 Apr 2010
Posts: 7

PostPosted: Sat Apr 03, 2010 5:50 am   

zmud scripts i cant seem to get to work on cmud
 
I was wondering what changes these need to have made to work on cmud:

1st script:

#var lhp 0
#var lgp 0
#var nhp 0
#var ngp 0
#var ohp 0
#var ogp 0
#var nextlev 1000000

#gauge hp "HP: @lhp" @lhp %mud.maxhp %mud.maxhp/5 "Gauges" "green" "red"
#gauge gp "GP: @lgp" @lgp %mud.maxgp 100 "Gauges" "green" "red"
#gauge xp "XP: %mud.xp" %mud.xp @nextlev @nextlev "Gauges" "blue" "green"
#gauge sp "SP: %mud.sp" %mud.sp %mud.maxsp %mud.maxsp "Gauges" "blue" "red"

#mxptrig {!EN} {#var nhp {%mud.hp};#if (@nhp != @ohp) {#var lhp {@nhp};#var ohp {@nhp}};#var ngp {%mud.gp};#if (@ngp != @ogp) {#var lgp {@ngp};#var ogp {@ngp}}} "Gauges" "Prompt|NoCr"

#alarm {*2} {#if (@lgp < %mud.maxgp) {#var lgp {%eval( @lgp+4)};#if (@lgp >= %mud.maxgp) {#var lgp {%mud.maxgp};#echo {"Your GP is full ("@lgp")."}}};#if (@lhp < %mud.maxhp) {#var lhp {%eval( @lhp+4)};#if (@lhp >= %mud.maxhp) {#var lhp {%mud.maxhp};#echo {"Your HP is full ("@lhp")."}}}} "Gauges"

#tr {^It would have cost &%dnextlev xp to teach * level}



-------------------------------------

second script:

#var oldxp 999999999
#var totxp 0
#var numxp 0

#tr {^You last logged in from} {#var oldxp {999999999}}
#tr {^Throw the other copy out? ~(y/n/restart~)} {#var oldxp {999999999}}

#alarm {*10:00} {#var lastten {%eval( %mud.xp-@oldxp)};#var oldxp {%mud.xp};#if (@lastten>0) {#var totxp {%eval( @totxp+@lastten)};#var numxp {%eval( @numxp+1)}};#echo {"Over the last 10 minutes you've earned "@lastten"xp, a rate of "%eval(@lastten*6)"xp/hr."};#echo {"You average "%eval( @totxp/@numxp*6)"xp/hour."}}

#st {XP Rate: %eval(lastten*6)xp/hr}

----------------------------------------------------------------------

third script:

#tr {^~((%x)~) (%x) wisps} {#sub "(%1 - "%time(hh:nn)") %2 wisps"}

I could use a hand in identifying the issues in these.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Apr 03, 2010 7:51 pm   
 
1)"" prevent any form of processing. "%1" now equates to the literal string of %1, rather than "the multiword contents of %1"

This applies to the first script and the third script.

2)all variable references in functions must start with @.

This applies to the second script.
_________________
EDIT: I didn't like my old signature
Reply with quote
ballin
Newbie


Joined: 03 Apr 2010
Posts: 7

PostPosted: Sun Apr 04, 2010 7:02 am   
 
... "%1" now equates to the literal string of %1, rather than "the multiword contents of %1"


so what command/function would i use then?

we have a chat channel that comes across as "wisps" (trigger keyword) and the channel name is appended. The %1 used to be used to get/use that channel name
Reply with quote
ballin
Newbie


Joined: 03 Apr 2010
Posts: 7

PostPosted: Sun Apr 04, 2010 7:08 am   
 
well, im still quite new to all of this anyways and these are another persons zmud scripts i had been using.

Can you walk me through the third script and explain the changes you would make and why? That might help me understand a bit better
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Sun Apr 04, 2010 7:23 am   
 
Basically, he's saying that to use %1 as a variable, you cannot place it inside quotes. That would tell the script you want it to treat %1 as LITERALLY %1, and not whatever it contains.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Apr 04, 2010 7:59 pm   
 
Quite simply, change every instance of "%1" to %1. "" stops processing completely, so instead of wisps you would get %1 which is clearly not what you wanted.
_________________
EDIT: I didn't like my old signature
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Thu Apr 08, 2010 6:01 pm   
 
#SHOW {Over the last 10 minutes you've earned @lastten~xp, a rate of %eval(@lastten*6)xp/hr.}

basically gotta lose the quotes on %1's, @vars, & %functions()

in zmud this woulda been proper as...
#SHOW {%concat("Over the last 10 minutes you've earned ", @lastten, "xp at a rate of ", %eval(@lastten*6), "xp/hr.")}

zmud usta let us be much more lazy :)

same for like coloring... %function cant be in quotes...

#SHOW {%ansi(red)%concat("Over the last 10 minutes you've earned ", %ansi(white), @current_level, %ansi(red), "xp at a rate of ", %ansi(white), %eval(@current_level*6), %ansi(red), "xp/hr.")}
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