- ComputerCraft | Programmable Computers for Minecraft
- → kazagistar's Content
kazagistar's Content
There have been 326 items by kazagistar (Search limited from 10-February 22)
#64832 textutils.setFont()?
Posted by
kazagistar
on 27 December 2012 - 11:27 AM
in
Suggestions
#57502 With
Posted by
kazagistar
on 08 December 2012 - 03:24 AM
in
APIs and Utilities
#56832 Load Bitmap image
Posted by
kazagistar
on 05 December 2012 - 04:48 PM
in
Ask a Pro
bobster71, on 05 December 2012 - 04:20 PM, said:
#55180 Simple destruction
Posted by
kazagistar
on 29 November 2012 - 07:32 AM
in
Media
pastebin get 6WsAnk8X carpetbomb
--[[
simple TNT carpet-bombing program (carpetbomb)
by Kazagistar
Do whatever you want with it, no rights reserved, as per WTFPL
(http://sam.zoy.org/wtfpl/COPYING)
]]--
local x, y, density, rounds = ...
assert(x and y and density and rounds, "carpetbomb <xSize> <ySize> [density=4] [rounds=1]")
density=tonumber(density or 4)
rounds=tonumber(rounds or 1)
x=math.floor(tonumber(x)/density)
y=math.floor(tonumber(y)/density)
assert(turtle.getFuelLevel()=="unlimited" or turtle.getFuelLevel() >= (y+1)*x*density*rounds, "I need juice!")
local sum = 0
for i=1,16 do sum=sum+turtle.getItemCount(i) end
assert(sum >= x*y*rounds, "Gimme moar stuff to drop!")
print("Teeheeheehee >:D/>/>/>")
local current = 1
local function drop()
if turtle.getItemCount(current) == 0 then
current = current + 1
assert(current <= 16, "Ran out of boom boom :(/>/>/>")
return drop()
end
turtle.select(current)
turtle.placeDown()
rs.setOutput("bottom", true)
sleep(0)
end
local function forward(distance)
while distance > 0 do
turtle.forward()
distance = distance - 1
end
end
local left = false
for k=1,rounds do
for i=1,x do
drop()
for j=1,y do
forward(density)
drop()
end
if i==x then break end
if left then
turtle.turnLeft()
forward(density)
turtle.turnLeft()
left = false
else
turtle.turnRight()
forward(density)
turtle.turnRight()
left = true
end
end
turtle.turnLeft()
turtle.turnLeft()
end
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
backwoods, on 22 November 2012 - 05:13 AM, said:
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..
#54947 Networking - Towards a complete solution
Posted by
kazagistar
on 28 November 2012 - 10:27 AM
in
General
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
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.
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
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.
#52996 Loading code - APIS versus Lua 5.1 modules
Posted by
kazagistar
on 23 November 2012 - 11:58 PM
in
General
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
#51160 [1.42] Customizable wall maker
Posted by
kazagistar
on 18 November 2012 - 06:08 PM
in
Turtle Programs
EntombedJester, on 18 November 2012 - 06:08 AM, said:
#50949 [turtleQuarry][error] [solved]
Posted by
kazagistar
on 18 November 2012 - 08:02 AM
in
Ask a Pro
#50946 Clock-in system!
Posted by
kazagistar
on 18 November 2012 - 07:57 AM
in
Ask a Pro
#50787 No errors, But something is wrong?
Posted by
kazagistar
on 17 November 2012 - 05:34 PM
in
Ask a Pro
walia6, on 17 November 2012 - 04:56 PM, said:
googolVal = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 for x = 1,googolVal do
#50770 CCIP Possibly?
Posted by
kazagistar
on 17 November 2012 - 03:02 PM
in
Suggestions
#50769 Turbo turtle mode
Posted by
kazagistar
on 17 November 2012 - 03:00 PM
in
Suggestions
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
Orwell, on 17 November 2012 - 02:14 PM, said:
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.
@Tom2018: This stuff is not so basic anymore, if you really want to do this, I suggest reading some more on how lua works.
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
Orwell, on 17 November 2012 - 01:05 PM, said:
#50733 Comparing Tables and Variables, and Tables in Function Parameters
Posted by
kazagistar
on 17 November 2012 - 01:17 PM
in
Ask a Pro
#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:
Way bigger than CC.
[snip]
- 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.
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
anonimo182, on 17 November 2012 - 12:48 PM, said:
myTable={"foo"}
myTable2={"FOO"}
myString=textutils.serialize(myTable)
myString2=textutils.serialize(myTable2)
if myString == myString2 then
print("no")
else
print("yes")
?#50709 Why does nobody seem to use Git?
Posted by
kazagistar
on 17 November 2012 - 11:59 AM
in
General
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
EntombedJester, on 17 November 2012 - 08:42 AM, said:
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
#50565 Re-Stacking Turtles
Posted by
kazagistar
on 17 November 2012 - 07:08 AM
in
Ask a Pro
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.
- ComputerCraft | Programmable Computers for Minecraft
- → kazagistar's Content


