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
Petrograd
Novice


Joined: 08 Dec 2005
Posts: 35
Location: Sweden

PostPosted: Sat May 27, 2006 6:46 am   

Alts and global variables
 
Been messing around with global variables lately, and managed to solve some stuff after thinking for hours... now this one doesn't want to work.

I have a global variable named @char1. I want to be able to click on a button (showing @char1) to make it quaff a potion a set number of times:

Code:
i = 0
#while (@i < @altquaffs) {
  :@char1: q heal @cont
  #add i 1
  }

Now, knowing gvar somewhat I think that should mean the character in question quaffs from their own container.

However, zmud doesn't like the whole :@char1: thingy, any better ideas on how to do this? I've been trying to mess around with {} and [] to no success, but that said I'm not used to them so that might be why.
Reply with quote
BlackSmith
Apprentice


Joined: 08 Dec 2002
Posts: 152

PostPosted: Sat May 27, 2006 12:41 pm   Re: Alts and global variables
 
Petrograd wrote:
However, zmud doesn't like the whole :@char1: thingy
Ummm, maybe because that would send this to mud:
:variable in @char1: q heal variable in @cont

Are those :: some mud sided commands/handels that are needed, thus on purpose, or?
_________________
BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient.
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Sat May 27, 2006 1:46 pm   
 
just do the math and drink the potion repeatingly.

Code:

#REPEAT @altquaffs {q heal @cont}
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Sat May 27, 2006 6:27 pm   Re: Alts and global variables
 
Maybe
Code:
:<@char1>: q heal @cont

or

:<@{char1}>: q heal @cont


You should be able to do what you want, but I'm not familiar enough with multi-playing and gvars to know if the above will work.


Last edited by mr_kent on Sun May 28, 2006 3:41 am; edited 1 time in total
Reply with quote
Petrograd
Novice


Joined: 08 Dec 2005
Posts: 35
Location: Sweden

PostPosted: Sat May 27, 2006 10:01 pm   
 
:Char: means the action is made in the alt's window, not the current one. It's intentional, but not mudspecific.

:<@char1>: q heal @cont did the trick, thanks :D
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