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
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Wed Aug 29, 2007 9:16 pm   

Help solving maps
 
I am trying to write a bot to solve maps on the mud I play. when you first look at an unsolved map, it will look similar to this:

The cyphers are very high, low, very high, very low and high.

Just to level set on this, there are 5 cyphers. The cypher can say 1 of 5 things: very high, high, correct, low, very low. Correct means, obviously, that the cypher is correct. If it says high, then the cypher is anywhere from 1 higher than correct to 3 higher than correct. If the cypher says very high, then it is 4 higher than correct. The same logic holds true for low and very low. I already have 10 aliases setup to go through the sequence of steps to raise or lower 1 cypher by 1 value. For example, I have raise1 and lower1 to raise or lower cypher1 by 1. I have raise2 and lower2 to raise cypher2 by 1 and so forth. I guess my problem is this. I have not found a way to totally automate the decyphering of these maps. When I enter the series of commands to raise and lower the cypher, the above message gets repeated multiple times as it goes through the series of commands. All I am interested in is the last statement when all the commands have completed. Below is an example output, minus my command prompt.

You decipher a section of the ancient map's script.
The cyphers are very high, low, very high, very low and high.
You analyse the layout of the ancient map.
You translate part of the ancient map's writing.
The cyphers are very high, low, high, very low and high.
You carefully study the markings on the ancient map.
You translate part of the ancient map's writing.
You're confused, and unable to make any sense of the map.
You carefully study the markings on the ancient map.
You decipher a section of the ancient map's script.
The cyphers are high, low, high, low and high.

I would be interested in the last message in that list. There could be anywhere from 4 to 12 lines of output. When I raise or lower a cypher and finally get one of them correct, it will look like this...

The cyphers are correct, low, high, low and high.

One it is correct, it will no longer show the cyphers, but just give this command: The map is complete.

Can someone help me figure out how to do this? Like I said, I already have the commands to raise or lower 1 cypher by 1 unit. All I need to do is call those. Thanks for any help that can be provided.

Xantharus
www.godwars2.com
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Aug 29, 2007 10:05 pm   
 
How do you know when your aliases are finished making their changes?

What I mean is to capture the lines you could do this.

Code:
#addkey cyphers {very low=lower4}
#addkey cyphers {low=lower}
#addkey cyphers {correct=smile}
#addkey cyphers {very high=raise4}
#addkey cyphers {high=raise}

#trigger {The cyphers are (*), (*), (*), (*) and (*).} {#exec %db(@cyphers,%1) 1;#exec %db(@cyphers,%2) 2;#exec %db(@cyphers,%3) 3;#exec %db(@cyphers,%4) 4}


Or something very similar. But from the above we cannot tell when to enable or disable this trigger. Or if it is even necessary.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Wed Aug 29, 2007 10:16 pm   
 
WHen I start an uncompleted map, none of the 5 cyphers will be correct. None of my aliases take more than 15 seconds to complete, so I could just wait 15 seconds after I invoke an alias or I could put a display statement at the end of each of my aliases and use that display statement to trigger something else. I've looked at your code above and it's important to note that any of the 5 cyphers can be very low or very high. If cypher 2 shows very low, then I'd need to run raise2 4 times. As I stated, each of my aliases will invoke a series of commands that will raise or lower 1 cypher by 1 unit. I am not quite savvy enough with zmud triggers to understand what you are trying to do and how I should use it. Could you explain a little more?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Aug 30, 2007 1:56 am   
 
Ok, first I have created a database variable containing the possible positions of the cyphers.

#addkey cyphers {very low=#4 lower}
#addkey cyphers {low=lower}
#addkey cyphers {correct=#noop }
#addkey cyphers {very high=#4 raise}
#addkey cyphers {high=raise}

This variable would only be created once. So you could place those commands into the command line and hit enter if you like.

So

#trigger {The cyphers are (*), (*), (*), (*) and (*).} {#exec %db(@cyphers,%1)1;#exec %db(@cyphers,%2)2;#exec %db(@cyphers,%3)3;#exec %db(@cyphers,%4)4}

Each cypher is represented by a (*) this captures it and lets the trigger check to see what it is. each (*) is also numbered from left to right like so %1 %2 %3 %4

So forgetting for the moment that a merely low or merely high value may take multiple tries this trigger will try ONCE for a high or a low value not at all for a correct value and four times for a very high or a very low value.

