Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,15 @@ Tests if n1 is greater than or equal to n2. Equivalent to NEEPASM `GTEQ`.
\cat{conversions}
# Type Conversions

## \>STR ( x1 -- s1 )
## >STR ( x1 -- s1 )

Converts the top stack item to a string.

```
123 >STR
```

## \>INT (x1 -- n1 )
## >INT (x1 -- n1 )

Converts the top stack item to an integer. Will cause an error if the conversion will not work.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,15 @@ begin
\cat{conversions}
# 类型转换

## \>STR ( x1 -- s1 )
## >STR ( x1 -- s1 )

将栈顶元素转换为字符串。

```
123 >STR
```

## \>INT ( x1 -- n1 )
## >INT ( x1 -- n1 )

将栈顶元素转换为整型值。无法转换会产生错误。

Expand Down Expand Up @@ -303,19 +303,19 @@ a 2 + ?
[2] 将第三个元素设为123
[3] 打印第三个元素

## ! ( n1 addr -- )
## ! ( n1 地址 -- )

将n1存入所给地址。

## @ ( addr -- n1 )
## @ ( 地址 -- n1 )

读取所给地址处的数据。

## ? ( addr -- )
## ? ( 地址 -- )

打印给定地址处的数据。与`@ .`等价。

## ' ( "词" -- addr )
## ' ( "词" -- 地址 )

查找所给词(以字符串形式给出),将其地址压栈。

Expand All @@ -329,7 +329,7 @@ a 2 + ?
```
[1] 打印词的地址

## EXECUTE ( addr -- )
## EXECUTE ( 地址 -- )

跳转到给定地址处的指令。与NEEPASM的`CALL`等价。

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: router
lookup: neepmeat:item_router, neepmeat:advanced_item_router
---

# Item Sorter

The Item Sorter distributes incoming items to neighbouring pipes. In the GUI, each coloured filter slot corresponds to an output direction.

Items can be inserted with pipes or hoppers.

The advanced version supports more detailed filters.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ This is a simple block breaker powered by a motor.

# Usage

Blocks are broken by the rapid and violent extension of the armature. When powered with a motor, the armature is gradually retracted. If a valid block is in front of the breaker, the armature will extend.
Blocks are broken by the rapid and violent extension of the armature. When powered with a motor, the armature is gradually retracted. If a valid block is in front of the breaker, the armature will extend.

Through unknown means the machine collects dropped items and ejects them from the back face.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ id: feeding_trough

The Feeding Trough allows nearby livestock to eat, encouraging them to reproduce. It has a radius of five blocks and must be filled with Animal Feed to operate.

## Usage

A trough can be filled with Animal Feed via fluid pipes. Items such as wheat and potatoes can be inserted by right-clicking or with pipes.

Each breed takes 13500d of fluid. This is equivalent to two inserted feed items, or 1/2 a feed item processed into animal feed with a Mixer.

## Motors

If a Motor is facing it and running, animals will breed at regular intervals. The time between feedings varies from 5s to 60s depending on the output power of the motor.

\graph{neepmeat:feeding_trough}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ id: actuators
- Implanter: The only actuator capable of performing surgery on entities.
- Robotic Arm: Can perform most manufacture instructions quickly but with a limited range. Requires a motor.
- Pipe Driver: Allows a PLC to make requests in an item pipe network
- Builder: Allows a PLC to place and break blocks.

\image[width=854,height=480,scale=0.6]{neepmeat:guide/images/plc_actuators.png}
\centering{Left to right: Implanter, Robotic Arm and a Pipe Driver.}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
id: builder
lookup: neepmeat:builder
---

# Builder

The Builder is a robot that can place and break blocks, controllable by a PLC. It has a base station, which gives access to its inventory and shows its currently selected slot.

## Usage

There are a number of operations that can control a Builder:

- BPLACE
- BBREAK
- SELSLOT
- SELITEM

## Inventory

Any items dropped from blocks that a Builder breaks will go directly into its inventory.

Before it can place a block, a Builder needs to know what item it should place.

With the `SELSLOT` and `SELITEM` operations, an inventory slot or a specific item can be selected.

`SELSLOT` takes an integer from the stack and tells the Builder to use items in that inventory slot.

`SELITEM` takes a string and tells the Builder to only use items whose IDs match the string.

## Example 1

This example shows the use of `BPLACE`, `BBREAK`, `SELSLOT` and `SELITEM`.

```
# Select the Builder at coordinates (1, 2, 3)
robot @(1 2 3)

