Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vos.loadApi('apis.lua')
- Peripheral.wrap({ type = 'wireless_modem' })
- Relay.find()
- local active = false
- --[[
- local me = vos.loadApi('me.api')
- while true do
- local count = me.getItemCount(13384, 0)
- print(count)
- local enabled = count < 2048
- print('setting output to ' ..
- tostring(not enabled))
- rs.setOutput('right', not enabled)
- os.sleep(30)
- end
- --]]
- Message.addHandler('tankInfo', function(h, id, msg)
- local tank = msg.contents
- active = tank.amount / tank.capacity * 100 < 90
- print('setting output to ' .. tostring(not active))
- rs.setOutput('right', not active)
- end)
- Event.addHandler('heartbeat', function()
- Relay.send('getTankInfo', {
- name = 'Ethanol'
- })
- end)
- Event.heartbeat(30)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement