5 posts
Posted 03 September 2012 - 02:27 AM
Hey i need some help with a program so that i can activate and deactivate some redstone stuff
I would like it to be a program were it there are multiple options
example:
.forcefield
.quarry
and when you chose it asks how long in seconds you want to keep it on or preferably an on or off option…
thank-you
90 posts
Location
that's no moon...
Posted 03 September 2012 - 06:32 AM
--------------------------------------------------
local function timer()
print("For run the quarry enter 'RunQ'")
print("For run the forcefield enter 'RunF'")
local input = read()
term.clear() term.setCursorPos(1,1)
print("Enter working time")
local tim = read()
term.clear() term.setCursorPos(1,1)
---|
if input == "RunQ" then rs.setBundledOutput("back", 1) end
if input == "RunF" then rs.setBundledOutput("back", 2) end
---|
sleep(tim)
rs.setBundledOutput("back", 0)
end
--------------------------------------------------
local function start()
print("For run the quarry enter 'RunQ'")
print("For run the forcefield enter 'RunF'")
local input = read()
term.clear() term.setCursorPos(1,1)
---|
if input == "RunQ" then rs.setBundledOutput("back", 1) end
if input == "RunF" then rs.setBundledOutput("back", 2) end
---|
print("For stopping the job enter 'stop'")
local s = read()
if s == "stop" then rs.setBundledOutput("back", 0) end
end
--------------------------------------------------
local function option()
print("For launch with timer enter 'LTim'")
print("For launch without timer enter 'LnoTim'")
local opt = read()
term.clear() term.setCursorPos(1,1)
---|
if opt == "LTim" then timer() end
if opt == "LnoTim" then start() end
---|
end
--------------------------------------------------
term.clear() term.setCursorPos(1,1)
option()
--------------------------------------------------
5 posts
Posted 03 September 2012 - 08:02 AM
thankyou so much!!!