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

REther's get() always returns false?

Started by Aeroxima, 15 April 2013 - 10:55 PM
Aeroxima #1
Posted 16 April 2013 - 12:55 AM
I'm not sure if there's a bug or I'm doing something wrong?


m = peripheral.wrap("right")  -- REther peripheral

m.setFreq(1)
m.get()  -- returns false
m.set(true)
m.get()  -- still returns false

I was trying to make a simple toggle, but my code always turns it on because get() is always false:


local m = peripheral.wrap("right")
m.setFreq(1)
if m.get() == true then
  m.set(false)
  print "false'd"
else m.set(true)
  print "true'd"
end
Sariaz #2
Posted 16 April 2013 - 03:12 PM
Running you program and experimenting with REther turtles i discovered a glitch with the peripheral. when u set the turtles frequency it sets that frequencies state to false with no way not to that I can tell only way around this i can think of is using the wireless transmitters and receivers with redstone or have program run then wait for key press or the such and toggle then and save state to file so that when loads new know what it was. Posting bug to mod owner may not fix since REther may be one of the things being removed to to rights stuff.
Sariaz #3
Posted 17 April 2013 - 04:55 PM
Aeroxima seeing a post on some other forum post it said that you can use the wireless transmitters as peripherals may want to look into this as a work around.