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


Joined: 10 Mar 2008
Posts: 5

PostPosted: Thu Jan 14, 2010 4:20 pm   

I need some help getting a scrupt to work
 
Here is what I have so far from some others that say these entries work fine for them:

#alias whore {#loop 1,@targets {
fam where @tar%i
}
}

#Trigger {You tell your familiar to ~'who pk~`.} {
#va cnt 0
#T+ famcheck
}

#CLASS {Famspy|famcheck}

#TRIGGER {Players found: %1} {
#va targets @cnt
#T- famcheck
}

#TRIGGER {~] ~(PK~) (%w)} {
#add cnt 1
#va tar@cnt %1
}

#CLASS 0



When I use this, here are my problems.

When I do the who pk stuff, it does successfully identify matches and add them as variables, but when I entry the whore command is itn't looping right. I just get
Fam where 1
fam where

Instead of the expected string of all the items in the list.

The other problem, is that for some reason the #va cnt 0 isn't resetting. I can manually do it, and it sets 0 zero, but when it comes up in the trigger for who pk, it doesn't do it, so the first time I do it I'll get 4 results, and when I do it again and see the same list, instead of 4 again, I'll have 8...and again I'll have 12, when instead it shoul bd resetting the count each time.


I think this is close to being right, but I can't figure out what I am missing to get the bugs out.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jan 14, 2010 8:44 pm   
 
Quote:

#Trigger {You tell your familiar to ~'who pk~`.} {
#va cnt 0
#T+ famcheck
}


I assume that @cnt is supposed to be in famcheck. If so, then you need to first enable the famcheck class and then populate the variable. If you don't, then ZMud will see that there is no @cnt variable and create a new one somewhere else.
_________________
EDIT: I didn't like my old signature
Reply with quote
Habbs
Newbie


Joined: 10 Mar 2008
Posts: 5

PostPosted: Thu Jan 14, 2010 8:54 pm   
 
MattLofton wrote:
Quote:

#Trigger {You tell your familiar to ~'who pk~`.} {
#va cnt 0
#T+ famcheck
}


I assume that @cnt is supposed to be in famcheck. If so, then you need to first enable the famcheck class and then populate the variable. If you don't, then ZMud will see that there is no @cnt variable and create a new one somewhere else.


I wondered that too, so I tried moving the #va cnt 0 command down below where the class was enabled and it didn't help.

I wonder if there might be a better way anyhow. The idea is to be able to type fam who pk, and it store all the names that come up. and then do a command to tell the pet to loop through checking where for each name.
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