Jump to content


FuzzyLitchi's Content

There have been 30 items by FuzzyLitchi (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#266565 Option for Pocket Computers to render similarly to maps

Posted by FuzzyLitchi on 22 April 2017 - 10:20 PM in Suggestions

Yeah i agree this is a good idea.



#266418 Error event

Posted by FuzzyLitchi on 17 April 2017 - 03:06 PM in Ask a Pro

You should use the fs API, probably the fs.exists() function.

if fs.exists("/disk/file") then
  print("Success")
end



#266170 How to return the value of the first object in a table

Posted by FuzzyLitchi on 08 April 2017 - 10:24 PM in Ask a Pro

You can iterate through all values in a table by using pairs()

test_table = { ["0,0,0"] = "foo", ["0,1,1"] = "bar" }
for key, value in pairs(test_table) do
    print(key, value)
end
--output
--[0,0,0]  foo
--[0,1,1]  bar

if test_table had tables instead of the strings foo and bar, pairs() would not go into those tables.
pairs() only iterates through the top table.

if you just want the first* item of a table you can use
first = next(test_table)
I do not recommend this as it is unreliable under some conditions.

* tables may act in unexpected ways due to the fact that they do not have an specific order in the same way that other languages has them.



#266121 small change to the recipe

Posted by FuzzyLitchi on 06 April 2017 - 11:07 AM in Suggestions

If you want realism, i don't think minecraft is the correct place to look.



#266077 small change to the recipe

Posted by FuzzyLitchi on 03 April 2017 - 10:50 PM in Suggestions

I don't think 8 more pieces of redstone will fix that.



#266066 Weird behavior of monitors

Posted by FuzzyLitchi on 03 April 2017 - 12:40 PM in Bugs

:)



#266064 Weird behavior of monitors

Posted by FuzzyLitchi on 03 April 2017 - 09:18 AM in Bugs

If removing optifine works, try toying around with the optifine options to see if you can fix it without removing optifine, but only if you want to keep optifine.



#266063 What OS do you use?

Posted by FuzzyLitchi on 03 April 2017 - 09:14 AM in General

View Postblackvice, on 05 March 2017 - 11:22 AM, said:

Windows 7 x64, I'd love to use Linux but drivers for my pc aren't available there so rip

I linux works on virtually any device. And ubuntu or arch anywhere help with setting drivers up, but ubuntu is easier for a linux beginner.



#266054 Weird behavior of monitors

Posted by FuzzyLitchi on 02 April 2017 - 09:12 PM in Bugs

You should check the version of java, also press f3 and take a screenshot, that will give us more information.

Also what OS are you using?



#265976 OpenPeripheral Terminal Glasses Colors

Posted by FuzzyLitchi on 31 March 2017 - 07:38 PM in Ask a Pro

<snip>



#265974 command.exec and testfor question

Posted by FuzzyLitchi on 31 March 2017 - 06:32 PM in Ask a Pro

If you would like more features or help, posting the source code would help us understand what you mean. :)

You can do this using "pastebin put <programName>" and then go to http://pastebin.com/<the weird Numbers and letters it writes>. You will then see your source code and can send us a link. :D



#265973 Need help finding the cause of a null pointer exception

Posted by FuzzyLitchi on 31 March 2017 - 06:28 PM in Ask a Pro

Just to be sure, the error is thrown by the Monitor setup computer, right?



#265972 small change to the recipe

Posted by FuzzyLitchi on 31 March 2017 - 06:15 PM in Suggestions

I think the point of the redstone is just to make sure that the player has to get that far in the game, but i don't think dan200 had game balance as the main focus of this mod.



#265966 Need help finding the cause of a null pointer exception

Posted by FuzzyLitchi on 31 March 2017 - 04:17 PM in Ask a Pro

Well this is no normal lua error, this a an error in the computercraft mod, or other mods. I will look into how this happend.

Does this happen when anything specific happens, or is it a general error?



#265942 Idea Exchange

Posted by FuzzyLitchi on 30 March 2017 - 09:40 PM in General

View PostIncinirate, on 20 March 2017 - 12:51 AM, said:

View PostDubbelSoftware, on 19 March 2017 - 06:39 PM, said:

View PostKingofGamesYami, on 19 March 2017 - 04:47 PM, said:

Make 8-ball pool. You can get a reasonable resolution if you use blittle.

I think that that is too hard, i can try it

It's not *that* hard, if you want take a look at the `eball` script from my project Riko4, it's basically 8ball pool, just I haven't added pockets yet. You can find it here
It produces something like this:
Spoiler

When it's done you should make it work over rednet. :)



#265940 Rednet API vs. ModemAPI, Authentication Server & Client

Posted by FuzzyLitchi on 30 March 2017 - 09:06 PM in Ask a Pro

View PostDave-ee Jones, on 29 March 2017 - 10:36 PM, said:

Mm, that is the only problem. Even if you hash the password the listening computer can still use the hash.

However there is a really cheeky way to get around this (works for anyone using Rednet and not Modem API)...

Check the ID of the client, and if it is in the Server's memory it says "Oh, I know you! Come in, come in!" and lets you open the door assuming you got the password correct. This can stop other computers trying to use the same password through Rednet.

Because computer IDs are known as channels to Rednet, Modems can easily pretend to be a computer they aren't by opening the channel port of the computer ID it wants to be. Cheeky. There's the big problem. How to get around it?
Maybe try using hostnames? Or send the password in hash packets so it confuses the listening computers?

Doing security through obscurity is never a good idea, rolling codes, using the Blink API recommended above or using a challenge response system would all be very viable solutions.

View PostKingofGamesYami, on 30 March 2017 - 01:11 PM, said:

