Jump to content


kazagistar's Content

There have been 326 items by kazagistar (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#64832 textutils.setFont()?

Posted by kazagistar on 27 December 2012 - 11:27 AM in Suggestions

Colors have already made a lot of applications more difficult. Originally, all you needed was an array of bytes to store store to save the state of the screen. With the addition of color, you now need to store that metadata, either as separate tags or just a per character "color array".



#57502 With

Posted by kazagistar on 08 December 2012 - 03:24 AM in APIs and Utilities

View PostKingdaro, on 02 December 2012 - 01:54 PM, said:

There's actually something like this in moonscript, one of my favorite features. Very nice implementation. :D

/me looks up moonscript

...this...looks... AMAZING



#56832 Load Bitmap image

Posted by kazagistar on 05 December 2012 - 04:48 PM in Ask a Pro

View Postbobster71, on 05 December 2012 - 04:20 PM, said:

Could anyone write me a small routine to load a bitmap please.
No. I am pretty sure no one could, because loading a bitmap is an non-trivial process. So you could make a long and complicated routine to do it, in theory.



#55180 Simple destruction

Posted by kazagistar on 29 November 2012 - 07:32 AM in Media

I wrote a simple carpet bombing program, and I took some pictures. If you need something large thoroughly destroyed, and have a stupid amount of explosives lying about, this is the program for you! It has simple command line parameters, and can scale up pretty effectively to whatever explosives you need.

pastebin get 6WsAnk8X carpetbomb
Spoiler

Here is an album I made, demonstrating it's full destructive power.



#54951 BranchMiner

Posted by kazagistar on 28 November 2012 - 10:32 AM in Turtle Programs

View Postbackwoods, on 22 November 2012 - 05:13 AM, said:

I dont understand it everytime I use a custom script like yours here the turtle will mine 1 block and completly freeze up.. I have to break it to be able to type anything in it again.. sometimes it doesnt even mine 1 block. Any ideas why this would be happening? I Put the file into the CC rar into the programs/turlte directory..

This is driving me nutz.. I have fuel in it....

The regular old default tunnel program works..

EDIT: I set the Need fuel option to False in the config and it might be workign now.. I dont know I got to watch it to see if it stops again.. I dont get it I have coal in the darn thing before..
Is the fuel in the inventory, or did you actually refuel? You need to actually actually call the refuel command.



#54947 Networking - Towards a complete solution

Posted by kazagistar on 28 November 2012 - 10:27 AM in General

Are you really sure that CC is multithreaded?

Also I realize you are using distance in space as a routing metric, what was trying to point out was that to do so is far slower computationally then just making hop counts of 1.

If a networking protocol scales easily to very large numbers and has a lower server load, that would be considered a better design then a smaller, heavier one, no?



#54799 Networking - Towards a complete solution

Posted by kazagistar on 27 November 2012 - 07:01 PM in General

No, Dijkstras is a misapplication of an algorithm into the wrong problem space.

Lets review some facts about CC, correct me if I am wrong:
  • We have a graph of nodes.
  • All edge lengths are 1.
  • Only one computer is processing one message at any given time.
  • Messages are proccessed in the order they are sent.
Just given 2, we already know that we can find shortest paths using a simple, O(n) complexity breadth first search, instead of the worse O(nlogn) complexity dijkstras. Moreover, since a breadth first search is usually implemented using a queue, if each node merely broadcasts a "node added" update to each neighbor, it will recieve the update from the closest neighbor to the updated node. Thus, each node needs to do a O(1) time complexity update to its table when it gets an add event, and a O(n) time complexty update when it gets a remove event to maintain a 100% accurate link-state diagram. Intelligently implemented, that could be reduced further for the average case.

The problem is, since the time complexity still has to be multiplied by the number of nodes, we end up with remove events costing a TOTAL of O(n^2) accross the network, as well as a O(n^2) memory cost. Is this acceptable? It would have to be tested, but with 1,000 nodes, it means 1,000,000*C operations for each change over the entire network, and a couple MB total server space taken up by the program states of all the computers. Memory-wise, this is fine, but the processing power required if all those nodes are turtles that will trigger at least one disconnect somewhere on the network every few ticks might cause some degree of trouble.

Thus, we reach the crux of the issue. The problem is not WRITING a networking program, the problem is writing a few networking programs, and then using them in different situations, all transparent to the person using the computer, who simply places a computer down, adds a file or two and a line to the startup file (or has his OS of choice do so for him) and then can freely send messages as far and wide as possible without any worry about server stability.

What CoolisTheName007 is trying to say I think is that no one algorithm will fit every single scenario, so a protocol of some kind should be established, so that different routing networks can interact. Or if not, well, that is what I think he is saying?

In any case, I will try to gather relative performance data about some networks, and maybe try to work out something for handling turtle mobility and storms.



#54675 Networking - Towards a complete solution

Posted by kazagistar on 27 November 2012 - 10:55 AM in General

As far as I understand, the number one limiting factor on network size and complexity is the size of the pullEvent queue. I might be misinformed, but it seems to me that there is an essentially linear queue of events that gets proccessed, and it has a size that is limited globally. Any packet sent while the queue is full will be discarded. This causes a large number of networking problems which are wholly "non-traditional".

Assume the maximum number of queued events is X.
  • If there are X+2 nodes, and each node broadcasts a message to each of its neighbors, which then broadcasts to each of its neighbors, it is possible that EVERY SINGLE MESSAGE to a specific node will get discarded every single time an attempt to send is made (unless of course the event queue is nondeterministic, which I doubt). This means updates must be sent through a more complex algorithm to get larger network sizes.
  • If more then X computers turn on at the same time (say, someone turning the game on), then if each computer has to do ANYTHING related to networking, even if it is just setting a delay timer or sending a single message, then some of them will fail to initialize.
  • If more then X computers set a timer of some sort (say, as a delay between message sends) then some of them will simply fail to trigger the timer.
Of course, I might have horribly misunderstood how the event queue in computercraft works. I will look into this more deeply, and see if it really is the central bottleneck I suspect it is. If so, then some kind of automaticly constructed tree architecture might be needed for larger scale networks.



#52996 Loading code - APIS versus Lua 5.1 modules

Posted by kazagistar on 23 November 2012 - 11:58 PM in General

I have played around with a few models but my favorite by far is just calling the library with dofile, and having my libraries store all their functions and such in tables.

While in theory namespace conflicts can be an issue, in practice, it is rarely a problem, and I keep the global namespace of the calling function nice and clean for the most part, but I can modify it however I want easily from within a library, load multiple tables, intentionally overwrite part or all of another api, etc.



#51314 INPUT NEEDED - Spam

Posted by kazagistar on 19 November 2012 - 07:54 AM in Forum Discussion

Are there really people who don't sign up if there is a captcha involved? I think the biggest inconvenience is email verification, but that still won't stop me from signing up for a forum.



#51160 [1.42] Customizable wall maker

Posted by kazagistar on 18 November 2012 - 06:08 PM in Turtle Programs

View PostEntombedJester, on 18 November 2012 - 06:08 AM, said:

I like your program but any possibility to add a function for people that have underground or cave houses where the turtle would dig out the wall then replace it with the desired blocks. Basically instead of just normal turtles they could use miner turtles.
I am sure you could just call a quarry program and then a builder program.



#50949 [turtleQuarry][error] [solved]

Posted by kazagistar on 18 November 2012 - 08:02 AM in Ask a Pro

I suggest you get yourself a rubber duck :)/>



