Skip to content

Documentation for the Pull Request "Computer Craft integration for Packager and Stock Ticker" #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
542c8bd
Added documentation for the first CC + Create: Logistics integration PR
BirbIrl Mar 3, 2025
d3ffbd9
fixed broken links
BirbIrl Mar 3, 2025
f0680fe
editing the main branch so i can host a preview of the docs, check th…
BirbIrl Mar 4, 2025
2463ed3
sync with pr, mention the packager change
BirbIrl Mar 6, 2025
33a0030
Merge remote-tracking branch 'refs/remotes/origin/main'
BirbIrl Mar 6, 2025
d3b37e7
Merge branch 'Creators-of-Create:main' into pull-request
BirbIrl Mar 6, 2025
7eeaf52
Merge branch 'Creators-of-Create:main' into main
BirbIrl Mar 6, 2025
24ea743
sync with pr, mention the packager change
BirbIrl Mar 6, 2025
6d03dbf
First attempt at updating the wiki
BirbIrl Mar 8, 2025
e3fe938
fixed table-cloth not having a thingamajig
BirbIrl Mar 9, 2025
042e961
fixed table-cloth not having a thingamajig
BirbIrl Mar 9, 2025
d46e49e
First attempt at updating the wiki
BirbIrl Mar 8, 2025
878bc07
fix silly example code
BirbIrl Mar 9, 2025
d6b94d0
fix silly example code
BirbIrl Mar 9, 2025
82385d5
mentioned u can turn the tablecloth back into it's normal function
BirbIrl Mar 10, 2025
a872d9e
mentioned u can turn the tablecloth back into it's normal function
BirbIrl Mar 10, 2025
bdb2e15
tablecloth mention jank
BirbIrl Mar 10, 2025
c702486
tablecloth mention jank
BirbIrl Mar 10, 2025
dd4d922
update info about getPackageItems/Address
BirbIrl Mar 13, 2025
3bab2c8
update info about getPackageItems/Address
BirbIrl Mar 13, 2025
bbdefb8
undo a messed up rebase
BirbIrl Apr 29, 2025
1959ca3
Merge branch 'main' into pull-request
BirbIrl Apr 29, 2025
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
1 change: 1 addition & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import developers from "./sidebars/developers";
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Create Wiki",
base: "/wiki/",
description: "Building Tools and Aesthetic Technology",

