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


Joined: 21 Jan 2002
Posts: 6
Location: USA

PostPosted: Fri Feb 01, 2002 2:10 am   

Looping variables and other goodies
 
Okay here is the problem.
I have a quest I need to be able to complete very quickly. I need it to kill one mob after another. but before I kill the mobs I need to say 'code'. The following is output from my mud.

This is the mob I see:
One of the 4 Time-agents is standing here.

This is the message after he dies:
Your blood freezes as you hear the Time-agent1's death cry.

This is the output I get when I say 'code':
The Time-agent2 says 'The second digit is 3.'

**The time agent can be any one of 4 agents, so the output could be Time-agent3 says 'The third digit . . .'

You get the point.

Anyway i need it to take the input returned from the agent and put it into a variable (or something) then outputs the information in order. One of the 4 digits will be missing and needs to be guessed until it's correct.

This is sample output from the mud:

A very, very odd room.
OOPPPS .... where are you here. It looks like a high-tech room with walls
made of a strange red metal. The floor is covered with dust. It must have been
unused for a long time. You are in the southern part of the room. In the
middle there is something like an energy barrier. In the northern part ....
..... you see a HUUUUUUUUUGGGGGGGGGGEEEEEEEEEE treasure.
On the right side there is the control for the barrier.
Obvious Exits: East

Once in this room you must guess the code using the information you have already gathered. The proper syntax for entering the code is:

enter 93*6 <--- In this case the random number is the number that needs to be guessed. This number can be in anyone of 4 spots and can be any number from 0-9.

When the answer is correct you get the following output:

As you enter the code, the barrier flickers out.

From this point you can now open the barrier and enter the chamber.

If you need more information I will gladly provide it.

Rezo
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Feb 01, 2002 5:35 am   
 
As this shouldn't happen often it doesn't
overly need to be optimized and a midnight
kludge will work. :P

Assumes you only see the red
trigger once. Change it if there is another
trigger indicator to start the process.



#TRIGGER {^One of the 4 Time-agents is standing here.$} {
#ECHO Time-agent script on
#T+ TimeAgent
#VAR V_Code "****"
}

Assumes agent 2 3 4 gives the codes
#TRIGGER {^Your blood freezes as you hear the Time
~-agent{1|2|3}~'s death cry.} {
say code
} "TimeAgent"

Assumes the agents can give any spot from
position 1 through 4:

#TRIGGER {^The Time-agent{2|3|4} says ~'The (%w) digit is (%d).~'} {
#IF (%1 =~ "first") {#VAR V_Code %concat
(%1,%copy(@V_Code,2,4))}
#IF (%1 =~ "second") {#VAR V_Code %concat
("%copy(@V_Code,1,1),%1,%copy(@V_Code,3,4))}
#IF (%1 =~ "third") {#VAR V_Code %concat
(%copy(@V_Code,1,2),%1,%copy(@V_Code,4,4))}
#IF (%1 =~ "forth") {#VAR V_Code %concat
(%copy(@V_Code,1,3),%1)}
} "TimeAgent"

Spits out all posibilities 0-9
#TRIGGER {^A very, very odd room.$} {
#10 enter %replace(@V_Code,"*",[%i-1])
#ECHO Time-agent script off
#T- TimeAgent
} "TimeAgent"

Untested but the idea should be there.

TonDiening
Uses 6.16
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