#50946 Clock-in system!

Posted by kazagistar on 18 November 2012 - 07:57 AM in Ask a Pro

I am just curious what you are using this for.



#50787 No errors, But something is wrong?

Posted by kazagistar on 17 November 2012 - 05:34 PM in Ask a Pro

View Postwalia6, on 17 November 2012 - 04:56 PM, said:

googolVal = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
for x = 1,googolVal do
How many times do you think that loop will run? This has nothing to do with printing. The problem is that the computer can do somewhere between a few million and a few billion operations per second, so finishing this will take approximately forever.



#50770 CCIP Possibly?

Posted by kazagistar on 17 November 2012 - 03:02 PM in Suggestions

If a satellite or long range comms peripheral was made, I hope it would use something like this.



#50769 Turbo turtle mode

Posted by kazagistar on 17 November 2012 - 03:00 PM in Suggestions

Problem
Testing large turtle programs can be a pain, because it takes so long to see if it works.

Solution
Make a way to change the delay between turtle actions, preferably to 0.

The idea is to have a flag in the config that can be used to speed up the turtles so that giant quarries/towers/factories/whatever can run really fast in creative mode, so you can see quickly if your code works as expected. It could also be helpful for video creators to showing off what their programs can do without having to record for a long time and then speed it up.



#50764 lua question

Posted by kazagistar on 17 November 2012 - 02:36 PM in Ask a Pro

View PostOrwell, on 17 November 2012 - 02:14 PM, said:

Yes, it is possible, by modifying existing functions.
Very easy example:
os.shutdown = function() print("You can't shutdown!") end
That would disable shutdown. Though, you can still access the original shutdown function through '_G.os.shutdown()'.
I made a chroot program myself as well a couple of months ago. :)/> Safest way is to set a separate environment for a new (custom) shell session. But it's probably still circumventable. (If you made it so shell.exit() still reboots the pc, you could use this ingenious method.)

@Tom2018: This stuff is not so basic anymore, if you really want to do this, I suggest reading some more on how lua works. :D/>

