Specified Slot Number Was Invalid

The Turtle API is used to work with your Turtles.

  1. Re: 'Specified slot number was invalid' when open OracleConnection. Jul 31, 2007 01:10 PM tlstanlet LINK.
  2. For example, in account #1 contact A has phone number “(xxx) xxx-xxxx”, but in account #2 contact A has phone number “(xxx)xxx-xxxx” without the space after the parenthesis. And for some reason, whenever I try to change either account to either add the space, or remove the space, it doesn’t have any effect.
  3. What do you mean 'single type only'. I've had it occur on occasion with other troops. Namely giants, but it seems to consistently occur with ice golems.

Key

Color Turtles that can perform this
White All
Green Crafty
Yellow Mining, Felling, Digging, Farming
Red Any tool

Currently in testing - FreeNAS 11.2-U4 IBM x3550 M4 2x Xeon E5-2650 2GHz 8 cores 192Gb RAM HBA1: M1215 crossflashed to LSI 9300-8i IT firmware HBA2: LSI 9201-16e.

API

Return Method name Description Min version
boolean successturtle.craft(number quantity)Craft items using ingredients anywhere in the turtle's inventory and place results in the active slot. If a quantity is specified, it will craft only up to that many items, otherwise, it will craft as many of the items as possible.1.4
boolean successturtle.forward()Try to move the turtle forward?
boolean successturtle.back()Try to move the turtle backward?
boolean successturtle.up()Try to move the turtle up?
boolean successturtle.down()Try to move the turtle down?
boolean successturtle.turnLeft()Turn the turtle left?
boolean successturtle.turnRight()Turn the turtle right?
boolean successturtle.select(number slotNum)Make the turtle select slot slotNum (1 is top left, 16 (9 in 1.33 and earlier) is bottom right)?
number slotturtle.getSelectedSlot()Indicates the currently selected inventory slot 1.6
number countturtle.getItemCount([number slotNum])Counts how many items are in the currently selected slot or, if specified, slotNum slot?
number countturtle.getItemSpace([number slotNum])Counts how many remaining items you need to fill the stack in the currently selected slot or, if specified, slotNum slot?
table dataturtle.getItemDetail([number slotNum])Returns the ID string, count and damage values of currently selected slot or, if specified, slotNum slot1.64
boolean successturtle.equipLeft()Attempts to equip an item in the current slot to the turtle's left side, switching the previously equipped item back into the inventory1.6
boolean successturtle.equipRight()Attempts to equip an item in the current slot to the turtle's right side, switching the previously equipped item back into the inventory1.6
boolean successturtle.attack([string toolSide])Attacks in front of the turtle. 1.4
boolean successturtle.attackUp([string toolSide])Attacks above the turtle. 1.4
boolean successturtle.attackDown([string toolSide])Attacks under the turtle. 1.4
boolean successturtle.dig([string toolSide])Breaks the block in front. With hoe: tills the dirt in front of it.?
boolean successturtle.digUp([string toolSide])Breaks the block above.?
boolean successturtle.digDown([string toolSide])Breaks the block below. With hoe: tills the dirt beneath the space below it.?
boolean successturtle.place([string signText])Places a block of the selected slot in front. Engrave signText on signs if provided. Collects water or lava if the currently selected slot is an empty bucket. 1.4
boolean successturtle.placeUp()Places a block of the selected slot above. Collects water or lava if the currently selected slot is an empty bucket.?
boolean successturtle.placeDown()Places a block of the selected slot below. Collects water or lava if the currently selected slot is an empty bucket.?
boolean resultturtle.detect()Detects if there is a block in front. Does not detect mobs.?
boolean resultturtle.detectUp()Detects if there is a block above?
boolean resultturtle.detectDown()Detects if there is a block below?
boolean success, table data/string error messageturtle.inspect()Returns the ID string and metadata of the block in front of the Turtle1.64
boolean success, table data/string error messageturtle.inspectUp()Returns the ID string and metadata of the block above the Turtle1.64
boolean success, table data/string error messageturtle.inspectDown()Returns the ID string and metadata of the block below the Turtle1.64
boolean resultturtle.compare()Detects if the block in front is the same as the one in the currently selected slot1.31
boolean resultturtle.compareUp()Detects if the block above is the same as the one in the currently selected slot?
boolean resultturtle.compareDown()Detects if the block below is the same as the one in the currently selected slot?
boolean resultturtle.compareTo(number slot)Compare the current selected slot and the given slot to see if the items are the same. Returns true if they are the same, false if not. 1.4
boolean successturtle.drop([number count])Drops all items in the selected slot, or specified, drops count items.
[>= 1.4 only:] If there is a inventory on the side (i.e in front of the turtle) it will try to place into the inventory, returning false if the inventory is full.
?
boolean successturtle.dropUp([number count])Drops all items in the selected slot, or specified, drops count items.
[>= 1.4 only:] If there is a inventory on the side (i.e above the turtle) it will try to place into the inventory, returning false if the inventory is full.
1.4
boolean successturtle.dropDown([number count])Drops all items in the selected slot, or specified, drops count items.
[>= 1.4 only:] If there is a inventory on the side (i.e below the turtle) it will try to place into the inventory, returning false if the inventory is full. If above a furnace, will place item in the top slot.
1.4
boolean successturtle.suck([number amount])Picks up an item stack of any number, from the ground or an inventory in front of the turtle, then places it in the selected slot. If the turtle can't pick up the item, the function returns false. amount parameter requires ComputerCraft 1.6 or later. 1.4
boolean successturtle.suckUp([number amount])Picks up an item stack of any number, from the ground or an inventory above the turtle, then places it in the selected slot. If the turtle can't pick up the item, the function returns false. amount parameter requires ComputerCraft 1.6 or later. 1.4
boolean successturtle.suckDown([number amount])Picks up an item stack of any number, from the ground or an inventory below the turtle, then places it in the selected slot. If the turtle can't pick up the item, the function returns false. amount parameter requires ComputerCraft 1.6 or later. 1.4
boolean successturtle.refuel([number quantity])If the current selected slot contains a fuel item, it will consume it to give the turtle the ability to move.
Added in 1.4 and is only needed in needfuel mode. If the current slot doesn't contain a fuel item, it returns false. Fuel values for different items can be found at Turtle.refuel#Fuel_Values. If a quantity is specified, it will refuel only up to that many items, otherwise, it will consume all the items in the slot.
1.4
number fuelturtle.getFuelLevel()Returns the current fuel level of the turtle, this is the number of blocks the turtle can move.
If turtleNeedFuel = 0 then it returns 'unlimited'.
1.4
number fuelturtle.getFuelLimit()Returns the maximum amount of fuel a turtle can store - by default, 20,000 for regular turtles, 100,000 for advanced.
If turtleNeedFuel = 0 then it returns 'unlimited'.
1.6
boolean successturtle.transferTo(number slot [, number quantity])Transfers quantity items from the selected slot to slot. If quantity isn't specified, will attempt to transfer everything in the selected slot to slot. 1.45
Retrieved from 'http://www.computercraft.info/wiki/index.php?title=Turtle_(API)&oldid=7474'
slot {methods}R Documentation

