4 posts
Posted 28 February 2013 - 09:32 PM
New to trying to use CC for things and i figure its easier than trying to figure out the logic stuff. But i have no clue how to program.
Extremely basic setup as you can see. Input signal from redstone wire is in the back, down on the right and up on the left.
What i would like is a code to bring the door down ( 4 pulses to the motor ) hold for say 30 seconds then bring the door back up. ( 4 more ) And all this with only one button press topside.
8543 posts
Posted 01 March 2013 - 06:45 AM
Split into new topic.
This section of the forums is for help fixing your existing code, not for asking people to code for you.
4 posts
Posted 01 March 2013 - 09:03 AM
were would i post? in my mine ask a pro was logically sound. lol
1511 posts
Location
Pennsylvania
Posted 01 March 2013 - 09:39 AM
Post here, your code, and we will solve any problem you encounter. We will not just GIVE you code since that would technically be OURS and not YOURS (Intellectual property) Plain and simple, post the erroring code and we will do out best to help you solve it. If you have no code, then you better get typing.
8543 posts
Posted 01 March 2013 - 11:17 AM
It's not an intellectual property issue at all. It's a forum section purpose issue.
Moved to General.
It's not an intellectual property issue at all. It's a forum section purpose issue.
Moved to General.
1619 posts
Posted 01 March 2013 - 01:06 PM
Are you sure that's computercraft? It looks kinda like an RP2 computer, but it may just be your texture pack.
We won't write you code. Learn Lua yourself:
http://www.computercraft.info/wiki/
4 posts
Posted 01 March 2013 - 01:45 PM
local function getredstoneinput()
os.pullevent('redstone)
if rs.getinput('back') == true then
shell.run('redpulse','left','4','.75')
sleep(30)
shell.run('redpulse','right','4','.75')
end
return true
end
while true do
parallel.waitforany(getredstoneinput)
end
what i got from looking at other programs. when i enter the program name i get an error. something about an unrecognized symbol on line three. I dont really understand so im basically tweaking what i can see to fit my setup.
2151 posts
Location
Auckland, New Zealand
Posted 01 March 2013 - 02:35 PM
local function getredstoneinput()
os.pullevent('redstone)
if rs.getinput('back') == true then
shell.run('redpulse','left','4','.75')
sleep(30)
shell.run('redpulse','right','4','.75')
end
return true
end
while true do
parallel.waitforany(getredstoneinput)
end
what i got from looking at other programs. when i enter the program name i get an error. something about an unrecognized symbol on line three. I dont really understand so im basically tweaking what i can see to fit my setup.
A few quick things,
on line 2 you are missing an apostrophe, change it to:
os.pullevent('redstone')
Also, on line 3 and 11, Lua is cases sensitive, change them to:
(also, the '== true' should not be needed)
if rs.getInput('back') then
and
parallel.waitForAny(getredstoneinput)
1619 posts
Posted 01 March 2013 - 03:07 PM
local function getredstoneinput()
os.pullevent('redstone)
if rs.getinput('back') == true then
shell.run('redpulse','left','4','.75')
sleep(30)
shell.run('redpulse','right','4','.75')
end
return true
end
while true do
parallel.waitforany(getredstoneinput)
end
what i got from looking at other programs. when i enter the program name i get an error. something about an unrecognized symbol on line three. I dont really understand so im basically tweaking what i can see to fit my setup.
Please use
and
tags. Also, why would you use parallel for one function?
7508 posts
Location
Australia
Posted 01 March 2013 - 03:12 PM
We won't write you code. Learn Lua yourself:
http://www.computercraft.info/wiki/
The PIL is a much, much, much better learning resource than the wiki, the wiki isn't always correct and/or have the best practices, the API section is only good for ComputerCraft related… Here is a link to the PIL
http://www.lua.org/pil/contents.html
1619 posts
Posted 01 March 2013 - 03:23 PM
We won't write you code. Learn Lua yourself:
http://www.computercraft.info/wiki/
The PIL is a much, much, much better learning resource than the wiki, the wiki isn't always correct and/or have the best practices, the API section is only good for ComputerCraft related… Here is a link to the PIL
http://www.lua.org/pil/contents.html
I agree, I simply linked to the wiki as it has documentation for the redstone API, and even door lock tutorials.
4 posts
Posted 02 March 2013 - 01:44 PM
i cleaned it up a bit still getting the error Bios:206: [string "irondoor"] :3: unexpected symbol
and is there a way to get the program to run automatically. my server restarts every 2 hours.
2151 posts
Location
Auckland, New Zealand
Posted 02 March 2013 - 01:53 PM
i cleaned it up a bit still getting the error Bios:206: [string "irondoor"] :3: unexpected symbol
and is there a way to get the program to run automatically. my server restarts every 2 hours.
Ok, please tell us the new code. As for getting to start automatically, try renaming it to 'startup', that should fix it.