42 posts
Posted 13 December 2013 - 09:03 AM
How can i get a turtle to read a Gate conditional ?
I wanted to automate quarry and for that i wanted a turtle to wait for "Work Done".
I didn't find a tutorial for the mod.
8543 posts
Posted 13 December 2013 - 10:44 AM
Have you tried playing around with its peripheral methods? Stuff like that isn't usually too hard to figure out from the peripheral method names. Run this in the Lua prompt, replacing "side" with the actual side (like "right"):
textutils.tabulate(peripheral.getMethods("side"))
That should show you a list of methods you can experiment further with.
42 posts
Posted 13 December 2013 - 10:54 AM
Thx ^^
Didn't know there was something like getMethods ^^
Edit: I tried it know but it doesn't show things for MiscPeriphals :(/>
http://pastebin.com/vm9iKAKi Found this in internet but it actually crashes the game
Edited on 13 December 2013 - 10:00 AM
41 posts
Posted 14 December 2013 - 02:15 AM
Every single peripheral implemented by Computercraft itself or an addon has a getMethods() function, so you can create a program which will give you the methods for the peripheral you enter:
write("Peripheral Side: ")
side = read()
print("Listing methods for "..side)
print(textutils.tabulate(peripheral.call(side, "getMethods")))
When you run this you can get the methods for any peripheral including through the use of wired modems.
8543 posts
Posted 14 December 2013 - 02:27 AM
Um, no. It's peripheral.getMethods(side), not peripheral.call(side, "getMethods"). The peripheral.getMethods call is separate, and not in the set of methods available from the peripheral itself, but rather is part of the peripheral API.
41 posts
Posted 14 December 2013 - 02:41 AM
Well I use that technique, I guess both work. peripheral.getMethods is probably best though.
Edited on 14 December 2013 - 01:42 AM
321 posts
Location
Melbourne, Australia
Posted 14 December 2013 - 02:54 AM
Every single peripheral implemented by Computercraft itself or an addon has a getMethods() function, so you can create a program which will give you the methods for the peripheral you enter:
write("Peripheral Side: ")
side = read()
print("Listing methods for "..side)
print(textutils.tabulate(peripheral.call(side, "getMethods")))
When you run this you can get the methods for any peripheral including through the use of wired modems.
(peripheral).getMethods()
is added by OpenPeripherals IIRC
41 posts
Posted 14 December 2013 - 02:57 AM
Thanks for the information, I didn't know it came from OpenPeripheral (I use OpenPeripheral to monitor my machines).
8543 posts
Posted 14 December 2013 - 03:22 AM
OpenPeripheral's silly alternative is called "listMethods". It's best not to get in the habit of using it, since it's the wrong way to get the list of peripheral methods.
42 posts
Posted 14 December 2013 - 05:26 AM
I tried everything of this but the MiscPeriphal stuff isn't being displayed :(/>