|
g61828 Beginner
Joined: 21 Nov 2003 Posts: 12 Location: USA
|
Posted: Fri Nov 21, 2003 8:31 am
Newbie Scripting |
Hello All
Long time using zMUD (from V3.32 {I think} and onward)
Even though I have been using zMUD for so long I haven't used the #alias, #trigger, or anyother type of scripting for that matter. I was wondering if there was any other resource besides the zMUD help files that I could use to teach me how to script. I have no Computer Programming experience (have been meaning to get into it for YEARS)so something that is dumbified would be great. I don't know if it would help but I play Eternal Darkness (address - ed.wolfpaw.net:9700) which is a heavily modified CircleMUD. Thanks for any of your efforts to help me try to learn how to fully take advantage of the wonderful program that Zugg has made for us to use. |
|
|
|
g61828 Beginner
Joined: 21 Nov 2003 Posts: 12 Location: USA
|
Posted: Fri Nov 21, 2003 10:56 am |
Point in case:
I wanted to create a set of Alias' where I would enter Spellup into the command line and it would cast certain spells on my char. I used the following commands (and please take pity on the newbie scripter)
#alias {invis} {#10 c 'superior invis'} spells
#alias {detect} {#10 c 'detect superior invis;#10 c 'detect alignment'} spells
#alias {protect} {#10 c 'invul'} spells
#alias {spellup} {#T+ spells invis;detect;protect #T- spells}
but when I entered spellup it didn't do the invis alias just the detect and protect alias...what did I do wrong?
EDIT: Nevermind...I figured it. |
|
|
|
g61828 Beginner
Joined: 21 Nov 2003 Posts: 12 Location: USA
|
Posted: Fri Nov 21, 2003 11:34 am |
Ok...this has me stumped.
I want a set of triggers/alias' under a class that causes my character to "autoprac" (a legal use of zMUD in Eternal Darkness). However, my char is a mage type so most of his "skills" are actually spells and sense I don't have an endless supply of mana I can't just cast away until I have "mastered" the spell. What I need to do is to set up the triggers and such that when I run out of mana I will go to the healer, wait until I have my mana fully healed, then go back to practicing whatever spell I have until it is maxed out. Now the only way to see if it's maxed out is to enter the text 'prac <skillname>' and the output is '<skillname> <##>'. What I want to know is how to set up all the triggers and stuff to get it to start casting the spells until the MUD sends 'You don't have the Mana for that spell!' then go to the healer and wait for max Mana (which is 4859) then go back to casting the spell until the prac <spellname>=<spellname> 90. Any help would be appreciated...and if possible the explaination as to why the scripting is like it is. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Nov 21, 2003 7:00 pm |
#AL ap {#VAR AutoPrac {%-1};#T+ AutoPractice;prac @AutoPrac}
#CLASS AutoPractice disable
#TR {unknown pattern which indicates a practice is finished and the next command can be accepted} {prac @AutoPrac}
#TR {You don't have the Mana for that spell!} {go to the healer;wait}
#TR {unknown pattern which provides (%d)Mana, preferably in numerical form} {#IF (%1 > 4858) {go back to practice place;ap @AutoPrac}
#TR {~<@AutoPrac~> 90} {#T- AutoPractice}
#CLASS 0
Explanation:
The ALIAS records the skill/spell being practiced in the variable @AutoPrac, enables the CLASS used for auto-practicing, and issues the first practice command.
The CLASS provides a convenient method of grouping related triggers (or other settings) and enabling/disabling them as a group. Since they shouldn't normally be on, the disable option disables the class when connecting to the MUD.
The first TRIGGER repeats the practice command when each practice finishes.
The second TRIGGER sends you to the healer and makes you wait.
The third TRIGGER sends you back to wherever you practice and issues the next practice command when your Mana reaches 4859 or more.
The fourth TRIGGER disables the AutoPractice script when you receive the mastery message.
CLASS 0 returns you to the main class. |
|
|
|
g61828 Beginner
Joined: 21 Nov 2003 Posts: 12 Location: USA
|
Posted: Sat Nov 22, 2003 12:03 am |
Ok...got most of it except for the part where I have to provide a numerical form of my mana. When I type the group command {gr} it shows this:
Hit Points Mana Movement Align Exp needed Level
[ 2362/3697 ][ 383/4859 ][ 1192/1192 ] [ 1000] [ 8661820] [160 Mu] Daemyn
2362hp 383m 1192mv>
What would I use to give me the numerical form of my mana?
Also when I do this it doesn't work
ap detect alignment
prac c 'detect alignment' detect alignment
To prac the spells in the MUD I play you just have to cast it. So to prac Detect Alignment I would just do c 'detect alignment'. Sorry for my mixup.
This is what I have so far:
#AL ap {#VAR AutoPrac {%-1};#T+ AutoPractice;c '@AutoPrac'}
#CLASS AutoPractice disable
#TR {You lost your concentration trying to cast detect alignment!} {c '@AutoPrac'}
#TR {Your eyes tingle.} {c '@AutoPrac'}
#TR {You haven't the energy to cast that spell!} {e;wait}
#TR {unknown pattern which provides (%d)Mana, preferably in numerical form} {#IF (%1 > 4858) {w;ap @AutoPrac}
#TR {~<@AutoPrac~> 90} {#T- AutoPractice}
#CLASS 0
I don't understand the last Trigger. In ED, when you do this you get this:
3697hp 4845m 1192mv> prac detect alignment
You have 99 practice sessions remaining.
detect alignment 31
I need it to set up so that when detect alignment=90 it will stop running through the trigger. I think I lost something between point A and point B though...lol. Thanx again for the help. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Nov 22, 2003 4:27 am |
It appears you have your current mana in your prompt, so that's an excellent choice for monitoring it. It's also important, whenever you use the prompt to trigger actions, to include a shutoff device so it only triggers once. I've done this by assigning an ID (manacheck) to the trigger so it can be individually disabled.
I tried YOUR ap alias, it seems to work.
ap detect alignment produces
c 'detect alignment'
In your previous post, you said that the line when you mastered a skill (spell) would be
<skill name> 90
Your latest post makes it clear that it's actually
skill name 90
Change the trigger pattern to match the actual line (including %s to match extra spaces). You'll also need to issue the prac @Autoprac command somewhere to produce the pattern.
So, the revised script would be:
#AL ap {#VAR AutoPrac {%-1};#T+ AutoPractice;c '@AutoPrac'}
#CLASS AutoPractice disable
#UNTR {You lost your concentration trying to cast detect alignment!}
#TR {You lost your concentration trying to cast @AutoPrac!} {prac @AutoPrac;c '@AutoPrac'}
#TR {Your eyes tingle.} {prac @AutoPrac;c '@AutoPrac'}
#TR {You haven't the energy to cast that spell!} {e;wait;#T+ manacheck}
#UNTR {unknown pattern which provides (%d)Mana, preferably in numerical form}
#TR manacheck {%dhp (%d)m 1192mv~>} {#IF (%1 >= 4859) {#T- manacheck;w;ap @AutoPrac} {} {prompt}
#UNTR {~<@AutoPrac~> 90}
#TR {@AutoPrac %s 90} {#T- AutoPractice;#SAY @AutoPrac mastered}
#CLASS 0
NOTES:
1. I included #UNTRigger statements to remove the current triggers if I changed their patterns.
2. Your eyes tingle is a specific success message for detection spells. You'll need similar triggers with the success messages for any other spells you want to use this with.
3. I used a space on either side of %s for readability. They aren't necessary. If there's any chance you'd ever have fewer than 3 spaces between the name and the percentage, remove them. %s will match any number of spaces, but at least one. |
|
|
|
g61828 Beginner
Joined: 21 Nov 2003 Posts: 12 Location: USA
|
Posted: Sat Nov 22, 2003 5:47 am |
Ok...that works great!!! Thank you for your help Lightbulb! I have even managed to learn a little bit about Classes and some more advanced scripting. Thanx again!
|
|
|
|
|
|