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

REther get() always returning false

Started by thehufbagel, 13 August 2013 - 02:33 PM
thehufbagel #1
Posted 13 August 2013 - 04:33 PM
Title: REther get() always returning false

I'm trying to have a mob spawner control using the REther peripheral and assign each mob its own frequency, however, when I run peripheral.get() it always returns false (even if I literally just turned it on). I was wondering if this is a bug or I'm doing something wrong.
Here's a sample code: http://pastebin.com/QFihi86k (returns false both times)
If this is a bug, anyone with a workaround (like making two turtles communicate across dimensions) would be great

Nevermind, got it working finally. Don't know how to delete post
Edited on 13 August 2013 - 02:41 PM
Bubba #2
Posted 13 August 2013 - 06:37 PM
Split into new topic.
TheOddByte #3
Posted 14 August 2013 - 08:16 AM
Idk, But this may be the error

transmitter = peripheral.wrap("right")

transmitter.setFreq(1)
transmitter.set(false)
local state = transmitter.get()
print(state)
os.sleep(1)
transmitter.set(true)
transmitter.get() -- You aren't updating the state here
print(state) -- Here it prints the state which haven't been updated from false

So simply change the last 'transmitter.get()' to 'state = transmitter.get()'
Edit: Nevermind.. Saw that you got it to work
Roachy #4
Posted 31 August 2013 - 12:03 AM
C'mon man, support forum rule #1… tell us how you fixed it!

Edit: NM I fixed it.





Just kidding, for those wondering I worked around this by instead going with a computer using a wireless transmitter and receiver as peripherals. I didn't know you could do this or I would have from the beginning. It's not well documented (unsurprisingly) and the only references to this feature that I found were some obscure forums posts and a tiny 3 sentence paragraph at the bottom of a spoiler, which is itself at the bottom of a spoiler in the OP of the Chicken Bones mod forum thread.

It doesn't help those who really want a turtle to perform these functions but if a computer works, all you have to do is place the transmitter/receiver on a side of the computer, wrap it as a peripheral and call its setFreq(freq) and getFreq() methods. From there you can use the Redstone API to send signals to the appropriate side. Works like a charm.