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. Unfortunately here, they only share the name and the purpose. For one, the program you've read about isn't even written in Lua, so you can't really expect it to run on OC. The one included in OpenOS cannot, in fact, download directories recursively. Nor do any of the fancy things the other program can. When searching for what an OpenOS program does, documentation for utilities included in a Linux distribution probably won't be useful. Instead, type man programname in the OpenOS shell, or look into the program's source code (edit /bin/programname).
  2. I had this problem quite a long time ago, and I think I fixed it by also updating the settings client-side to match those on the server.
  3. There was no IRC library for OpenComputers, so I've made one. Here's a demo bot that uses it: local com = require("component") local event = require("event") local thread = require("thread") local gpu = com.gpu local irc = require("irc") local events = irc.events local env = setmetatable({ irc = irc, events = events, }, {__index = _G}) local client = irc.builder() :connection { host = "irc.esper.net:6667", throttling = { maxDelay = 2, maxThroughput = 5, }, } :auth { nickname = "oc-finger-irc", username = "fingercomp", realname = "OpenComput
  4. TL;DR: set the resolution to 159×28. Displays automatically scale the content to fit the screen's inner area. If you decrease the resolution height, the display area will occupy more horizontal space. I'll assume that your screen is 8×3. The aspect ratio of the screen's inner area is (2 × (8×16 - 4.5)) : (3×16 - 4.5) = 494×87. The "- 4.5" terms are the screen borders, and the width is doubled because the cell width is half its height. If you set the resolution proportional to this ratio, it will fill the whole screen. Of course, you can't do this, as the maximum resolution is 160×50.
  5. Pressing the button that is placed on the screen turns the screen on/off. Make sure the button is not adjacent to the screen. Also, you should use rs.getInput in yor problem. rs.getOutput returns the strength of the redstone signal emitted by the computer's redstone card.
  6. Of course there is. Assembling a drone with a leash upgrade produces a drone that can transport cows, horses, sheeps, and pigs. Like this: Or... like this: Besides, drones are entities. They move in straight lines; they don't get stuck in the fence and can actually enter a house through a door. They move pretty fast — about 6 blocks a second (robots are at least 2 times slower). Drone's movement is asynchronous, so the machine can execute some other code in the middle of the flight. Drones can fly above the block height limit. The screenshot above was made while enjoying th
  7. It's a bit unclear for me what kind of problem you have. Is print also called twice per supposedly one sent modem message? Or is it only the doHarvestRoutine call that's repeated? If it's the former case (the print line is also run twice), it means your sent messages are somehow duplicated. First thing to check for is whether you have any relays nearby. These blocks LOVE to mess up with network packets. If you use them, I advice you to remove them and use linked cards or a network that checks for duplicates. If you don't, it's very likely that the sender program has a bug that causes it t
  8. The last chapter mentions briefly the biggest problems that make sound reconstructed from the audio data sound bad, and I'm going to try to explain them. 1. The program is quite simple. It's merely a proof of concept. It doesn't use modulation or non-sine waveforms. 2. Most sounds are complex. Most sounds I hear are far from being purely sinusoidal. Perhaps it's different for you, or for someone else who happens to read this post. :) White noise is vastly different from a flute, and the flute isn't the same as a guitar. Each instrument has a unique timbre, and even a single
  9. A byte is an octet of bits, which can store 2⁸ = 256 possible values. To represent a character as a number, we need an encoding system. ASCII is one of them, and it assigns first 128 values to control characters, digits, English letters and punctuation. But people also use different languages, which need additional characters to be represented. Latin-1, for example, uses the remaining 128 values to define a few more characters from Latin-based scripts. Even with that, the character coverage was low: Chinese has several thousand different characters, for instance. Therefore, that was a need for
  10. This behaviour is strange and indicates there's a bug somewhere. Since the double buffering library is used by MineOS, it would have much more chance of being noticed, so it's more likely there's some problem in your code. Could you show the code you run, please?
  11. Yeah, basically. The buffer is a singleton. In other words, there's only a single buffer instance in the memory, which is kept there even if programs that required the library exited. An implication of this fact is that buffer may be non-empty when you start your program; therefore, before you use the buffer, you need to do a buffer.clear() followed by a forceful render: buffer.drawChanges(true). It's been a long time since I've used that library, though. Things might have changed. Considering there aren't proper releases and commit descriptions, it's rather difficult to navigate throu
  12. OC sets significant limits the GPU, which make it much harder to do more advanced graphics. You can optimize the calls at the cost of high RAM usage — storing data in a buffer and only drawing the cells that changed since the last buffer flush. It isn't really an easy thing to implement yourself, so you might want to use a buffering library someone else made — here's one that definitely works, for example. I was also making one, but it's not yet ready. OpenComputers has a font.hex file, which is the font that's used to render characters on the screen. Since OC 1.6, asie's funscii font
  13. Yeah, there is a way to make it faster. In fact, way faster. One of the things that makes it slow is... gpu.setBackground. It's quite expensive in terms of perfomance (tier 3 GPUs consume 1/128 of the call budget when this method is called). Fortunately, your program only involves 4 colors, so it can be easily optimized. Actually, there are two ways to do it. A somewhat naive way would be to process all cells of one color first, then process all cells of another color, etc. That would solve the issue with gpu.setBackground, but there's another thing to worry about. The gpu.set method isn'
  14. Please calm down. There are some component methods that block the computer for a tick when called, yes. Such methods usually interact with the world. For example, a transposer allows to transfer items between invetories by calling the transferItem method, which takes a tick to execute (so you get up to 20 stacks/second). On the other hand, there are a lot of direct methods, which can be called several times per tick. For example, the GPU's methods are direct. And the processor (as well as RAM) determines how many direct calls are allowed per tick. I think T2 T3 setup allows you to ca
  15. Oh, right... I forgot about that, sorry. Replace socket:close() with response:close().
  16. The code below tries to make sure that the request finished, and then it reads the response. Unfortunately, I can't test the program in the game for various reasons. Could you try using it? local c = require("component") local computer = require("computer") local internet = require("internet") local f = io.open("test.txt", "wb") local imax = 0 local xmax = 75 local ymax = 180 local zmax = 87 local TIMEOUT = 5 -- in seconds local link = "https://raw.githubusercontent.com/LordNocturnus/sf-" local folder = "/master/" local pos = 0 for i = 0, imax do for xb = pos, xmax do for yb =
  17. Pay attention to what the installer says. It's where to install to, not what to install. You've been trying to install OPPM to a floppy disk or something, but you should've chosen the OpenOS filesystem instead to install it on the system HDD.
  18. There are a bunch of questions, so let me start from the easiest ones to solve. There is indeed no such thing as internet.close. You call the close method directly on the response object — and after you no longer need it. You can't read from a socket if you closed it. -- this code... local imax = 10 do local i = 1 while i <= imax do print(i) i = i + 1 end end -- ...is equivalent to the following code: for i = 1, imax do print(i) end -- I recommend using for loops as there's less code to write Now, the main question: how to check if a file exists. The GitHub s
  19. Oh, too long without yielding... This error means the computer exceeded the timeout, but didn't yield; it's required to prevent "stupidly written or malicious programs" from blocking other computers from running. I can't say oppm is stupidly written (although it isn't certainly the most efficient program ever, either), nor is it malicious. The error can also be thrown if the MC host server (or, if you are playing in a SP world, your computer) is overloaded and causes the game — and the opencomputers — run slower. Less code is executed per second, so it can just be unable to reach an os.sleep c
  20. My guess is that you didn't even install OpenOS, and now you're trying to install oppm on a read-only floppy disk. This won't work, of course. Insert a HDD, boot from the OpenOS floppy, run install, choose openos if you're asked, and reboot the computer when it's done. Then you can try to install oppm.
  21. Well, it executes exactly what's written in the code, and is the expected behavior. event.pull("modem_message") stops the program (more specifically, the thread) until it gets the modem_message event. You may want to set a timeout, so that the pull would stop early — returning nil in such case; for example, event.pull(1, "modem_message") sets the timeout to 1 second. Let's step through the program line by line. The first 5 lines don't cause any difficulties, so we skip them. There's the repeat-until loop, and the first iteration is run unconditionally. First, the string "hello" is printed
  22. Actually, it's possible. Here's the program if you don't mind some Russian. Assemble a robot with: an inventory upgrade; an inventory controller upgrade; a redstone card; a solar generator upgrade (optional; you can use a charger instead).
  23. Erm, the thin line is for the modem. The thick line is for components.
  24. The bug is really simple. To find it, follow through the code line-by-line, analyzing what happens at each line. (This is something I do quite often when debugging an obscure problem.) First, skip the first few dozens of lines until we get to the L65 (short for line 65), where the loop is defined. We then encounter the if block at L68, of which the first branch is actually run (page == "page1" as it was set to this value on L63), resulting in the pageOne call. The next line to examine is L79, where the program stops until it pulls the touch event. Here, I check that the event paramet
  25. The sound card is added by Computronics, a wonderful addon for OpenComputers. There are a few who actually know what it does. Even less people are able to use it. No one dares to understand how it works, or so I hope. Anyway, it appeared a few years (?) ago, and is still mostly undocumented. There is a page in the in-game manual, which fails to explain how great the card is. Of course it does! It has a heap of different methods, which you can use to cast many crazy magics to make the sound card sound, and it's impossible to teach someone to do magic by reading a single page. OK, I'm
×
×
  • Create New...

Important Information

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