Jump to content


Kryptanyte's Content

There have been 80 items by Kryptanyte (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#153656 Rednet.broadcast() And Rednet.receive() Woes (they're Really Slow)

Posted by Kryptanyte on 22 November 2013 - 06:40 AM in Ask a Pro

Why don't you send it all at once. I can't make out exactly what the issue you are having is, but something about the first message sends? and the rest don't?

Try putting the location, stack, name, damage into a table then textutils.serialize(table) then send that, so:

local rawTable = {location, stack, name, damage}

local sendTable = textutils.serialize(rawTable)

rednetFunction(sendTable)




#153655 Comment Clearing Program

Posted by Kryptanyte on 22 November 2013 - 06:26 AM in Programs

View Posttheoriginalbit, on 22 November 2013 - 06:23 AM, said:

While you're at it what about this block comment?

--[=[
Multi-line comment that
supports use of [[ ]] inside of it.
]]

Maybe I'll do the regular block comment first...



#153653 Comment Clearing Program

Posted by Kryptanyte on 22 November 2013 - 06:23 AM in Programs

Yeah, I did say it wouldn't do them. I can add it in if you really want me to.



#153643 Comment Clearing Program

Posted by Kryptanyte on 22 November 2013 - 12:52 AM in Programs

I don't really know a real useful reason you would want to use this, but it's there if you need it.

The title says it all, this program will clear programs of comments, however it will not clear any multi line comments Aka --[[ Comment in Here ]] (EDIT HERE), Block Comments

Program: http://pastebin.com/2hHydSQt

Again for those who prefer spoiler tags
Spoiler

Usage:

ClearC file1 file2	 -- This will clear file1 of comments and place the cleared file in file2

OR

ClearC file1		 -- This will clear file1 of comments and replace it in the same file


Also note this program does not remove cleared lines if they are emptied and there is no text before the comment, so;

function this()

	print("Some text here") -- Comment Here

	-- And Another Comment

end

Will turn into this:

function this()

	print("Some text here")



end


Post any bugs you get when using this program and if you really want me to fix the empty line thing just say, if there's enough interest then I will try and get it to work.



#113619 Idea Exchange

Posted by Kryptanyte on 23 April 2013 - 12:13 PM in General

You can cross fallout terminal off: http://www.computerc...h__1#entry95452



#99846 Riddles

Posted by Kryptanyte on 21 March 2013 - 05:54 PM in Forum Games

KaoS got it, now who can get the alexander one? Theres a lot of speculation about this one.



#99542 Riddles

Posted by Kryptanyte on 21 March 2013 - 01:13 AM in Forum Games

View Postamtra5, on 20 March 2013 - 11:51 PM, said:

View PostKryptanyte, on 20 March 2013 - 10:17 PM, said:

-snip-
Good luck people
1: He is short :D

That doesn't really answer it. Just saying he is short doesn't explain why he does those particular things...



#99515 Riddles

Posted by Kryptanyte on 20 March 2013 - 10:17 PM in Forum Games

I have two riddles:

Riddle One!

A man who lives on the tenth floor takes the elevator down to the first floor every morning and goes to work. In the evening, when he comes back; on a rainy day, or if there are other people in the elevator, he goes to his floor directly. Otherwise, he goes to the seventh floor and walks up three flights of stairs to his apartment.
Can you explain why?


Riddle Two!

Alexander is stranded on an island covered in forest.

One day, when the wind is blowing from the west, lightning strikes the west end of the island and sets fire to the forest. The fire is very violent, burning everything in its path, and without intervention the fire will burn the whole island, killing the man in the process.

There are cliffs around the island, so he cannot jump off.

How can the Alexander survive the fire? (There are no buckets or any other means to put out the fire)


Good luck people



#97548 [Project Idea]Sudoku

Posted by Kryptanyte on 15 March 2013 - 06:14 PM in General

LuaEclipser, I think I may have an idea for an algorithm for leaving the numbers on the screen, so its an actual playable sudoku I'll try and come up with it and send it to you if you are able to do the rest?



#97190 [Project Idea]Sudoku

Posted by Kryptanyte on 15 March 2013 - 12:16 AM in General

Double post bump with help request?
http://www.computerc...or-double-data/



#97189 Variables to multiple files or just to one file

Posted by Kryptanyte on 15 March 2013 - 12:07 AM in Ask a Pro

If you are making your own code for it, before you save remember to use x = textutils.serialize(table) and save x then when you read from the file x = textutils.unserialize(table from file read) then use x as the variable table



#97184 [Sudoku Game]Checking vert tables for double data

Posted by Kryptanyte on 14 March 2013 - 11:59 PM in Ask a Pro

Help anyone?



#97183 Variables to multiple files or just to one file

Posted by Kryptanyte on 14 March 2013 - 11:58 PM in Ask a Pro

assuming you are writing these to a single file and insert the new variable into a main table try this for writing:

function writeVar(saveTable)

    save = textutils.serialize(saveTable)
    file = fs.open("variables", "w")
    file.write(save)
    file.close()
    
end

Then something like this for getting the variables from the file:

function getVar()

    file = fs.open("variables", "r")
    vars = file.readAll()
    file.close()
    returnVars = textutils.unserialize(vars)
    
    return returnVars

end

I hope you know how to use these, I am terrible at explaining code...



#97159 [Sudoku Game]Checking vert tables for double data

Posted by Kryptanyte on 14 March 2013 - 08:17 PM in Ask a Pro

Hey guys.

Just been working on this off and on, this has got me stumped. I keep seemingly getting duplicate numbers on the vertical lines.

Spoiler

I know it checks the y col, but it seems to return true, I might be getting tired and missing something, idk?

Also, for those of you prefer it Pastebin: http://pastebin.com/S7DzjG5H



#96845 Remote controlled turtle program

Posted by Kryptanyte on 13 March 2013 - 10:57 PM in Turtle Programs

View Post44shades44, on 13 March 2013 - 10:47 PM, said:

Should i start my own topic with my RC turtle?

Probably would be the best Idea



#96840 Remote controlled turtle program

Posted by Kryptanyte on 13 March 2013 - 10:34 PM in Turtle Programs

View Post44shades44, on 13 March 2013 - 09:01 PM, said:

Edit1:
It would also be cool to use turtle.detect() to make a visual minimap on the screen, if you know how, that'd be great :D

That can be arranged. Maybe I could work on that after Sudoku?



#96779 Lock with server + client support.

Posted by Kryptanyte on 13 March 2013 - 04:37 PM in Programs

It had code, and I removed it, please read the first post... I have stopped working on it as a individual program for now.



#96613 [Project Idea]Sudoku

Posted by Kryptanyte on 13 March 2013 - 07:41 AM in General

Well according to numberphile all you need is 17 numbers, there is no need to have specific ones except when you get an "Unavoidable Square" when there are two pairs numbers exactly the same on the same lines but flipped so like:

425
168
973
-----
842
791
356

See the 9 and the 7? thats what I mean



#96507 [Project Idea]Sudoku

Posted by Kryptanyte on 13 March 2013 - 01:08 AM in General

Call me crazy, but Challenge Accepted.

It won't be pretty and anyone who is actually good at LUA will probably think what the hell am I doing with random lines of useless code everywhere.



#96088 [Question][String?/Numbers]Combining strings/numbers from a table to a single...

Posted by Kryptanyte on 11 March 2013 - 11:41 PM in Ask a Pro

Thats sort of implied, because of how the tables work with that, it doesn't print the table key if you just print() it



#96076 Editable Print.

Posted by Kryptanyte on 11 March 2013 - 11:33 PM in Ask a Pro

Oh, I see thank you



#96074 [Question][String?/Numbers]Combining strings/numbers from a table to a single...

Posted by Kryptanyte on 11 March 2013 - 11:32 PM in Ask a Pro

Yeah, I got it probably as you posted that, Its intended as a randomly generated cipher for an encryption function



#96066 Editable Print.

Posted by Kryptanyte on 11 March 2013 - 11:16 PM in Ask a Pro

@TOB What exactly is the mask? Like I see where is it used, but don't fully understand what it is.



#96065 [Question][String?/Numbers]Combining strings/numbers from a table to a single...

Posted by Kryptanyte on 11 March 2013 - 11:15 PM in Ask a Pro

As the title says, I am trying to take random letters and numbers from a table which is randomly generated, and make them all into a single variable.

I have been going through the http://lua-users.org/wiki/ for about an hour now looking for such a function, and this is my question, does this exist? or do we have to come up with some really smart way of combining them?

*EDIT*

Found it. Just by chance, table.concat(table, separator)

so if you did something like

tableToJoin = {1,2,3,4,5,6,7}

joined = table.concat(tableToJoin, ",")

It would create it exactly how it is in the table, but if you were to change the separator to like "l" then there would be a l between each table item in the variable, so like 1l2l3l4l5l6l7



#96043 [LUA] computer controlled pistons

Posted by Kryptanyte on 11 March 2013 - 10:29 PM in Ask a Pro

Is it still throwing an error, and also whats your updated code?