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
demingm
Beginner


Joined: 27 May 2005
Posts: 23

PostPosted: Thu Nov 20, 2008 3:30 pm   

Gear Swapping and Blessing Alias/Script
 
Let me first preface this by saying that I'm using Zmud 7.21 on Vista x64, and I cannot access my Zmud helpfiles. I even went to Microsoft's site and installed some plugin that is supposed to allow me to see helpfiles that were made pre-Vista... and still no dice. So needless to say I'm pretty frustrated and I've had difficulty figuring this stuff out without helpfiles.

Anywho, I'm looking to create some aliases/scripts to help me perform some mundance functions that I need to do in this mud I play. I'll separate them into two sections so it is easy to see which is which.

Weapon Swapping
So my main character I play can dual wield, and depending on what I am doing at the time he has different sets of weapons that he likes to wield. Sometimes he wants to wield flaming weapons if he's fighting something vunerable to them, etc. Ideally, I'd like to setup some variables that will hold the values of these different weapons and sets, and then enter an alias to switch between the sets on the fly. I need the setup to be smart enough to know what weapon set I am currently using, so when I enter the alias it will check to see if I'm already wielding that set, and if not, it will remove the appropriate weapons, put them in a bag, get the appropriate weapons from the same bag, and wield them. It should then update the currently weaponset variable to the new set. Basically this is what I've come up with so far:

1 Variable to hold the current weaponset
Individual variables to hold the name of the individual weapons for the sets, i.e. flamer1, flamer2, etc.
An alias to change to each weaponset

So, in each alias, I want to do some sort of IF statement, which will first compare the input (%1) to the value in the current weaponset variable. If they match it does nothing. If it doesn't match, it will remove the weapons that are wielded, put them in a bag, grab the new weapons from the bag (based on the input), wield them, then set the current weaponset variable to the new weaponset. I have it conceptualized in my head, but I don't know what the syntax would be because I can't access my helpfiles. If someone could help me with a basic outline of what the syntax would be for the IF statement and the various variables I would need that would be great. I'm not looking for a finished product just something to get me started.


Blessing Script
This one might be a bit more complicated. Currently, I have variables setup that hold values for what gear I wear in every gear slot. I want to create a script that will allow me to cycle through these variables, and bless each item until I have cycle through all of them. I'm not even sure how to begin with this one so I will just explain how I need it to work.

Basically, on each cycle of the loop, it will remove a piece of gear (based on the variable for that slot), attempt to bless the gear by zapping it with a bless wand, if successful, it will move to the next piece of gear, if not it will attempt to bless it again. There's a few different scenarios that can happen when zapping gear: the zapping is successful and the wand does not blow up, the zapping is successful and the wand blows up, the zapping is unsuccessful and the wand does not blow up, and the zapping is unsuccessful and the wand does blow up. So depending on which scenario happens, I may or may not need to rezap the gear, and I may or may not have to get another wand from a bag on hold it until I zap the next piece. So in essence, I think I need a simple looping process, that will cycle through each piece, and pause for reholding a new wand, and start up again through to the end of the loop. So here are some basic thoughts of mine:

Need some sort of variable to act as a control for the loop. So have it start out with whatever the max # of eq slots is, and have it decrease each type a piece of gear is successful blessed. When the variable equals zero, the loop is done and it resets back to the max #. Looping through the list of eq variables will be controlled by triggers, as will getting a new bless wand and holding it if one blows up. Again, I have it conceptualized, but I have no idea what the syntax would be. So if anyone can point me in the right direction or at least get me started it would be greatly appreciated.

Sorry, I know this is a lot, but I figured the more information I provide the easier it would be for someone to help me. If people need specific details (i.e. mud output) I can provide that as well, but I think I can handle that kind of stuff if I have the basic structure to work with.

Thanks!
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Thu Nov 20, 2008 3:57 pm   
 
I don't have time right now to go into the specifics of your two problems right now, but the help files are available online here.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
demingm
Beginner


Joined: 27 May 2005
Posts: 23

PostPosted: Thu Nov 20, 2008 6:09 pm   Thanks
 
Cool, I'll take a stab at it when I get home tonight, but input would still be appreciated.
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Thu Nov 20, 2008 6:27 pm   
 
Demingm, a few commands you might want to look like are #IF, #FORALL, #ALIAS, #VAR, #TRIGGER. Also pattern matching variables and %ismember might be helpful to you in these cases.
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
demingm
Beginner


Joined: 27 May 2005
Posts: 23

PostPosted: Thu Nov 20, 2008 8:03 pm   
 
The gear swapping one I think I can write, now that I have access to the online help.

The second one, I think I can write a script that would loop through all my eq and attempt to bless the gear, but I'm not sure how to "pause" the loop to handle the different error scenarios (the zapping of the bless wand failing and the zapping of the bless wand causing the wand to explode). But I'll give it a shot and see what happens. Been also trolling some posts to see if I can find an example of something similar so I can have something to work from.

Thanks!
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Thu Nov 20, 2008 8:20 pm   
 
That would depend on how you code the loop. One that I like to use is have some variable as a check...it is either 1 or 0...if it has been changed to 0, then it waits 10 seconds, checks again, etc
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Nov 20, 2008 9:13 pm   
 
The correct way to implement the sort of loop you want for blessing is to use triggers for nearly all of it. A basic outline would be:

trigger removed gear {zap it}
trigger readied wand {zap gear}
trigger succesul bless {wear gear; increment item counter; check for end and disable, else remove gear}
trigger failed bless no explode {zap gear}
trigger exploded wand {get wand; ready it}
alias blessme {enable triggers; set counter to 1; remove gear}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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