This one trigger tries for EVERY cypher on each pass. And it will always try the fourth cypher last. If the first try should fail I don't know how to cause the mud to send the cypher text again. AND I don't know if the mud resends the cypher pattern as you try to correct the map. IF IT DOES then you need to disable this trigger while the aliases are attempting to raise or lower the cyphers.

What I mean. If when you send the alias lower1 the mud then sends out the trigger text showing you if you are correct or not the trigger will fire again and send MORE commands even if the first batch are done. This would throw your cyphers off badly if the trigger were left turned on while the aliases were working.

There are MANY ways to solve this problem but I need more information before I or likely anyone else can help you much.

Some raw text from the mud, including your prompt!, and an explanation of each line until completion would be most helpful!
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 30, 2007 1:57 am   
 
If I am following where your inputs are correctly then it looks like the mud maintains order for the values. A random guess may actually result in a correct value. I would need to know what the total allowed range is to build a custom script to do this.

Having provided that the max deviation for the 'high' and 'low' statements is ±3, and provided that my assessment of the mud maintaining order for the responses is right, then it should be quite easy to have the script rapidly narrow. The next question becomes how many guesses do you get? Do the values of the cypher change when you run out of guesses?
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Thu Aug 30, 2007 3:19 am   
 
I guess it's kind of confusing because you don't really know what I have to in order to change 1 cypher by 1. The following is a list of all the right hand actions. Since I know the formatting won't hold, I'll describe each move in parens.

asd >>> <<< <<< - - (this is right hand, so typing ra, then rs, then rd results in 1st cypher being raised 3, 2nd cypher being lowered 3, 3rd cypher being lowered 3 and the 4th and 5th cyper doesnt move)

ast - >>>> >>>> <<<< - (typing ra, rs, rt results in the 1st and 5th cypher not moving, 2nd and 3rd raising by 4 and the 4th lowering by 4.)

sad >>>> >>>> >>>> - <<<< (typeing rs, ra, rd results in the first 3 cyphers raising by 4, the 4th doing nothing and the 5th lowering by 4)

sat <<< <<< >>>> - <<<< (typing rs, ra,rt results in 1st and 2nd cyper lowering by 3. 3rd cypher raising by 4, 4th cypher doesnt move and 5th cypher lowers by 4)

ad > - > - > (type ra, rd results in 1st, 3rd and 5th cypher raising by 1 and the 2nd and 4th cypher doesnt move)

