- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
-
Content Count
451 -
Joined
-
Last visited
-
Days Won
35
Everything posted by Molinko
-
@Izaya that magic bees info is actually interesting, thx.
-
Lua is single threaded. Meaning that only one chunck of code can ever run at a time. Coroutines are considered co-operative in that they yield to allow others to compute before they themselves finish. The idea is that we can do a little work we need right now and do it quickly, then yield so others can do the same, hence co-operative. Threads are fancy coroutines, but they are still limited to cooperation, so they must yield if you wish to begin another. Use term.read or io.read or os.sleep.... etc.
-
I believe this is actually by design so that OC(particularly robots) isn't considered too 'OP'
-
I haven't tested but I believe the file descriptor has a file position. After the call to :read("*all") you're at the end of the file and thus nil is returned.
-
local c = require("component") local computer = require("computer") local internet = require("internet") local f = io.open("test.txt", "wb") local imax = 0 local xmax = 75 local ymax = 180 local zmax = 87 local TIMEOUT = 5 -- in seconds local link = "https://raw.githubusercontent.com/LordNocturnus/sf-" local folder = "/master/" local pos = 0 for i = 0, imax do for xb = pos, xmax do for yb = 0, ymax do for zb = 0, zmax do print(xb, yb, zb) local file = xb .. "-" .. yb .. "-" .. zb .. ".mb3d" local url = link .. i .. folder .. file local status,
-
Functions cannot* be sent over a modem. Only primitive types like strings, numbers or booleans can be sent raw. Tables can be serialized(turned into a string), but the same rules apply. Just send a command as a string or number that the drone will use as a command to call computer.shutdown on it's own.
-
you're going to have to be more specific.
-
just type the command install with the oppm disk in a floppy drive. You will be prompted for installation, type y and press enter.
-
If you're trying to use the *same terminal window on two screens at once it can be tricky to do unless you know OpenOS as well as Payonel does. However, if you just want to be able you run one program on a secondary screen and be able to use a shell or run a program on another screen , then you can check out this thread I answered before. I think it might be helpful. similar question
-
Debugging drones can be difficult but the analyzer will help you get an error message from crashed programs on microcontrollers. Seeing the code and where you say it crashes.. I'd say that indexing the supposed table `v` caused the error. Indexing being `v.name` or `v.x`. I suppose if v.x or v.z or v.y are nil then drone.move will likely throw an error. But it's hard to know without more info. Get that analyzer data and come back. Hell, just wrap the whole code in pcall and collect any errors. local d= component.proxy(component.list("drone")()) local m= component.proxy(component.list(
-
The linked card is one of the most expensive components next to the geolyzer when it comes to energy. Coroutines are actually really efficient because all other forms i.e loops are a "busy" waiting and thus consume power running functions, evaluating... os.sleep is essentially coroutines.yield. As for remote booting you should see the doc on modem.setWakeMessage
-
local component = require("component") local event = require("event") local m = component.modem m.open(1) repeat print("Hi") -- # seconds, event name local cmd = select(6, event.pull(1, "modem_message")) until cmd == "stop" https://ocdoc.cil.li/api:event
-
Hot damn asie, I think you win coolest shit on the forums with this one...
-
I think I need you to ask your question again.. I thought you needed the loop to stop on a "modem_message" event, but I guess you're really trying to stop a loop when a key is pressed?
-
local component = require("component") local event = require("event") local m = component.modem -- # make local too m.open(1) -- # 001 ?? repeat -- # run in the loop to repeat reception of 'cmd' local cmd = select(6, event.pull("modem_message")) -- # this is cleaner until cmd == "stop"
-
I'm running MC 1.12.2 with Computronics meant for 1.12.1 and although it works* I also cannot retrieve any player information from the radar. So I wouldn't call it a bug because I'm in the wrong version... but it's prob a bug...
-
Need the full error of current code and a copy of the all the current code to help you bud...
-
Last line. stop should be "stop"
-
I totally forgot about fishing... I'll hop on in a bit and give this a shot :3 -- Nope. I've tried several times but the robot never actually casts the fishing line. You can get robot.used to return true on the rod when its successful but even then you never see a fishing line nor any fish
-
What's the best way tell a drone to pause in a sequence of movements?
Molinko replied to PHOBOSS98's question in Programming
What you want is code that will "block" further execution until some condition is met. Because drone.move is non-blocking(pain in the ass if you ask me :p) we have to write a function to wait until the drone is finished moving. function waitUntil(freq, predicate) -- # wait 'freq' amount of time until 'predicate' returns true repeat computer.pullSignal(freq) until predicate() end Can then apply it to your code like so.. local r=component.proxy(component.list("radar")()) local m=component.proxy(component.list("modem")()) local d=component.proxy(component.list("drone")()) d.setLig -
Do radars from computronics have blind spots?
Molinko replied to PHOBOSS98's question in Programming
Post any code you believe should be working. I'll take a look and give it a test. Most likely not the component. -
So I did some testing and I think what your approach is misunderstood. Once a Tunnel is placed into a Relay it cannot be addressed (as a component). It effectively becomes a part of the "physical" network layer. A better approach would be to place a Tunnel into a Relay on the "master" computer network (via some cable. the master has a modem inside). Your robot should have a wireless modem. And the third piece is a "Network extender". A "Network extender" consists of a Power Distributor component connected via cable to two Relay components (these must not touch each other nor can both dire
-
Okay, so i worked something up for you. These two scripts should get you started. If you need something better you'll have to build it yourself :p Add these files to /home/, /home/bin/, or /usr/bin/. Whichever you prefer. tmsp.lua "term swap" local component = require "component" local term = require "term" local args, opts = require("shell").parse(...) local USAGE = [[ Usage: $cmd [q, m, f, --gpu, --screen] [screen_address] $cmd -mf --screen=27f include motd, flush screen $cmd -qf 27f --gpu=38a quite mode, flush ]] if not term.isAvailable() then os.exit() end if no
-
It is possible but mirroring in the precise sense is a bit tricky. If you just want to run a program on a screen and still have a shell in the remote terminal that's not that difficult. What are you trying to achieve? Do you really need mirroring? Or do you just want to be able to run more than one program at a time?