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

dgelessus

Members
  • Content Count

    158
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by dgelessus

  1. That explains the "Windows would be better". Trust me, if you program on Windows long enough, you'll find that it's terrible for programming. Okay, that's true for *every* system that you work with long enough, but Windows is worse than most Unix-based systems. I'm talking about the underlying operating system, not the user interface. A "good UI" is very subjective.
  2. You can use component.gpu.setResolution to reduce the resolution, which (like most real monitors nowadays) means that the text is upscaled and looks larger. This only affects the text size on the screen block in the world, in the right-click GUI for the screen it will just make the "window" smaller. You might also want to use more than one monitor block - for the default resolution I find a 3*2 screen works well.
  3. The first line doesn't do what you think. All it does is assign the string "component.redstone" to the variable c. If you want to use the redstone component, you first have to load the component library using local component = require("component"). You'll also want to load the sides library the same way, because you later need to say what side to read the signal from. The third line is what's causing your error. On the wiki, functions are written like getInput(side: number): number. This means that the function takes one argument of type number and returns a number. However this is not normal
  4. I think the OpenOS shell supports piping, so you could run crashingprogram > output.log and look at the log file with edit afterwards.
  5. @Elsys656 That's not how Lua works. Whether or not you have a local before the function name doesn't matter - you're passing the function value to event.listen, not its name. Theoretically you could even do eventhandler = nil afterwards and the code would still work, as the function is not actually deleted. In fact in Lua you almost never want to make a variable not local, because then it will land in the global namespace shared by all libraries and programs (the shell might do additional sandboxing, but you shouldn't rely on that). I'm also quite sure that your unreg command won't wor
  6. dgelessus

    GUI?

    There are countless GUI systems that you can find on the forums, but as far as I can tell none of them are widely used. The best solution for GUIs at the moment is probably to write everything you need yourself based on the standard OpenOS libraries. How would you create text files using print? To create text files by hand you can use the edit program from the shell, and to create files from Lua code you should use the io library.
  7. OC has no real threading or background processes. This means that even "background" listeners only run when you (indirectly) tell them to. In an empty loop like while true do end nothing happens at all, and at some point OC kills the program because it ran too long without checking for events. Event handling happens in the event.pull function - when you call it, it waits for the next event to happen, then calls any listener functions for that event and returns the event name and data. You can also set a filter so that only specific events are caught and returned by event.pull (listeners are st
  8. OC computers don't have any operating system preinstalled, not even a BIOS. To get started, you need to craft the Lua BIOS (not just an empty EEPROM chip) and an OpenOS boot disk. The BIOS chip goes into the computer, and the floppy into an attached floppy drive. Now you should be able to start the computer. Once you're at the OpenOS shell, you can run the command "install" to install OpenOS onto the hard disk, that way you can boot without a floppy and you can write into the system directories.
  9. The dig program from the loot disk is from before robots had a flight height limitation. That's why it doesn't work on current versions unless you install the tier 2 hover upgrade, which effectively gives the robot unlimited flight again.
  10. Not really. Lua uses 64-bit signed integers as long as possible (unless you force floating-point numbers by writing 4265.0 instead of 4265) and switches to double-precision floats for anything outside of that range. And if you exceed that range, then you get float infinity. If you're doing cryptography, you might want to look at the Data Card though. If I remember correctly the higher tiers provide some cryptographic functions too.
  11. The real question is: does it work on 1.8.8? No way to tell until you try it, so please enlighten us and be sure to report any crashes
  12. You could set up your router to make your RPi's "garden temperature service" port available over the internet, then you don't have to worry about modifying the blacklist. And you can get your garden temperature from any computer running on any server, not just from one in your LAN. Of course you'll have to live with the danger of people gaining access to highly personal information like the temperature in your garden. As for how to implement it on the RPi side, you'd probably have some kind of Python HTTP server running, which would return the garden temperature on the URL http://weatherm
  13. Or like this to see closed issues (already implemented changes) as well.
  14. Who knows, maybe "cil" is some kind of euphemism. Or maybe it made a clbuttic error because of the documentation on the site.
  15. Keyboards are technically just "keyboard upgrades" for screens, they allow you to provide keyboard input when using a screen. As Gangsir said, you can't use them on their own, because they have no GUI.
  16. "Premium" refers to a Mojang account with Minecraft purchased, i. e. a "premium" server means that you need to have bought Minecraft to play, as opposed to offline/cracked servers.
  17. You can use Lua's built-in pairs function to go over all keys and values of a table (such as a component or a required library). My quick command to see all fields of a table is for k, v in pairs(thing) do print(k, v) end.
  18. dgelessus

    Other fonts.

    That's not possible very easily. The font used by OpenComputers is the GNU Unifont, which is a raster font (each character is 8*16 or 16*16 pixels) instead of a vector font like most fonts, including the DejaVu ones (where characters are multiple lines and curves which can be displayed at any size). I'm also not sure how exactly OC's internal font data file looks and how you would convert a TrueType font to that format.
  19. The screen should be connected to a single computer only, if you connect it to multiple ones there might be problems with which one gets the screen, since OpenOS grabs the first available screen on boot.
  20. The command block component interaction is disabled by default in the config, you need to enable it manually. Though as far as I know it does nothing that the debug card can't do, so you could just use that instead.
  21. That's a bad idea, there probably is some code that relies on require not reloading every module every time. It's safer to remove the modules that you want to reload from package.loaded instead.
  22. External libraries/packages are loaded using the require function, for example require("myAPI") loads the file myAPI.lua. To find libraries, require looks through a few different folders and uses the first file it finds. Your own libraries should go under /usr/lib, OpenOS's own libraries are under /lib, and a few libraries (like math or computer) are provided by Lua or the mod and are loaded "by magic". To write a library that can be loaded using require, it's important that you return something from your library (usually a table). The return value of the library is what require passes bac
  23. In Lua, strings are just bytes. There is no distinction between text and raw data (like in Java or Python), instead all characters represent their ASCII byte value. (Well, Lua makes no promises about which character set is actually used, but in almost all cases it's ASCII or a superset of it, like Latin-1.) Unicode characters are represented by UTF-8 byte sequences, there is no native Unicode support in Lua, except for the utf8 library that provides a few utilities for encoding and decoding UTF-8 strings.
×
×
  • Create New...

Important Information

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