1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-12 18:30:29 +00:00

Merge pull request #329 from Wilma456/pocketequip

Add equip and unequip for Pocket Computers
This commit is contained in:
Daniel Ratcliffe 2017-06-28 22:06:35 +01:00 committed by GitHub
commit 025af6a0a0
4 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,5 @@
equip is a program for Turtles. equip will equip an item from the Turtle's inventory for use as a tool of peripheral.
equip is a program for Turtles and Pocket Computer. equip will equip an item from the Turtle's inventory for use as a tool of peripheral. On a Pocket Computer you don't need to write a side.
ex:
"equip 5 left" will equip the item from slot 5 of the turtle onto the left side of the turtle
"equip" on a Pocket Computer will equip the first item from your inventory.

View File

@ -1,4 +1,5 @@
unequip is a program for Turtles. unequip will remove tools of peripherals from the specified side of the turtle.
unequip is a program for Turtles and Pocket Computers. unequip will remove tools of peripherals from the specified side of the turtle. On a Pocket Computer you don't need to write a side.
ex:
"unequip left" will remove the item on the left side of the turtle
"unequip" on a Pocket Computer will remove the item from the Pocket Computer

View File

@ -0,0 +1,6 @@
local ok, err = pcall( pocket.equipBack )
if not ok then
printError( "Nothing to equip" )
else
print( "Item equipped" )
end

View File

@ -0,0 +1,6 @@
local ok, err = pcall( pocket.unequipBack )
if not ok then
printError( "Nothing to unequip" )
else
print( "Item unequipped" )
end