Lupus linked one of my APIs (Blink) which solves the identity problem. I recommend at least checking it out.

Definitely the simplest and probably the most reliable option.


If you want to use a disk, i would simply store a password in the disk then make the computer read it. Potentially using a disk event.
Then simply use the filesystem API to read a file on the disk, and send the key in that file to the door computer via any of the methods we have mentioned above.
Then the door computer validates this and opens the door.



#265930 Door Lock Code Issues

Posted by FuzzyLitchi on 30 March 2017 - 11:09 AM in Ask a Pro

You have quite a few extra end's, you only need an end when you want to end an if statement or loop entirely

while true do
  input = read("*")
  if input == password then
	--do correct password stuff
  elseif input == "backdoor" then
	--do backdoor stuff
  else
	--do wrong password stuff
  end
end
Notice how every time the indentation go a level down, there is an end. There is no end before the else and elseif statment because they are part of the if statement, they build onto it.

Also note how the elseif comes before the else, this is because if the else was before, the computer would check to see if the input is the same as the password and if not then it would check the the next statement, if this statment is an else it would do that code and be done, but if it is an elseif it would check that code and then continue depending on the statment.

Generaly if statments go as follows,
first an if, any amount of elseif's (0 is an amount), optionally an else, an end

A more detailed version of the previous would be as follows
first an if, a condition and a then, any amount of elseif's, a condition and a then (0 is an amount), optionally an else, an end

I don't know if that made sense just ask if it didn't. :)



#265929 Door Lock Code Issues

Posted by FuzzyLitchi on 30 March 2017 - 11:01 AM in Ask a Pro

using 'read ("*")' is valid, but weird if the rest of the code is without a space between the function name and the parentheses



#265911 Rednet API vs. ModemAPI, Authentication Server & Client

Posted by FuzzyLitchi on 29 March 2017 - 07:55 PM in Ask a Pro

View PostDave-ee Jones, on 29 March 2017 - 02:17 AM, said:

Use Rednet, but do it like this:

Create a server computer (somewhere in your house, can be either Advanced or Normal) and just let it constantly test for rednet messages and if the rednet message equals your password (e.g. "password") then open a redstone output to open the door FROM THE SERVER COMPUTER!

Next, create a client computer (preferably not next to the door, as that would be easy to hack and use a redstone signal to open it, but as long as someone can't put a disk drive next to the computer it is fine) and have it let the user input a password into it and then send the password to the server computer. Then let the server computer do it's thing. Probably reboot the computer every time a password is entered as well (not the server, just the client).

This is the most secure way to do a door lock on your house, as the client cannot be told to open an output to open the door (well, it can but it just won't open the door cus it is not next to the door) and even if someone hacks into the computer they cannot get the password because the password is stored on your server's computer which is INSIDE your house, so they need to be inside to get the password.

Easy :)

The problem with this is that if anyone is listening while you transfer your secret password they get your password, and can then use it to do whatever you use your password for.



#265876 Rednet API vs. ModemAPI, Authentication Server & Client

Posted by FuzzyLitchi on 28 March 2017 - 07:01 PM in Ask a Pro

The crypto required is doesn't really need to be that advanced if it's just a simple authentication.

Let's say there is a secret key that only the server and client know, any other listener doesn't have this key.
First the client says that it want's to authenticate so it requests a salt from the server.
The server sends a randomly generated salt (You have to properly generate this using a good randomizer since lua's is horrible)
Then the client takes it's key and concatenates the salt to it, and hashes the result. It then sends that hash to the server.
The in the meanwhile takes it's own secret key and concatenates the salt to it, and hashes the result.
It then receives the hash from the client and checks to see if they match, if they do, the client has the proper key.

Note that the key was never sent at any time, the only form that was sent was the hash and the salt.
This allows a listener to produce a brute force attack, but using a long enough random key and a good hashing algorithm (brcrypt), this bruteforce could last longer than the lifespan of the universe.

The only way to get this key would be to compromise the server or client.

You could also, as the OP states, store the key on a disk instead of the client, which means that the client is now secured, but instead you have to protect the disk. :)

EDIT: Here is a, according to the post, cryptographically secure random number generator.



#265803 PasteUpdate: A simple way of implementing updating into your program

Posted by FuzzyLitchi on 24 March 2017 - 11:29 PM in APIs and Utilities

I'm working on adding a generic tag where one can paste a full url and forget about the rest, but surprisingly i am having more problems with this than the pastebin and github tag combined. :huh:



#265800 <eof> expected

Posted by FuzzyLitchi on 24 March 2017 - 09:12 PM in Ask a Pro

You're welcome :D



#265783 <eof> expected

Posted by FuzzyLitchi on 23 March 2017 - 08:07 PM in Ask a Pro

If you want TigerMeister and Tigernr2 to be passwords and usernames you have to use them as string. Use this
master = "TigerMeister"
password = "Tigernr2"

Also instead of
if master == password then
you should compare user to master and pass to password as so
if user == master and pass == password then

Using more descriptive variable names such as master_username, master_password, read_user, read_password can ensure that these types of errors don't happen :)

If you have any other errors, please write down the error line number and message, or explain what happens :)



#265604 fs API: Adding string without deleting previous string in file

Posted by FuzzyLitchi on 16 March 2017 - 02:37 PM in Ask a Pro

You're welcome :)



#265590 fs API: Adding string without deleting previous string in file

Posted by FuzzyLitchi on 16 March 2017 - 12:22 AM in Ask a Pro

you want to use
file = fs.open("file_path_here", "a")

"a" being the important part, this appends to the end of the file.

you can then use
file.writeLine("This line is now appended!")
to append to the end of the file.