Skip to content

Instantly share code, notes, and snippets.

@adkinss
Last active May 1, 2024 12:01
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • Save adkinss/592d282d82a8cce95a55db6a33aa6736 to your computer and use it in GitHub Desktop.
Save adkinss/592d282d82a8cce95a55db6a33aa6736 to your computer and use it in GitHub Desktop.
Minecolonies + ComputerCraft (CC:Tweaked) + Refined Storage + Advanced Peripherals script to automatically fulfill open work requests
-- RSWarehouse.lua
-- Author: Scott Adkins <adkinss@gmail.com> (Zucanthor)
-- Published: 2021-09-21
--
-- This program monitors work requests for the Minecolonies Warehouse and
-- tries to fulfill requests from the Refined Storage network. If the
-- RS network doesn't have enough items and a crafting pattern exists, a
-- crafting job is scheduled to restock the items in order to fulfill the
-- work request. The script will continuously loop, monitoring for new
-- requests and checking on crafting jobs to fulfill previous requests.
-- The following is required for setup:
-- * 1 ComputerCraft Computer
-- * 1 or more ComputerCraft Monitors (recommend 3x3 monitors)
-- * 1 Advanced Peripheral Colony Integrator
-- * 1 Advanced Peripheral RS Bridge
-- * 1 Chest or other storage container
-- Attach an RS Cable from the RS network to the RS Bridge. Connect the
-- storage container to the Minecolonies Warehouse Hut block. One idea is
-- to set up a second RS network attached to the Warehouse Hut using an
-- External Storage connector and then attach an Importer for that network
-- to the storage container.
-- THINGS YOU CAN CUSTOMIZE IN THIS PROGRAM:
-- Line 59: Specify the side storage container is at.
-- Line 66: Name of log file for storing JSON data of all open requests.
-- Lines 231+: Any items you find that should be manually provided.
-- Line 373: Time in seconds between work order scans.
----------------------------------------------------------------------------
-- INITIALIZATION
----------------------------------------------------------------------------
-- Initialize Monitor
-- A future update may allow for multiple monitors. This would allow one
-- monitor to be used for logging and another to be used for work requests.
local monitor = peripheral.find("monitor")
if not monitor then error("Monitor not found.") end
monitor.setTextScale(0.5)
monitor.clear()
monitor.setCursorPos(1, 1)
monitor.setCursorBlink(false)
print("Monitor initialized.")
-- Initialize RS Bridge
local bridge = peripheral.find("rsBridge")
if not bridge then error("RS Bridge not found.") end
print("RS Bridge initialized.")
-- Initialize Colony Integrator
local colony = peripheral.find("colonyIntegrator")
if not colony then error("Colony Integrator not found.") end
if not colony.isInColony then error("Colony Integrator is not in a colony.") end
print("Colony Integrator initialized.")
-- Point to location of chest or storage container
-- A future update may autodetect where the storage container is and error
-- out if no storage container is found.
local storage = "left"
print("Storage initialized.")
-- Name of log file to capture JSON data from the open requests. The log can
-- be too big to edit within CC, which may require a "pastebin put" if you want
-- to look at it. Logging could be improved to only capture Skipped items,
-- which in turn will make log files smaller and edittable in CC directly.
local logFile = "RSWarehouse.log"
----------------------------------------------------------------------------
-- FUNCTIONS
----------------------------------------------------------------------------
-- Prints to the screen one row after another, scrolling the screen when
-- reaching the bottom. Acts as a normal display where text is printed in
-- a standard way. Long lines are not wrapped and newlines are printed as
-- spaces, both to be addressed in a future update.
-- NOTE: No longer used in this program.
function mPrintScrollable(mon, ...)
w, h = mon.getSize()
x, y = mon.getCursorPos()
-- Blink the cursor like a normal display.
mon.setCursorBlink(true)
-- For multiple strings, append them with a space between each.
for i = 2, #arg do t = t.." "..arg[i] end
mon.write(arg[1])
if y >= h then
mon.scroll(1)
mon.setCursorPos(1, y)
else
mon.setCursorPos(1, y+1)
end
end
-- Prints strings left, centered, or right justified at a specific row and
-- specific foreground/background color.
function mPrintRowJustified(mon, y, pos, text, ...)
w, h = mon.getSize()
fg = mon.getTextColor()
bg = mon.getBackgroundColor()
if pos == "left" then x = 1 end
if pos == "center" then x = math.floor((w - #text) / 2) end
if pos == "right" then x = w - #text end
if #arg > 0 then mon.setTextColor(arg[1]) end
if #arg > 1 then mon.setBackgroundColor(arg[2]) end
mon.setCursorPos(x, y)
mon.write(text)
mon.setTextColor(fg)
mon.setBackgroundColor(bg)
end
-- Utility function that returns true if the provided character is a digit.
-- Yes, this is a hack and there are better ways to do this. Clearly.
function isdigit(c)
if c == "0" then return true end
if c == "1" then return true end
if c == "2" then return true end
if c == "3" then return true end
if c == "4" then return true end
if c == "5" then return true end
if c == "6" then return true end
if c == "7" then return true end
if c == "8" then return true end
if c == "9" then return true end
return false
end
-- Utility function that displays current time and remaining time on timer.
-- For time of day, yellow is day, orange is sunset/sunrise, and red is night.
-- The countdown timer is orange over 15s, yellow under 15s, and red under 5s.
-- At night, the countdown timer is red and shows PAUSED insted of a time.
function displayTimer(mon, t)
now = os.time()
cycle = "day"
cycle_color = colors.orange
if now >= 4 and now < 6 then
cycle = "sunrise"
cycle_color = colors.orange
elseif now >= 6 and now < 18 then
cycle = "day"
cycle_color = colors.yellow
elseif now >= 18 and now < 19.5 then
cycle = "sunset"
cycle_color = colors.orange
elseif now >= 19.5 or now < 5 then
cycle = "night"
cycle_color = colors.red
end
timer_color = colors.orange
if t < 15 then timer_color = colors.yellow end
if t < 5 then timer_color = colors.red end
mPrintRowJustified(mon, 1, "left", string.format("Time: %s [%s] ", textutils.formatTime(now, false), cycle), cycle_color)
if cycle ~= "night" then mPrintRowJustified(mon, 1, "right", string.format(" Remaining: %ss", t), timer_color)
else mPrintRowJustified(mon, 1, "right", " Remaining: PAUSED", colors.red) end
end
-- Scan all open work requests from the Warehouse and attempt to satisfy those
-- requests. Display all activity on the monitor, including time of day and the
-- countdown timer before next scan. This function is not called at night to
-- save on some ticks, as the colonists are in bed anyways. Items in red mean
-- work order can't be satisfied by Refined Storage (lack of pattern or lack of
-- required crafting ingredients). Yellow means order partially filled and a
-- crafting job was scheduled for the rest. Green means order fully filled.
-- Blue means the Player needs to manually fill the work order. This includes
-- equipment (Tools of Class), NBT items like armor, weapons and tools, as well
-- as generic requests ike Compostables, Fuel, Food, Flowers, etc.
function scanWorkRequests(mon, rs, chest)
-- Before we do anything, prep the log file for this scan.
-- The log file is truncated each time this function is called.
file = fs.open(logFile, "w")
print("\nScan starting at", textutils.formatTime(os.time(), false) .. " (" .. os.time() ..").")
-- We want to keep three different lists so that they can be
-- displayed on the monitor in a more intelligent way. The first
-- list is for the Builder requests. The second list is for the
-- non-Builder requests. The third list is for any armor, tools
-- and weapons requested by the colonists.
builder_list = {}
nonbuilder_list = {}
equipment_list = {}
-- Scan RS for all items in its network. Ignore items with NBT data.
-- If a Builder needs any items with NBT data, this function will need
-- to be updated to not ignore those items.
items = rs.listItems()
item_array = {}
for index, item in ipairs(items) do
if not item.nbt then
item_array[item.name] = item.amount
end
end
-- Scan the Warehouse for all open work requests. For each item, try to
-- provide as much as possible from RS, then craft whatever is needed
-- after that. Green means item was provided entirely. Yellow means item
-- is being crafted. Red means item is missing crafting recipe.
workRequests = colony.getRequests()
file.write(textutils.serialize(workRequests))
for w in pairs(workRequests) do
name = workRequests[w].name
item = workRequests[w].items[1].name
target = workRequests[w].target
desc = workRequests[w].desc
needed = workRequests[w].count
provided = 0
target_words = {}
target_length = 0
for word in target:gmatch("%S+") do
table.insert(target_words, word)
target_length = target_length + 1
end
if target_length >= 3 then target_name = target_words[target_length-2] .. " " .. target_words[target_length]
else target_name = target end
target_type = ""
target_count = 1
repeat
if target_type ~= "" then target_type = target_type .. " " end
target_type = target_type .. target_words[target_count]
target_count = target_count + 1
until target_count > target_length - 3
useRS = 1
if string.find(desc, "Tool of class") then useRS = 0 end
if string.find(name, "Hoe") then useRS = 0 end
if string.find(name, "Shovel") then useRS = 0 end
if string.find(name, "Axe") then useRS = 0 end
if string.find(name, "Pickaxe") then useRS = 0 end
if string.find(name, "Bow") then useRS = 0 end
if string.find(name, "Sword") then useRS = 0 end
if string.find(name, "Shield") then useRS = 0 end
if string.find(name, "Helmet") then useRS = 0 end
if string.find(name, "Leather Cap") then useRS = 0 end
if string.find(name, "Chestplate") then useRS = 0 end
if string.find(name, "Tunic") then useRS = 0 end
if string.find(name, "Pants") then useRS = 0 end
if string.find(name, "Leggings") then useRS = 0 end
if string.find(name, "Boots") then useRS = 0 end
if name == "Rallying Banner" then useRS = 0 end --bugged in alpha versions
if name == "Crafter" then useRS = 0 end
if name == "Compostable" then useRS = 0 end
if name == "Fertilizer" then useRS = 0 end
if name == "Flowers" then useRS = 0 end
if name == "Food" then useRS = 0 end
if name == "Fuel" then useRS = 0 end
if name == "Smeltable Ore" then useRS = 0 end
if name == "Stack List" then useRS = 0 end
color = colors.blue
if useRS == 1 then
if item_array[item] then
provided = rs.exportItemToPeripheral({name=item, count=needed}, chest)
end
color = colors.green
if provided < needed then
if rs.isItemCrafting(item) then
color = colors.yellow
print("[Crafting]", item)
else
if rs.craftItem({name=item, count=needed}) then
color = colors.yellow
print("[Scheduled]", needed, "x", item)
else
color = colors.red
print("[Failed]", item)
end
end
end
else
nameString = name .. " [" .. target .. "]"
print("[Skipped]", nameString)
end
if string.find(desc, "of class") then
level = "Any Level"
if string.find(desc, "with maximal level:Leather") then level = "Leather" end
if string.find(desc, "with maximal level:Gold") then level = "Gold" end
if string.find(desc, "with maximal level:Chain") then level = "Chain" end
if string.find(desc, "with maximal level:Wood or Gold") then level = "Wood or Gold" end
if string.find(desc, "with maximal level:Stone") then level = "Stone" end
if string.find(desc, "with maximal level:Iron") then level = "Iron" end
if string.find(desc, "with maximal level:Diamond") then level = "Diamond" end
new_name = level .. " " .. name
if level == "Any Level" then new_name = name .. " of any level" end
new_target = target_type .. " " .. target_name
equipment = { name=new_name, target=new_target, needed=needed, provided=provided, color=color}
table.insert(equipment_list, equipment)
elseif string.find(target, "Builder") then
builder = { name=name, item=item, target=target_name, needed=needed, provided=provided, color=color }
table.insert(builder_list, builder)
else
new_target = target_type .. " " .. target_name
if target_length < 3 then
new_target = target
end
nonbuilder = { name=name, target=new_target, needed=needed, provided=provided, color=color }
table.insert(nonbuilder_list, nonbuilder)
end
end
-- Show the various lists on the attached monitor.
row = 3
mon.clear()
header_shown = 0
for e in pairs(equipment_list) do
equipment = equipment_list[e]
if header_shown == 0 then
mPrintRowJustified(mon, row, "center", "Equipment")
header_shown = 1
row = row + 1
end
text = string.format("%d %s", equipment.needed, equipment.name)
mPrintRowJustified(mon, row, "left", text, equipment.color)
mPrintRowJustified(mon, row, "right", " " .. equipment.target, equipment.color)
row = row + 1
end
header_shown = 0
for b in pairs(builder_list) do
builder = builder_list[b]
if header_shown == 0 then
if row > 1 then row = row + 1 end
mPrintRowJustified(mon, row, "center", "Builder Requests")
header_shown = 1
row = row + 1
end
text = string.format("%d/%s", builder.provided, builder.name)
mPrintRowJustified(mon, row, "left", text, builder.color)
mPrintRowJustified(mon, row, "right", " " .. builder.target, builder.color)
row = row + 1
end
header_shown = 0
for n in pairs(nonbuilder_list) do
nonbuilder = nonbuilder_list[n]
if header_shown == 0 then
if row > 1 then row = row + 1 end
mPrintRowJustified(mon, row, "center", "Nonbuilder Requests")
header_shown = 1
row = row + 1
end
text = string.format("%d %s", nonbuilder.needed, nonbuilder.name)
if isdigit(nonbuilder.name:sub(1,1)) then
text = string.format("%d/%s", nonbuilder.provided, nonbuilder.name)
end
mPrintRowJustified(mon, row, "left", text, nonbuilder.color)
mPrintRowJustified(mon, row, "right", " " .. nonbuilder.target, nonbuilder.color)
row = row + 1
end
if row == 3 then mPrintRowJustified(mon, row, "center", "No Open Requests") end
print("Scan completed at", textutils.formatTime(os.time(), false) .. " (" .. os.time() ..").")
file.close()
end
----------------------------------------------------------------------------
-- MAIN
----------------------------------------------------------------------------
-- Scan for requests periodically. This will catch any updates that were
-- triggered from the previous scan. Right-clicking on the monitor will
-- trigger an immediate scan and reset the timer. Unfortunately, there is
-- no way to capture left-clicks on the monitor.
local time_between_runs = 30
local current_run = time_between_runs
scanWorkRequests(monitor, bridge, storage)
displayTimer(monitor, current_run)
local TIMER = os.startTimer(1)
while true do
local e = {os.pullEvent()}
if e[1] == "timer" and e[2] == TIMER then
now = os.time()
if now >= 5 and now < 19.5 then
current_run = current_run - 1
if current_run <= 0 then
scanWorkRequests(monitor, bridge, storage)
current_run = time_between_runs
end
end
displayTimer(monitor, current_run)
TIMER = os.startTimer(1)
elseif e[1] == "monitor_touch" then
os.cancelTimer(TIMER)
scanWorkRequests(monitor, bridge, storage)
current_run = time_between_runs
displayTimer(monitor, current_run)
TIMER = os.startTimer(1)
end
end
@rayadas007
Copy link

rayadas007 commented Dec 23, 2022

I've set this up in 1.18.2 and the display works to load all the requests, but I'm not having any luck with the Auto Crafting portion. I have the extra storage crafters installed and have tried using the Gold Crafter, and have also tried the standard crafter, but the display shows as blue for a wooden shovel, even though I have the pattern for sticks and the shovel, and have planks already added to the warehouse/grid.

--Update, it turns out the issue was with what was requested, such as a shovel or pick axe, and the options being gold or wood, but once there was only one option for the request, auto crafting works as expected.

@cadexn
Copy link

cadexn commented Jan 12, 2023

To whoever getting the RSWarehouse.lua:259 error, make sure none of your building has minimum stock set. Should be the one causing the bug

@Mortiis87
Copy link

https://www.reddit.com/r/Minecolonies/comments/zqxgm9/warehouse_refined_storage_autocrafting/

I have made a post on the minecolonies subreddit. It shows how I have it working with storage and crafting.

@greene5300
Copy link

I made a video on the setup
https://youtu.be/j2ROhK99t5M

@raulsammelselg
Copy link

https://gist.github.com/adkinss/592d282d82a8cce95a55db6a33aa6736?permalink_comment_id=4434631#gistcomment-4434631

So this didn't help me with that error, managed to figure it out with a lot of effort, so t oeveryone having this issue in the future, make sure that there is a storage next to RS Bridge block!!!

@Chazdedevil
Copy link

Chazdedevil commented Mar 26, 2023

Is there any chance of an updated version that works with 1.15 of ATM 8 as the auto crafting doesn't work anymore and there are serialisation issues.

[edit] modpack version updated recently 1.14 to 1.15

@NintendoFan37
Copy link

NintendoFan37 commented Apr 5, 2023

Hi - I'm using the latest version of ATM8, and it gives the error "Cannot serialize table with repeated entries". Any chance you are able to update the script so this issue does not occue? Thank you <3

Edit: Solved it! Here's how to fix it on your end too!

So, the issue is on Line 203 - CC:Tweaked made it so you have to manually make it so it allows duplicated.
The line currently reads: " file.write(textutils.serialize(workRequests))"

You need to change it to be: "" file.write(textutils.serialize(workRequests, { allow_repetitions = true }))"

For easy access, I've put it on pastebin here: https://pastebin.com/54RUrvQW

Also went ahead and made a fork of it for other edits i might make

@ericsfinck
Copy link

As of the latest update to advanced peripherals, this program will be broken.

Change the argument of isItemCrafting to an item filter table

AP Wiki - Filters

As such, line 264 needs to be changed from

            if rs.isItemCrafting(item) then

to

            if rs.isItemCrafting( { name = item } ) then

@larholl
Copy link

larholl commented Jun 13, 2023

This has been working great until today.

Any thoughts on why I might get a /RSWarehouse.lua:192: bad argument (table expected, got nil)

Line 192 is - for index, item in ipairs(items) do

Error

@elli0t-sillyLilGuy
Copy link

elli0t-sillyLilGuy commented Jun 13, 2023

Hi, I've been having a small problem on my Minecraft server with the integration of RS tools and the MineColonies not working together, it'll load all of the request to the monitors and will give out what is in the new RS system, but when it comes to auto crafting what the MineColonies need that's when " [Failed] ... " is thrown into the computer, I took notes from the video and from this post:
https://www.reddit.com/r/Minecolonies/comments/zqxgm9/warehouse_refined_storage_autocrafting/
to get it working with the monitors, but now I'm running into this issue:
image

the set up:
image

please help me with this issue...

@ericsfinck
Copy link

This has been working great until today.

Any thoughts on why I might get a /RSWarehouse.lua:192: bad argument (table expected, got nil)

Line 192 is - for index, item in ipairs(items) do

Error

See My comment above

As of the latest update to advanced peripherals, this program will be broken.

Change the argument of isItemCrafting to an item filter table

AP Wiki - Filters

As such, line 264 needs to be changed from

            if rs.isItemCrafting(item) then

to

            if rs.isItemCrafting( { name = item } ) then

@bhanuk09
Copy link

bhanuk09 commented Jun 23, 2023

image

Any thoughts on why I might get a /RSWarehouse.lua:206: attempt to index field '1' (a nil value)
line 206:item = workRequests[w].items[1].name

Edit: seems like when item is nil it is failing so i tried adding below. after adding if condition it started working
if workRequests[w].items and workRequests[w].items[1] then
item = workRequests[w].items[1].name
end

image

Please check from your end and let me know if i am wrong

@TheExiled616
Copy link

Hi does anyone know how to fix this error it says cannot serialize with table with repeated entries

@dady172172
Copy link

Hi does anyone know how to fix this error it says cannot serialize with table with repeated entries

Try deleting or commenting out line 204 file.write(textutils.serialize(workRequests))
Had the same problem on 1.19.2 (Direwolf20 pack) this worked for me

@Kessekk
Copy link

Kessekk commented Jul 19, 2023

image

Ran into this issue after doing the above fixes, if there's any idea on how to fix them, please let me know :)

               if rs.isItemCrafting( { name = item } ) then
                    color = colors.yellow
                    print("[Crafting]", item)
                else
                    if rs.craftItem({name=item, count=needed}) then
                        color = colors.yellow
                        print("[Scheduled]", needed, "x", item)
                    else
                        color = colors.red
                        print("[Failed]", item)
                    end
                end
            end

@xp0colipse
Copy link

xp0colipse commented Aug 21, 2023

image
image

Hello everyone! I currently have the program up and running again and working with above fixes on the following:
Modpack - ATM8 1.0.21b
AP Version - AdvancedPeripherals-1.19.2-0.7.29r
ComputerCraft Version - cc-tweaked-1.19.2-1.101.2
Minecolonies Version - minecolonies-1.19.2-1.0.1489-BETA
Refined Storage Version - refinedstorage-1.11.6

The program can be found here "https://pastebin.com/C4RKCU0y"

Run this to override startup so it starts when you load your save " pastebin get C4RKCU0y startup "

@xp0colipse
Copy link

image image

Hello everyone! I currently have the program up and running again and working with above fixes on the following: Modpack - ATM8 1.0.21b AP Version - AdvancedPeripherals-1.19.2-0.7.29r ComputerCraft Version - cc-tweaked-1.19.2-1.101.2 Minecolonies Version - minecolonies-1.19.2-1.0.1489-BETA Refined Storage Version - refinedstorage-1.11.6

The program can be found here "https://pastebin.com/C4RKCU0y"

Run this to override startup so it starts when you load your save " pastebin get C4RKCU0y startup "

This also is confirmed to work in 1.0.25 version of ATM8 without changing anything.

@mariomteixeira
Copy link

image image

Hello everyone! I currently have the program up and running again and working with above fixes on the following: Modpack - ATM8 1.0.21b AP Version - AdvancedPeripherals-1.19.2-0.7.29r ComputerCraft Version - cc-tweaked-1.19.2-1.101.2 Minecolonies Version - minecolonies-1.19.2-1.0.1489-BETA Refined Storage Version - refinedstorage-1.11.6

The program can be found here "https://pastebin.com/C4RKCU0y"

Run this to override startup so it starts when you load your save " pastebin get C4RKCU0y startup "

Which items you've used to make this works ?
I've to do this direct on the Warehouse Block ?

@xp0colipse
Copy link

xp0colipse commented Aug 31, 2023

image image
Hello everyone! I currently have the program up and running again and working with the above fixes on the following: Modpack - ATM8 1.0.21b AP Version - AdvancedPeripherals-1.19.2-0.7.29r ComputerCraft Version - cc-tweaked-1.19.2-1.101.2 Minecolonies Version - minecolonies-1.19.2-1.0.1489-BETA Refined Storage Version - refinedstorage-1.11.6
The program can be found here "https://pastebin.com/C4RKCU0y"
Run this to override startup so it starts when you load your save " pastebin get C4RKCU0y startup "

Which items you've used to make this works? I've to do this directly on the Warehouse Block?

Colony Integrater, RS Bridge, Advanced Computer (with "startup" overridden with previously mentioned command) 9x Advanced Monitors connected with modems and cables from CC (the gray cables)

RS Controller, Grid, and an External Storage (connect this to your warehouse hut block) connect RS bridge to the mentioned RS components with RS cables. You will also want to attach several Crafters so your network can auto-craft and fulfill requests from your colonists.

You must have a colony created before you can successfully run the script. Please read the comments in the program so you can familiarize yourself with the functions and color coding of the displayed test. DO NOT upgrade your warehouse with these components inside the hut. You will have to search for your stuff in the warehouse if you do. To mitigate running into this issue, place the network outside of the hut boundaries and connect the RS network via a network transmitter. This could be in your base or, commonly, placed in any level 5 hut. For example, I like to place this in the Town Hall once it reaches level 5. If you have any questions you can DM me or I also have a discord with pinned messages and mini-tutorials.

Hope this helps!

@Snakegreen88
Copy link

Screenshot 2023-09-01 182040
im trying to connect it to minecolonies stash and tips?

@Xerrass
Copy link

Xerrass commented Oct 8, 2023

image image
Hello everyone! I currently have the program up and running again and working with the above fixes on the following: Modpack - ATM8 1.0.21b AP Version - AdvancedPeripherals-1.19.2-0.7.29r ComputerCraft Version - cc-tweaked-1.19.2-1.101.2 Minecolonies Version - minecolonies-1.19.2-1.0.1489-BETA Refined Storage Version - refinedstorage-1.11.6
The program can be found here "https://pastebin.com/C4RKCU0y"
Run this to override startup so it starts when you load your save " pastebin get C4RKCU0y startup "

Which items you've used to make this works? I've to do this directly on the Warehouse Block?

Colony Integrater, RS Bridge, Advanced Computer (with "startup" overridden with previously mentioned command) 9x Advanced Monitors connected with modems and cables from CC (the gray cables)

RS Controller, Grid, and an External Storage (connect this to your warehouse hut block) connect RS bridge to the mentioned RS components with RS cables. You will also want to attach several Crafters so your network can auto-craft and fulfill requests from your colonists.

You must have a colony created before you can successfully run the script. Please read the comments in the program so you can familiarize yourself with the functions and color coding of the displayed test. DO NOT upgrade your warehouse with these components inside the hut. You will have to search for your stuff in the warehouse if you do. To mitigate running into this issue, place the network outside of the hut boundaries and connect the RS network via a network transmitter. This could be in your base or, commonly, placed in any level 5 hut. For example, I like to place this in the Town Hall once it reaches level 5. If you have any questions you can DM me or I also have a discord with pinned messages and mini-tutorials.

Hope this helps!

where is the mentioned discord at?

@laurad2423
Copy link

Latest update to CC broke some of the args, so color stopped working. Here is a working version of Scott's code with all missing updates.

https://pastebin.com/jrEhpvJ8

@luan122
Copy link

luan122 commented Dec 14, 2023

Correction for item = workRequests[w].items[1].name:

		if #workRequests[w].items < 1 then
			color = colors.red
			nameString = name .. " [" .. workRequests[w].target .. "]"
			print("[ERROR]",nameString)
			item = ""
		else
			item = workRequests[w].items[1].name
		end

@BadMuthaJeffer
Copy link

BadMuthaJeffer commented Dec 14, 2023

Hey, I'm getting an error
/RSWarehouse:219: Here is no colony or you don't have the right permissions
Line 219
workReRequests = colony.getRequests()

Can someone point me in the right direction to sort this please? I have zero knowledge with this.

We're on a ATM 9 server playing version 1.20. 1

Edit: Ignore this I didn't realise the Colony Integrator had to be within the colony boundry

@OhmegaWolf
Copy link

Has anyone been able to get this script working in ATM9? Ive been trying to get an AE Variant going and the issue i keep running into is that it will happily craft the items but for some reason the script doesn't see the items in the AE in order to pull them out and put them in the warehouse

@OhmegaWolf
Copy link

Has anyone been able to get this script working in ATM9? Ive been trying to get an AE Variant going and the issue i keep running into is that it will happily craft the items but for some reason the script doesn't see the items in the AE in order to pull them out and put them in the warehouse

This is the script I used for atm9.

https://pastebin.com/jrEhpvJ8

Thanks - gave that a go and it (modified for AE of course) didnt work unfortunately

@gus3000
Copy link

gus3000 commented Jan 23, 2024

On top of @laurad2423's script (thank you by the way), I had to do the following changes :

  • Connect the storage you're exporting into via a CC network cable, check the name the modem gives you
  • change the following line :
local storage = "right"

to :

local storage = "minecraft:chest_4" --put the name of the storage you're exporting into

@AngelicAdmiral
Copy link

just a passing question, ive been useing this program for awhile and really enjoy it as it makes the minecolony so much easier to use, however today it started thowing this error, anyone got any ideas ?
image

@marcospiber
Copy link

Has anyone been able to get this script working in ATM9? Ive been trying to get an AE Variant going and the issue i keep running into is that it will happily craft the items but for some reason the script doesn't see the items in the AE in order to pull them out and put them in the warehouse

This is the script I used for atm9.

https://pastebin.com/jrEhpvJ8

its working? because for my it didnt works :(

@xp0colipse
Copy link

xp0colipse commented Apr 13, 2024

Has anyone been able to get this script working in ATM9? Ive been trying to get an AE Variant going and the issue i keep running into is that it will happily craft the items but for some reason the script doesn't see the items in the AE in order to pull them out and put them in the warehouse

This is the script I used for atm9.
https://pastebin.com/jrEhpvJ8

its working? because for my it didnt works :(

I was able to just hook it all up and it worked using the script the others have been using ( https://pastebin.com/jrEhpvJ8)
Im using version 2.56, latest ATM9 pack.

2024-04-13_11 00 40

2024-04-13_11 00 48

2024-04-13_11 00 57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment