- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
Gorzoid
Members-
Content Count
111 -
Joined
-
Last visited
-
Days Won
22
Everything posted by Gorzoid
-
getBundledOutput does not return a table, sadly there is no way to get the entire bundled output in 1 call. However that doesn't mean this is impossible, it's actually way easier than you think, you are just using the alternate version of setBundledOutput. According to the docs the first version of setBundledOutput takes side, color, value. So you really don't need functions to do this, but if you're still unsure here is the fixed version. local component = require("component") local rs = component.redstone function addcol(sid, col) rs.setBundledOutput(sid, col, 15) end function
-
Prevent user from terminating program? via Ctrl-alt-c or alternatives?
Gorzoid replied to ackley14's question in Programming
My method mimics the general method used in computercraft which would allow easier conversion, many of the oc users used cc before hand or still do so it isn't crazy to believe op might be converting old cc code. pcall method does however fit the op's description while also seeming like less of a hackish method. But just saying pcall will fix it may confuse newer users. It's different to the first method as instead of blocking the interrupt, it just catches it and returns early, causing some of the code not to run. The method of overriding an os function is not ideal and I'd rather t -
Yep whoops thanks for that
-
Go watch tutorials before screaming for help on forums. ??? Profit
-
As in locate any player anywhere in the map? You can't, atleast not without a debug card i believe. Motion sensor can detect movement in a small radius and navigation card can get your position relative to a map or waypoint.
-
I don't think you're using the correct function, internet.open creates a TCP socket with the IP at the port. Try using internet.request, although OC may not support HTTPS, pretty sure computercraft doesn't.
-
filesystem.open or io.open used like this local io = require("io") local f = io.open("file.txt","w") f:write("file contents") f:close()
-
stands for relative x, relative z, relative y, width(x), depth(z), height(y) dunno what last one does.
-
Are there any tutorials or any documentation for setting up a drone?
Gorzoid replied to LazyFridge's question in Programming
This is the video I used when drones first came out, the interactive prompt makes it very easy to experiment -
Since you have probably done arrays in your C/C++ tables can be explained like this: there are 2 types of tables, numerically indexed table which is like an array (except you start at array[1] rather than array[0]) and there is the hash table which contains 2 values, the key which is used to look up the value, this can be a a number, a string, any type except another table I think. Luckily for you getItemsInNetwork returns this type, so you can just loop from 1 to #essentiatable to get essentiatable. The itemstack values inside the array are hash tables though, you can think of them like struc
- 2 replies
-
- applied energistics 2
- ae2
-
(and 1 more)
Tagged with:
-
Files representing disks stored on server rather than locally?
Gorzoid replied to macrah's question in Miscellaneous
If files and processing was all done client side then having multiple users use a computer would be next to impossible, requiring the server to relay the state of the computer back and forth continuosly. It's also bad networking practice to do any important processing client side. -
Have you tried using robot.swingDown from robot API provided by OpenOS?
-
OpenComputers is not the best for timed redstone due to the forced delay, I have to use computercraft when I want to do it.
-
getInput also returns a number not a boolean check if it is > 0
-
Pretty weird, looks like the font renderer is using the wrong image. You may want to post this to the issue tracker along with the version of OC used. Does it happen on regular computers?
-
So there's quite a bit wrong with this, for a start the for loop can't be used that way, not in Lua atleast. I'd recomend a while loop which would look something like this. while true do local gis = tp.getItemInSlot(sides,east,i) --store item that is being read to recall later if not gis then break end -- Rest of code end With your list, you first need to create a table before you can reference gp like that. So at the top of your code you would need something like "local gp = {}". Then when adding to it the simplest way is to use gp[slot] = gis -- or if you want to copy
-
Just so you know, event.pull calls coroutine.yield so really modifying event.pull is unnecessary, just coroutine.resume the task with each signal and event lib will do the rest of the work. Not exactly correct, looks like machine.lua also messes with coroutine table in order to correctly sandbox it. Shame, it'd be so simple otherwise.
-
1. According to the wiki Important*: it is generally recommended to use io.open instead of this function, to get a buffered wrapper for the file stream. When opening files directly via the file system API you will get a file stream, a table with four functions. These functions are thin wrappers to the file system proxy's callbacks, which also means that read/write operations are not buffered, and can therefore be slow when reading few bytes often. You'll usually want to use io.open instead. So yeah use io. 2. Text files are basically large strings of characters with
-
Assuming you are require'ing the io and fs table, your only problem is that you need to put the w/r inside quotes, like "w"
- 2 replies
-
- filesystem
- api
-
(and 1 more)
Tagged with:
-
This may be because you are not sleeping, if you constantly check without yielding then it can't check keys pressed, add an os.sleep call before or after the print
-
https://github.com/Gorzoid/oc_dcpu I think there is a java 1.6 compatibility issue blocking it from building, but you should be able to run it fine in either gradle runClient or eclipse
-
oetf OETF #8 - Allocated Network Card Port Numbers
Gorzoid replied to MajGenRelativity's topic in OpenEngineering Task Force
Don't you think the first n ports should be saved for public oetf network protocols, rather than taking the first 10 for a private chat program? I think maybe the first 256. Or since people tend to use low numbers for their private programs, we should use the highest 256 ports for oetf ports -
Prevent user from terminating program? via Ctrl-alt-c or alternatives?
Gorzoid replied to ackley14's question in Programming
You can do this by overriding event.shouldInterrupt function event.shouldInterrupt() return false end -
So I have very slowly been making a DCPU Architecture for OpenComputers. If you don't know what DCPU is, it's a fake CPU architecture designed by notch for his discontinued game 0x10c. While all work on the game has come to a halt, there is still alot of interest for the CPU spec which he released. My idea was to make an emulator that completely follows the spec, including all or most of the devices. This would mean that existing software would work perfectly. Development is slow as my motivation disappears and returns very briefly. One of my problems is that I can never keep working
-
Because of the little activity on this forum, that 3 post system may deter any new users, or force them to basically shitpost on other threads. Maybe instead just make sure they have confirmed their email address? It's not like there is much spam anyway.