i have made some code to play around with the modem stuff but for some reason the modem_message event always returns 0 also im am running one of the scripts on a microcontroller and i am running minecraft version 1.7.10
code of the microcontroller:
local rs = component.proxy(component.list("redstone")())
local modem = component.proxy(component.list(modem)())
local identity = 1
a ={}
d = "id:"
f = tostring(identity)
a[1] = d
a[2] = f
modem.broadcast(1234, "id:1 is online")
while true do
computer.pullSignal(0.5)
end
code of the not microcontroller:
local component = require('component')
local event = require('event')
local modem = component.modem
modem.open(1234)
while true do
local _, _, from, port, message = event.pull("modem_message")
print(message)
os.sleep(0.1)
end
obviously both are connected with wires and the file with the modem.open is executed befor starting the microcontroller
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
i have made some code to play around with the modem stuff but for some reason the modem_message event always returns 0 also im am running one of the scripts on a microcontroller and i am running minecraft version 1.7.10
code of the microcontroller:
local rs = component.proxy(component.list("redstone")())
local modem = component.proxy(component.list(modem)())
local identity = 1
a ={}
d = "id:"
f = tostring(identity)
a[1] = d
a[2] = f
modem.broadcast(1234, "id:1 is online")
while true do
computer.pullSignal(0.5)
end
code of the not microcontroller:
local component = require('component')
local event = require('event')
local modem = component.modem
modem.open(1234)
while true do
local _, _, from, port, message = event.pull("modem_message")
print(message)
os.sleep(0.1)
end
obviously both are connected with wires and the file with the modem.open is executed befor starting the microcontroller
Link to post
Share on other sites