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

Fingercomp

Members
  • Content Count

    120
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by Fingercomp

  1. A newer version of OpenComputers is available: https://github.com/MightyPirates/OpenComputers/releases/tag/v1.6.0-rc.1 Update the mod and see if that helps.
  2. So, I guess, you want to unserialize a table. This can be done using the unserialize function from the serialization library. Here's the sample code: -- Require the library local srl = require("serialization") -- The table of serialized tables tables = { '{user = "ADMIN", pass = "ADMIN", settings = {}, admin = true}', '{user = "KARASURO", pass = "TEST", settings = {}}' } -- The table where unserialized tables will be put unsrlTables = {} -- Finally, unserialize for k, tbl in pairs(tables) do unsrlTables[k] = srl.unserialize(tbl) end
  3. In OpenOS 1.6 the piping system was greatly improved, and is capable to redirect not only io.stdxxx buffers, but also print and term.write. So, to be able to redirect the output of your program, you should consider either upgrading OpenComputers, or using io.write instead of print. And the fs issues... I think your test program should look like this: local fs = require("filesystem") local f = fs.open("/testfile.txt", "w") print(f) print(f:write("testtext")) -- colon, not period f:close() -- and here, too But why do you not just use io.open? You don't need to require any library, and it
  4. The problem is that all programs that previously were on magic component filesystems (e.g., pastebin, wget) got moved to loot disks. So you need to craft any loot disk (e.g., openos or oppm) with a scrench to get another one, and cycle through them until you get a floppy you need. Then you simply type install, and install program(s) on floppy disk. Another option you may consider is updating your OC to the very latest version, which can be found here. In one of those builds internet-related programs were moved to OpenOS. You will only need to reinstall OS (the installer will only copy the OS'
  5. Try to click on your drone with a scrench (an OC wrench) while sneaking to pick it up.
  6. Replace your wait function with this one: local function wait(seconds) local begin = os.time() repeat computer.pullSignal(0.05) until os.time() - begin >= seconds end OpenComputers devices (such as servers, drones, etc.) should call the computer.pullSignal function periodically, or they'll crash. Just like your µC does.
  7. Shift-click on the disk drive, open the chat, and click on the address to copy it. Here is an OpenOS command to get the API methods: component -l disk_drive.
  8. What do you type when you are prompted for an address? print("Type address") adr = io.read()
  9. So, basically, the things you need to get your computer running: Computer case, a block where cards, CPU, RAM and HDDs are located. Central processing unit (CPU). Memory (at least 2 x T1). Hard disk drive. Graphics card. If your computer case is tier 2 or lower, you'll also need a disk drive. EEPROM (Lua BIOS) — a blank one won't work. OpenOS floppy disk (simply combine a blank floppy with a OpenComputers manual in the crafing grid). Power converter. Screen. Keyboard. When you have all of these things, do: Place a power converter next to the power source. This block will convert such types
  10. Energy from such mods as AE2, Factorization, Galacticraft, IC2 and Mekanism can be used, same for RF (Redstone Flux).
  11. Yes, Galacticraft energy is compatible with OpenComputers. Connect the solar panels to the power converter with aluminium wires. Then simply place your computer next to the power converter.
  12. I've updated the game. One of new features is highlighting, toggled by [c]. (Red means that a cell will die next turn. Green - will be born. White - stays alive) Other features: [backspace] clears the board; [<] and [>] controls the speed of the simulation; [Enter] updates the board if the simulation is paused (something like one-step simulation); Generation counter.
  13. This program can download gists, upload files to gist and do some more things. It uses JSON library, which will be downloaded automatically if it is missing. Usage: For example, you need to upload some junk. To do this, you need to specify -p flag. --P=s flag makes your gist to be a secret one (it will not show up in lists). Use --desc="description" to provide a description for a gist. Then you should specify each file you want to upload as argument. (/path/to/the/file/on/computer.lua=fileOnGistWith.ext). The command will look like this: gist -p --P=s --desc="Hello, world!" /exampl
  14. OK, here's what you should do in this game: Create an initial configuration. Observe how it evolves. Sounds simple? This program is something like the pixel editor. You have a board with a grid, pressing left mouse button places a cell, pressing right one kills a cell. All the magic begins when you press [space bar]. Then every 1/10 s the board updates according to the following rules: Every cell may have up to 8 neighbors. Any live cell with 0 or 1 neighbors dies (under-population). Any live cell with 2 or 3 neighbors lives on to the next generation. Any live cell with more than 3 neighbors
  15. Command blocks has three methods: cb.setCommand(command) cb.getCommand() cb.executeCommand() So your code must look like this: local component = require("component") local cb = component.command_block local ticks = math.floor(1000/60/60 * os.time() - 6000) print(os.date()) cb.setCommand("time set " .. (ticks + 24000)) cb.executeCommand() print(os.date()) If command block driver was disabled in the config, this program would crash with error "no such component". P. S. This wiki is outdated, use ocdoc.cil.li.
  16. Time is completely messed up. But, yeah, some changes to the code are required. *** New CORRECT setting makes possible to do some tweaking with time zones.
  17. Long time ago I wrote a small program. It displays in-game time and real-life time. Pastebin: pastebin get aKjh5SZL clock.lua By default, touching the screen switches mode (from RL to in-game and vise versa). There are also some settings to play with.
  18. Insert the OpenOS floppy int a disk drive, and then turn on the computer.
  19. To keep values updating, you need to move this part into a loop. There's a code: local term = require("term") local component = require("component") local turbine = component.br_turbine local tRPM, tRf, tRfPt -- Not to spam with 'local' in a loop while true do if turbine.getActive() then -- If turbine IS active, then get and print out info... tRPM = math.ceil(tonumber(turbine.getRotorSpeed())) -- Get tRf = math.ceil(tonumber(turbine.getEnergyStored())) -- turbine tRfPt = math.ceil(tonumber(turbine.getEnergyProducedLast
×
×
  • Create New...

Important Information

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