Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getmsg()
- while true do
- d = {}
- event, side, frequency, replyFrequency, message, distance = os.pullEvent("modem_message")
- d["e"] = event
- d["s"] = side
- d["f"] = frequency
- d["rf"] = replyFrequency
- d["m"] = message
- d["d"] = distance
- return d
- end
- end
- function farmon()
- local h = fs.open("open.txt", "r")
- local a = tonumber(h.readLine())
- print("value in fle is: " .. tostring(a))
- h.close()
- if a == 1 then
- return true
- else
- return false
- end
- end
- modem = peripheral.wrap("bottom")
- modem.open(31300)
- while true do
- aw = farmon()
- print("sending")
- modem.transmit(31391,31300,{["awn"] = aw})
- modem.transmit(31392,31300,{["awn"] = aw})
- sleep(0.05)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement