This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TheAlcatraz's profile picture

LockSmith Program "unfinished string"

Started by TheAlcatraz, 03 January 2013 - 03:23 PM
TheAlcatraz #1
Posted 03 January 2013 - 04:23 PM
I made A lock file and when I start it up it says unfinished string. The Code is

os.pullEvent = os.pullEventRaw
print (" Welcome to LockSmith v1.1 Alpha please enter passcode ")


write("")
x = io.read()

if x == "110011" then

redstone.setOutput ("back". true )

print ("Passcode Accepted…")

sleep(4)
redstone.setOutput ("back", false )
else
term.clear
print ("Passcode Denied…")
sleep(4)

end
os.shutdown()
W00dyR #2
Posted 03 January 2013 - 04:26 PM
put a space in the write function

so itll be


write(" ")

Thats the only thing I can think of


EDIT: Also, I dont think you can have a space in between the print function and its string, so it cant be


print ("blabla")

but it has to be



print("Blabla")

this also goes for the redstone.setOutput()
theoriginalbit #3
Posted 03 January 2013 - 04:39 PM
EDIT: Also, I dont think you can have a space in between the print function and its string, so it cant be…….
White space doesn't matter in most high level languages. The compilers are normally smart enough to ignore white space (with a few areas of syntax where there must be none)
W00dyR #4
Posted 03 January 2013 - 04:42 PM
EDIT: Also, I dont think you can have a space in between the print function and its string, so it cant be…….
White space doesn't matter in most high level languages. The compilers are normally smart enough to ignore white space (with a few areas of syntax where there must be none)

Alright then, I'm only learning as well :)/>


On topic:
I just noticed in the first redstone.setOutput(), theres a dot instead of a komma, I'm pretty sure it has to be a , instead of . :)/>
theoriginalbit #5
Posted 03 January 2013 - 05:24 PM
Alright then, I'm only learning as well :)/>/>/>


On topic:
I just noticed in the first redstone.setOutput(), theres a dot instead of a komma, I'm pretty sure it has to be a , instead of . :)/>/>/>

Hey that's fine, we were all at that stage at one point, we all had to learn.

Ahh good pickup, missed that one was looking at all the strings, sometimes hate error messages, especially when we don't get the full error ;)/>

EDIT: Also for OP try to use code tags to make it look better for us to read and help, they are this ['code]['/code] without the ' of course. Also the full error message that you are given DOES help. And lastly long code is handy in pastebin, especially when the error is say at line 40 or 60 or I've even seen one at 250. Easier to find that line in pastebin :)/>
TheAlcatraz #6
Posted 04 January 2013 - 01:51 PM
Ok thanks the tutorial I wacthed siad to put spaces
TheAlcatraz #7
Posted 04 January 2013 - 01:54 PM
Ok now it says bois:206: [string "LockSmith"] :18: '=' expected
W00dyR #8
Posted 04 January 2013 - 02:13 PM
Ok now it says bois:206: [string "LockSmith"] :18: '=' expected

Please post your current code, and put it in the
 tags :)/>
TheAlcatraz #9
Posted 04 January 2013 - 02:18 PM
Ok just one sec
TheAlcatraz #10
Posted 04 January 2013 - 02:20 PM
os.pullEvent = os.pullEventRaw
print("Welcome to LockSmith v1.1 Alpha please enter passcode")


write(" ")
x = io.read()

if x == "110011" then

redstone.setOutput("back". true )

print("Passcode Accepted…")

sleep(4)
redstone.setOutput("back", false )
else
term.clear
print("Passcode Denied…")
sleep(4)

end
os.shutdown()
TheAlcatraz #11
Posted 04 January 2013 - 02:24 PM
Any Ideas?
W00dyR #12
Posted 04 January 2013 - 02:26 PM
Try changing the first

redstone.setOutput("back". true )

into

redstone.setOutput("back", true)


and finish term.clear into term.clear()
Loki #13
Posted 04 January 2013 - 02:29 PM
put a space in the write function

so itll be


write(" ")

Thats the only thing I can think of


EDIT: Also, I dont think you can have a space in between the print function and its string, so it cant be


print ("blabla")

but it has to be



print("Blabla")

this also goes for the redstone.setOutput()

That doesnt matter at all The problem is that you did term.clear and not term.clear()

If i helped it all. Press DAT littel' green fellah' :o/>
Loki #14
Posted 04 January 2013 - 02:30 PM
EDIT: Also, I dont think you can have a space in between the print function and its string, so it cant be…….
White space doesn't matter in most high level languages. The compilers are normally smart enough to ignore white space (with a few areas of syntax where there must be none)

Alright then, I'm only learning as well :)/>


On topic:
I just noticed in the first redstone.setOutput(), theres a dot instead of a komma, I'm pretty sure it has to be a , instead of . :)/>
It does indeed. :)/> Although the problem is that you did term.clear and not term.clear() towards the end.
Loki #15
Posted 04 January 2013 - 02:32 PM
os.pullEvent = os.pullEventRaw
print("Welcome to LockSmith v1.1 Alpha please enter passcode")


write(" ")
x = io.read()

if x == "110011" then

redstone.setOutput("back". true )

print("Passcode Accepted…")

sleep(4)
redstone.setOutput("back", false )
else
term.clear
print("Passcode Denied…")
sleep(4)

end
os.shutdown()

For future reference. Put your code in the code tag. Like this:


FUS RO DAHHHH
TheAlcatraz #16
Posted 04 January 2013 - 02:35 PM
Thanks it now works

Now my base is protected in this server