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. You'd be surprised how OpenOS does it. Though the OpenOS version is slightly better, as it uses event.pull, which means that signals happening during sleep are properly passed on to any listener functions instead of being swallowed by the sleep loop.
  2. dgelessus

    OpenPrograms

    Uh... it's a collection of GitHub repos, does that really need screenshots? I mean, click the link and see for yourself.
  3. Do commands work that don't require op rights? Like say Hi, I'm a debug card!
  4. The screen switch is because the "primary" component system is provided by OpenOS, not the Lua BIOS or the sandbox. The BIOS binds the first GPU to the first screen, and that is what OpenOS will show the boot progress log on. Once OpenOS' component additions are loaded, the last screen with a keyboard is set as the primary screen, which is then bound to the primary GPU. The definitons of "first" and "last" are basically random. All that is guaranteed is that the primary screen will have a keyboard, unless there is no screen with a keyboard.
  5. IIRC that requires a config setting that is not enabled by default. I might be wrong though.
  6. In more recent versions there is a built-in manual item, which is the main documentation for the mod (AFAICT). If you have NEI installed you can also look up documentation for items by checking their crafting usage - this will show a short description, a list of all component methods (if the item provides a component) and a button to open the corresponding manual page. While there is no built-in power system (in fact computers don't need power unless you have a mod installed that provides a power system) the normal cables can be used to transfer power. There is also the Power Distributor
  7. How would that be easier than directly connecting two projectors to one computer? If you're having problems with the component limit, get a server and install component busses, that way you can connect up to four times as many components as with a normal computer case.
  8. @nvmqpa et @sshikamaru: Il y a des tables Unicode sur Wikipédia pour les caractères "filets" et "pavés". Sur Windows il y a aussi une application qui s'appelle "Character Map" en anglais (ma version de Windows n'est pas française, donc je ne connais pas le nom en français) et sur Mac il y a un "visualiseur de caractères". Pour voir certains caractères Unicode, vous devez installer la fonte Unifont (qui est aussi utilisé par Minecraft et OpenComputers). Surtout sur Windows il y a beaucoup de caractères qui ne sont inclus dans aucun des fontes défaut. (Pardon si mon français n'est
  9. If you ask me, writing to an EEPROM chip is not that hard: Write your BIOS in Lua Stick an empty EEPROM chip into your computer Run flash yourbioscode.lua Take out your EEPROM (and put the old one back in, otherwise your dev computer won't start) Or if you want to do it from Lua: local component = require("component") component.eeprom.set("-- your BIOS code here") Writing data to an EEPROM is not hard, it's writing a program in only 4 KB with only basic APIs that's difficult. The reason for that is that you're not programming an Arduino, you're programming a computer on its lowest level.
  10. dgelessus

    Beginner Help

    Unlike in ComputerCraft, not all APIs are loaded into the global namespace by default. Lua itself provides a few standard functions and libraries in the global environment, but anything other than that must be loaded using require. In the case of robot the library is actually loaded from a file /lib/robot.lua, like many other of OpenOS's libraries. It would make no sense to automatically load all libraries in /lib when the computer starts. Not only would it make the OS take a lot longer to load, it would also be quite messy. Most robot commands won't generate a Lua error and stop the scr
  11. In Lua, variables declared local are only local after this declaration. For example, in this code block: local function early_use() return later() end local function later() return 42 end print(early_use()) The use of later in the early_use function refers to the global later, because it has not yet been declared local, and in Lua all variables are global by default. Because there is no such global, the function will error out. To change this, you need to declare later as local before you use it the first time. You also need to remove the local from the definition of the later
  12. Because it was probably uploaded as a guest, and Pastebin doesn't keep guest pastes forever. By the way, if you want to know the maximum resolution of a GPU, use gpu.maxResolution().
  13. OpenComputers' filesystem contents and computer state is stored in a "opencomputers" subfolder of the world, make sure that that folder has been migrated over and that the server has read and write permission for it.
  14. What I was thinking with point 1 was a continuous sequence of objects (with no nils in between) that stores one clear display order - basically an ordered version of objects that replaces layerT. Because every object has a single position in the display order, and two objects never have the same position, there can be no z-fighting. Both systems have their advantages - the current one means that you can set a layer number for an object that will never change, but looping over all layers isn't as easy. The single-display-order one means a clear ordering of objects and easy iteration, but mo
  15. Had some time to look through the GUI.lua source code, so here come my usual questions/complaints/suggestions: 1. An idea about layers - make layerT a sequence of objects. One layer == one object, which means no z-fighting (in the tech demo, move the two squares into the same layer, then move both of them around). Use table.insert to move objects/layers around inside layerT. This would mean that layer numbers would not be absolute - they would change with the order of objects - but it would be much more efficient to loop over layerT. 2. I'm not entirely sure what the objects table is good
  16. This might be what you're looking for. I've added comments (like -- comment) in many places to explain what the code does, you don't need to copy them into your program. -- Open the file statistics.txt in "w" (write) mode. This will overwrite existing files! local f = open("statistics.txt", "w") -- Run this loop 10 times and increase i each time for i = 1, 10 do local a, b, c = -- This data needs to come from your reactor -- table.concat converts a table to a string, with a string (in this case ";") added between all elements local line = table.concat({i, a, b, c}, ";") -- Wri
  17. dgelessus

    edit file .txt

    Not quite. Backslash escapes (like \n for newline) need to be inside the string, like "first line\nsecond line". It is important that you use a backslash (\), not a forward slash (/). Wikipedia tells me that on AZERTY keyboards the backslash is on AltGr + 8.
  18. You could read the entire hologram into memory and write it back to the projector in a different rotation, but that would not be very fast. There's also no way to rotate holograms in anything except 90° angles, so a continuous rotation wouldn't look very nice anyway.
  19. If you want to "combine" multiple projectors, you need to do that manually in your program. OC has no built-in feature to link up projectors and make them act like one. The projector size can probably be changed in the config if you want.
  20. Files don't know "lines", they are a sequence of bytes. You can use file:seek(pos) to move the current position, then the file:read and file:write functions will start reading/writing from that position. (Note that those two functions also move the current position to where they stopped reading/writing.) You'll need to manually find where line breaks ("\n") are though.
  21. dgelessus

    Decimal to hex

    By the way, if you want to display a number as hexadecimal, it's much easier to use string.format: ("%x"):format(256) -- = "100" But as said above, color values aren't strings, meaning that you don't need to convert them to any specfic number format. 0x100 and 256 are both of the type number and are equal.
  22. Never use globals in Lua. Lua globals are evil. Lua globals want to take over the world and enslave humanity. Every time you use a global in Lua, Hannibal Lecter violently murders a kitten. *ahem* The problem with globals is that they stick around even after the program is done running. Locals are automatically deleted when they are no longer accessible (i. e. when the function/program ends and they aren't stored elsewhere), but any object assigned to a global takes up extra memory until the global is reassigned. This can also cause odd bugs in other programs that run afterwards, which is
  23. But... that's just one beep at a time, ten times in a row. (If computer.beep doesn't block while the tone plays, you can always use os.sleep.)
  24. Maybe computer.beep is enough for you.
  25. Did you mount the hard disk at /hdd yourself? Boot from the floppy disk, and if the HDD still mounted there, try unmounting it (with umount /hdd) and then try to install OpenOS again.
×
×
  • Create New...

Important Information

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