- 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
-
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.... function main() local running = true local e = nil repeat -- Get the tank information, results are in table format local tInfo = batbox local cap = tonumber(batbox.getCapacity()) local fill = tonumber(batbox.getStored()) -- Output as you want... a very simple way:
- 13 replies
-
- coroutine
- coroutines
- (and 6 more)
-
NOOB TOPIC: Can someone help me run a program off the Internet?
Molinko replied to stgX_'s question in Miscellaneous
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. -
NOOB TOPIC: Can someone help me run a program off the Internet?
Molinko replied to stgX_'s question in Miscellaneous
/../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({...})
-
NOOB TOPIC: Can someone help me run a program off the Internet?
Molinko replied to stgX_'s question in Miscellaneous
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.
-
Are there any tutorials or any documentation for setting up a drone?
Molinko replied to LazyFridge's question in Programming
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. -
Connecting OpenComputers 1.6.2.7 to AE2 rv4-alpha-11
Molinko replied to cracker54's question in Programming
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... -
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, reasonForFailur
-
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
-
operating system StattenOS - Base control system
Molinko replied to Elijahlorden's topic in Programs
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 :).... -
Problem with the server, modem.send() and modem.broadcast
Molinko replied to danielrama30's question in Programming
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 es- 5 replies
-
- modem.send
- issue
-
(and 2 more)
Tagged with:
-
Problem with the server, modem.send() and modem.broadcast
Molinko replied to danielrama30's question in Programming
Please post the formatted server code. Preferably in code tags formatted for lua. I'll take a crack at it.- 5 replies
-
- modem.send
- issue
-
(and 2 more)
Tagged with:
-
What port to relayed linked card message get sent on?
Molinko replied to Elijahlorden's question in Programming
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.
-
Having issues with some code on opencomputers with opensecurity
Molinko replied to Sherlok's question in Programming
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.. 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
-
Look up the function 'load' and or 'loadstring'. I'd post more but I'm on my phone at work
-
https://www.lua.org/pil/2.4.html
-
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)
-
OC PC's (and robots) Crash when idle for a little while
Molinko replied to houseofkraft's topic in OpenComputers
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. -
Tis a really old post.. If you're seeking help on a particular piece of code try making a new topic in Programming/Support