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


Joined: 19 Apr 2009
Posts: 6
Location: California

PostPosted: Sun Apr 19, 2009 10:56 pm   

Several things I would like help on..
 
Okay, so I'm completely new to Zmud, I've used old versions for trial and always been intimidated by the complexity of everything that I've seen, but I decided to take the step and try it again.

first I'd like to be able to create a status bar that sits to the right of the screen that holds the spells I'm affected by and for how long, and my current experience amount out of 'X' (being what I'm working towards)

Second I'd like to be able to make a floating window for all channels and tells.

Now I have no idea where to start, It's all extremely foreign to me, but I'll post what information I would assume one would need to help me out..

You are level 30 with 0 practices (10301 hours)
You are carrying 1/20 items with weight 97/400 pounds. Encumbrance: 1%
You have 732/732 hit, 189/206 mana, 360/360 movement.

Str: 25 Int: 16 Wis: 18 Dex: 30 Con: 25 Chr: 12
Your levels are: Ma 15 Cl 20 Th 30 Wa 25
You have 17821600 experience points, and 5449 gold coins.
Hitroll: 18 Damroll: 33.
Armor: -7 (you are very poorly armored for your level)
You are sneaking.
You are neutral.
You are affected by:
Spell 'slow poison'
You are flying, your feet just inches above the ground.
Spell 'infravision', one hour, 42 minutes remaining, level 15
Spell 'sense life'

Some of the spells I don't know, so I won't know the times, so that might be an issue? Hopefully someone can help me.
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Mon Apr 20, 2009 3:42 pm   
 
Status bars don't have much room and you may want text elements to show what is what too. Status Windows can contain all that information. If you create a status bar or window with the @ symbol and text that denotes a variable to check. You then use triggers to give value to the variables you put in the #STA or #STW.

Tweaking what you want is not difficult. ZMud is made for that. It just requires the assignment of the variables from triggers you make for the information you provided. Not a lot of coding is needed, to provide a script would belie the simplicity here. Try it a bit with the Define Status Bar option in the Action menu. That will open "SETTINGS". Just put a bit of text and some new variable in the status, eg. My Test @Test1

Then make a value for a new variable named Test1. Use #STW ON

Got to run. Happy to help later.
Reply with quote
MarquisDeSade
Newbie


Joined: 19 Apr 2009
Posts: 6
Location: California

PostPosted: Mon Apr 20, 2009 8:24 pm   
 
Okay, I've loaded up a window, changed some of the text that shows up, but how would I set up the trigger to update the variable? I am not sure how I would make
'You have %d gold coins.' into a trigger since '%d=@gold' doesn't work, I'm sure I'm missing a step or three.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Apr 20, 2009 8:56 pm   
 
#trigger {^You have &%dgold gold coins.} {}

The ^ means the line has to match at the beginning of the line, to prevent issues like Tom says, "You have -50000 gold coins." from firing the trigger.

&gold assigns the matched text directly to the @gold variable instead of having to use a=b or #variable syntax. The %d is a little trick that allows you to limit the match based on a subpattern, so in the above case the trigger would not fire if the phrase "You have twenty gold coins." appeared.
_________________
EDIT: I didn't like my old signature
Reply with quote
MarquisDeSade
Newbie


Joined: 19 Apr 2009
Posts: 6
Location: California

PostPosted: Mon Apr 20, 2009 9:03 pm   
 
Alright, got it! thanks. Now, what would I do to match multiple variables in one line? %d1/%d2? I'm so used to using AlClient everything is %1 %2 %3.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Apr 20, 2009 11:09 pm   
 
You can put stuff in triggers inside brackets, like this:

#trig {You have (%d) gold coins.} {}

You can have more than one set of brackets:

#trig {You have (%d) (%w) coins.} {}

And brackets don't need to just surround a wildcard:

#trig {You have (%d %w) coins.} {}

Each set of brackets is put into a %1-%99 variable based on the order the brackets opened. So given the line "You have 252 gold coins.", example one has %1, which is equal to "252". Example two has %1, "252", and %2, "gold". Example three has %1, "252 gold".

The reason you might want to do it this way rather than the way Matt has suggested is because you don't always want to store the result of the match in a variable - sometimes you want it to be kept around just to do some script stuff on it, and then you don't care about the value any more, so there's no need to keep it in a variable.

Finally, to answer your specific question - you can have as many wildcards as you like in a trigger pattern. "Blah %d %d (%d) %w &%dsomeVariable %d &%waWord Blah" is a valid pattern that expects the word "Blah", three numbers, a word, two numbers, another word, and then another "Blah". %1 will contain the third number, @someVariable will contain the fourth number, and @aWord will contain the second word. A list of the wildcards you can use in your patterns is here.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
MarquisDeSade
Newbie


Joined: 19 Apr 2009
Posts: 6
Location: California

PostPosted: Tue Apr 21, 2009 2:46 am   
 
Alright I'm having trouble trying to capture

Spell 'infravision', 2 hours remaining, level 30

And making 'infravision' and '2 hours' (2 hours being a variable time which will change) and getting it to post to the stw. I've broken it down to this:

^Spell '&%dspell1', &%dtr2 %w remaining, %W %D

But nothing shows after that. AND I need to find a way to list multiple spells, like I showed in the first post, but need to make them all list as apposed to one that will just crap out because it covers too many various spells.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Apr 21, 2009 10:23 am   
 
Click the link I gave you that explains wildcards. Firstly, you're using the %d wildcard in &%dspell1 when you mean to use %w, because that matches a word. Secondly, you're using %W and %D when you mean to use %w and %d - the distinction is important because %W is the exact opposite of %w, and the same goes for %D and %d.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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