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


Joined: 11 Dec 2007
Posts: 8

PostPosted: Tue Dec 11, 2007 1:07 pm   

novice needs help
 
Hello,

I'm trying find a way of sending a string list to my mud, in attempt to speed up a puzzle solving quest.

What I have done so far isn't ideal and I was hoping someone could point me in the right direction.

So far I have..

#alias guesssolution {#Send %pop(List);enter solution}
and I have a Variable named List with all the possible solutions in it.

So currently I just enter "guesssolution" until the correct solution comes up.

The command "enter solution" causes a balance delay.

My biggest annoyance with this script is that the %pop command deletes the solutions as it goes. As a workaround I have set the @list with a default, and each time I use this script I just reset the list to the orginal to get all the values back.

So is there another command I can use instead of %pop, or am I on the wrong track completely.

I did originally try using the #alarm function to do it all automatically, but I had trouble getting it to stop once the correct solution was found, so I scrapped it.

Any help would be greatly appreciated.

Sog
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Dec 11, 2007 1:46 pm   
 
#alias resetsolution {iter=1}
#alias guesssolution {#send %item(@List,@iter);enter solution;iter=@iter+1}

Hopefully that's self-explanatory.

Also, your alarm: if you give the alarm an ID, you can create a trigger that goes off when you enter the correct solution that does #UNTRIG <id> to delete the alarm.
_________________
Rorso's syntax colouriser.

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


Joined: 11 Dec 2007
Posts: 8

PostPosted: Tue Dec 11, 2007 8:53 pm   
 
Hey thats great, I see exactly what you're saying.

My only issue is now to figure out how to stop the @iter variable returning a value of 1+1+1 etc, instead of a single number.

Cheers for the advice!!
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Tue Dec 11, 2007 9:08 pm   
 
I think Fang was thinking about CMud.

For ZMud, I think, You have to use for example

Code:


iter=%eval(@iter+1)



Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Tue Dec 11, 2007 9:29 pm   
 
Or instead of using eval you could just do:

#ADD iter 1...

My question would be... is there a different starting pattern for each solution?
If so I'd just trigger off the starting pattern to always fire the exact solution.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Tue Dec 11, 2007 9:38 pm   
 
There are always at least 3 ways to skin a cat.

You could also use #math, for example.

#math iter {@iter+1}

Usually though, when I'm doing some sort of counter, #add looks the nicest, I give you that Cool


Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Sogdog
Newbie


Joined: 11 Dec 2007
Posts: 8

PostPosted: Tue Dec 11, 2007 9:59 pm   
 
Thanks guys, that worked a treat, I'm going to try to put it in an alarm now and see how that goes.

Ralgith, the puzzle consists of 4 off/on buttons and the exact solution is random each time. As far as I know the method I'm using is the simplest option, but I'm not a puzzle or Zmud whizz. Even so I'm very happy with the results I've had so far.

Sog
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Wed Dec 12, 2007 3:39 am   
 
Interesting... and it can be any combination of on and off I take it?
If so then... well... yeah ;) PM me the exact text from room entry to success with at least 1 of each possible failure message and I'll write you a quick and dirty :)
Then you can take that and learn from it.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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