I'm playing on the yogscast complete pack and trying to use the magnet turtle for a small project but i can't understand how to use it, i've got all the commands but everytime i try to run them it returns a nil value, any help would be appreciated. the commands i've tried running are magnet.activate(left) and peripheral.activate(left) and also with left in quotes.
please help, and please don't link me to this topic, i've already read it...
Magnet Turtle
Started by THE_FACELESS_ONE, Oct 01 2014 11:09 PM
4 replies to this topic
#1
Posted 01 October 2014 - 11:09 PM
#2
Posted 02 October 2014 - 02:36 AM
First you'd want to wrap the peripheral, then you'd want to activate it:
You may find this guide useful when dealing with peripherals.
local magnet = peripheral.wrap("left") -- Assuming the magnet is to the turtle's left.
if magnet.isAboveEntity() then
print("I should be above something I can grab. Grabbing....")
magnet.activate()
if magnet.isGrabbing() then
print("Grabbed!")
else
print("Failure...")
end
else
print("I'm not above something I can grab.")
end
You may find this guide useful when dealing with peripherals.
#3
Posted 02 October 2014 - 04:55 PM
Thanks for replying, i understand now how to run the commands but i can't seem to understand how they work... could you please explain them for me?
i have this list:
i used the "getMethods" command but i don't understand what anything actually does :/ i can't really use the magnet at the moment...
i have this list:
i used the "getMethods" command but i don't understand what anything actually does :/ i can't really use the magnet at the moment...
#4
Posted 02 October 2014 - 04:59 PM
i should probably be specific and point out that i want to use it to move a block...
#5
Posted 03 October 2014 - 01:58 AM
I've not used the magnet myself.
My assumption is that you move the turtle directly over the block you want, activate the magnet, move the turtle over where you want the block to go, then deactivate the magnet. It sounds like the magnet can pick up blocks which are a few spaces below it.
It may be the case that the magnet doesn't work on blocks, but instead only on dropped items, or on mobs. Dunno.
OpenPeripheral's documentation can be accessed by running a script with the side of the peripheral you want to query:
For specific info on a function, you'd then enter:
If you're lucky, this'll give you more info about the activate/deactivate functions than pointless stuff such as "activates/deactivates the magnet". Try it and see, anyway.
My assumption is that you move the turtle directly over the block you want, activate the magnet, move the turtle over where you want the block to go, then deactivate the magnet. It sounds like the magnet can pick up blocks which are a few spaces below it.
It may be the case that the magnet doesn't work on blocks, but instead only on dropped items, or on mobs. Dunno.
OpenPeripheral's documentation can be accessed by running a script with the side of the peripheral you want to query:
openp/docs <side>
For specific info on a function, you'd then enter:
openp/docs <side> <functionName>
If you're lucky, this'll give you more info about the activate/deactivate functions than pointless stuff such as "activates/deactivates the magnet". Try it and see, anyway.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











