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


Joined: 14 Nov 2001
Posts: 4
Location: Finland

PostPosted: Mon Jun 17, 2002 12:19 pm   

Repeating commands ...
 
Another problem occured.. relating to 'trigger problem' topic

Now when i look in my bag and have the amount of the heads (extracted by a trigger) in a variable [@heads], the purpose of the variable was to repeat the 'sac' command (sacrifice, a mud alias that get a head from bag then sacs it on the altar) the @heads amount of times when at altar.
This helps a lot when can only press a button or type an alias to sac all heads in bag than typing 'sac' to the mud @heads times yourself, especially when you got like 250 heads in bag.

Now the problem is, that if you make an alias that repeats the sac command like 250 times to the mud rapidly, the mud disconnects you due to flooding. So the sac'ing has to paused in intervals for the mud to process the previous commands without flooding the mud.

Would work if the alias repeated 'sac' 15 times then had a #wa 2000 or something then repeated until all heads sacrificed.

('The flame wells up and consumes your sacrifice!' is the string from mud indicating a head being successfully sacrificed, also 'No such thing here' can be used to stop the alias from looping, which tells no more heads in bag to sac)

I've trying to do this using math commands, by dividing the amount of heads in smaller amounts then saccing the smaller amounts and so forth.. but always something in the calculations resulting in 0..

-Reapage

____ ____
/ _ | _ (_( | | |_) )
> Reapage <
/_/ |_|_| _-===========-
-=======-
Reply with quote
Darker
GURU


Joined: 24 Sep 2000
Posts: 1237
Location: USA

PostPosted: Mon Jun 17, 2002 1:47 pm   
 
Ok, pardon my groggy logic, I haven't had coffee yet today. My plan is: Create an alias to manage the job.

In the alias (sachead), first check to see if we're mid-job, or starting the job. This is done by checking the @headcount variable and the headsac status variable. Theoretically, if headcount is 0, we're either at the beginning or end of the job, but if sachead is also 0 (off/false), we're definitely at the beginning.

So, when at the beginning, set headcount = @heads (as you're already calculating it), turn on the sachead status flag, and proceed...

If the status flag is On, and we're not out of heads yet, set a temp trigger to watch for the success message: When found, subract one (or add -1) from the headcount and run this alias again. After the temp trigger is defined, call the 'sac' command to get things started.

If the status flag is On, and we *are* out of heads, turn off the status flag.

If I'm not on the crack pipe, that should do it. I don't guarantee my formatting or coding below: I'm studying java right now and it's messing with my head.



#alias sachead {
#if (@headcount = 0 and @headsac = 0) {
#var headcount @heads
#var headsac 1
}
#if (@headcount > 0 and @headsac = 1) {
#temp {The flame wells up and consumes your sacrifice} {
#add headcount -1
sachead
}
sac
} {
#var headsac 0
}
}




zMUD 6 Online Help: All the power you'll ever need.
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Tue Jun 18, 2002 4:59 am   
 
i'd have made an easier alias...an extremely basic one for an extremely basic job

make an alias
#alias {sachead} {get head bag;drop head;sac head}

look in the bag, see theres 33 heads in it:

#33 sachead


Why oh WHY did I have pass door on...
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