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

Magnet Turtle Tutorial (OpenBlocks)

Started by DavEdward, 24 April 2014 - 05:54 PM
DavEdward #1
Posted 24 April 2014 - 07:54 PM
I've been looking at the 'magnet turtle' which is created by having OpenBlocks & OpenPeripherials installed.
It looks awesome and there's only one youtube video of it in action with no explaination how it works.

You can use the 'docs' command for a GetMethods on the peripheral on the turtle, but there's otherwise no instructions how to use it.

Could someone possibly put together a basic tutorial and/or simple sample scripts on how to make use of the magnet trutle?
I can see it having many uses as it's like giving a turtle a gravity gun. It can lift and move blocks and entities at a range!

Thanks in advance.
theoriginalbit #2
Posted 25 April 2014 - 03:34 AM
using the docs and the getMethods, you'll find that there's 8 methods, all of which are pretty self-explanatory…

activate — turns on the magnet
deactivate — turns off the magnet
toggle — grab/release entity under magnet
setTarget — args: x, y, z — sets the target for the magnet
getPosition — gets the Turtle's position
isAboveEntity — is the magnet above a grab-able entity
isGrabbing — does the magnet have hold of anything
distance — the distance to the magnet