Jump to content
  • 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

  1. 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
  2. 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
  3. Gorzoid

    Locate Player

    Yep whoops thanks for that
  4. Go watch tutorials before screaming for help on forums. ??? Profit
  5. Gorzoid

    Locate Player

    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.
  6. 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.
  7. 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()
  8. stands for relative x, relative z, relative y, width(x), depth(z), height(y) dunno what last one does.
  9. This is the video I used when drones first came out, the interactive prompt makes it very easy to experiment
  10. 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
  11. 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.
  12. Have you tried using robot.swingDown from robot API provided by OpenOS?
  13. OpenComputers is not the best for timed redstone due to the forced delay, I have to use computercraft when I want to do it.
  14. getInput also returns a number not a boolean check if it is > 0
  15. 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?
  16. 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
  17. 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.
  18. 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
  19. 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"
  20. 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
  21. 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
  22. 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
  23. You can do this by overriding event.shouldInterrupt function event.shouldInterrupt() return false end
  24. 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
  25. 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.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.