The Slots in an Object from a Formal Class

Description

These functions return or set information about the individual slotsin an object.

Usage

Specified Slot Number Was Invalid

Arguments

object

An object from a formally defined class.

name

The name of the slot. The operatortakes a fixed name, which can be unquoted if it is syntactically aname in the language. A slot name can be any non-empty string, butif the name is not made up of letters, numbers, and ., itneeds to be quoted (by backticks or single or double quotes).

In the case of the slot function, name can be anyexpression that evaluates to a valid slot in the class definition.Generally, the only reason to use the functional form rather thanthe simpler operator is because the slot name has to be computed.

value

A new value for the named slot. The value must bevalid for this slot in this object's class.

check

In the replacement version of slot, a flag. IfTRUE, check the assigned value for validityas the value of this slot. User's code should not set this toFALSE in normal use, since the resulting object can be invalid.

x

either the name of a class (as character string), or a classdefinition. If given an argument that is neither a character stringnor a class definition, slotNames (only) uses class(x)instead.

Details

The definition of the class specifies all slots directly andindirectly defined for that class. Each slot has a name and anassociated class. Extracting a slot returns an object from thatclass. Setting a slot first coerces the value to the specified slotand then stores it.

Unlike general attributes, slots are not partially matched, and askingfor (or trying to set) a slot with an invalid name for that classgenerates an error.

The @ extraction operator and slotfunction themselves do no checking against the class definition,simply matching the name in the object itself.The replacement forms do check (except for slot in the casecheck=FALSE). So long as slots are set without cheating, theextracted slots will be valid.

Be aware that there are two ways to cheat, both to be avoided butwith no guarantees. The obvious way is to assign a slot withcheck=FALSE. Also, slots in R are implemented asattributes, for the sake of some back compatibility. The currentimplementation does not prevent attributes being assigned, viaattr<-, and such assignments are not checked forlegitimate slot names.

Note that the '@' operators for extraction and replacement areprimitive and actually reside in the base package.

The replacement versions of '@' and slot() differ inthe computations done to coerce the right side of the assignment tothe declared class of the slot. Both verify that the value providedis from a subclass of the declared slot class. The slot()version will go on to call the coerce method if there is one, ineffect doing the computation as(value, slotClass, strict = FALSE). The '@' version just verifies the relation,leaving any coerce to be done later (e.g., when a relevant method isdispatched).

In most uses the result is equivalent, and the '@' versionsaves an extra function call, but if empirical evidence shows that aconversion is needed, either call as() before the replacementor use the replacement version of slot().

Value

The '@' operator and the slot function extract orreplace the formally defined slots for the object.

Functions slotNames and getSlots return respectively thenames of the slots and the classes associated with the slots in thespecified class definition. Except for its extended interpretation ofx (above), slotNames(x) is just names(getSlots(x)).

References

Chambers, John M. (2008)Software for Data Analysis: Programming with RSpringer. (For the R version.)

Chambers, John M. (1998)Programming with DataSpringer (For the original S4 version.)

See Also

Specified Slot Number Was Invalid May

@,Classes_Details,Methods_Details,getClass,names.

Specified Slot Number Was Invalid Due

Examples