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


Joined: 04 May 2004
Posts: 5
Location: USA

PostPosted: Tue May 04, 2004 9:43 am   

Help a newbie make a script? Come On People!
 
Alright, I've been using Zmud for a very long time now, it's a great program and I love it to death (Maybe one day I'll actually get enough money to purchase the full package). I just recently though, started delving into the many many many features that Zmud has to offer, but here's the thing... most of it makes absolutely no sense to me.

Now I'm not computer illiterate, I mean, playing MUDs should say that much about me. I'm actually really good with computers, but programming isn't really something I get... at all. Scripting looks far too much like programming and it just makes my head spin.

But this mud I play, it's kind of a complex MUD, and one of the features on it, being stat rolling, is no exception.

> roll stats

You roll your stats.
-=-=-| STATS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Strength : 4 (+0) Charisma : 19 (+0) Intelligence : 23 (+0)
Constitution : 4 (+0) Dexterity : 22 (+0) Wisdom : 23 (+0)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

That's what it looks like. Now I wanted to make a script, or trigger, or whatever it is you call it... that would keep rolling, until it hit the stats I wanted. So let's say I wanted Strength to be 6, Charisma to be 20, Intelligence to be 23, Constitution to be 6, Dexterity to be 22, and Wisdom to be 23. How would I go about making a script, that would keep rolling until it got a roll perfect to that which I just specified?

I really want to learn how to start doing stuff like this... but it confuses me so much, with all the different variables and such. If anyone can guide me through this... I would be SO SO grateful.
Reply with quote
john_taylor_jr
Wanderer


Joined: 17 Jan 2003
Posts: 57
Location: USA

PostPosted: Tue May 04, 2004 1:57 pm   
 
#TRIGGER {Strength : (%d) ~(+0~) Charisma : (%d) ~(+0~) Intelligence : (%d) ~(+0~)} {str=%1;cha=%2;int=%3}
#COND {Constitution : (%d) ~(+0~) Dexterity : (%d) ~(+0~) Wisdom : (%d) ~(+0~)} {con=%1;dex=%2;wis=%3;#IF ((@str < 6) | (@cha < 20) | (@int < 23) | (@con < 6) | (@dex < 22) | (@wis < 23)) {reroll command} {save command}}

Where it says reroll command enter whatever you have to type to reroll where it says save command inster whatever you type to save the stats
The (%d) lets the trigger know to capture the numbers that are in that place. the ~ in front of the () let the trigger know you're not trying to capture that as a variable. Then you count the number of () you have surrounding things zmud recognizes them as %1 %2 and %3
The if command is a boolean expression. It is just true or false.
Is your int < 23? is your con less than 6? ect. The way I've placed the () around things is important. Think of it as seperating each question. then in the first {} is what to do if all of the logic question is true. The other {} is what to do if it is false. You can look up boolean logic on the net and it may explain it in more detail. I'm logic oriented so I just have a natural predisposition to it.
Reply with quote
Desmock
Newbie


Joined: 04 May 2004
Posts: 5
Location: USA

PostPosted: Tue May 04, 2004 4:23 pm   
 
I'm afraid it didn't work, my friend. Either I put it into the wrong place, but I don't think I did... or something. Anyways... it came back with a new trigger.

Pattern: Strength : (%d) ~(+0~) Charisma : (%d) ~(+0~) Intelligence : (%d) ~(+0~)

Value: str=;cha=;int=

It's probably my bad luck, knowing everything that happens to me LOL. I really wish I could be of more help, but every time I look at those tutorials, the help guides and menus, and everything else about this... I kind of get really confused.

The MUD happens to be Merentha... www.merentha.com, you know, if you need to go there to test it out yourself... But just tell me what to do and I'll do it, and if you think I'm pretty much boned... hey I can live with that LOL.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue May 04, 2004 9:55 pm   
 
for starters change your value to :
Value: str=%1;cha=%2;int=%3

And Then Post a bigger example I.E. Three rolls with 2 No's and a Yes from start to finish and someone can get you going

quote:
Alright, I've been using Zmud for a very long time now, it's a great program and I love it to death (Maybe one day I'll actually get enough money to purchase the full package).

Also What version are you using (some older versions do not support #COND triggers

quote:
But just tell me what to do and I'll do it, and if you think I'm pretty much boned... hey I can live with that LOL.
Zmud can do just about anything you want it to do if you take the time to read the #HELP files
Reply with quote
Desmock
Newbie


Joined: 04 May 2004
Posts: 5
Location: USA

PostPosted: Wed May 05, 2004 5:36 am   
 
Every time I change the variables on the new trigger that keeps popping up... It gives me this:

State 0: str=;cha=;int=
^ syntax error

State 1: con=;dex=;wis=;#IF ((@str < 6) | (@cha < 20) | (@int < 23) | (@con < 6) | (@dex < 22) | (@wis < 23)) {roll stats} {save}
^ syntax error

I keep trying to change the str and the cha and the int to %1 and %2 and %3 but it keeps changing them back to that.

Also... you wanted more rolls? Before I post them though... I am using version 7.05, I just started using it on my new computer. After I run out on the trial dates I normally start using 6.40 again... since I have a key for that version still, and I don't feel like buying a totally new one for the newer version. If you buy once, you shouldn't have to buy again. Anyways... here's the text from the MUD.

roll stats
You roll your stats.
-=-=-| STATS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Strength : 2 (+0) Charisma : 20 (+0) Intelligence : 20 (+0)
Constitution : 3 (+0) Dexterity : 22 (+0) Wisdom : 23 (+0)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> roll stats

You roll your stats.
-=-=-| STATS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Strength : 3 (+0) Charisma : 16 (+0) Intelligence : 17 (+0)
Constitution : 4 (+0) Dexterity : 16 (+0) Wisdom : 20 (+0)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> roll stats

You roll your stats.
-=-=-| STATS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Strength : 2 (+0) Charisma : 18 (+0) Intelligence : 23 (+0)
Constitution : 4 (+0) Dexterity : 22 (+0) Wisdom : 23 (+0)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> roll stats

You roll your stats.
-=-=-| STATS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Strength : 2 (+0) Charisma : 16 (+0) Intelligence : 20 (+0)
Constitution : 2 (+0) Dexterity : 16 (+0) Wisdom : 21 (+0)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> roll stats

You roll your stats.
-=-=-| STATS |-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Strength : 5 (+0) Charisma : 16 (+0) Intelligence : 18 (+0)
Constitution : 2 (+0) Dexterity : 22 (+0) Wisdom : 20 (+0)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>

As you can see it could take a very long time for me to get the actual roll I want, thank god this MUD has unlimited rolls. That's why I want to make this script trigger... so that I can run it and not have to worry about spending hours at a time rolling for the perfect stats. Especially when I could potentially mess up and hit the enter key one too many times and roll right past the roll I wanted. Also, would it matter if the text is in any kind of ansi coloring?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 05, 2004 5:55 am   
 
From your description of your problem, you put the script into the VALUE: box of a trigger in the SETTINGS EDITOR. It doesn't belong there.

We've all seen the Settings Editor. We all know enough to tell you which part of a trigger goes in the Pattern box and which part goes in the Value box, if we write a trigger that we intend you to use in the Settings Editor.

HINT: Any trigger script which begins with #TRIGGER instead of Pattern: or Value: is intended for entry into the COMMAND LINE, not the Settings Editor.

Go back to the script which john taylor jr wrote, and copy it into your command line.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed May 05, 2004 6:24 am   
 
quote:
I am using version 7.05, I just started using it on my new computer. After I run out on the trial dates I normally start using 6.40 again... since I have a key for that version still, and I don't feel like buying a totally new one for the newer version. If you buy once, you shouldn't have to buy again. Anyways... here's the text from the MUD.


If you bought/recieved a valid registration code for 6.40 it will work on 7.05 just register 7.05 with it. If however your code doesn't work then send an e-mail to support@zuggosft.com
Reply with quote
Desmock
Newbie


Joined: 04 May 2004
Posts: 5
Location: USA

PostPosted: Wed May 05, 2004 8:50 am   
 
Ok I found out a problem that was giving me these errors. I don't know if it would have worked in the settings editor... I'm not that smart, yet. But I do know that a } was missing from next to the wis=%3

So it was wis=%3;#IF instead of wis=%3};#IF

So I fixed that up and now the trigger is actually functional, but the program is... it wont respond correctly.

I type it in and it rolls the stats for me, but then nothing else happens... and the stats aren't even near to what the ones I set to. And when I type roll stats it doesn't go into a loop trying to find my perfect stats... it just doesn't do anything. Did I do something wrong yet again?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed May 05, 2004 9:32 am   
 
Ok I logged into your mud and and noticed the patterns don't match I am 99.9% sure this trigger will work

#TRIGGER {Constitution%s: (%d) ~(+0~)%s Dexterity%s: (%d) ~(+0~)%s Wisdom%s: (%d) ~(+0~)} {str=%1;cha=%2;int=%3}
#COND {Constitution%s: (%d) ~(+0~)%s Dexterity%s: (%d) ~(+0~)%s Wisdom%s: (%d) ~(+0~)} {con=%1;dex=%2;wis=%3;#IF ((@str < 6) | (@cha < 20) | (@int < 23) | (@con < 6) | (@dex < 22) | (@wis < 23)) {roll stats} {save command}}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 05, 2004 6:44 pm   
 
No, there should not be a } next to wis=%3. That would remove the #IF command from the trigger, and it's the #IF command which makes this an autoroller. Without the #IF command, the script just fills some variables but doesn't do anything with them.

Your problem comes down to two things:
1. Pattern doesn't match output
2. %1, %2, and %3 being removed from the Value section of the trigger

The syntax of every TRIGGER and CONDITION we've given you is correct using default prefs. If the Settings Editor says otherwise, and especially if the Settings Editor won't allow you to enter the settings the way they are written, turn off the Settings Editor's syntax checking/correction. If you've made any changes to default prefs, particularly to Special Characters or General Parsing, you should probably restore them to the default.

john taylor jr's patterns are lacking spaces, but that should be easy to fix once you know what the problem is. nexela's trigger has the wrong pattern, it matches the same Constitution line instead of the Strength line. That should also be easy to fix.

If you'd prefer two triggers to one multistate trigger, you can use these:
Command line version
#TR {Strength * (%d) ~(%n~) * Charisma * (%d) ~(%n~) * Intelligence * (%d) ~(%n~)} {#VAR str %1;#VAR cha %2;#VAR int
%3
}
#TR {Constitution * (%d) ~(%n~) * Dexterity * (%d) ~(%n~) * Wisdom * (%d) ~(%n~)} {#VAR con %1;#VAR dex %2;#VAR wis %3;#IF ((@str < 6) OR (@cha < 20) OR (@int < 23) OR (@con < 6) OR (@dex < 22) OR (@wis < 23)) {reroll stats} {#BEEP;#SAY You decide}}

Settings Editor Version
Pattern:
Strength * (%d) ~(%n~) * Charisma * (%d) ~(%n~) * Intelligence * (%d) ~(%n~)
Value:
#VAR str %1
#VAR cha %2
#VAR int %3

Pattern:
Constitution * (%d) ~(%n~) * Dexterity * (%d) ~(%n~) * Wisdom * (%d) ~(%n~)
Value:
#VAR con %1
#VAR dex %2
#VAR wis %3
#IF ((@str < 6) OR (@cha < 20) OR (@int < 23) OR (@con < 6) OR (@dex < 22) OR (@wis < 23)) {reroll stats} {#BEEP;#SAY You decide}
Reply with quote
Desmock
Newbie


Joined: 04 May 2004
Posts: 5
Location: USA

PostPosted: Thu May 06, 2004 8:07 am   
 
Saweeeeet, it works! Thank you SOOOOO much LightBulb... I wish I was as smart as you, and no I'm not just kissing up. This kind of stuff confuses me... so anyone who understands it really amazes me. John and Nexela... thank you as well, trying is just as important as getting the job done, it shows you cared and that's very appreciated.

Now I'm gonna go run this script and get the perfect roll on my favorite character LOL.
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