I'm trying to use a computer to turn on my tekkit classic force-field. I want to be able to input activate to turn it on and have it stay on. and later input a diffrent passcode to deactivate it. Any tips or suggestions would be very welcomed and apreciated. Also i need it to automaticly run on startup if possable. Many thanks in advance, I hope to one day concour this Lua beast.
Computer controlled force-field
Started by Tharr, Jan 19 2014 07:53 AM
1 reply to this topic
#1
Posted 19 January 2014 - 07:53 AM
#2
Posted 19 January 2014 - 02:14 PM
Im assuming you can use redstone to controll it, so just use the redstone API for that.
to read user input you can use read()
to read user input you can use read()
redstone.setOutput("back",false)
while true do
local input = read()
if input == "activate" then
redstone.setOutput("back",true)
elseif input == "deactivate" then
redstone.setOutput("back",false)
end
end
To run it on startup, just name the program "startup".
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











