ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: Chaos_02 on Jan 20, 2024, 08:36 PM

Title: Wireless draconic evolution ball script debugging
Post by: Chaos_02 on Jan 20, 2024, 08:36 PM
Hi - I'm kinda new to Lua (I do other programming) and I'm trying to get two Computercraft scripts working together:

this popular draconic evolution energy ball display (https://www.computercraft.info/forums2/index.php?/topic/29508-draconic-evolution-energycore-monitoring-program/) https://pastebin.com/j7zCy3k6 (https://pastebin.com/j7zCy3k6)
together with this wireless peripheral interface library https://github.com/jdf221/CC-WirelessPeripheral (https://github.com/jdf221/CC-WirelessPeripheral)

I've edited the beginning of the display script to require the wpp library and connect to a network:

if not fs.exists(shell.dir() .. "wpp") then
    shell.execute("wget", "https://raw.githubusercontent.com/jdf221/CC-WirelessPeripheral/main/wpp.lua", shell.dir() .. "wpp")
end
local wpp = require("wpp")
wpp.wireless.setDebugMode(true)
wpp.wireless.connect("draconic-ball")


local mon = peripheral.find("monitor")
local core = wpp.peripheral.find("draconic_rf_storage")
local tier = 6
local colorShield = colors.lightBlue
local colorCore = colors.purple
local input, output = wpp.peripheral.find("flux_gate")
local limitTransfer = true

and also changed all occurances of `peripheral` (except the monitor one) with `wpp.peripheral`

however I get

/disk/wpp:401: bad argument (table expected, got nil)
Line 401
  table.insert(foundToReturn, wrapp [ display cut off ]


I have done some research and as far as I can tell from the wpp "debug log" the peripheral.find() functions never make their way over to the "native" computer with the wired modems attached.
I've stitched the logs of both units into images:

Display side https://media.discordapp.net/attachments/1198132515530080276/1198140591394017341/Unbenannt.png?ex=65bdd261&is=65ab5d61&hm=c57da759c1a370dfdcfd0908a3cca61d9450464ce6c38e4396023ac6b06b84e9&=&quality=lossless (https://media.discordapp.net/attachments/1198132515530080276/1198140591394017341/Unbenannt.png?ex=65bdd261&is=65ab5d61&hm=c57da759c1a370dfdcfd0908a3cca61d9450464ce6c38e4396023ac6b06b84e9&=&quality=lossless)

first couple lines of energy ball side
https://media.discordapp.net/attachments/1198132515530080276/1198146356846534666/image.png?ex=65bdd7bf&is=65ab62bf&hm=81509cb024b5bbf971953403aef800a41a01a14a08bd9fb42047da0df5eef1ce&=&quality=lossless (https://media.discordapp.net/attachments/1198132515530080276/1198146356846534666/image.png?ex=65bdd7bf&is=65ab62bf&hm=81509cb024b5bbf971953403aef800a41a01a14a08bd9fb42047da0df5eef1ce&=&quality=lossless)

find("flux_gate") also doesn't work when run natively... find("flow_gate"), however does. The program runs if its not thru wpp tho so that might be another issue...

I'm running draconic evolution 1.18.2-3.0.31.531-universal on Forge
Title: Wireless draconic evolution ball script debugging
Post by: Chaos_02 on Jan 25, 2024, 04:26 AM
With the help of the wpp author jdf221 (https://github.com/jdf221) and fatboychummy (https://github.com/fatboychummy) was not only wpp fixed but also the draconic evo ball script now upgraded to work wirelessly and in newer Minecraft versions (above 1.18.2)!

you can install the new version here (https://pastebin.com/axQJqYvT):
Title: Wireless draconic evolution ball script debugging
Post by: QuickMuffin8782 on Jan 26, 2024, 05:52 AM
Quote from: Chaos_02 on Jan 25, 2024, 04:26 AMWith the help of the wpp author jdf221 (https://github.com/jdf221) and fatboychummy (https://github.com/fatboychummy) was not only wpp fixed but also the draconic evo ball script now upgraded to work wirelessly and in newer Minecraft versions (above 1.18.2)!

you can install the new version here (https://pastebin.com/axQJqYvT):
  • Monitor side:
    pastebin get axQJqYvT startup
  • Peripheral side (opt.):
    pastebin get YvTB6eUy startup (connect this side to the energy ball!)


As Chaos_02 said, it would be best to update it to the latest version. Yours is out of date, thus the error throws.