- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
-
Content Count
120 -
Joined
-
Last visited
-
Days Won
35
Everything posted by Fingercomp
-
Use a file storage that gives you a direct link to the file, not some webpage packed with JS scripts. For instance, https://mixtape.moe/, or any other site like this.
-
No Lua built-in function, type name, primitive, library, etc. starts with a capital letter. So you should write true, not True.
- 1 reply
-
- extremereactors
- lua
-
(and 1 more)
Tagged with:
-
If I remember correctly, the RT does not work on Lua 5.3. Try switching the processor to Lua 5.2 (shift-click while holding it).
-
Problem with adapter using inventory controller upgrade
Fingercomp replied to Willcenx's question in Programming
See this comment on the issue you opened. It references a few issues that describe similar problems. You can't really say "I guess it's a bug" if you haven't tried solving the problem—without the assumption it's indeed a bug. -
How to check the filesystem is Hard Disk Drive?
Fingercomp replied to DIES's question in Programming
EEPROM does not have any file systems. It's not actually a file system. What is reported is most likely a tmpfs component. Use component.tmpAddress() == k to determine if it's a temporary file system. -
It is a problem with the code. event.pull returns the event name, which is put in the laddress, not its own variable, so the event parameters get shifted by 1. Replace the event.pull line with the following. local evt, laddress, saddress, distance, port, message = event.pull("modem_message")
-
Well, this means the ic2_te_mfsu component doesn't have the getMaxEnergyStored method. The reason the crash occures after click is that you fetch the values after pulling a touch event (before the first update, the default value is used, i.e. 0). To get a list of available methods, run the following command in the OpenOS shell: components -l ic2_te_mfsu | less
-
Look again at the coordinate system the printer uses. (source: http://computercraft.ru/blog/11/entry-349-3d-printer/) It's a Cartesian grid, meaning that coordinates determine the position of a vertex, not voxel. In your case, the Z-coordinate is 0 for both points, so you effectively ask the printer to print you a flat face. That's exactly why you're getting this error. Change the Z-coordinate of the second point from 0 to 1 to add a 1-voxel-high shape. component.printer3d.addShape(6, 6, 0, 9, 7, 1, 'hardened_clay_stained_lime')
-
Enable the effect. Click on a bee hive. Use an impregnated stick to make the bees attack an entity. Keep the nanomachines charged if you don't want the bees to attack you.
-
Check if you can connect to your server from a remote host. A firewall might be blocking the connection. Keep in mind that your host may be blacklisted in the configuration file by default (if you're trying to connect to localhost, for instance). Wrap handle:write("1234") into print (like print(handle:write("1234"))) so that if there were any errors, they would be printed, not ignored. Also, try to os.sleep a while before writing to or reading from the socket. Perhaps the socket doesn't get enough time to establish the connection. Call handle.stream.socket.finishConnect() to check if
- 1 reply
-
- internet card
- socket
-
(and 1 more)
Tagged with:
-
Robots cannot attack players, is this intended?
Fingercomp replied to LightningShock's topic in OpenComputers
No, you shouldn't. This is the default behaviour of OpenComputers. You can allow robots to attack players by setting canAttackPlayers to true in the OC configuration file. -
http Sending PUT and DELETE requests [Solved]
Fingercomp replied to Slamakans's question in Programming
The internet card's request method doesn't allow to set a custom request method. No mod adds such feature, either. Though if you can't avoid the need to use methods different from GET and POST, there's a rough implementation of HTTP/1.1 I've written in Lua to test my TLS library. It may easily fail for some unusual responses (I didn't really test it much specifically), and is slow (like, really really slow) in comparsion to the internet card's built-in HTTP request method. Also, it lacks support for HTTP/2, obviously, which is the protocol that many websites start gradually switching to. -
What algorithm is used to approximate colors?
Fingercomp replied to swg2you's question in Programming
This page, though in Russian, may be useful to you. The code there contains functions to deflate a color into its palette index and vice versa. Generate a color palette and use palette:inflate(palette:deflate(color)). -
You don't need to use component.invoke here. It's a quite rarely used function since there are better alternatives. First, component.<component type>.<method>. E.g., component.tile_defense_machine_launcherscreen_name.launch(). This is what you should use if you only have a single component of some type. local component = require("component") local launcher = component.tile_defense_machine_launcherscreen_name launcher.launch() Second, component.proxy(address). Use it if there are several components of the same time, and you need to operate with a specific one. An addres
-
The Vigenère cipher is vulnerable to cryptanalysis. Unless the length of key equals to the length of plaintext, the cipher IS NOT secure. Generation of such key, which also must be random and not used previously, isn't an easy task. In such case, because the cryptographic strength is provided by the key instead of the cipher (in other words, it's an OTP system), you can simply XOR the plaintext with the key instead of using this cipher and get the same strength. This cipher might be used to encrypt short pieces of text, but for relatively large pieces, especially when the attacker knows t
-
Have you read GitHub help articles? They explain everything to start using GitHub. Read these two articles first: 1, 2. You can use the web interface if you want to simply throw a file on GitHub and prefer not to mess with git. Although I highly recommend you to learn how to use it if you want to keep pushing updates to the repository. This book is an excellent guide to git.
-
When table.concat is called without specifying the fourth argument it's assumed to be #list. The default value for the third argument is 1. Operator # returns any of the table's borders. A border is a natural index of a non-nil element that is followed by a nil element. There's only one border in sequences. In table {1, 1, 2, 3, 5, 8}, the border is 6. Your table is different, as it has more than one border: 0 and 2. The border the operator # chooses depends on the Lua table implementation -- it could be 0 as well as 2 depending on how the table was populated and its non-numeric
-
Try component.isAvailable("tablet").
-
You need to require("term") before you can use the library in your code, like this: local term = require("term") term.clear()
-
Insert saplings in the bottom-right slot of robot inventory, and a log in the previous one. The program compares blocks in front of robot with contents of these slots to distinguish saplings from trees.
-
Assemble both the drone and the client with a navigation upgrade.
-
When I was writing that response, I didn't really know, well, how experienced you are at Lua programming. OOP in general, not in Lua, isn't really advanced. Many languages allow to write in object-oriented style. To name a few: Java, Python, C++. If you don't know what OOP is, writing a few programs in these languages can help to understand the subject. OOP in Lua is really complicated. It requires using of metatables -- and that is advanced. In library, the code may quickly become complicated and hard to maintain. Instead of messing with metatables, I prefer to use libraries that ni
-
This mod adds a new architecture. Use the same items and blocks you use to build a regular Lua computer. Before you insert the processor, shift-click while holding it, until something like "65C02 Thistle" is printed to the chat. Then you can insert it into the computer. I also think the mod adds an EEPROM, so don't forget to insert it.
-
As an author of a few programs that heavily used different GUI libraries, I have found problems in your current library. The approach it going to work for really simple programs, but when someone uses it for bigger projects, it becomes really hard to use. Below are some of problems I've found. You wanted feedback, after all. Why not use OOP? So that GUI elements could be modified in some way by calling its method, like menu:addSeparator(). OOP is a really great choice when making GUI libraries. It's incredibly hard to add a custom element that would use your GUI system. Every program