# Select the first slot
0 selslot

# Place a block
@(2, 2, 3) .bplace

# Break a block
@(2, 2, 3) .bbreak

# Select an item
selitem "minecraft:dirt"

# The pattern string can also be read from the stack:
"minecraft:dirt" .selitem -

# Place a dirt block
@(2, 2, 3) .bplace
```

## Example 2

This example shows how to fill a cuboid area with dirt. It uses the `AREA3` instruction to iterate through a cuboid area.

The `AREA3` operation calls an execution address for each block within an area defined by two corner positions. The first argument it takes is the execution address. The second and third arguments are corner positions.

```
selitem "minecraft:dirt"

# Create a callback word
# It consumes a world target, and returns nothing.
: callback ( pos -- )
bplace
# Discard the result of BPLACE
drop
;

# Grab the execution address of callback
"callback" '

# First corner
@(0 0 0)

# Second corner
@(10 10 10)
area3
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Workbenches allow items and entities to be modified by a PLC via an actuator.
- Display Plate (item)
- Pedestal (item)
- Surgery Platform (entity)
-

Not all instructions require workbenches. Some operate on normal item or fluid inventories.

\image[width=854,height=480,scale=0.6]{neepmeat:guide/images/plc_workbenches.png}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
id: thord_data_types
---

# Data Types in THORD

The PLC's stack can hold various different data types. Some data types can be converted into other ones with special words.

## INT

Represents an integer, such as 0, 1, or -1. Also used for booleans, where -1 represents TRUE and 0 represents FALSE.

Conversion words:

- `>STR` (converts to string)

Common operators:

```
# Add and subtract
1 1 + # Gives 2
1 1 - # Gives 0

# Multiply and divide
2 10 * # Gives 20
10 5 / # Gives 2
```

## STRING

Represents a sequence of characters, such as "hello", or "how are you".

Conversion words:

- `>INT` (converts to int, will error if the string does not look like an int)

Mathematical operators:

```
# Add (concatenate)
"Hello " "there." + # Gives "Hello there."
```

## WORLD_TARGET

Represents a world target consisting of coordinates and a direction.

