Intranet Catprocess
  1. news...
  2. about Blackvoxel
  3. download
  4. manual
  5. videos
  6. about us
  1. PushVoxelTo

    Description

    bool PushVoxelTo(integer Location, integer VoxelType)

    Get a voxel in the robot storage unit and push it through the voxel_input interface of the voxel at the specified location. With this function you can make material transferts between storages/transport systems. You can use this function in the 6 voxels which are directly adjacent. Of course, the destination voxel must support the voxel_input interface : you can test the voxels to ensure they support this capacity with the Look() and GetVoxelProp() functions.  The requested material must be available in the robot's storage. This function can only be used in Voxel_Step().

    Parameters

    VoxelType : The VoxelType code of the material you want to push. The requested material must be available in the robot's storage.

    Location : The position of the receptor voxel in "position code" notation. The receptor voxel must support the voxel_input interface.

    0 =  { 0, 0, 1 } = Front of the robot.
    1 =  { 1, 0, 0 } = Right of the robot.
    2 =  { 0, 0, -1} = Back of the robot.
    3 =  {-1, 0, 0 } = Left of the robot.
    4 =  { 0, 1, 0 } = Above the robot.
    5 =  { 0,-1, 0 } = Under the robot.

    Position Code

    Return Value

    A boolean number. It will be true if the function pushed a voxel successfully. False will be returned the voxel didn't support the voxel_input interface or if the interface refused the voxel for any reason (storage is full, broken light transmission, etc...).

    Example of use

    This example will transfert the content of the robot inventory into storage on top of the robot.

    // Listing #1: Material Transfert

    function Voxel_Step() { local Slot, VoxelType; // Look if voxel on top support the voxel_input interface. if (!GetVoxelProp( Look(4), 1)) { Display("PUT STORAGE ON TOP OF THE ROBOT", 1000, 2 , 0); return; } // Does robot's inventory contains something. Slot = GetFirstUsedSlot(); if (Slot < 0) { Display("PUT SOME VOXELS IN THE ROBOT", 1000, 2 , 0); return; } // Pushing voxels to the storage. VoxelType = GetSlot_Type(Slot); PushVoxelTo(4, VoxelType); }

    See Also

    PullVoxelFrom()
    Look()
    GetVoxelProp()

     
  2. Google+