24,527 ARTICLES
ON THIS WIKI

Sortron


Sortron
Sortron

Name Sortron
Source Mod RedPower 2
ID Name Unknown
Type Block
Stackable Yes (64)
Solid Yes
Transparent No
Affected by Gravity No
Emits Light No
Flammable No
Required Tool Unknown

The Sortron is an advanced computer-controlled version of the Sorting Machine. It can be connected to an adjacent inventory or inline in a tube system, allowing you to select what is pulled from it or what it will allow to pass through it respectively. It is controlled from a Redpower computer and requires blutricity to function.

Unlike the Manager, the Sortron can only filter one item type at a time and cannot accept items from its output side to supply an inventory.

Recipe[edit]

GUI Crafting Table.png
Iron Ingot
Diamond
Iron Ingot
Red-Doped Wafer
Sorting Machine (RedPower 2)
Red-Doped Wafer
Iron Ingot
Ribbon Cable
Iron Ingot
Sortron

Forth Words[edit]

A number of Forth words are available to control the Sortron, but to use these you will need to boot your computer using an Extended Forth Disk.

Tube input[edit]

SORTINCOL! / SORTINCOL@[edit]

Sets/gets what color items the Sortron will accept from tubes. Setting this to 0 will accept any color.

> 2 SORTINCOL! (Sortron will only accept orange-colored items)
SORTPAT! / SORTPAT@[edit]

Sets/gets the item hash that needs to be matched for the item to be accepted from tubes (The hash of an item can be found with the SORTSLOT@ word). Only a single item hash can be accepted at a time, however setting this to 0 0 will allow any item to pass.

> 28677 -24831 SORTPAT! ( Only accept sandstone )
SORTMATCH[edit]

Accept a specific number of items that match the patterns given by SORTPAT@ and SORTINCOL@. The number of items to accept is taken from the stack.

> 2 SORTINCOL! 28677 -24831 SORTPAT! 2 SORTMATCH (Sortron will accept 2 orange-colored sandstone)
SORTCOLOR! / SORTCOLOR@[edit]

Sets/gets what color the Sortron will paint items it outputs

> 2 SORTCOLOR! (Sortron will output orange-colored items)

Inventory access[edit]

SORTSLOTS[edit]

Puts the number of slots in the inventory next to the Sortron onto the stack

> SORTSLOTS CR .
   27
SORTPULL[edit]

Pulls items from an inventory slot into the tube network. The slot number to pull is taken from the top of the stack (Slot numbers start at 0)

> 1 0 SORTPULL (Pulls 1 item from slot 0)
SORTSLOT@[edit]

Puts the item hash and item count of an inventory slot onto the stack. The item hash is 2 numbers that uniquely identify the item type (they should not depend on block ids). The slot number to look at is taken from the top of the stack.

> 0 SORTSLOT@ CR .
   S 15852 -23718 1
SORTDMG@[edit]

Puts the damage value of the item last looked at using SORTSLOT@ on the stack

> 0 SORTSLOT@ SORTDMG@ CR .5
SORTDMGMAX@[edit]

Puts the maximum potential damage value of the item last looked at using SORTSLOT@ on the stack

> 0 SORTSLOT@ SORTDMGMAX@ CR .
   250

Low-level functions[edit]

SORTCMD[edit]

A low-level function to interrogate the Sortron. It takes a single value from the stack which corresponds to a Sortron instruction. Arguments and outputs need to be written to the memory after address RP0. More information is available at the Redpower wiki

> 4 RBP! 1 SORTCMD RP0 2 + @ CR . (Print the number of inventory slots in the Sortron at bus id 4)
27
SORTADDR[edit]

A variable containing the bus id of the current Sortron. By default Sortrons have a bus id of 4; if multiple Sortrons are connected to a single CPU you can select between them by changing this variable.

> 4 SORTADDR ! (Set the bus id for sortrons to 4)

> SORTADDR @ CR . (Print the current bus id)
4

Video[edit]