Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

payonel

Developer
  • Content Count

    172
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by payonel

  1. `io.read()` returns a string, and you want a number, there is a core lua function to convert strings to numbers: `tonumber(string): number` so something like: `local num = tonumber(io.read())` would be fine note that tonumber returns nil when the input can't be converted. Also, I strongly recommend you get in the habbit of declaring everything local, unless you are intended to modify the global state of the operating system, and future scripts that you run, at least until the next time you boot. Thus: local component = require("component") local sides = requ
  2. in the more recent versions of OC (check out the dev builds for 1.7.10 and 1.10, I haven't merged up to 1.11 and 1.12 with all of these fixes as of this writing, but will "soon") it is safe/reliable to run gui programs from your .shrc the gui program for brgc is `brgc_gui`, so this should be sufficient to run the gui at start up echo brgc_gui >> /home/.shrc though this will probably work just fine in the version you are running, try it out. update if you have issues
  3. You need to read that whole page I linked. It literally tells you how to do that. That is what I said to you in my last post. Again, "if you want to start the controller at boot time" "start at boot time" IS literally what you are asking for, for it to "autorun" also, if you want more information about autorunning programs on OpenOS in general, read this: https://ocdoc.cil.li/tutorial:autorun_options But that covers all of the options, and is not specific to this program nor the service that XyFreak made for it
  4. I think you are using this on the br_reactor, yes? I found the br code for that here: https://github.com/ZeroNoRyouki/BigReactors/blob/master/src/main/java/erogenousbeef/bigreactors/common/multiblock/tileentity/TileEntityReactorComputerPort.java Strangely, there is no setControlRodsLevels method on that component. There is a setAllControlRodLevels. I searched the commit history on the component and there never was a setControlRodsLevels, nor a get*. I also checked the original BR code, same story there. So I"m confused what method this was calling. Searching the entire code base of ER als
  5. @Sindor Nex It is well documented here: https://tenyx.de/brgc/index.html#setup
  6. our screen resolutions are not exposed in the config. you can make a multi-block of screens though, if that helps. they auto connect, and I think they have a 6x8 max grouping, or something like that
  7. If you increase your font size, you are reducing the number of lines you can print to If you decrease your resolution, your font appears larger, and you reduce the number of lines you can print to It is effectively the same
  8. nothing has changed in the term api, and there was never a way to change font size, only ever could you change the resolution, via the gpu require("component").gpu.setResolution(newWidth, newHeight)
  9. This is definitely not a bug in the thread library, but instead you misunderstand what this code is doing -- having nothing to do with threads, but in the logic of the code you have written You are attempting to store the thread.create result in your local variable, t1 -- nothing wrong there thread.create takes a single parameter, a FUNCTION. `handleMessage` is a function, but `handleMessage()` is the invocation of that function. Thus, you are attempting to pass the RESULT of `handleMessage` (i.e. the value returned by `handleMessage`) as the argument to `thread.create`. Thus, `handl
  10. OpenOS has absolutely proper pipes now, such as those you invoke with `cat file | grep foobar`, and a kick butt threading library (read https://ocdoc.cil.li/api:thread ) As for virtual components? No, there is nothing built into OpenOS for virtual components, but gamax92 has written a nice vcomponent library you can add via oppm, `oppm install vcomponent` Plan9k is retired, to be honest. It was ahead of its time, but is now outdated. OpenOS is faster, lower memory, has gobs of great libraries, super awesome command line parsing, and is ACTIVELY developed. I might be biased....
  11. > I want to create a server that pulls the modem_message event and prints to the console Cool, you can `listen` or `pull` for that event > but I also want the computer to be able to send messages (based on io.read()) while waiting for a message. `listen` works well for background handling, while in the foreground you are doing other work (such as io.read). However, you want your background to also print to the console? That'll obscure/interfere (visually) with the io.read getting user input. But okay > I tried using threads Sure, threads can do this job too.
  12. From the screen shot, it actually appears that the `getPlayers()` function is returning an array (a type of table), so while _Jacques is being helpful, the code sample they provided won't work. However, I do highly recommend you read the lua.org links _Jacques provided. Those will definitely be good to read try this local component = require("component") for _, player in ipairs(component.radar.getPlayers()) do print(player.name, player.distance) end
  13. Our `components` command line program can help too. It lists components attached to the system, but you can pass an argument to filter the results to components that match the name you ask for, and that can be a partial match too `components file` will list all `filesystem` components. Also, you can get the "long" output, which prints the methods and method documentation string `component robot -l` Which prints the robot component and its methods Now, this can fill up more than a screen's worth of output, you can pipe to `less` and scroll up and down to read the
  14. Let me try to explain it in a general way Our default Lua EEPROM has been programmed to do one simple job => Run `init.lua` on the attached filesystem A "filesystem" is a a component that provides a filesystem, such as hard drives, floppies, etc It tries to be smart about this: 1. Check all filesystems, one by one 2. Remember the last filesystem that had init.lua, and try it first Enough about Lua EEPROM. When we hear about this failure to boot a computer "no bootable medium found", that tells us that the EEPROM was unable to find any filesystem with an
  15. payonel

    io.open

    As a side note, always make your functions and variables `local`, that's the very first thing I noticed when reading your code. You'll want it to be `local checkAuthPlayer = function(p)` Also, and it makes no operational difference, you could declare your functions: `local function checkAuthPlayer(p)` instead, if you like that style more I'm not sure why this code doesn't work, but one thing to consider is that `io.open` uses relative paths if you don't use `/....` paths for files. Thus, `authPlayers` is searched in your current directory. Are you executing this script from a differe
  16. I'm not sure what you mean by the startup log, or are you referring to the boot messages about what is loading? If so, those screen prints are done here: https://github.com/MightyPirates/OpenComputers/blob/master-MC1.7.10/src/main/resources/assets/opencomputers/loot/openos/lib/core/boot.lua#L51 Just remove all the code in `status()` in the `if gpu ... ` section. The `gpu.set` is printing the boot messages
  17. read about the gpu and the color system here: https://ocdoc.cil.li/api:gpu It has a nice color table at the bottom Tier 2 max bit depth is 4, thus 2^4 colors, ie 16 WIth Tier 2 color, you can set palette colors as well. You aren't locked into the 16 we provide by default
  18. we saw a bug report I think was about this program: https://github.com/MightyPirates/OpenComputers/issues/2908 you should always include bit32 in your scripts, and not assume it is in _G: `local bit32 = require("bit32")`
  19. I recommend using `/usr/bin` for your personal programs
  20. share your code, if you would thanks
  21. understood. again (for others reading here), http://ci.cil.li/job/OpenComputers-MC1.7.10/1178/ will they need that for other mc versions?
  22. @XyFreak you can hack-fix this if your users don't want to update OC (again, sorry) by `_G.bit32 = require("bit32")`
  23. http://ci.cil.li/job/OpenComputers-MC1.7.10/1178/
×
×
  • Create New...

Important Information

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