The sandbox I linked protects against ALL modification of the base system from within the sandbox (last time I checked) as well as a couple of VERY obscure holes, like using "getfenv()" and using the bytecode loading properties of "load()" to inject code with illegal references.



#50735 lua question

Posted by kazagistar on 17 November 2012 - 01:24 PM in Ask a Pro

View PostOrwell, on 17 November 2012 - 01:05 PM, said:

I don't think that their exists a simple way. :)/> Best way to do this is overriding some methods of fs api. You could of course look in the programs section, there are some 'OS's that do this.
Overriding the fs api is likely enough to protect against inexperienced users, but will not protect against the most experienced players. For that, check out this chroot program. Of course, it is from an older version of minecraft, and uses white-listing (as any good sandbox should) so some things might not work and would need to be tweaked to your needs. Good luck!



#50733 Comparing Tables and Variables, and Tables in Function Parameters

Posted by kazagistar on 17 November 2012 - 01:17 PM in Ask a Pro

The hash tables can have different sizes internally, which could potentially lead to different mappings as well.



#50732 Redpower no longer updated?

Posted by kazagistar on 17 November 2012 - 01:15 PM in General

 ElvishJerricco, on 17 November 2012 - 12:20 PM, said:

[snip]
Way bigger than CC.
[snip]
When you say something like that, you better define what "big" is. Because I can clearly state computercraft is better in a number of vital ways:
  • Turtles.
  • An public API, so that dozens of smaller mods have already been developed by the community. The stuff this adds is huge.
  • Allow new programmers to learn programming and do something useful with it.
I would also say it is better in that it gets ported quickly, but that would be unfair, because Elo is distracted with playing with computercraft right now, which is understandable :)/>. (<-- this is a joke)

Computercraft can also replace many of the functions of RP. Turtles can move and sort and craft items at least as intelligently as a tube system, if not more. The electricity system exists mainly to make this function and to add a fuel cost of some sort, which turtles have as well now. The only things that RP has that CC does not are microblocks, decorative blocks, (which are not particularly important in my mind, but ymmv) and frames, which I will be the first to admit are awesome.

So yes, RP Control serves as a pretty neat environment to learn assembly programming. And I agree with you that Elo probably is not do upset by CCs popularity, as her exploits using it on DireWolf20's stream have shown.



#50724 Comparing Tables and Variables, and Tables in Function Parameters

Posted by kazagistar on 17 November 2012 - 12:51 PM in Ask a Pro

View Postanonimo182, on 17 November 2012 - 12:48 PM, said:

Can't you just use
 myTable={"foo"}
myTable2={"FOO"}
myString=textutils.serialize(myTable)
myString2=textutils.serialize(myTable2)
if myString == myString2 then
   print("no")
else
   print("yes")
?
If you have more then one item in the table, then the order of the items might be different, causing the strings to be different.



#50709 Why does nobody seem to use Git?

Posted by kazagistar on 17 November 2012 - 11:59 AM in General

I use github, and I release everything open source, but I voted no. Right tool for the right job... often, pastebin is sufficient, and adding the extra waste and lower convenience of github is not worth the cost.

Also, while I think it is somewhat silly, if people wish to not permit redistribution, modified or otherwise, that is their perogative. Having a pulbic fork of non-open-source project is redistribution of copyrighted materials without author's consent, which is illegal. Just because the fork button exists does not mean you are not breaking the law.

Generally, I just don't participate in copyright ego posturing on either side, and license my code as close to public domain as I can.



#50694 Re-Stacking Turtles

Posted by kazagistar on 17 November 2012 - 11:34 AM in Ask a Pro

View PostEntombedJester, on 17 November 2012 - 08:42 AM, said:

I don't think that turtle.dumpFuel() of os.clearAll() are valid turtle functions.

I misspoke, I know they are not functions, I was suggesting a solution that could be added to Computercraft by dan or cloudy if this turns out to be a real bug/misfeature.



#50691 I'm starting a site for finding awesome ComputerCraft scripts and I need...

Posted by kazagistar on 17 November 2012 - 11:29 AM in General

View PostHuman, on 17 November 2012 - 11:04 AM, said:

Most scripts are only for advanced computer now :)/>
Honestly, I suspect most of the scripts CC newbies from tekkit or FTB want are turtle utilities and remote control scripts, neither of which require advanced computers. But we will see!



#50565 Re-Stacking Turtles

Posted by kazagistar on 17 November 2012 - 07:08 AM in Ask a Pro

Do any of the turtles get labeled?

Or perhaps it is just saving fuel level that is causing turtles to become "unique" and non-stackable. If this is the case, you could either make the turtles waste all their fuel, or perhaps a turtle.dumpFuel() or os.clearAll() command could be added to make the turtles non-unique and stackable again.

Or perhaps all placed computer blocks are non stackable now? This wasn't the case a few versions ago, but I don't have the ability to test it now.