Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1, 1)
- -- Load API
- os.loadAPI("re")
- if not re then
- error( "Redstone Event Extension API not loaded!" )
- end
- --[[ === MAIN LOOP === ]]
- while true do
- local event, param1, param2 = re.pullEvent()
- if event == "redstone" then
- write( event..", "..param1..", " )
- if param1 == "vanilla" then
- for sSide, bChanged in pairs( param2 ) do
- write( "{ "..sSide.." = "..tostring( bChanged ).." }" )
- end
- end
- if param1 == "bundled_cable" then
- local newValue = 1
- local oldValue = 2
- for sSide, tChanged in pairs( param2 ) do
- write( "{ "..sSide.." = { "..tostring( tChanged[newValue] )..", "..tostring( tChanged[oldValue] ).." } }" )
- end
- end
- write( "\n" )
- end
- if event == "char" and string.lower( param1 ) == "e" then break end -- Pressing 'e' will exit the program.
- end
- -- Cleanup
- os.unloadAPI( re )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement