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


Joined: 02 Dec 2004
Posts: 27
Location: Kansas... whippie!

PostPosted: Thu Dec 02, 2004 12:47 am   

Zmud script... help please ?
 
Alright, I'm starting to get frustrated as I'm not extremely Zmud literate....I can make alot of basic scripts, triggers, alias's etc, but here's what I need help with if anyone cares to lend a hand.

I need to make a part of a script that will determine several factors
#1 If I've lost concentration casting casting one of 2 spells
#2 If I've failed casting one of two spells
#3 Of the two spells, was it nexus or gate
#4 To determine which item needs to be picked up ( I typically quest to find items, much faster)
#5 To take a break in the script if I run out of mana to regen, but to resume where I left off to try getting to that place again. Once the gate or nexus is successfull, I want it to finish the quest.

Basically this is a Questing Script for a mud I play. I'm using Zmud 7.05, but have previously gotten used to 5.53 for the most part, just upgraded. I had an idea to use variables for setting which place to gate or nexus to
I.E.

Pattern: Look in the general area of blah.
(now, let's say hoorah was in area blah)
#ALIAS setgate {c gate ~'%1 %2'}{#VAR setgate @~'%1 %2'}
#ALIAS blah {setgate hoorah}
#TRIGGER c gate @'setgate %1 %2'
pattern: You step through a gate and vanish
#TRIGGER kill @'setgate %1 %2' (If it was a trigger to kill hoorah)

Now I am consciderably a noob compared to most when it comes to setting up triggers so any advice would be extremely appriciated. Just wanting to setup a questing script.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Thu Dec 02, 2004 4:56 am   
 
This will fix the first couple of problems for you. First off, convert your spells to zmud aliases. For your particular problem, you'll want to put an additional command in the gate-casting alias:

#alias cgate {cast 'gate' %-1;#var GateType 1}
#alias cnexux {cast 'nexux' %-1;#var GateType 2}

This variable will tell you which spell was casted.
Then, collect a list of the different messages you receive when you lose your concentration etc, and put them in this trigger:

#CLASS {recast}
#TRIGGER {{<list of different messages, each message separated by the | symbol>}} {ccast @oldcast}
#CLASS 0

Then, make a list of the different messages that stops you from casting completely, aka the message for a !magic room:

#TRIGGER {{<list of different messages, each message separated by the | symbol>}} {normalcast}

Now, finally, collect a list of the different messages that indicates a successful cast. Also include the lack of mana Msg, or make a separate one to regain mana before resuming casting:

#TRIGGER {{<list of different messages, each message separated by the | symbol>}} {#delnitem castlist 1;#IF (%numitems(@castlist)>0) {#var oldcast {%item(@castlist,1)};ccast @oldcast}} "" {case}

Input the remaining aliases:

#CLASS 0
#ALIAS wa {wake;pos=2}
#ALIAS st {#IF (@pos=1) {wake;~st} {~st};pos=3;#T- autodir}
#ALIAS sleep {~sleep;pos=1;#T+ autodir}
#ALIAS rest {#IF (@pos=1) {wake;~rest} {~rest};pos=2;#T+ autodir}
#ALIAS sit {~sit %-1;pos=2;#T+ autodir}
#ALIAS attack {#T- defensecast;#T+ attackcast;#T- normalcast;#T- recast}
#ALIAS defense {#T+ defensecast;#T- attackcast;#T+ normalcast;#T+ recast}
#ALIAS normalcast {#var oldcast {};#var castlist {}}
#ALIAS ccast {#IF (@pos=3) {cas @oldcast} {st;cas @oldcast}}
#CLASS {autodir}
#ALIAS n {st;#T- autodir;n}
#ALIAS s {st;#T- autodir;s}
#ALIAS e {st;#T- autodir;e}
#ALIAS u {st;#T- autodir;u}
#ALIAS d {st;#T- autodir;d}
#ALIAS w {st;#T- autodir;w}
#CLASS 0
#CLASS {defensecast}
#ALIAS cast {#var newcast {%-1};#IF (%numitems(@castlist)>0) {#var castlist {%additem(@newcast,@castlist)}} {#var oldcast {%-1};#var castlist {%additem(@newcast,@castlist)};#IF (@pos=3) {cas @oldcast} {st;cas @oldcast}}}
#CLASS 0
#CLASS {attackcast} {disable}
#ALIAS cast {#var oldcast {%-1};cas @oldcast}
#CLASS 0


To use this script, there are a couple of things to know how it works. If you spam multiple casts at once, it will send the first cast to the MUD. If you lose concentration, it will cast it again. When it is successful, it will cast the second cast. If for some reason, you are not able to cast at all in the room, it will clear the spell queue, and stop trying to cast.
There are two different modes you can run this in. The prior described system is the Defense system. To change it, to enable it to send all casts at once to the mud, just type Attack and the script will be turned off. If the script hangs, type NormalCast, and the script will reset. You can access the last casted spell via the @OldCast variable. You can check the spell queue via the @CastList variable.
Reply with quote
talonfreak2003
Beginner


Joined: 02 Dec 2004
Posts: 27
Location: Kansas... whippie!

PostPosted: Thu Dec 02, 2004 5:45 am   
 
ok, not completely sure how that one works. I understand the cnexus/cgate part. Ok, first a couple of questions. The !magic isn't really needed, all the questmasters are in nexusable/gateable rooms. Secondly, not sure how oldcast and castlist there work. Would it be helpfull if I give you the messages that you can recieved ?

{Spell failed|You lost your concentration} would be the two fail messages you would recieve if your nexus or gate didn't work and the gating is highly based off of casting level. And alot of the quests you get are high level mobs, so you get the Spell failed maybe once or twice, every once in a while you hit it first shot.

{You do not have enough mana} would be the message you get if you don't have enough mana (Simple mud)

Using the cgate and cnexus, all I really need to figure out is just what to use to recast the same spell and I need to find a way to pause it if I run out of mana...using a regen alias that would run me to the resting room and then use the #WAIT 150000 command. then wake, run back out and resume. that's the main problem I run into, the rest is cakework.Gonna try the trigset there and see if I can figure out how it works. That's the main problem I have with zmud is I don't know how to work the variables/pauses etc.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Thu Dec 02, 2004 11:26 am   
 
The casting system I gave you can be used for casting everything, not just gates and nexuses. Its just that it fixes your 1st, 2nd and 3rd problems. If you lose concentration, it will recast the gate or nexus. It tells you which was casted via the alternate values of the GateType variable. If you don't like its extended properties, I'll cut it down to size for you:

#alias cgate {ccast 'gate' %-1;#temp {You step through a gate and vanish} {<finish your quest>}}
#alias cnexux {ccast 'nexus' %-1;#temp {You create a nexus} {enter nexus;<finish your quest>}}
#ALIAS ccast {#var newcast {%-1};cast @NewCast}
#trigger {{Spell failed|You lost your concentration}} {cast @NewCast}
#trigger {You do not have enough mana} {GotoRegen}
#alias GotoRegen {<blah>;#alarm +150000 {ccast @NewCast}}

Now, the way this works: You will only continue to do your quest when you create a nexus/gate and enter it. If you're out of mana, it will attempt to recast the gate/nexus spell after 150 seconds. So, it will be paused until it receives confirmation of a successful gate/nexus cast. If you fail the cast, it will attempt to recast until it either succeeds, or receives a !mana message.
Reply with quote
talonfreak2003
Beginner


Joined: 02 Dec 2004
Posts: 27
Location: Kansas... whippie!

PostPosted: Fri Dec 03, 2004 5:00 am   
 
Alright, that second version makes a whole lot of sense, now I just ned help on one last part and this script will be 100% complete.

The last remaining problem is how to make it select via what the questmaster says, which questplace to goto, now I have a full set of alias's now that will search the area for that particular item, recall and finish the quest off, and each alias is named.

Sample

Thank you, Brave soandso, vile pilfers have stolen the royal sceptre.
Our wizardess has pinpointed its location.
Look in the general area of the Lost Catacombs for a Lost Puppy.

Now the alias that is made for the catacombs:
#ALIAS {cataquest;c nexus ghast;<A whole lotta directions and variables that is complete>;recall;n;n;pq complete}

Now there are about 40 areas that the questmaster will send you to at your peak level of the game, each one I've got an alias for. My final question is how do I make it pick which alias is needed? should I use #IF #THEN variables?I.e. ....
#IF #VAR 'area' = catacombs;#THEN cataquest and just make one long #IF/#THEN clause ? Btw, I appriciate every bit of advice, it's starting to make sense Shocked
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