Jump to content


Conlan99's Content

There have been 14 items by Conlan99 (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#106513 Getting "error ":1: "do" expected", even though "do" already exists

Posted by Conlan99 on 05 April 2013 - 01:53 PM in Ask a Pro

View PostNinetainedo, on 05 April 2013 - 12:59 PM, said:

To check if a variable is equal to something else, you have to put "==" instead of "=".
Thank you!



#106474 Getting "error ":1: "do" expected", even though "do" already exists

Posted by Conlan99 on 05 April 2013 - 12:56 PM in Ask a Pro

So I was making a program to control my redpower2 tunnel bore (I'm using computercraft computers), and when I run this program, I get the error, "error [something here] :1: "do" expected". I already have a "do" on line 1 though, so I'm not sure what to do...
Essentially what this program is supposed to do is, whenever it receives a redstone signal from the front, it starts the frame motors with redstone signals.
while redstone.getInput("front") = true do
  redstone.setOutput("back", true)
  sleep(0.4)
  redstone.setOutput("back", false)
  sleep(1.44)
  redstone.setOutput("left", true)
  redstone.setOutput("right", true)
  sleep(1.44)
  redstone.setOutput("left", false)
  redstone.setOutput("right", false)
end



#71837 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 09:26 AM in Ask a Pro

View Postcrazyguymgd, on 10 January 2013 - 08:58 AM, said:

change the then to a do will get it to run.

Okay, I changed my "then" to a "do". Not sure why you wanted me to do that though. I thought you were supposed to close a "repeat" with an "until"

View PostConlan99, on 10 January 2013 - 09:26 AM, said:

View Postcrazyguymgd, on 10 January 2013 - 08:58 AM, said:

change the then to a do will get it to run.

Okay, I changed my "then" to a "do". Not sure why you wanted me to do that though. I thought you were supposed to close a "repeat" with an "until"
Oh, and It's telling me it now expected an = sign...



#71834 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 09:23 AM in Ask a Pro

View PostConlan99, on 10 January 2013 - 09:22 AM, said:

Okay. I'll be sure not to copy the code display thingy in the future :P
And I literally just did it again :I



#71832 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 09:22 AM in Ask a Pro

View PostremiX, on 10 January 2013 - 09:18 AM, said:

View PostConlan99, on 10 January 2013 - 08:47 AM, said:

Shouldn't have copied what? O_o

Copying the code directly from another user and pasting it causes it to keep the html editing:

[color=#000000][size=2]input [/size][/color][color=#666600][size=2]=[/size][/color][color=#000000][size=2] read[/size][/color][color=#666600][size=2]()[/size][/color]

[color=#000088]if[/color][color=#000000] input [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]"stop"[/color][color=#000000] [/color][color=#000088]or[/color][color=#000000] input [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]"Stop"[/color][color=#000000] [/color][color=#000088]or[/color][color=#000000] input [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]"exit"[/color][color=#000000] [/color][color=#000088]or[/color][color=#000000] input [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]"Exit"[/color][color=#000000] [/color][color=#000088]or[/color][color=#000000] input [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]"quit"[/color][color=#000000] [/color][color=#000088]or[/color][color=#000000] input [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]"Quit"[/color][color=#000000] [/color][color=#000088]then
[/color]
Okay. I'll be sure not to copy the code display thingy in the future :P



#71828 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 09:20 AM in Ask a Pro

View PostViextraProgramming, on 10 January 2013 - 09:14 AM, said:

Hey, Conlan.... I am going to rewrite this program. It might be messy, and you may not like it, but it will work. Even if you dont like it.. I AM DOIN IT ANYWAY!!!
Okay



#71813 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 09:06 AM in Ask a Pro

View Postcrazyguymgd, on 10 January 2013 - 08:58 AM, said:

think you just need an end after print("Unrecognisable command. Please try again.")
Aha! Thanks. You fixed the "end expected" error! Still having issues with an "Unrecognisable character" error on the same line as my "until" statement.



#71802 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 08:47 AM in Ask a Pro

AHA! I found out how to enter the code into this awesome little box. I've been tinkering around with the code; trying to get the redstone portion done, and now I am faced with a whole new error message that I looked up, but didn't understand... Here it is: :21: 'end' expected (to close 'if' at line 18)
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("Hello, and welcome to Conlan99's automatic miner's\nmining program.")
sleep(1)
print("\nThe automatic miner is starting.\nTo stop the automatic miner, please enter Stop.")
repeat
local input = read()
redstone.setOutput("right",true)
sleep(0.25)
redstone.setOutput("right",false)
sleep(1)
redstone.setOutput("back",true)
sleep(0.25)
redstone.setOutput("back",false)
sleep(0.25)
if input ~= "stop" or input ~= "Stop" or input ~= "exit" or input ~= "Exit" or input ~= "quit" or input ~= "Quit" then
print("Unrecognisable command. Please try again.")
until input == "stop" or input == "Stop" or input == "exit" or input == "Exit" or input == "quit" or input == "Quit" then
textutils.slowPrint("Goodbye.")
sleep(0.25)
os.shutdown()
end



#71801 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 08:42 AM in Ask a Pro

View PostremiX, on 10 January 2013 - 08:14 AM, said:

Instead of checking if it's equal to Quit or quit lower the read string

input = string.lower(read())

if input == "exit" or input == "quit" or input == "stop" then

edit: Shouldn't have copied :P
Shouldn't have copied what? O_o
If you are referring to the code, I would love to know how you managed to get yours into a little white box like that.



#71790 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 08:12 AM in Ask a Pro

View PostViextraProgramming, on 10 January 2013 - 06:26 AM, said:

I GOT IT! I accidentally made you put one extra end. Here is the real code:


term.clear()
term.setCursorPos(1,1)

textutils.slowPrint("Hello, and welcome to Conlan99's automatic miner's\nmining program.")
sleep(1)
print("\nThe automatic miner is starting.\nTo stop the automatic miner, please enter Stop.")
input = read()

if input == "stop" or input == "Stop" or input == "exit" or input == "Exit" or input == "quit" or input == "Quit" then
textutils.slowPrint("Goodbye.")
sleep(0.25)
os.reboot()
else
print("Unrecognizable command.")
end
Thank you so much! My code is finally working as I intended it to. Now I just need to get the redstone functioning... And again, Thanks for the help :D



#71712 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 06:10 AM in Ask a Pro

View PostViextraProgramming, on 10 January 2013 - 05:57 AM, said:

Did you read my updated post? Sorry about that.
Okay, I added empty parenthesis next to os.reboot, and read, I added quotes around every possible exit answer, and ditched the parentheses on them too. I am now met with the error ":16: '<eof>' expected" btw, line 16 is where my "else" statement starts.



#71700 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 06:00 AM in Ask a Pro

View PostViextraProgramming, on 10 January 2013 - 05:57 AM, said:

Did you read my updated post? Sorry about that.
Oh, I missed that. Thanks!



#71696 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 05:55 AM in Ask a Pro

View PostViextraProgramming, on 10 January 2013 - 05:50 AM, said:

You need to put "end" no quotes at the end of your "os.reboot()" and the end of the program.. :-)
Thanks for the tip, but my program still won't start (Same error) :I



#71694 [ERROR] Having a rough start with my first Computercraft program.

Posted by Conlan99 on 10 January 2013 - 05:48 AM in Ask a Pro

Hello. I have recently become very interested in the computercraft mod. I decided to make an automatic miner using both the redpower and computercraft mods. Although I haven't added the code for the miner's functioning yet, I have added some code to start and stop the program and have a bit of text pop up to help the user. Here is my code so far (Prepare for noobishness):



term.clear()
term.setCursorPos(1,1)

textutils.slowPrint("Hello, and welcome to Conlan99's automatic miner's\nmining program.")
sleep(1)
print("\nThe automatic miner is starting.\nTo stop the automatic miner, please enter Stop.")

local input = read

if (input == stop) or (input == Stop) or (input == exit) or (input == Exit) or (input == quit) or (input == Quit) then
textutils.slowprint("Goodbye.")
sleep(0.25)
os.reboot

else
print("This input is not recognised in this program. Please try again.")

^The program ends here

NOTE: My most recent error said "bios:338: [string "Conlan99Miner"] :15: '=' expected. I have no idea what this means

Please note this is my first post on this forum, let alone any forum, so please, if I messed anything up on the post, please tell me.