turtle.getItemCount

Get the number of items in a slot. It will use the current selected slot, if slot is not specified.

ExampleGet the item count
Get the item count of the currently selected slot and print it.
Code
<nowiki>
print(turtle.getItemCount())
  </nowiki>
Output
5

turtle.getItemCount
Function
Syntax
turtle.getItemCount(
  • slot? : number
)

Returns number count
API turtle
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.