Rednet sending doesnt send while using same code but with lua and file #2050
Replies: 2 comments
-
I believe this is a bug in your program(s), rather than something to do with calling from It's quite hard to know quite what's going wrong, without recreating your setup block-for-block. I'd recommend adding lots of One possible cause here is that the first computer will send |
Beta Was this translation helpful? Give feedback.
-
My assumption of your issue is that you aren't waiting for Specifically, I am talking about this chunk here: ido, messoge = rednet.receive()
if messoge == "asem" then
print("recieved")
redstone.setOutput("right", true)
end if Recommendation: Listen for specific messages repetitively, instead of once. For example, --- This function waits until a specific message arrives. Do note that you cannot compare tables received this way!
---@param expected_message any The message to listen for.
local function wait_for_message(expected_message)
print("Waiting for:", expected_message)
repeat
local id, message = rednet.receieve()
until message == expected_message
print("Got:", expected_message)
end Then, in your code, you could do something like so: while true do
wait_for_message("disasem") -- Waits specifically for "disasem".
redstone.setOutput("right", false)
sleep(0.2)
rednet.send(3, "load")
wait_for_message("asem") -- Waits specifically for "asem".
redstone.setOutput("right", true)
end |
Beta Was this translation helpful? Give feedback.
-
Minecraft Version
1.20.1
Version
1.113.1
Details
when i use rednet to send messages between computers to do tasks with the starting computer using the lua command everything works as intended but when i make it a file even with the same code the 3 computer in the series sends the message but the computer receiving the message doesnt receive it although the code is the same link to video https://drive.google.com/file/d/1nwdiP9DqDxCeLzEAJdch5hoTSkd9Am1B/view?usp=sharing
Beta Was this translation helpful? Give feedback.
All reactions