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


Joined: 21 Feb 2007
Posts: 8

PostPosted: Wed May 09, 2007 6:36 am   

Complicated alias that won't work with version 1.33
 
Ok, I just upgraded to version 1.33 and one of my huge aliases that I had a lot of help creating with a whole class full of coordinating aliases, triggers, and variables is no longer working, which depresses me. I'm going to post it here, hopefully one of you can figure out what's making it not work!

#var elmode 1;#var eldir %word( @elstring, 1, "");#var ellen %len( @eldir);#var eldirx %copy( @eldir, 1, 1);#var eldiry %copy( @eldir, 2, 2);#var elslave 0;barracks="west";%if( @eldirx=0, elbark0, %if( @eldirx=1, elcom1, %if( @eldirx=2, elcom2, %if( @eldirx=3, enlist man, %if( @eldirx=5, elcom5, %if( @ellen >0, order men march @eldir))))))

Any help would be much appreciated!
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed May 09, 2007 2:01 pm   
 
#var elmode 1;#var eldir %word( @elstring, 1, "");#var ellen %len( @eldir);#var eldirx %copy( @eldir, 1, 1);#var eldiry %copy( @eldir, 2, 2);#var elslave 0;barracks="west";#exec {%if( @eldirx=0, elbark0, %if( @eldirx=1, elcom1, %if( @eldirx=2, elcom2, %if( @eldirx=3, enlist man, %if( @eldirx=5, elcom5, %if( @ellen >0, order men march @eldir))))))}

Note the addition is #exec

Zmud would let you use a variable or a function as a command Cmud does not.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed May 09, 2007 5:09 pm   
 
A better solution would be to rewrite it with #SWITCH
#SWITCH (@eldirx=0) {elbark0}
(@eldirx=1) {elcom1}
(@eldirx=2) {elcom2}
(@eldirx=3) {enlist man}
(@eldirx=5) {elcom5}
(@ellen >0) {order men march @eldir}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
ShadowWind
Newbie


Joined: 21 Feb 2007
Posts: 8

PostPosted: Thu May 10, 2007 1:49 am   
 
I did all of that, and it's now going through, but when I fire the alias, it just shows the code and tells me it does not understand. Here's what I've got, any ideas why it's still broken?

#var elmode 1;#var eldir %word( @elstring, 1, "");#var ellen %len( @eldir);#var eldirx %copy( @eldir, 1, 1);#var eldiry %copy( @eldir, 2, 2);#var elslave 0;barracks="west";#switch (@eldirx=0) {elbark0} #switch (@eldirx=1) {elcom1} #switch (@eldirx=2) {elcom2} #switch (@eldirx=3) {enlist man} #switch (@eldirx=5) {elcom5} #switch (@ellen >0) {order men march @eldir}))))))
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu May 10, 2007 2:12 am   
 
He means for you to do it this way.
Code:
#var elmode 1
#var eldir %word( @elstring, 1, "")
#var ellen %len( @eldir)
#var eldirx %copy( @eldir, 1, 1)
#var eldiry %copy( @eldir, 2, 2)
#var elslave 0
barracks="west"
#SWITCH (@eldirx=0) {elbark0}
 (@eldirx=1) {elcom1}
 (@eldirx=2) {elcom2}
 (@eldirx=3) {enlist man}
 (@eldirx=5) {elcom5}
 (@ellen >0) {order men march @eldir}

Just copy what is in the box and paste it into the script of your alias and hit save.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
ShadowWind
Newbie


Joined: 21 Feb 2007
Posts: 8

PostPosted: Thu May 10, 2007 3:17 am   
 
Alright, I put that thing viz copy and paste into my alias and it now moves the first loc, and stops, feeding me this text:

You bark out your order, but it is undirected and hence ignored.
nw
ordermanmarchw
I do not follow your meaning.

Any ideas why it stops? I tried planting a man in both locs to see if it was other macros or triggers acting up, but neither way worked.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu May 10, 2007 3:29 am   
 
Riiight, ok I didn't edit his stuff at all. You need to make this change.

from
order men march @eldir

to
"order men march "@eldir

See the quotes?
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
ShadowWind
Newbie


Joined: 21 Feb 2007
Posts: 8

PostPosted: Thu May 10, 2007 3:47 am   
 
Uhg, this alias hates me! I added that, I put the whole thing in like this:

#var elmode 1
#var eldir %word( @elstring, 1, "")
#var ellen %len( @eldir)
#var eldirx %copy( @eldir, 1, 1)
#var eldiry %copy( @eldir, 2, 2)
#var elslave 0
barracks="west"
#SWITCH (@eldirx=0) {elbark0}
(@eldirx=1) {elcom1}
(@eldirx=2) {elcom2}
(@eldirx=3) {enlist man}
(@eldirx=5) {elcom5}
(@ellen >0) "order men march"@eldir

And I got:

ERROR: Syntax error in Alias: elthak1 : command list expected

I'm soooo sorry about this! I don't know how to fix this silly thing though!
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu May 10, 2007 4:54 am   
 
OI, Look just paste the stuff in the box into your alias. Spaces are important, as are the curly braces {}

Code:
#var elmode 1
#var eldir %word( @elstring, 1, "")
#var ellen %len( @eldir)
#var eldirx %copy( @eldir, 1, 1)
#var eldiry %copy( @eldir, 2, 2)
#var elslave 0
barracks="west"
#SWITCH (@eldirx=0) {elbark0}
 (@eldirx=1) {elcom1}
 (@eldirx=2) {elcom2}
 (@eldirx=3) {enlist man}
 (@eldirx=5) {elcom5}
 (@ellen >0) {"order men march"@eldir}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
ShadowWind
Newbie


Joined: 21 Feb 2007
Posts: 8

PostPosted: Thu May 10, 2007 5:56 am   
 
Thanks a ton! Still got a few tweaks to work on it, but I've bugged you enough. Thanks for the patience and help!
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