A few instructions (such as `BPLACE` and `BBREAK` can take world targets from the stack. Most instructions that interact with the world do not.

Conversion words:

- `>STR` (converts to string)

Mathematical operators:

```
# Multiply and divide by integer
@(1 2 3) 10 * # Gives @(10 20 30)

# Add and subtract
@(1 2 3) @(10 10 10) + # Gives @(11 12 13)
```

## ADDRESS

Conversion words:

- `>STR` (converts to string)


Mathematical operators:

- Same as INT.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ id: thord_variables

# Variables

Variables can be created with the `VARIABLE` word.
In THORD, a variable is data that is stored inside the PLC's *heap memory*. Variables are different to values stored on the stack. They can be used for longer-term data storage, and to reduce the amount of stack manipulation necessary.

A variable can be created with the `VARIABLE` word.

```
# Create a variable called 'count'
variable count
```

Stating a variable's name puts its address on the stack. This can be taken as an argument by any word.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ id: word_definition

# Defining THORD Words

Words are the equivalent of functions. Most character sequences form a valid word name.
Words in THORD are the equivalent of functions in other languages. Most character sequences form a valid word name.

A word definition starts with ':' followed by the word's name. The definition is terminated with a ';'.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@
{"id": "assault_drill", "contents": [
{"type": "text", "text": "Assault Drill\n", "bold": true},
{"type": "text", "text": "The Assault Drill is a drill rated for offensive use. It continuously damages entities with a range of one block. \n"},
{"type": "text", "text": "The drill runs on Transient Ichor. To refuel, right-click on a container of Transient Ichor or use a bottler. This item can also be enchanted to increase its damage output."}
{"type": "text", "text": "The drill runs on metabolic substrate. To refuel, right-click on a container of Reconstituted Food, Animal Feed or Liquid Meat. Food can also be inserted with a Bottler. This item can also be enchanted to increase its damage output."}
]},

{"id": "halberd", "contents": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
{"type": "page", "id": "thord", "icon": "neepmeat:plc", "text": "THORD"},
{"type": "page", "id": "thord_stack", "icon": "neepmeat:plc", "text": "The Stack"},
{"type": "page", "id": "word_definition", "icon": "neepmeat:plc", "text": "Defining Words"},
{"type": "page", "id": "thord_data_types", "icon": "neepmeat:plc", "text": "Data Types"},
{"type": "page", "id": "thord_constructs", "icon": "neepmeat:plc", "text": "Flow-Control Constructs"},
{"type": "page", "id": "thord_variables", "icon": "neepmeat:plc", "text": "Variables"},
{"type": "page", "id": "thord_booleans", "icon": "neepmeat:plc", "text": "Booleans"},
Expand All @@ -119,7 +120,8 @@
{"type": "page", "id": "actuators", "icon": "neepmeat:robotic_arm", "text": "Actuators"},
{"type": "page", "id": "program_cabinet", "icon": "neepmeat:program_card", "text": "Program Disks"},
{"type": "page", "id": "implants", "icon": "neepmeat:pineal_eye", "text": "Implants", "lookup": ["neepmeat:upgrade_manager", "neepmeat:pineal_eye", "neepmeat:extra_mouth", "neepmeat:extra_knees", "neepmeat:lung_extensions"]},
{"type": "page", "id": "tool_organism", "icon": "neepmeat:living_tool_implant", "text": "Tool Organism"}
{"type": "page", "id": "tool_organism", "icon": "neepmeat:living_tool_implant", "text": "Tool Organism"},
{"type": "page", "id": "builder", "icon": "neepmeat:builder", "text": "Builder" }
]},
{"type": "menu", "id": "neepbus", "icon": "neepmeat:data_cable", "text": "NEEPBus", "entries": [
{"type": "page", "id": "neepbus", "icon": "neepmeat:data_cable", "text": "NEEPBus", "lookup": ["neepmeat:data_cable"] },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: router
lookup: neepmeat:item_router, neepmeat:advanced_item_router
---

# 物品分拣器

物品分拣器能将收到的物品分散到相邻的管道中去。分拣器GUI内的每个有色过滤槽都各自对应一个输出方向。

物品可通过管道和漏斗送入。

高级版本的分拣器支持更细致的过滤器。
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ lookup: neepmeat:breaker

# 使用方法

破坏器依靠衔铁快速而猛烈的弹出来破坏方块。使用发动机驱动可缓慢缩回衔铁。破坏器前存在有效方块时衔铁即会弹出。
破坏器依靠衔铁快速而猛烈的弹出来破坏方块。使用发动机驱动可缓慢缩回衔铁。破坏器前存在有效方块时衔铁即会弹出。

由于某些未知设计,破坏器会收集掉落的物品,并向后方主动弹出。
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ id: feeding_trough

饲料槽会向周围的家畜分配食物,催动它们繁殖。其工作半径为5格,运作时必须装入动物饲料。

## 使用方法

饲料槽接受流体管道供应的动物饲料。小麦、马铃薯等物品可用管道送入,也可手动右击放入。

每次繁殖都需消耗13500d的流体,等价于放入2份饲料物品,或在混合机内处理1/2份饲料物品的产物。

## 发动机

接上发动机后,动物两次繁殖行为的间隔时长即会固定。此间隔可为5s到60s,具体由发动机的输出功率决定。

\graph{neepmeat:feeding_trough}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ id: actuators
- 植入器:唯一能对实体执行手术的操作机构。
- 机械臂:可高速执行大多数加工指令,但其范围有限。需外接发动机。
- 管道驱动器:允许PLC向物品管道网络发送请求。
- 建造机器人:允许PLC放置和破坏方块。

\image[width=854,height=480,scale=0.6]{neepmeat:guide/images/plc_actuators.png}
\centering{左至右:植入器、机械臂、管道驱动器。}
Loading
Loading