This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Blade2277's profile picture

Lava pump

Started by Blade2277, 16 April 2016 - 11:32 PM
Blade2277 #1
Posted 17 April 2016 - 01:32 AM
Hello. I am trying to make a wireless detector in tekkit lite to see if my nether pumps are activated. i am having trouble getting the signal to transmit, however. Could someone go over my code and see if there is any mistakes? Thanks.
Receiving end:

rednet.open ("top")
rednet.receive()
end
os.pullEvent(modem.message)
if param4 == ("1") true then
print ("LAVA PUMPS ACTIVE")
else
print ("LAVA PUMPS DEACTIVATED/MISSING")
end

Broadcasting end:

rednet.open ("left")
if redstone.getInput ("bottom") == true then
rednet.broadcast (1)
end
The_Cat #2
Posted 17 April 2016 - 10:31 AM
What are the errors you are getting? (what lines do they occur on?)
From what I can see:
You have a random 'end'. (are you giving us all the code?)
You are using a rednet.receive() and os.pullEvent(). They can both be used to receive messages from another computer and they both return values. (Click for rednet.receive wiki Click for os.pullEvent() wiki)
os.pullEvent(modem.message) should have quotes in it: os.pullEvent("modem.message") (look at os.pullEvent() wiki)
You are also missing a 'param4' variable which is not declared (I presume it is meant to be returned my the os.pullEvent("modem.message")) (look at os.pullEvent() wiki)

If you have any questions, ask.
Edited on 17 April 2016 - 08:33 AM
KingofGamesYami #3
Posted 17 April 2016 - 03:19 PM
Also, modem.message isn't an event name. "modem_message" is.