CodeBreaker

Posted by WRTIII on Thu 09 Jan 2003 06:47 PM — 6 posts, 26,213 views.

Canada #0
Ok I've been through this once before and I remember I had it working decently but I lost all my files and went through here and got all the parts of code but can't get it working again :(

What it is I want to do is crack a safe combo. It consists of 3 Numbers

// The safe is set into the wall and has no apparent keyhole, but instead there
is a combination lock dial with three separate dials, each numbering 0-9. A
great lever is used to open the safe. The three dials are currently turned to
1 1 0. //
//
turn 1 to 0
You turn the first dial on the safe to zero.
*
turn 2 to 1
You turn the second dial on the safe to one.
*
turn 3 to 2
You turn the third dial on the safe to two.
*
open safe
The lever on the safe will not turn. //

That's a couple bits of what it looks like so I need a script that will:

turn 1 to 0
turn 2 to 0
turn 3 to 1
...
turn 1 to 0
turn 2 to 1
turn 3 to 0
...
turn 1 to 9
turn 2 to 9
turn 3 to 9

go from checking 001 to 999

The code I have now is:

Sub Crackit (Thename, theoutput, thewildcards)
Int CODE
Int A
Int B
Int C
CODE=world.getvariable ("CODE")
A = mid (CODE, 1, 1)
B = mid (CODE, 2, 1)
C = mid (CODE, 3, 1)
world.send "TURN 1 TO " & A
world.send "TURN 2 TO " & B
world.send "TURN 3 TO " & C
world.send "open safe"
CODE = CODE + 1
If CODE = 1000 Then
CODE = 000
world.setvariable "Code", Code
Else
world.setvariable "Code", Code
End If
End Sub

with a simple alaias CRACKIT to run it and it will do

1
blank
blank
..
2
blank
blank
..
1
0
blank
..
1
0
0
..
to 999
..
then back to the start This is the script I had written before I realized the that code used zero's.

After I get it working manually I plan to improvise some sort of timing system so I don't just spam 3000 lines to the game at once just something to automaticly go through it with a bit of break from spamming.. but for now if I could just get it working automaticly..

Any help is appreciated Thanks.
Bill
Australia Forum Administrator #1
Did you check out Code Breaker? - we seem to have done this before.
Canada #2
I know that's what I said, and I can't get it working again lol I've been trying all day and it's just not working out.
United Kingdom #3
I tested this just now and it seems to work fine. I made it call by a timer since you said you didn't want to spam the game. So you'll need to make one.


Sub Crackit (Timername)
if Isempty(world.getvariable ("CODE")) then
world.setvariable "CODE", "000"
end if
Dim CODE, A, B, C
CODE = world.getvariable ("CODE")
If CODE < 10 then
B = 0
C = 0
end if
if CODE < 100 and CODE > 9 then
C = 0
end if
world.send "TURN 1 TO " & A
world.send "TURN 2 TO " & B
world.send "TURN 3 TO " & C
world.send "open safe"
C = C + 1
if C = 10 then
C = 0
B = B + 1
end if
if B = 10 then
B = 0
A = A + 1
end if
CODE = A & B & C
If CODE = 1000 Then
CODE = 000
end if
world.setvariable "CODE", CODE
End Sub


I guess you could make a trigger that'd turn the timer off when it opens the safe. *shrugs*

~Rhinoa~
Amended on Mon 09 Jun 2003 04:41 PM by Rhinoa
Canada #4
That Code worked great and has a couple failsafes in it that I never would of had Thank you very much. The only problem that I had to make was where If code =1000 set code to 000 had to be set code to "000" cause it was changing the varible to 0 not 000 :) Thanks again
United Kingdom #5
If CODE = 1000 Then
CODE = 0 & 0 & 0
end if

world.setvariable "CODE", CODE

That should fix it.

~Rhinoa~