Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ CodeBreaker

CodeBreaker

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by WRTIII   Canada  (76 posts)  Bio
Date Thu 09 Jan 2003 06:47 PM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 09 Jan 2003 08:07 PM (UTC)
Message
Did you check out Code Breaker? - we seem to have done this before.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #2 on Fri 10 Jan 2003 03:34 AM (UTC)
Message
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.
Top

Posted by Rhinoa   United Kingdom  (37 posts)  Bio
Date Reply #3 on Fri 10 Jan 2003 02:57 PM (UTC)

Amended on Mon 09 Jun 2003 04:41 PM (UTC) by Rhinoa

Message
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~
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #4 on Sun 12 Jan 2003 01:08 PM (UTC)
Message
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
Top

Posted by Rhinoa   United Kingdom  (37 posts)  Bio
Date Reply #5 on Sun 12 Jan 2003 02:10 PM (UTC)
Message
If CODE = 1000 Then
CODE = 0 & 0 & 0
end if

world.setvariable "CODE", CODE

That should fix it.

~Rhinoa~
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,959 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.