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
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sun Jan 06, 2008 2:49 am   

Trigger Help Needed w/ Substitution
 
I need help with a trigger. I had it working before but lost my settings.

In the mud I am able to merge two items together. For example, there are 10 items in a toolbox. If I have 2 toolboxes, one with 5 items and the other with 6 items. I can merge the two together so that now I have two toolboxes, one full one of 10 items and the other one with 1 item.

The syntax in the game is this: consolidate box 1 with box 2.

The problem is when I have many toolboxes, I have to change the numbers to match the corresponding toolbox. For example, consolidate box 5 with box 8.

I had an alias set up before where I would just type in something like: cb 1 2 or cb 5 8 and it would automatically swap the numbers into the syntax so that the results would be:

consolidate box 1 with box 2 or consolidate box 5 with box 8

Anyone know how this can be done?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jan 06, 2008 6:31 am   
 
#ONINPUT {^cb (%d) (%d)} {consolidate box %1 with box %2}

That should work.

Charneus
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sun Jan 06, 2008 6:37 am   
 
I was looking at the help files and didn't see one for ONINPUT in the version of zmud I have. v4.62. However, I was messing around with it and from memory I think this was what I had before and it worked.

I created an ALIAS CB
#IF (%d = %1) {consolidate box 1 with box 2} {consolidate box %1 with box %2}

so I just type in CB 1 2, or CB 5 8

It seems to work, do you have any idea why the first part is there? (%d = %1)?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jan 06, 2008 6:47 am   
 
Uh, not sure why it's %d=%1... that doesn't make any sense whatsoever. And really, you should upgrade to 7.21. You need to tell us what versions you have before you ask questions because we're not mind readers. :P If you want to use just the alias, that's easy, too.

#ALIAS cb {#IF (%isnumber(%1) AND %isnumber(%2)) {consolidate box %1 with box %2}}

That'd be a more efficient way of doing it, I believe.

Charneus
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Jan 06, 2008 7:02 am   
 
Old versions of zMUD aren't supported. From a practical standpoint, it's pretty much impossible to support those old versions - the help files and forum threads relating to old versions are mostly long gone, and nobody remembers the exact syntax expected in a version that was released well over ten years ago. Taking a more mercenary view, if you've bought zMUD, the upgrade will cost you nothing and benefit you greatly. If you've stolen zMUD, why should we help you?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)

Last edited by Fang Xianfu on Sun Jan 06, 2008 7:12 am; edited 1 time in total
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sun Jan 06, 2008 7:03 am   
 
Thanks for the help Charneus. That worked perfectly, you rock.
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: Sun Jan 06, 2008 7:14 am   
 
Another quick question, not sure if it's possible. If not, that's okay.

Using the script above, is it possible to issue commands based on the number I put after it. So like if I typed something like zkill 1 2 3 it would issue the command kill 1; kill 2; kill 3...but if i just typed zkill 1 2...then it would issue the command kill 1 2
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jan 06, 2008 7:39 am   
 
It is possible, but I'm not sure it would work with 4.62. Can you not upgrade to 7.21? Like Fang said, 4.62 isn't supported, and we don't have the memory of what was implemented back then and whatnot.

Charneus
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