at - > < - < (type ra, rt results in 1st and 4th cyphers not moving, 2nd cypher raising by 1 and the 3rd and 5th cypher lowering by 1

sd < << - > - (type rs, rd results in 1st cypher lowering by 1, 2nd lowering by 2, 4th raising by 1 and 3rd and 5th not moving)

st > > - < - (type rs, rt results in 1st and 2nd cypher raising by 1 and the 4th cypher lowering by 1.)

d < >> >>> >> < (type rd results in 1st and 5th cypher lowering by 1, 2nd and 4th cypher raising by 2 and the 3rd raising by 3)

t - - - > > (type rt results in 4th and 5th cypher raising by 1)

e - - - - - (Nothing moves... just sees the current cypher locations)


When doing this, I am holding the map in both hands, so there is an entire set of left hand commands as well. Here is the solutions to raise/lower each cypher by 1.

Drop 1 - ra rt rs rd la lt ls ld ld rd la ld
Drop 2 - rs rd rs rt
Drop 3 - ra rt ld ra rd rs rd
Drop 4 - ls lt lt rd ls ld la lt ra rd la ld
Drop 5 - la lt rd ld ls ld ra rt ld rs rd

Raise 1 - ra rd ra rt rs rt rs rd
Raise 2 - rd ls ld la lt ls lt la ld
Raise 3 - rs rt ls ld rd ra rt rs rd la lt la ld
Raise 4 - rt la lt rd ld ls ld ra rt ld rs rd
Raise 5 - ra rd ra rd ra rt ls ld ra rt

With that said, Vij, you are right. A random guess could result in a correct value for one of the cyphers and often does. If you attempt a move that would put a cypher higher than very high or lower than very low, then the mud returns that you are confused and randomizes all the cyphers, even if you had some correct. There are unlimited number of guesses so you can keep working on it until you get it right.

I can provide more mud text and I can provide a list of the left hand commands. Suffice to say that I have aliases that do that raise1...5 and lower1...5 commands and they work like a champ. There are a few other points to consider. There is a left hand command "lt" that lowers all cyphers by 1. If all of the values show high or very high, then this one can be done to lower them all by 1. The best order to attack solving these maps is to start with any very high or very low values, usually starting from cypher1 and working toward cypher 5, and work those very high/low values to correct first, then attempt the low/high values. I can provide any additional text you need. Thanks for taking a look at this!

Xantharus
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Aug 30, 2007 3:57 am   
 
Ok, I'm going to leave this one to you Vijilante as I'm not making any sense to Xantharus and you seem to understand the problem. *admittedly I goofed on only going up to 4 with my trigger* Confused
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 30, 2007 12:36 pm   
 
That helped but left me with some other questions.

The values you list for doing a 2 step move don't seem to make a sum of its parts. If I compare what you wrote for 'rs rd' and 'rs rt' using the individual values for 'rd' and 'rt' then I end up with 2 totally different values for 'rs'. So my question is can you do 'rs' by itself or is that considered invalid?

Based on your Raise1 and Drop2 it would appear that these are sums of the move groups you listed. Is that correct?

From some of your figures it looks like a value can go out of range while your working. The confused reset only happens when use 'e'?

Have you ever taken a very high value and lowered by 1 and still had it say very high?

Have you ever tried lowering a very high value to just high, then raising repeatedly it to make sure that there is only 1 very high value possible before it resets?

Think you could post up all left hand values?
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Thu Aug 30, 2007 1:17 pm   
 
Left Hand Values

asd - - <<< <<< >>> (Cypher 3 and 4 lower by 3 and cypher 5 raises by 3)
ast - <<<< >>>> >>>> - (cypher 2 lowers by 4 and cyphers 3 adn 4 raises by 4)
sad >>>> <<< >>>> - <<<< (cypher 1 and 3 raises by 4 and cypher 2 lowers by 3 and cypher 5 lowers by 4)
sat <<<< >>> >>>> - <<<< (cyphers 1 and 5 lower by 4, cypher 2 raises by 3 and cypher 3 raised by 4)
ad < > < < > (cyphers 1, 3 and 4 lower by 1 and cyphers 2 and 5 raise by 1)
at >>>> < - < - (cypher 1 raises by 4 and cypher 2 and 4 lower by 1)
sd << << - - > (cyphers 1 and 2 lower by 2 and cypher 5 raises by 1)
st - > << - < (cypher 2 raises by 1, cypher 3 lowers by 2 and cypher 5 lowers by 1)
d - > < < - (cypher 2 raises by 1 and cyphers 3 and 4 lowers by 1)
t < < < < < (all cyphers lower by 1)
e - - - - - (examine only)
r - - - - - (examine only)

Vijilante, to answer your first question, there are 1 step moves, 2 step moves and 3 step moves. Let's take the drop1 sequence. ra, rt is a 2 step sequence. rs, rd is a 2 step sequence, la, lt is a 2 step sequence, ls, ld is a 2 step sequence, ld is a 1 step sequence, rd is a 1 step sequence, la, ld is a 2 step sequence for a total of 7 cypher moves.

to summarize that, moves like ld mean 1 thing when executed after an ls and another thing when not executed after an ls. The same thing occurs on the right hand where rd means 1 thing after an rs but something else when not executed after an rs. if you look at the moves I provided you, an rs is not a valid move by itself. The only valid 1 step moves on the right hand are rd, rt and re. On the left hand, the only valid 1 step moves are ld, lt, le and lr.

You also had questions specifically about raise1 and drop2. I will explain those as I did drop1 above.
raise1: ra rd ra rt rs rt rs rd (ra, rd is a 2 step seq, ra, rt is a 2 step seq, rs, rt is a 2 step seq, rs, rd is a 2 step seq, so 4 total cypher moves)
drop2: rs rd rs rt (rs,rd is a 2 step sequence and rs, rt is a 2 step seq, so 2 total cypher moves)

No, the values cannot go out of range while working on these. That causes the statement "You're confused, and unable to make any sense of the map. ". When that happens, the cyphers are randomized. That's why it's important to try to lower the very highs and raise the very lows first. There will never be an occasion where you lower a very high and it still say very high. There is only 1 very high value.

Please let me know if there are any other questions I can answer or more mud text I can provide. Thank you for all of your assistance.

Xantharus

Also, Thank you very much Arminas. I am very fluent in scripting, but not zmud scripting, so I apologize for not understanding. I am a slow student.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 30, 2007 1:33 pm   
 
I don't think you understood my question about values going out of range and where it is a problem. Let's for a moment assume you have this set of cypher values: "very high, very high, very low, high, very low". You use your Drop1 alias. The first sequence of that is "ra rt" which by looking at the right hand "at" value you gave pushes the 2nd, 3rd, and 5th cyphers out of range. Do you get a confused message at that point, or does it wait until the whole set of sequences is done and you look again with an "re"?
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Thu Aug 30, 2007 1:52 pm   
 
It gives you the confused message right away. However, with the alias I have setup, it continues on with all of the remaining moves. I could do 1 of 2 things. I could add an "escape" to the alias so the sequence stops when it gets confused. or we could still just focus on the final result of the sequence. If you type an le at any time, you can see the current cypher settings. If I entered a series of commands and it was confused after every command sequence, we would still end up with a randomized cypher sequence at the end.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 30, 2007 2:38 pm   
 
I have most of the initial framwork done for this, and now have another question.

Are the various command you mentioned rd, rt, lr, ls, etc aliases or actual mud commands?

Also when a valid sequence such as ls, la, lt is sent does the mud reply with the new values, or is a re/lr required to get them?
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Thu Aug 30, 2007 9:28 pm   
 
The rd, rt, etc are actual mud commands. The right and left hand commands are actually from a mud help file. When you enter a 2 command sequence, for example, it will say something similar to this...

You analyse the layout of the ancient map.
The cyphers are very high, low, very high, very low and high.

so if I enter 4 separate 2 command sequences, it would look like this, but with my prompt in between each of these.

You analyse the layout of the ancient map.
The cyphers are very high, low, very high, very low and high.
You decipher a section of the ancient map's script.
The cyphers are high, high, very high, low and very high.
You analyse the layout of the ancient map.
You translate part of the ancient map's writing.
The cyphers are very high, low, high, very low and very high.
You carefully study the markings on the ancient map.
You translate part of the ancient map's writing.
The cyphers are high, low, high, low and high.

of course, at the end of this, you can do an le if you wish to get the last status.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Aug 31, 2007 1:07 am   
 
I think I got this about as good as it can get. First step is a bunch of logic so it knows what the exact values are. Next it runs a brute force calculation up to a depth of 4 sequences. This calculation has a bunch of graceful exits so that it can say close enough. You can adjust that closeness if you want. I didn't really put in the tracking stuff for when it gives up for a max depth, but it tells you where to look for a list of sequences and what the outcome from them will be. Also I really didn't have much ability to test the command sending portions. I was using a shorthand during my testing and had it interface to a secondary script to simulate the mud. Hopefully that isn't buggy. Enjoy.
Code:
#CLASS {CypherSystem}
#ALIAS CypherAdj {AdjResults="";AdjBest="";#LOOPDB @CypherMoves {CypherTemp=1;#LOOP 5 {#IF (%abs(%eval(%concat(@{Cypher%i},%word(%val,%i))))>4) {CypherTemp=0}};#IF (@CypherTemp) {CypherTemp="";NewCypher1=0;#LOOP 5 {CypherTemp=%concat(@CypherTemp,%eval(%concat(@{Cypher%i},%word(%val,%i)))," ");#IF (%ismember(%i,@KnownCorrect)=0) {#IF (%abs(%word(%val,%i))=2) {#ADD NewCypher1 4} {#IF (%word(%val,%i)!="+0") {#ADD NewCypher1 1}}}};#ADDKEY AdjResults {%key} {%trim(@CypherTemp)};#ADDITEM AdjBest {%concat(%rightback(%concat(%repeat("0",3),@NewCypher1),3)," ",%key)}}};AdjBest=%sort(@AdjBest,1);#IF (%numitems(@KnownCorrect)<5) {#LOOP 5 {#IF (%ismember(%i,@KnownCorrect)) {#VAR NewCypher%i {%word(%db(@AdjResults,%word(%item(@AdjBest,1),2)),%i)}} {#VAR NewCypher%i {@{Cypher%i}}}};#T+ CypherUpdate;CypherTemp=2;CypherTemp2=%word(%item(@AdjBest,1),2);#WHILE (@CypherTemp<=%len(@CypherTemp2)) {#IF (@CypherPause=0) {#EXEC {%left(@CypherTemp2,1)%copy(@CypherTemp2,@CypherTemp,1)}} {CypherDelayed=%additem(%left(@CypherTemp2,1)%copy(@CypherTemp2,@CypherTemp,1),@CypherDelayed)};#ADD CypherTemp 1}} {#IF (@FinalCypherMoves="") {#SHOW Got all known, time to make right.;CypherTemp="";#NOOP Check for within 1;#LOOPDB @AdjResults {#IF (%subchar(%val," 0","")="") {CypherTemp=%key};#IF (@CypherTemp="") {#IF (%eval(%subchar(%val," 234-","+999"))<3) {#SHOW Close enough %val;CypherTemp=%key}}};#IF (@CypherTemp) {#SHOW LuckyWinner @CypherTemp;CypherTemp2=2;#WHILE (@CypherTemp2<=%len(@CypherTemp2)) {#IF (@CypherPause=0) {#EXEC {%left(@CypherTemp,1)%copy(@CypherTemp,@CypherTemp2,1)}} {CypherDelayed=%additem(%left(@CypherTemp2,1)%copy(@CypherTemp2,@CypherTemp,1),@CypherDelayed)};#ADD CypherTemp2 1}} {#NOOP Check for within many;AdjBest=%expanddb(@AdjResults,"|","=");CypherTemp3="";CypherBrute}}}}
#ALIAS CypherBrute {#T+ BruteStat status;#WHILE (@AdjBest) {#LOOPDB @CypherMoves {CypherTemp2=1;#LOOP 5 {#VAR NewCypher%i {%eval(%word(%val,%i)+%word(%word(%item(@AdjBest,1),2,"="),%i))};#IF (%abs(@{NewCypher%i})>4) {CypherTemp2=0}};#IF (@CypherTemp2) {CypherTemp2="";#LOOP 5 {CypherTemp2=%concat(@CypherTemp2," ",@{NewCypher%i})};#IF (%subchar(@CypherTemp2," 0","")="") {CypherTemp=%concat(%word(%item(@AdjBest,1),1,"=")," ",%key);#WHILE (%numitems(@AdjBest)>1) {#DELNITEM AdjBest 1};CypherTemp3="";#ADDKEY CypherTemp3 {%word(%item(@AdjBest,1),1,"=") %key} {%trim(@CypherTemp2)}} {#IF (%eval(%subchar(@CypherTemp2," 234-","+999"))<3) {CypherTemp=%concat(%word(%item(@AdjBest,1),1,"=")," ",%key);#SHOW Close enough value of @CypherTemp2;CypherTemp3="";#ADDKEY CypherTemp3 {%word(%item(@AdjBest,1),1,"=") %key} {%trim(@CypherTemp2)};#WHILE (%numitems(@AdjBest)>1) {#DELNITEM AdjBest 1}} {#ADDKEY CypherTemp3 {%word(%item(@AdjBest,1),1,"=") %key} {%trim(@CypherTemp2)}}}}};#DELNITEM AdjBest 1;#IF (@AdjBest="") {#IF (@CypherTemp) {#SHOW LuckyWinner @CypherTemp;#T- BruteStat status;#T+ CypherUpdate;FinalCypherMoves=%replace(@CypherTemp," ","|");CypherTemp2=%db(@CypherTemp3,@CypherTemp);#IF (@CypherTemp2!="0 0 0 0 0") {#SHOW Adding needed raise and lower data.;#LOOP 5 {#IF (%word(@CypherTemp2,%i)="1") {FinalCypherMoves=%concat(@FinalCypherMoves,"|",%replace(%db(@PosSpecData,%concat("-",%i))," ","|"))} {#IF (%word(@CypherTemp2,%i)="-1") {FinalCypherMoves=%concat(@FinalCypherMoves,"|",%replace(%db(@PosSpecData,%concat("+",%i))," ","|"))}}}}} {AdjBest=%expanddb(@CypherTemp3,"|","=");#IF (%numwords(%word(%item(@AdjBest,1),1,"="))<3) {CypherTemp3="";#SHOW Stepping deeper %numwords(%word(%item(@AdjBest,1),1,"="))} {#SHOW Sorry, brute didn't get far enough. Picking route for low values and working it.;AdjBest=99;CypherTemp2="";#LOOPDB @CypherTemp3 {CypherTemp=%eval(%subchar(%val,"- ","++"));#IF (@CypherTemp<@AdjBest) {AdjBest=@CypherTemp;CypherTemp2=%key}};FinalCypherMoves=%replace(@CypherTemp2," ","|");CypherTemp="";AdjBest="";#T- BruteStat status}}}}}
#ALIAS ComputeCypherTemp {CypherTemp=%replace(%replace(@CypherTemp,", ","|")," and ","|");CypherTemp=%replace(@CypherTemp,"correct","0");CypherTemp=%replace(@CypherTemp,"low","*-1-3");CypherTemp=%replace(@CypherTemp,"high","*1+3");CypherTemp=%replace(@CypherTemp,"very ","1");#LOOP 5 {#VAR Cypher%i {%eval(%concat("0",%item(@CypherTemp,%i)))}}}
#ALIAS Decypher {#IF ("%1"="stop") {CypherPause=1} {#IF ("%1"="off") {#T- CypherSpot;#T- CypherUpdate;#T- CypherConfusion;#T- CypherFinish;#T- CypherReport status;#T- CypherBrute status;#RESET CypherSystem} {#IF ("%1"="step") {#IF (@CypherDelayed) {#T+ CypherUpdate;#EXEC {%item(@CypherDelayed,1)};#DELNITEM CypherDelayed 1} {#SHOW No steps to do on the cypher queue}} {#RESET CypherSystem;#IF ("%1"="slow") {CypherPause=1};#T+ CypherReport status;#T+ CypherSpot;#T- CypherUpdate;#T+ CypherConfusion;#T+ CypherFinish;le}}}}
#VAR Cypher1 {} {}
#VAR Cypher2 {} {}
#VAR Cypher3 {} {}
#VAR Cypher4 {} {}
#VAR Cypher5 {} {}
#VAR CypherTemp {} {}
#VAR CypherTemp2 {} {}
#VAR CypherTemp3 {} {}
#VAR NewCypher1 {} {}
#VAR NewCypher2 {} {}
#VAR NewCypher3 {} {}
#VAR NewCypher4 {} {}
#VAR NewCypher5 {} {}
#VAR AdjResults {} {}
#VAR AdjBest {} {}
#VAR KnownCorrect {} {}
#VAR FinalCypherMoves {} {}
#VAR CypherPause {0} {0}
#VAR CypherDelayed {} {}
#VAR PosSpecData {-1=rat rsd lat lsd ld rd lad|-2=rsd rst|-3=rat ld rad rsd|-4=lst lt rd lsd lat rad lad|-5=lat rd ld lsd rat ld rsd|+1=rad rat rst rsd|+2=rd lsd lat lst lad|+3=rst lsd rd rat rsd lat lad|+4=rt lat rd ld lsd rat ld rsd|+5=rad rad rat lsd rat}
#VAR CypherMoves {rasd=+3 -3 -3 +0 +0|rast=+0 +4 +4 -4 +0|rsad=+4 +4 +4 +0 -4|rsat=-3 -3 +4 +0 -4|rad=+1 +0 +1 +0 +1|rat=+0 +1 -1 +0 -1|rsd=-1 -2 +0 +1 +0|rst=+1 +1 +0 -1 +0|rd=-1 +2 +3 +2 -1|rt=+0 +0 +0 +1 +1|lasd=+0 +0 -3 -3 +3|last=+0 -4 +4 +4 +0|lsad=+4 -3 +4 +0 -4|lsat=-4 +3 +4 +0 -4|lad=-1 +1 -1 -1 +1|lat=+4 -1 +0 -1 +0|lsd=-2 -2 +0 +0 +1|lst=+0 +1 -2 +0 -1|ld=+0 +1 -1 -1 +0|lt=-1 -1 -1 -1 -1}
#TRIGGER "CypherUpdate" {^The cyphers are &{CypherTemp}.$} {#T- CypherUpdate;ComputeCypherTemp;CypherTemp="";#LOOP 5 {#IF (%ismember(%i,@KnownCorrect)) {#IF (@{Cypher%i}!=0) {#IF (%abs(@{Cypher%i})!=4) {#VAR Cypher%i {@{NewCypher%i}}}}} {#IF (@{Cypher%i}=0) {#ADDITEM KnownCorrect {%i}} {#IF (%abs(@{Cypher%i})=4) {#ADDITEM KnownCorrect {%i}} {#IF (%eval(@{NewCypher%i}*10/@{Cypher%i})<0) {#NOOP Changed Sign check adjust amount and we might know what it is.;#IF (%abs(%word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i))=2) {#VAR Cypher%i {%eval(@{Cypher%i}/3)};#ADDITEM KnownCorrect {%i}} {#IF (%abs(%word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i))=3) {#VAR Cypher%i {%eval(@{Cypher%i}/3*2)}} {#IF (%abs(%word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i))=4) {#VAR Cypher%i {%eval(@{Cypher%i}/3*2)}} {#SHOW Uncovered circumstance you missed something dumbass %i %word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i).;CypherTemp="idiot"}}}} {#NOOP No Sign change have to figure here.;#IF (%abs(%word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i))=2) {#IF (%eval(%word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i))/@{Cypher%i})=-1) {#VAR Cypher%i {%eval(@{Cypher%i}/3)}};#ADDITEM KnownCorrect {%i}} {#IF (%abs(%word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i))=1) {#VAR Cypher%i {%eval(@{Cypher%i}/3*2)}} {#IF (%word(%db(@CypherMoves,%word(%item(@AdjBest,1),2)),%i)="+0") {#NOOP Just checking to cover the error} {#SHOW Uncovered circumstance you missed something dumbass %i.;CypherTemp="idiot"}}}}}}}};#IF (@CypherTemp="") {CypherAdj;#IF (@FinalCypherMoves) {#T+ CypherUpdate;CypherTemp2=%item(@FinalCypherMoves,1);#IF (@CypherTemp2="Report") {CypherTemp="";#LOOP 5 {CypherTemp=%concat(@CypherTemp," ",@{Cypher%i});#VAR NewCypher%i {@{Cypher%i}}};#SHOW {Cypher values are:@CypherTemp};le} {#LOOP 5 {#VAR NewCypher%i {%word(%db(@AdjResults,@CypherTemp2),%i)}};CypherTemp="";#LOOP 5 {CypherTemp=%concat(@CypherTemp," ",@{Cypher%i})};#SHOW {Cypher values are:@CypherTemp};#SHOW CypherValues set to %db(@AdjResults,@CypherTemp2) for @CypherTemp2;CypherTemp=2;#WHILE (@CypherTemp<=%len(@CypherTemp2)) {#IF (@CypherPause=0) {#EXEC {%left(@CypherTemp2,1)%copy(@CypherTemp2,@CypherTemp,1)}} {CypherDelayed=%additem(%left(@CypherTemp2,1)%copy(@CypherTemp2,@CypherTemp,1),@CypherDelayed)};#ADD CypherTemp 1}};#DELNITEM FinalCypherMoves 1}}} "" {disable}
#TRIGGER "CypherSpot" {^The cyphers are &{CypherTemp}.$} {KnownCorrect="1|2|3|4|5";ComputeCypherTemp;#LOOP 5 {#IF (%abs(@{Cypher%i})=3) {#DELITEM KnownCorrect {%i}}};#T- CypherSpot;CypherAdj} "" {disable}
#TRIGGER "CypherConfusion" {^You're confused, and unable to make any sense of the map.$} {#RESET CypherSystem;#T+ CypherSpot;#T- CypherUpdate;le} "" {disable}
#TRIGGER "CypherFinish" {^You've finished deciphering the map.$} {#T- CypherUpdate;#T- CypherConfusion;#T- CypherFinish;#T- CypherSpot;#T- CypherReport status;#RESET CypherSystem;#BEEP} "" {disable}
#STAT {CypherBrute at %numkeys(@CypherTemp3)} "" "BruteStat"
#STAT {Correct: %sort(@KnownCorrect) Cyphers: @Cypher1 @Cypher2 @Cypher3 @Cypher4 @Cypher5} "" "CypherReport"
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums

Last edited by Vijilante on Fri Aug 31, 2007 7:42 pm; edited 1 time in total
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Fri Aug 31, 2007 2:02 am   
 
Thank you very much. I have imported this, but, I guess I am just a bit stupid about these things... how do I make it work? I tried to get it going, but couldn't. It kicked in somewhat when I started to do it manually and it got confused. It actually said there was an uncovered circumstance and called me a dumbass. =). Please just let me know how to get it kicked off.

Thanks!
Xantharus
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Aug 31, 2007 2:44 am   
 
Actually that message is in there as part of the debugging code. There are 2 of them for circumstances I thought were impossible and it likely only appeared because the script wasn't initialized.

The easiest way to start it is to copy the script from the confused trigger into an alias of whatever name you like. You know, I will just write out the alias here:
#CLASS CypherSystem
#ALIAS Decypher {#RESET CypherSystem;#T+ CypherSpot;#T- CypherUpdate;le}
#CLASS 0

Actually looking at it there is a small error in the script. You need to add a line to that 'confused' trigger "#T- CypherUpdate" right below the #T+ line. I put it in quite hastily.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Fri Aug 31, 2007 4:29 am   
 
Thank you very much. I still haven't gotten it to work right, but it is working to some extent. The most I can get it to solve is 2 before it ends up stopping and having me do it manually. I keep getting either "Sorry, brute didn't get far enough. Pick a route from CypherTemp3 and then work it." or "Uncovered circumstance you missed something dumbass". Can you tell me what the following output is supposed to represent? "Cypher values are: 0 0 -2 -1 0". Is this supposed to say that cypher 1, 2 and 5 are correct and cypher 3 is low and cypher 4 is low? If so, that's not what the cyphers are showing me. I appreciate you working on this so long. We only need to pursue this if you want to. If you would like me to meet you on godwars and show you, then I can do that as well.

I do appreciate all you've done on this!
Thanks!
Xantharus

EDITED: Here is a cut and paste of something that might indicate this is getting "off" a little.
The cyphers are low, high, low, low and high.

Cypher values are: 0 1 1 0 1
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Aug 31, 2007 11:29 am   
 
The uncovered circumstance message shouldn't be possible with the numbers you gave me. It is part of a mathematical portion for determining what the actual values are. The only things I can think that would cause it are some of the number values you gave me weren't right, or I made an error in entering the effects of the commands. If it is an error in my entry you should be able to find it quite readily whenever that message comes up. Look at the AdjBest variable, the top line there will be the command sequence that was issued. Then find that sequence in CypherMoves and check to make sure the values are right. My simulator was using those values for responses so it is an error I wouldn't have found.

The message about 'brute didn't get far enough' means that it never managed to get the numbers to come within 3 of totally correct. That is after look 3 command sequences ahead. I chose to stop at that level since it frequently was up to 1000 possibilities by that point. As it tries to calculate its way through it validates each command sequence to not get a 'confused' message, so it is possible you have had many occasions where the valid commands are small in number. If you really want I can change it so that it will pick something and run through it then try to resume the brute calculation.

Is this something I could easily get at and play with as a new character there? I really don't want to have wander about for more then 10 minutes or so before being able to work with it. Also you mentioned getting some of the commands and things from the help, does it list specific numbers or such as well?
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Fri Aug 31, 2007 2:21 pm   
 
I will look through those variables you recommended. Yes, if you can add something where ti can continue the brute calculation, then that would be good. The goal of this is to have a character be able to take a pile of maps and process through them unattended, or lightly attended. As far as getting on the mud, yes, it is very fast to get on and start in the mud right away. As a matter of fact, I will send you a PM with a new character that I create and he will have a map in his inventory. All you'd have to do is sign on, import your script and start debugging. I will be on as well and can talk to you in-game.
Thanks!
Xantharus
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Aug 31, 2007 7:48 pm   
 
New version is in up above. Thanks for setting me up to debug this whole thing. There were quite a few logic errors in my original, and a number of data entry errors. New features include the Decypher alias, optional commands for which are off, stop, and step. Also there is now a finish trigger to shut down and clear all the variables. The final phase using the sequences you provided are what really does the trick. I also tighened the requirements to enter the final phase, but also added another door to that stage which should speed things up dramatically if it happens.

Enjoy.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
xantharus
Beginner


Joined: 21 Aug 2007
Posts: 29

PostPosted: Fri Aug 31, 2007 8:00 pm   
 
Thanks for everything! I still am getting the following:

The first 5 commands being executed are: ra rs rd r+ r3
Then I get the following errors

Unrecognised command 'r+' (type 'commands' to list those available).

'rs' and 'rd' have been removed from the end of your combat queue.

I'm quite sure this is just something I am doing wrong. I held the map, typed la, then typed decypher. I almost immediately got this message.

Ideas?
Reply with quote
meezyfuh
Newbie


Joined: 14 Jun 2009
Posts: 1

PostPosted: Wed Jun 17, 2009 8:20 am   
 
bump


I used the script above and got the same result. It sends

ra
rs
rd
r+
r3

The last two of which aren't commands.
Help!
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