Difference between revisions of "Turtle.getSelectedSlot"
From ComputerCraft Wiki
(Created page) |
Bomb Bloke (Talk | contribs) |
||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
{{lowercase}} | {{lowercase}} | ||
| + | {{Function | ||
| + | |name=turtle.getSelectedSlot | ||
| + | |api=turtle | ||
| + | |returns=A number-type indicating the currently selected slot. | ||
| + | |addon=ComputerCraft | ||
| + | |desc=Added by version 1.6 of ComputerCraft, this command returns the currently selected inventory slot. In builds prior this value must be tracked manually by the scripter.<br><br> | ||
| + | |||
| + | See also: [[Turtle.getFuelLevel|turtle.select()]] | ||
| + | |examples= | ||
| + | {{Example | ||
| + | |desc=Checks to see if the current inventory slot contains items. | ||
| + | |code= if turtle.getItemCount( turtle.getSelectedSlot() ) > 0 then | ||
| + | print("I have items in my selected slot.") | ||
| + | else | ||
| + | print("I'm out of items in my selected slot.") | ||
| + | end | ||
| + | |output=Whether or not the currently selected slot contains items. | ||
| + | }} | ||
| + | }} | ||
| + | |||
| + | [[Category:API_Functions]] | ||
Revision as of 01:23, 29 March 2014
| Added by version 1.6 of ComputerCraft, this command returns the currently selected inventory slot. In builds prior this value must be tracked manually by the scripter. See also: turtle.select() | |
| Syntax | turtle.getSelectedSlot() |
| Returns | A number-type indicating the currently selected slot. |
| Part of | ComputerCraft |
| API | turtle |