cleanUrls: true,
Expand Down
33 changes: 33 additions & 0 deletions .vitepress/sidebars/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,39 @@ export default {
text: "Create's Computercraft Integration",
collapsed: true,
items: [
{
text: "Logistics",
items: [
{
text: "Packager",
link: "/users/cc-tweaked-integration/logistics/packager",
},
{
text: "Re-Packager",
link: "/users/cc-tweaked-integration/logistics/repackager",
},
{
text: "Stock Ticker",
link: "/users/cc-tweaked-integration/logistics/stock-ticker",
},
{
text: "Redstone Requester",
link: "/users/cc-tweaked-integration/logistics/redstone-requester",
},
{
text: "Table Cloth",
link: "/users/cc-tweaked-integration/logistics/table-cloth",
},
{
text: "Package Frogport",
link: "/users/cc-tweaked-integration/logistics/package-frogport",
},
{
text: "Postbox",
link: "/users/cc-tweaked-integration/logistics/postbox",
}
],
},
{
text: "Trains",
items: [
Expand Down
30 changes: 30 additions & 0 deletions users/cc-tweaked-integration/logistics/package-frogport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
| Method | Description |
| -------------------------------------- | ------------------------------------------------------------ |
| [`getAddress()`](#getAddress) | Sets the Frogport's address |
| [`setAddress([address])`](#setAddress) | Sets the Frogport's address |

---


### `getAddress()` {#getAddress}

Gets the Frogport's address.

**Returns**

- `string` With the address currently in use.

---

### `setAddress([address])` {#setAddress}

Sets the Frogport's address to the given variable.

If the address arg is nil, it'll unset the address.

**Parameters**

- _address?:_ `string = nil` Will grab packages addressed to `address`. Unsets if address is `nil`.


---
131 changes: 131 additions & 0 deletions users/cc-tweaked-integration/logistics/packager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
| Method | Description |
| -------------------------------------- | ------------------------------------------------------------ |
| [`getAddress()`](#getAddress) | Sets the packager's address |
| [`setAddress([address])`](#setAddress) | Sets the packager's address |
| [`getItemCount()`](#getItemCount) | Counts the number of items in the connected inventory |
| [`list()`](#list) | Lists all items in the connected inventory |
| [`listDetailed()`](#listDetailed) | Lists all items in the connected inventory with details (slower) |
| [`makePackage()`](#makePackage) | Makes a package |
| [`getPackageItems()`](#getPackageItems) | Checks the contents of the currently held package |

---


### `getAddress()` {#getAddress}

Gets the Packager's address.

**Returns**

- `string` With the address currently in use.

---

### `setAddress([address])` {#setAddress}

Sets the Packager's address to the given variable until it tries to make a package with no computer attached, at which point it forgets about it and goes back to normal behavior.
If you want to programatically assign it an address every time, it's a good idea to put .setAddress in a startup.lua file, so it applies the address you want on chunkload.

If the address arg is nil, it'll go back to the default sign-based behavior again.

**Parameters**

- _address?:_ `string = nil` Force every package to be addressed to `address`. Goes back to default if address is `nil`.

---

### `getItemCount()` {#getItemCount}

Counts the number of items in the connected inventory.

**Returns**

- `number` The number of items in the connected inventory.

---

### `list()` {#list}

Lists basic information about all items in the connected inventory.

**Returns**

- `table` with basic item information like:
```lua
{
{
name = "minecraft:apple",
count = 1,
},
{
name = "minecraft:stick",
count = 1,
},
}
```

---


### `listDetailed()` {#listDetailed}

Lists detailed information about all items in the connected inventory.

**Returns**

- `table` with detailed item information like:
```lua
{
count = 1,
itemGroups = {
{
id = "minecraft:food_and_drinks",
displayName = "Food & Drinks",
},
},
tags = {
[ "c:foods/fruit" ] = true,
[ "c:animal_foods" ] = true,
[ "minecraft:horse_food" ] = true,
[ "c:foods" ] = true,
},
name = "minecraft:apple",
maxCount = 64,
displayName = "Apple",
},
{
enchantments = {
{
level = 2,
name = "minecraft:knockback",
displayName = "Knockback II",
},
},
name = "minecraft:stick",
itemGroups = {},
tags = {
[ "c:rods/wooden" ] = true,
[ "c:rods" ] = true,
},
count = 1,
maxCount = 64,
displayName = "Stick",
},
}
```

---

### `makePackage()` {#makePackage}

Activates the packager like if it was powered by redstone. It operates by the same rule as a button press, but unlike a redstone signal, returns a value on if it actually succeeded at making a package.

**Returns**
- `boolean` whether a new package was made successfuly.

---

### `getPackageItems()` {#getPackageItems}

**Returns**
- `table` with detailed item information or `nil` if there's no package.
30 changes: 30 additions & 0 deletions users/cc-tweaked-integration/logistics/postbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
| Method | Description |
| -------------------------------------- | ------------------------------------------------------------ |
| [`getAddress()`](#getAddress) | Sets the Postbox's address |
| [`setAddress([address])`](#setAddress) | Sets the Postbox's address |

---


### `getAddress()` {#getAddress}

Gets the Postbox's address.

**Returns**

- `string` With the address currently in use.

---

### `setAddress([address])` {#setAddress}

Sets the Postbox's address to the given variable.

If the address arg is nil, it'll unset the address.

**Parameters**

- _address?:_ `string = nil` Will receive packages addressed to `address`. Unsets if address is `nil`.


---
88 changes: 88 additions & 0 deletions users/cc-tweaked-integration/logistics/redstone-requester.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
| Method | Description |
| -------------------------------------- | ------------------------------------------------------------ |
| [`getAddress()`](#getAddress) | Sets the Redstone Requester's address |
| [`setAddress([address])`](#setAddress) | Sets the Redstone Requester's address |
| [`getConfiguration()`](#getConfiguration) | Gets the packager's configuration |
| [`configure([{[name = string], [count = number]}...])`](#configure) | Sets the packager's configuration |
| [`request()`](#request) | Requests a package for the network |

---


### `getAddress()` {#getAddress}

Gets the Redstone Requester's address.

**Returns**

- `string` With the address currently in use.

---

### `setAddress([address])` {#setAddress}

Sets the Redstone Requester's address to the given variable.

If the address arg is nil, it'll unset the address.

**Parameters**

- _address?:_ `string = nil` Addresses requested packages to `address`. Unsets if address is `nil`.


---

### `getConfiguration()` {#getConfiguration}

Gets the Redstone Requester's configuration.

**Returns**

- `table` Table of itemDetails.

---

### `configure([{[name = string], [count = number]}]...)` {#configure}

Sets the packagers configuration, the same one as the one available in the GUI.
- Each argument represents a slot of the configuration and is a table of the item `name`, like `create:wrench` or `apple` and the `count`, between `1` and `256`.
- nil argument or a table with an unspecified `name` equates to an empty slot.
- Unspecified `count` equates to `1`


**Parameters**

- _item:_ `table` Table of `name = string` and `count = number`.

**Usage**
```lua
redstoneRequester = peripheral.find("Create_RedstoneRequester")
redstoneRequester.configure(
{ name = "minecraft:diamond", count = nil }, -- defaults to 1
-- "diamond", -- this would error
{ name = "minecraft:diamond", count = "yay" }, -- defaults to 1
{ name = "diamond", count = 1 }, -- skipping "minecraft:" works for vanilla items
{ name = "minecraft:air" }, -- sets an empty slot
{ name = "minecraft:stick" },
nil, -- also sets an empty slot
{}, -- also also sets an empty slot
{ name = "minecraft:stick" },
-- not providing args at the end also sets an empty slot
)
redstoneRequester.setAddress("crafter")
redstoneRequester.request()
```
Will request a package that crafts into a Diamond Pickaxe when provided to properly set up auto-crafters.

While:
```lua
stockTicker.configure()
```
will clear the configuration.

---

### `request()` {#request}

Requests for a package in the network using the Redstone Requester's configuration.

53 changes: 53 additions & 0 deletions users/cc-tweaked-integration/logistics/repackager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
| Method | Description |
| -------------------------------------- | ------------------------------------------------------------ |
| [`getAddress()`](#getAddress) | Sets the Re-Packager's address |
| [`setAddress([address])`](#setAddress) | Sets the Re-Packager's address |
| [`makePackage()`](#makePackage) | Makes a package |
| [`getPackageItems()`](#getPackageItems) | Checks the contents of the currently held package |
| [`getPackageAddress()`](#getPackageAddress) | Checks the address of the currently held package |

---

### `getAddress()` {#getAddress}

Gets the Re-Packager's address.

**Returns**

- `string` With the address currently in use.

---

### `setAddress([address])` {#setAddress}

Sets the Re-Packager's address to the given variable until it tries to make a package with no computer attached, at which point it forgets about it and goes back to normal behavior.
If you want to programatically assign it an address every time, it's a good idea to put .setAddress in a startup.lua file, so it applies the address you want on chunkload.

If the address arg is nil, it'll go back to the default sign-based behavior again.

**Parameters**

- _address?:_ `string = nil` Force every package to be addressed to `address`. Goes back to default if address is `nil`.

---

### `makePackage()` {#makePackage}

Activates the Re-Packager like if it was powered by redstone. It operates by the same rule as a button press, but unlike a redstone signal, returns a value on if it actually succeeded at making a package.

**Returns**
- `boolean` whether a new package was made successfuly.

---

### `getPackageItems()` {#getPackageItems}

**Returns**
- `table` with detailed item information or `nil` if there's no package.

---

### `getPackageAddress()` {#getPackageAddress}

**Returns**
- `string` with the package's address or `nil` if there's no package.
Loading