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


Joined: 08 Jan 2006
Posts: 3

PostPosted: Sun Jan 08, 2006 12:16 am   

Numerical spacing; 1 0 0 to 9 9 9
 
Hi, I'm trying to make a script that tries all numbers on treasure combinations hidden around the world in my MUD.

It is a 3 digit combination ranging from 1 0 0 to 9 9 9.

I'm not familiar with the functions of ZMUD and wondered how you could get this to work. It would be great if there were no spaces in the numbers

i.e. "turn chest to 123" but as such there are spaces. I'm sure there is a command I'm missing that can increment from 100 to 999 and space the numbers out to send to the mud but I have yet to find it. I thought about substring functions to pull out number locations but I don't see that.

I tried to use variables for each digit but I'm having problems with that method when changing from 100-109 to 110-119, etc.

Anyone think they could hammer this out?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Jan 08, 2006 3:02 am   
 
Start = variable tracking what you are trying to turn
Continue = do you want to auto "bot" the checking
#VAR Start 100
#VAR Continue 1
#ALIAS combotry {turn chest to [@Start/100] [@Start\100/10] [@Start\100];#TEMP Combotryfailtrig {Message for fail} {#ADD Start 1;#IF (@Continue) {#IF (@Start<1000) {#ALARM Combotryagain +1 {combotry}}}}}

Something like that
Reply with quote
Zerox
Newbie


Joined: 08 Jan 2006
Posts: 3

PostPosted: Sun Jan 08, 2006 3:41 am   
 
Ok the script seems feasible except the same problem i was having for with mathematical operators pops up again. I'm used to C/C++ operators like / for divide and ++. But everything seems to work fine in your script except for the division operators:

instead of 1 0 0

it displays [100/100] [100/100] [100\100] exactly

if i could find the command for simple division this could be fixed, any ideas?

and i need the numbers to be like
1 0 0
1 0 1
1 0 2
1 0 3
...
2 4 6
...
etc.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Jan 08, 2006 9:43 am   
 
Ton is using []'s this will only work if you have the allow [] for evaluation option checked in prefrences but he should be using %eval() instead of brackets

#VAR Start 100
#VAR Continue 1
#ALIAS combotry {
turn chest to %copy(@start,1,1) %copy(@start,2,1) %copy(@start,3,1)
#TEMP Combotryfailtrig {Message for fail} {
#ADD Start 1
#IF (@Continue) {#IF (@Start<1000) {#ALARM "Combotryagain" +1 {combotry}}
}
}
}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Zerox
Newbie


Joined: 08 Jan 2006
Posts: 3

PostPosted: Sun Jan 08, 2006 11:35 am   
 
Worked like a charm, thanks for you Zmud scripting prowess fellas
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Mon Jan 09, 2006 2:48 pm   
 
Check this one out as well.
I remember that I checked it and it worked.
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=20453&highlight=combo
_________________
http://www.Aardwolf.com
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Jan 09, 2006 2:52 pm   
 
Ah thanks Nexela for catching that. I have used [] for evaluation for so long I have forgotten it is not standard ^_^
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