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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Apocalpse
Newbie


Joined: 25 Feb 2001
Posts: 6

PostPosted: Sun Jun 23, 2002 6:33 am   

Need help covert into zmud format
 
Hello all was wonder if someone could help

me covert these 2 dmud scripts into zmud

format for me if all possible seeing have

trouble get it work my self.
---------------------------------------------
#HEAD -- Attempt at a damge counter --

#HEAD SET totaldamage=0

#HEAD TRIG You barely punch (.*).=#ADD totaldamage=2;#SHOW 2

#HEAD TRIG You punch (.*).=#ADD totaldamage=6;#SHOW 6

#HEAD TRIG You punch (.*) hard.=#ADD totaldamage=11;#ADD totaldamage=-6;#SHOW 11

#HEAD TRIG You punch (.*) very hard.=#ADD totaldamage=15;#ADD totaldamage=-17;#SHOW 15

#HEAD ALIAS reportdamage=gtell I did total &totaldamage damage.

--------------------------------------------
#HEAD -- Darkie Status report --

#ALIAS glon={

#SET alldarks=STATUS:;

#SET teldarks=1;

#TRIG ([A-Za-z]+) (is in excellent shape|has a few (bruises|scratches)|is minorly wounded|has several wounds|is wounded|is majorly wounded|is at the brink of death) and (looks (energetic|fatigued|tired|winded|beat|fainty|exhausted))={

#SET darkstatus=~2;

#If &darkstatus=is in excellent shape={#SET darkstatus=fine}={# frop};

#If &darkstatus=has a few bruises={#SET darkstatus=good}={# frop};

#If &darkstatus=has a few scratches={#SET darkstatus=good}={# frop};

#If &darkstatus=is minorly wounded={#SET darkstatus=hurt}={# frop};

#If &darkstatus=has several wounds={#SET darkstatus=hurt}={# frop};

#If &darkstatus=is wounded={#SET darkstatus=HURT}={# frop};

#If &darkstatus=is majorly wounded={#SET darkstatus=BAD}={# frop};

#If &darkstatus=is at the brink of death={#SET darkstatus=AWFUL}={# frop};

#SET dark=~1(&darkstatus);#SET alldarks=&alldarks &dark;#ADD teldarks=1;glance &teldarks.evil};

#TRIG They aren't here.={#If &alldarks=STATUS:={# frop}={gtell &alldarks};gloff}}

#ALIAS gloff={

#TRIG ([A-Za-z]+) (is in excellent shape|has a few (bruises|scratches)|is minorly wounded|has several wounds|is wounded|is majorly wounded|is at the brink of death) and (looks (energetic|fatigued|tired|winded|beat|fainty|exhausted));

#TRIG They aren't here.}

#ALIAS gl={glon;glance 1.evil}

---------------------------------------------
Sorry long post this is it.

Apoc
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jun 23, 2002 4:46 pm   
 
; -- Attempt at a damge counter --
#VAR totaldamage 0
#TRIG {You barely punch %w} #ADD totaldamage 2;#SHOW 2}
#TRIG {You punch %w} {#ADD totaldamage 6;#SHOW 6}
#TRIG {You punch * hard} {#ADD totaldamage 5;#SHOW 11}
#TRIG {You punch * very hard} {#ADD totaldamage 4;#SHOW 15}
#ALIAS reportdamage {gtell I did total @totaldamage damage.

There's the first one. As you can see, #HEAD is not used by zMUD. #SET is also not used, but appears to match the #VAR command. All zMUD commands are immediately preceded by the # symbol. { and } are used to delimit multi-word fields in most commands. ; is used at the beginning of a line to mark a comment, anywhere else it separates commands.

I'd recommend looking up #VAR, #ALIAS, #TRIGGER, #ADD, and #IF to make sure you have the correct syntax for each command. I'd also recommend reading Basic Usage, Introduction to Aliases, Introduction to Variables, and Introduction to Triggers in the Getting Started section of the helpfile.

LightBulb
Senior Member
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Jun 23, 2002 5:24 pm   
 
Now that I got the easy ones out of the way I will take a go at this one. Since I have no clue what {# frop} is supposed to mean I will ignore it. Oh, wait it looks like an ABORT...I can get around without using that though. Voila!

#CLASS {DarkieStatusReport}
#ALIAS glon {#VAR alldarks {STATUS:};#VAR teldarks {1}}
#ALIAS gloff {#VAR teldarks {0};#VAR alldarks {STATUS:}}
#ALIAS gl {glon;glance 1.evil}
#VAR alldarks {}
#VAR teldarks {0}
#VAR StatusDescriptions {is in excellent shape|has a few bruises|has a few scratches|is minorly wounded|has several wounds|is wounded|is majorly wounded|is at the brink of death}
#VAR StatusValues {fine|good|good|hurt|hurt|HURT|BAD|AWFUL}
#VAR darkstatus {}
#VAR dark {}
#TRIGGER {(%w) (@StatusDescriptions) and looks {energetic|fatigued|tired|winded|beat|fainty|exhausted}} {#IF (@teldarks) {#VAR darkstatus %item(@StatusValues,%ismember("%2",@StatusDescriptions));#VAR dark %concat("%1",@darkstatus);#VAR alldarks %concat(@alldarks,@dark);#ADD teldarks 1;glance @teldarks.evil}}
#TRIGGER {They aren't here.} {#IF (@alldarks!="STATUS:") {gtell @alldarks;gloff}}
#CLASS 0

I eliminated the need to constantly change the triggers by put an IF in one. All the FROP went away, in one case by changing the logic, in the other by using something better. I was a little unsure what the + in this "TRIG ([A-Za-z]+)" does so I ignored it, but the %w I used to replace that whole item will match it if it is something the mud sends.
Reply with quote
Apocalpse
Newbie


Joined: 25 Feb 2001
Posts: 6

PostPosted: Sun Jun 23, 2002 11:20 pm   
 
I try your idea out Lightbulb and work perfect now. Thanks!

Well Vijilante havn't had chance test your idea out yet but thanks for help.

Oh ya would been nice add like simple button

toggle on and off. But guess that something

else been add at later date.

Thanks

Apocalpse
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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