- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
-
Content Count
451 -
Joined
-
Last visited
-
Days Won
35
Posts posted by Molinko
-
-
You're very welcome .
If you find the opencomputers config settings and change 'bufferChanges=true' to 'bufferChanges=false', you won't have to close minecraft every time you want to access a computers filesystem outside of MC.
-
/../Curse/Minecraft/Instances/Custom pack/saves/Alleron Next/opencomputers/d81d5515-0d52-466a-ac35-a5d8e3ba3b7e (<- example filesystem address)
**32-bit UUID is the address of the in game filesystem(computer drive) you want to save on.
-
You are correct. I thought for some reason that was an example you inserted to say ...this model...
The 'answer' var is a string returned from either term.read() or io.read() (excuse my first advice. term.read is probably better...). The line you're looking for is this..
os.execute("print3d /usr/share/models/" .. answer .. ".3dm") -- # string concatenation -- # OR os.execute(table.concat({"print3d ", "/usr/share/models/", answer, ".3dm"})) -- # Using table.concat({...})
-
Open your modded minecraft folder.
Open the relevant ../saves/.. folder.
Open the open computers folder and find the filesystem of the in game computer to place the file on. The filesystem's are listed by the filesytems component uuid.
-
Replace require 'term' with 'io'. You don't use term lib but you are using the io lib. If that's not your issue please post the full code and resulting error please.
-
http://ocdoc.cil.li/tutorial:custom_oses
Check out the "What's available" section in the link for the default environment available at the eeprom level. Remember drone don't have a file system and thus booting open os into them isn't possible( hard to do..).
You won't have access to libs like the event lib. You will have access to raw component libs though.
-
I haven't worked much with AE and OC but I think you'll need an import or export interface on the me bus connected to the adapter with inventory controller. FYI, I'm not sure...
-
2 hours ago, XenizedKitsune said:
(Plus running between two different trees means putting in 'robot.forward()' half a dozen times and that feels so crude...)
What you're looking for is a function. Specifically a 'for' or while loop in a function. Here is a crude one of the former that 'could' be made way better (features n stuff)...
local robot = require 'robot' local function forward( times ) times = times or 1 local success, reason, moves = false, nil, 0 for move = 1, times do success, reason = robot.forward() if not success then break end moves = moves + 1 end return success, moves, reason end -- # USAGE -- # Let's say we're moving 3 forward, on a clear path. forward( 3 ) -- # // true, 3, nil (success, moves, reasonForFailure) -- # Now we try another 3 with and obstruction 2 blocks ahead of the robot. forward( 3 ) -- # // false, 1, "path obstructed... or something like this that component.robot.move(side) returns when it fails"
-
Yes, functions are real... I'm not really sure what you meant by that.. But here's an example anyways..
-- # A named function local function sum( a, b ) return a + b end -- # An 'anonymous' function stored in the named variable 'mul' local mul = function( a, b ) return a * b end local pow -- # forward declaration allows us to reference the caller 'pow' inside of itself. pow = function( a, p ) if not p then -- # return a partial application return function( p2 ) -- # remember the initial number 'a' and take a power of p2 to apply return pow( a, p2 ) end end return a^p end --[[ # local val = pow( 3, 2 ) --> // 9 local f = pow( 3 ) --> // function( p2 ) return 3^p2 end local val2 = f( 2 ) --> // 9 ]]
-
Interesting OS. Small, simple, and to the point. I like it. BTW, what exactly is the point? It seems heavily network oriented as the title suggests... Base Control.. Sounds neat. I'm looking forward to a breakdown of what you intend this to be :)....
-
I believe I see the problem.. You are sleeping past the responses from the server.. Try this out. It has some comments to try and explain...
-- # Setting libraries local component = require("component") local term = require("term") local event = require("event") local modem = component.modem -- # Program code modem.open(111) term.clear() print(">") term.setCursor(2,1) input = io.read() if input == "server.status" then modem.send("address of the server", 123, input) -- # os.sleep(2) // HERE. We sleep beyond the response of the server, thus waiting forever. -- # event.pull is essentially coroutine.yield, which will wait for a loose match of an event id. i.e "modem" will match "modem_message" local _,_,_,_,_,status = event.pull("modem") -- # halt until any modem* event. This, ideally, should be "modem_massege" print("Server status: " .. status) -- we must have seen an event that at least started with the string "modem". else print("Illegal command") end
-
Please post the formatted server code. Preferably in code tags formatted for lua. I'll take a crack at it.
-
The port of the sender presumably.
-
I believe the later version of oc has good support for enderio bundled cable. Also, I believe the delay between setting two colors at once is solved with bundled cable here. Just a thought
-
Not sure if this will solve the delay between calls, but you can try using rs bundled cable and set the output simultaneously..
rsComponent.setBundledOutput(sides.back, colors.green, colors.red)
I don't think you can specify ticks for delay.. Only seconds and a tenth I believe...
-
Replace getOutput with getInput. getOutput checks if the computer itself is outputting a rs signal.
-
It would be easier for myself and others to help if you were a bit more descriptive. Is there an error message? If so which file? Things like that.
-
You could think about loading libraries remotely into memory from a network... As TYKUHN2 said..
On 3/26/2017 at 9:30 AM, TYKUHN2 said:Also "require" is not much more than loading and executing a file.
With an extra step of requesting a file... require could be switched with a call to load or loadfile.
-- # pseudo code.. this might work but isn't tested or even run... function require(module) -- # do some checks n shit.. local file, chunk = nil, "" modem.send(address, port, "get[file] " .. module) while true do local e, la, ra, p, d, ch, status = computer.pullSignal(2) if e == "modem_message" then if status:match("error") then -- # request failed somehow return nil, status elseif st == "chunk" or st == "start" then -- # first and subsequent chunks chunk = chunk .. ch elseif st == "done" then -- # we haz all the chunkz. time to load ze chunkz. file = chunk .. (#ch > 0 and ch or "") break end end end if file then local ret = {pcall(load, file, "=" .. module)} if not ret[1] then return nil, ret[2] end -- # ret[2] here is an error msg ret = {pcall(f)} return ret[1] and ret[2] or nil, ret[2] end return nil, "failed because reasons..." end
-
Look up the function 'load' and or 'loadstring'.
I'd post more but I'm on my phone at work
-
3 hours ago, noahthegame said:
how the hell can i no that \n means newline unless two nice guys is telling me
-
The backslash is above the the enter/return key(qwerty) below the backspace button..
-
From what I understand file:seek is only a method available when reading files with io.open. The char you need it backslash n or '\n'.
You can use the concatenation operator to join 2 strings into one. Looks like this '..' .
I.e.
s = 'line 1\n' .. 'line 2\n' .. 'More lines...'
file:write(s)
-
Could you post the script that is running on one of the computers when this crash happens please. 'Too long without yielding' is an error thrown by OpenOS when a program doesn't yield to let other programs or the shell run.
-
3 hours ago, Ketzak said:
Did you ever get this working? I'm trying to write a similar program. Rather, I'm trying to rewrite a program I wrote in Computer Craft that used coroutines to monitor redstone inputs and send them to a server, while updating outputs based on data from a server. Every way I try to implement it results in the computer eventually failing out for not yielding.
Tis a really old post.. If you're seeking help on a particular piece of code try making a new topic in Programming/Support
Help with events and coroutines
in Programming
Posted
The code looks great.. One problem stands out and that is that your keyChecker coroutine isn't being run. Also, Your main function and the keyCheck function both have a loop that will block one another if keyChecker is run within main. Try this solution out. I believe its what you're going for....