Advertisement
Guest User

startup

a guest
Nov 21st, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. local outputstate = true
  2. local inputstate = 1
  3.  
  4. while true do
  5.   inputstate = redstone.getAnalogInput("back")
  6.  
  7.   if outputstate == true then
  8.     if inputstate <= 1 then
  9.       outputstate=false
  10.     else
  11.       print ("Discharging, power at "..inputstate)
  12.     end
  13.   else
  14.     if inputstate >=14 then
  15.       outputstate=true
  16.     else
  17.       print ("Charging, power at "..inputstate)
  18.     end
  19.   end
  20.  
  21.   redstone.setOutput("left",outputstate)
  22.   os.sleep(2)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement