Having a guy help me with some code, however, he doesnt know VB6 and only has freebasic
I need to convert the following into VB6 so I can make a user interface (comport selection etc) but not sure how to do it.
Even a step in the correct direction would be great!
Much appreciated, thank you.
Dim resp1 As String
Dim resp2 As String
Dim resp3 As String
Dim x As uinteger
declare sub getreply()
Open Com "COM1:9600,N,8,1,CS0,DS0,DT" As #1
Open "progress.txt" For Output As #2
input "enter start number (add &h at the beginning for a hex #)"; x
Print "starting at "; Hex(x)
x = Int(x)
If x < 0 Then GoTo FinishThat
If x > 65535 Then GoTo FinishThat
Print #2, "seed key tryer"
Print #2, "starting at "; Hex(x)
Print #1, "atz"
getreply()
sleep 2500
Print #1, "at sh 6c 10 f1"
getreply()
x = x + &H27020000
sleep 350
MainLoop:
Print #1, "27 01"
sleep 500
getreply()
Print #1, Hex(x)
sleep 500
getreply()
If resp2 = "67 02 34 " Then GoTo FinishThis
If resp2 = "67 02 37 " Then x = x - 1
Print #2, Hex(x)
Print #2, resp2
x = x + 1
If x = &H27030000 Then GoTo FinishThat
Print #1, "27 01"
sleep 500
getreply()
Print #1, Hex(x)
sleep 500
getreply()
If resp2 = "67 02 34 " Then GoTo FinishThis
If resp2 = "67 02 37 " Then x = x - 1
x = x + 1
If x = &H27030000 Then GoTo FinishThat
sleep 11000
GoTo MainLoop
FinishThis:
x = x - &H27020000
Print #2, Hex(x); " this is your key"
Close #1
Close #2
End
FinishThat:
Print #2, "your key was not found"
Close #1
Close #2
End
Sub getreply()
resp1 = "0"
Do While resp1 = "0"
Input #1, resp1
Loop
Print #2, resp1
resp2 = "0"
Do While resp2 = "0"
Input #1, resp2
Loop
Print #2, resp2
resp3 = "0"
Do While resp3 = "0"
Input #1, resp3
Loop
Print #2, resp3
End Sub
I should ad (not sure how freebasic works) but this current code opens in a dos window, I am wanting to use a regular windows interface to add buttons etc.