|
Zerox Newbie
Joined: 08 Jan 2006 Posts: 3
|
Posted: 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? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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 |
|
|
|
Zerox Newbie
Joined: 08 Jan 2006 Posts: 3
|
Posted: 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. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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}}
}
}
} |
|
|
|
Zerox Newbie
Joined: 08 Jan 2006 Posts: 3
|
Posted: Sun Jan 08, 2006 11:35 am |
Worked like a charm, thanks for you Zmud scripting prowess fellas
|
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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 ^_^
|
|
|
|
|
|