- 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
-
binary read and write, how does it work exactly?
Gorzoid replied to Ta©ti Tac0Z's question in Programming
Assuming you are using io and not filesystem, PIL shows how to read binary files https://www.lua.org/pil/21.2.2.html it works mostly the same as normal io -
So what your saying is we should use the torcherino mod to make our computers run at 1780 TPS?
-
Note this is why indenting is incredibly useful, if you correctly indented that code you would clearly see where you are missing an end
-
Open computers is not fast enough to do per tick redstone signals on multiple sources. For the actual problem you have there, os.time returns minecraft seconds. It's a pretty useless metric about 0.28 ticks, I'm pretty sure the most tick accurate clock is computer.uptime() which is seconds since computer was started.
-
infoName isnt assigned, you forgot to call printInfos with a string, something like printInfos("stored")
-
I would not recommend doing io.open():read() or write(), you are never closing the file so you can't guarantee the handle is released. Make a custom function to readall/writeall quickly if you need to. Also filesystem.concat might be better than just using "WH/db/"..LOC
-
Think you might be on the wrong forum dude?
-
work in progress KLang: C++-styled programming language using Lua.
Gorzoid replied to tpzker's topic in Libraries & API's
Waiting on STL implementation.- 3 replies
-
- programming language
- wip
-
(and 2 more)
Tagged with:
-
I'd still recommend having OpenOS installed if possible, it adds alot to make robot API easier and allows robot to be used through terminal aswell.
-
Navigation upgrade having the ability to magically share waypoints with eachother seems a bit weird, I like the idea of setting local waypoints that only the component itself can see but networked waypoints can be recreated with just a wireless card.
- 8 replies
-
- navigation
- waypoints
-
(and 2 more)
Tagged with:
-
I think fake player clicking was disabled on the regular sieve after the electric sieve was added to the mod. Isn't an electric sieve cheaper anyway?
-
gpu.bind is exactly what you're looking for, it's first function in the docs http://ocdoc.cil.li/component:gpu I think you'll need to redraw the UI every time you bind though
-
the first argument of computer.pullSignal is the max timeout. Use deadline - computer.uptime() instead of 0 and that should give a more desired output. The lua sleep function doesn't work because OpenComputers requires you to manually halt your code every.
- 2 replies
-
- sleep
- microcontroller
-
(and 5 more)
Tagged with:
-
If you want it to work for all words/strings then use "1" instead of 1. In lua numbers and strings are not the same, ie 1 != "1". It seems that lua for some reason allows strings to be implicitly converted to numbers when using arithmetic operators(who do they think they are, JavaScript). So if your inputs aren't restricted to being numbers only then just compare with the number as a string(in quotes)
- 8 replies
-
- term.write
- term.read
-
(and 1 more)
Tagged with:
-
component.invoke(address, "setEnabled", true) Or component.proxy(address).setEnabled(true)
-
excavators.on isnt a function did you mean to use component.invoke/component.proxy
-
When you say the loop doesn't end do you mean it doesn't end immediately or it doesn't end after you press enter.
-
Threads are added in 1.6.4, Nexarius seems to have made a very useful program that updates OpenOS even on lower modpack versions. https://oc.cil.li/index.php?/topic/1261-openos-updater/
-
The thread containing info on applying is here although considering there is only 10 "entitled players" in over 2 years since the thread was posted (most being staff), I'd say it's pretty difficult to get. Ofcourse you could be evil and just add your name to the list in the code, but I never said that Anyway it would only be client side and only visible in F5 mode so nowhere near as cool as the real deal.
-
Calculating energy needed for robot travel distance
Gorzoid replied to Roachy's question in Programming
Weird the code doesn't show anything about being a variable cost, it seems to be fixed value defined in configs (15 by default) -
The table containing bundled Colour values is colors. If using the lua prompt you can simply do conponent.redstone.setBundledOutput(sides.west, colors.green, 200) but if using a program you must require it. local colors = require("colors") local sides = require("sides") local rs = require("component").redstone rs.setBundledOutputsides.west, colors.green, 200)
-
NEI has some resource dumpers that you may want to check out, from what I can remember you can dump all items and all recipes into json/csv files.
-
Why not just return
-
io.read() is a blocking call, you either need to remove that input or use one of the coroutine APIs like threads to run both at the "same" time.
-
No sides are only available in the 6 axial directions. You can't give arbitrary vectors/angles