Jump to content


The Lone Wolfling's Content

There have been 35 items by The Lone Wolfling (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#213382 [1.73] turtle.inspect and turtle.getItemDetail have different keys for damage

Posted by The Lone Wolfling on 10 April 2015 - 02:44 PM in Bugs

Yeah, there is no guarantee that metadata will match with damage values. For a lot of blocks it will match, but not always.

Among other things, damage values can go a lot higher than metadata values.



#213381 How do I turn off one color in a bundled cable?

Posted by The Lone Wolfling on 10 April 2015 - 02:41 PM in Ask a Pro

View PostBomb Bloke, on 10 April 2015 - 07:59 AM, said:

... though that's a bit risky if the line might be executed when the colour is already disabled. Hence colours.subtract(), which can handle such a scenario correctly:

rs.setBundledOutput( "back", colours.subtract(rs.getBundledOutput( "back" ), *your color here* ))
I have two functions to do basically this - add or subtract (a set of) color(s). I find it a whole lot more intuitive to use.



#212248 Disapearing turtles

Posted by The Lone Wolfling on 03 April 2015 - 10:25 PM in Ask a Pro

View PostBomb Bloke, on 03 April 2015 - 11:32 AM, said:

Creepers can destroy turtles? I've not sat down and actually tested it per say, but I've seen a fair few excavating turtles detonate creepers, and they've never been the worse for wear.
I know that nether ores can destroy turtles. Found that one out the hard way. Don't know about creepers.



#212165 Disapearing turtles

Posted by The Lone Wolfling on 03 April 2015 - 11:27 AM in Ask a Pro

View PostNanoBob, on 03 April 2015 - 10:23 AM, said:

From the config:
	# Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES.
	B:removeErroringTileEntities=false

	# Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticable differences in mechanics so default is vanilla behavior. Default: false
	B:fullBoundingBoxLadders=false
So it was already set to false :/
In that case something is probably blowing up the turtles. Are you absolutely sure that no creepers / etc can spawn?



#212067 How does a natural language parser work?

Posted by The Lone Wolfling on 02 April 2015 - 03:42 PM in Ask a Pro

Well, the online parser won't do anything beyond "tree"-ifying the sentence. You'll still have to do the rest.

Here's a simple proof-of-concept I threw together using the JSON API and the HTTP API, and the aforementioned online NLP parser:

pastebin get DvkeHmUd nlp



#212024 How does a natural language parser work?

Posted by The Lone Wolfling on 02 April 2015 - 12:44 PM in Ask a Pro

It may be best to offload the actual NLP part to an online NLP parser. For example.



#212021 Disapearing turtles

Posted by The Lone Wolfling on 02 April 2015 - 12:34 PM in Ask a Pro

That would be my suggestion as well: Forge may be deleting them. Check your config file: in "forge.cfg", in "general", check if "B:removeErroringTileEntities" is true. If it is, that may be your problem.

(Of course, if it is and it is erroring tile entities, changing it to false will instead cause the game to crash. But then at least you can dump the crashlog so that hopefully it can be fixed)

Another suggestion for debugging purposes is to put down a chest in the same chunk, with an item in it. Next time the turtle gets deleted, check if the item is still in the chest. If it isn't, you've got bigger problems than just Forge deleting tile entities.



#211576 event to tell a computer that it is about to be unloaded

Posted by The Lone Wolfling on 30 March 2015 - 07:05 PM in Suggestions

View PostMKlegoman357, on 30 March 2015 - 06:28 PM, said:

Well, Lama somehow managed it.
Lama managed it for translational movement. For rotational movement, not so much. Again, race conditions.

View PostMKlegoman357, on 30 March 2015 - 06:28 PM, said:

For inventory, getting a result and saving it for later use is of course a bad thing, because it's not just server restarts/chunk reloads that can cause a change in the inventory, so you just check the inventory right before you make actions with it.
Again, that's still a race condition. You can minimize the window that way but you cannot eliminate it.

View PostMKlegoman357, on 30 March 2015 - 06:28 PM, said:

For rotation, you can first save the updated state and then rotate.
Again, again, still that's a race condition. As I have said multiple times, you can minimize the window that way but you cannot eliminate it.

View PostMKlegoman357, on 30 March 2015 - 06:28 PM, said:

For your 'file system is out of sync thing': I haven't came across this issue.
The reason you haven't come across it is that most of the time it only is an issue if there's something forcing an unload, as opposed to it saving normally. The most common cause of this being crashes.



#211566 event to tell a computer that it is about to be unloaded

Posted by The Lone Wolfling on 30 March 2015 - 05:43 PM in Suggestions

View PostLyqyd, on 30 March 2015 - 03:37 PM, said:

Rotations don't fail under any circumstances that I'm aware of, and inventory manipulation a can be checked behind the scenes beforehand to ensure success or failure before attempting the action.
Both of those are susceptible to race conditions. Not to mention that currently they both suffer from the whole "filesystem isn't synced with world state" thing.

Let's say you write the current rotation to a file, then rotate, then write the current rotation again. Even ignoring the second issue above, what can happen is that you write the rotation state to the file, then the chunk unloads. So you've written that you are about to take a rotation. But you have no idea if the rotation actually happened or not. Before you say "that won't happen often" - yeah, it does. Often enough that I gave up even trying with my quarry script. And just went to the peripheral-based system above.

Or let's say you are trying to put something in a chest. You check for space, it says there's space, then something else puts something into the chest. All of a sudden when you actually try to put things into the chest it doesn't work. Again: race condition. You cannot, in general, assume that just because you've checked something in advance that it will actually work when you actually go to do it.

Your second example is equivalent to saying that you don't need turtle.move() to return if it moved, because you can always check beforehand with turtle.detect(). And has the exact same flaw.

And with the second issue above these are even worse.

Now, if you've got a method that will reliably rotate, I'm all ears. But until/unless I see someone post a script that, say, rotates left 400 times and comes back to the starting position reliably through restarts / chunk unloads, without relying on external hacks (such as placing blocks or gps+movement or reserving 2 inventory spaces for keeping track of rotation. And the last is still susceptible to a race condition, and the first doesn't work in all cases. Ditto with the second.)...



#211523 event to tell a computer that it is about to be unloaded

Posted by The Lone Wolfling on 30 March 2015 - 12:07 PM in Suggestions

View PostBomb Bloke, on 29 March 2015 - 11:28 PM, said:

[stuff]

To my understanding, a turtle's fuel level can be relied upon no matter what happens. I gather code has already been written to take advantage of this.
Fuel level however, unfortunately, doesn't work for some cases. Namely: rotations and inventory management.

Now, there is actually a solution, and I've got it working, on my machine at least. Unfortunately, it requires a peripheral currently, although I believe it could be implemented without too much trouble into CC itself. The way it works is as follows: the peripheral exposes three methods: writeData, readData, and hasStateChanged. Write saving a string, read reading a string, hasStateChanged returning a boolean. When you call write, it saves the value to NBT. readData returns that data. When you call writeData, it also writes the turtle's current state to NBT. When the turtle is updated for the first time thereafter, or when you call hasStateChanged, it returns if the turtle's state has changed since when you called writeData.

So basically, you can get 90% reliable resyncs by doing the following: writing the current state in the program with writeData(str), then doing whatever. Repeat. On startup, call readData() to get the state, then call hasStateChanged() to see if the last action you were about to do went through.

There still is a race condition, theoretically, but I have yet to encounter it. (If the turtle's NBT is in the middle of being saved when the server goes down. However, there's really no way around this. And on atomic filesystems it shouldn't be a problem anyways.)

(You need readData / writeData because the turtle's filesystem is not atomic with the chunk state.)



#211462 event to tell a computer that it is about to be unloaded

Posted by The Lone Wolfling on 29 March 2015 - 10:43 PM in Suggestions

View PostMKlegoman357, on 28 March 2015 - 04:12 PM, said:

There are ways to preserve sensitive data on the computer. It really depends on what program you want to run. If it's just a door lock then you can put it as a startup file, which will run every time a computer starts.
Not really.

Writing to the HD is the only "good" way, and it a) hammers the HD (at least in a lot of cases), and B) isn't reliable. The world saves out of sync with the filesystem, so if you save that you've done something to the HD and then the world gets forcibly unloaded, you'll often find that the file saved but the world didn't. It's especially annoying with turtles.

There's also the whole "computers don't always start up until they get updated or opened" thing. Speaking of 4th wall breaking...



#211248 event to tell a computer that it is about to be unloaded

Posted by The Lone Wolfling on 28 March 2015 - 02:41 PM in Suggestions

How does an event like this break the fourth wall more than computers losing data because you walked away from them?



#211173 [1.0] Matrix API

Posted by The Lone Wolfling on 27 March 2015 - 09:18 PM in APIs and Utilities

May I suggest you add a simple matrix inverter?

Also, calculating the determinant.

Also, making a zeroed matrix.

Also, making a matrix by passing in a function that returns the value of a cell given the row/column number.

Also, raising a (square) matrix to a power using exponentiation by squaring.



#211167 RedLogic Bundle Integration

Posted by The Lone Wolfling on 27 March 2015 - 09:02 PM in Ask a Pro

Project Blue has a MFR rednet <-> Project Red bundled cable adapter.



#210075 Sugar Cane Farm - SUGARGEN

Posted by The Lone Wolfling on 18 March 2015 - 11:49 AM in Turtle Programs

A suggestion regarding persistence.

This is the sort of program that can use "fake" persistence. In other words, you don't need to explicitly store position across restarts. Which is good, because currently there is no way to reliably do so.

What you do is box the turtle in (by, say, a ring of blocks at two high. If you don't want to block movement you can use signs or something.). Then, on startup, just have the turtle move forward and inspect until it hits the blocktype the ring is made of. Check to see if the chest is below the turtle, turn right (or left), and repeat until you see the chest. This will get you back to your starting point.

Alternatively, move the chest up one block, and just make it so the turtle always stays above sugar cane. (It will slow down growth slightly, as it blocks one sugar cane from growing, but not too much.) (Note: you cannot actually make it so the turtle always stays above sugar cane without additional blocker blocks. However, what you do is, if you are above sugar cane never move backwards. Then, if you aren't above sugar cane, move back one and you should be above sugar cane again.)



#210074 Comprehensive Strip Miner

Posted by The Lone Wolfling on 18 March 2015 - 11:37 AM in Turtle Programs

Your fueler should check if you can actually fuel with things, rather than just using a whitelist. (A whitelist is good as an option, but not necessarily the only thing to use. A blacklist may be better...)

You can still check how much of that item you'd need by checking the item count before refueling, and dividing appropriately to come up with the fuel value of the item.



#210073 Are there any NBT/tileentity reader peripherals?

Posted by The Lone Wolfling on 18 March 2015 - 11:29 AM in Peripheral Help and Discussion

Random Peripherals was actually the inspiration for me asking the question (well, that and trying to control a MFR steam boiler). But yes, it reads items, not blocks.



#209998 Are there any NBT/tileentity reader peripherals?

Posted by The Lone Wolfling on 17 March 2015 - 08:03 PM in Peripheral Help and Discussion

This should be fairly easy, but I don't see any peripherals that do so currently. Am I blind, or are there none? If there are none, would someone be interested if I made one?

(And yes, I realize this could be...interestingly gamebreaking in some ways.)



#209533 [MC 1.7] [CC 1.74] Chunky Peripherals: Turtle chunkloaders! Mining chunkl...

Posted by The Lone Wolfling on 14 March 2015 - 12:14 PM in Peripherals and Turtle Upgrades

View Post_CR_, on 13 March 2015 - 05:31 PM, said:

New version! v1.1.1.0
Added the chunky peripheral and the chunky detector.
Also defined a license, it's MIT! sources uploaded to github :)
And there was great rejoicing!



#209291 Variable Size Quarry (now with Super Ore Quarryâ„¢)

Posted by The Lone Wolfling on 12 March 2015 - 04:56 PM in Turtle Programs

View Postcivilwargeeky, on 02 March 2015 - 02:11 AM, said:

That's actually a pretty cool idea, now that I don't care much how the turtle gets fueled. With quarry 3.6.4 I will be simplifying the way that I set up special slots (like enderchests), so adding in a bucket slot should be easy.

The way I imagine it would work is you set "quarry -lava true" or "quarry -lava 14", put the bucket in. When it gets to lava it will check if it needs fuel, then detect if lava, then place in bucket and refuel self. Do note, it would only fuel itself if it was 1000 less than "excessFuelAmount" (which can be set by parameter). Does this sound like what you were thinking?

I will probably be able to get to it next weekend, which is spring break for me :)
That's pretty much what I was thinking, yes. Though an option to whenever possible refuel (i.e. even if you're 2 fuel down from max) would be useful too.



#209274 Idea Exchange

Posted by The Lone Wolfling on 12 March 2015 - 03:41 PM in General

View Postjerimo, on 12 March 2015 - 03:12 PM, said:

View PostThe Lone Wolfling, on 12 March 2015 - 12:31 PM, said:

Hmm... It should be possible to use a cell phone or tablet as a monitor, using the HTTP API. Has anyone already done this?
Wouldnt you also need to make an app for the cellphone or tablet in question to display it though?
You could, but I don't think you need to. A fullscreened web page should be enough. I think you'd need a web server running somewhere though, as as far as I know CC doesn't allow HTTP servers. (Although: That would be a neat peripheral.)

See, for example, Mote. And Mote's API could allow this, assuming one could find some way to serve the "glue" page.

Although you could skip the web server by making an app.



#209258 Idea Exchange

Posted by The Lone Wolfling on 12 March 2015 - 12:31 PM in General

Hmm... It should be possible to use a cell phone or tablet as a monitor, using the HTTP API. Has anyone already done this?



#208386 [MC 1.7] [CC 1.74] Chunky Peripherals: Turtle chunkloaders! Mining chunkl...

Posted by The Lone Wolfling on 06 March 2015 - 04:35 PM in Peripherals and Turtle Upgrades

What's the license for this mod?

Also, could you add a chunkloader block? Seems a mite overkill to have a turtle sitting there just to load a chunk.



#208385 [MC1.12][CC1.8] "More Turtles", "Waking Chunks", "Multipl...

Posted by The Lone Wolfling on 06 March 2015 - 04:30 PM in Peripherals and Turtle Upgrades

View PostNokiyen, on 03 March 2015 - 02:44 AM, said:

(Actually, I've tried some in my environment, but couldn't recreate the crash situation...)
(And if you could, I recommend you to delete such a fatal lua program directly from your save folder.)
That's what I ended up doing. That being said, could you add a null pointer check to the LiquidTurtle dig routine? It would be much better to log something than to have the entire server crash.

Sorry for lack of response. Realized you don't allow redistribution, so I'm no longer using the mod.



#207875 [MC1.12][CC1.8] "More Turtles", "Waking Chunks", "Multipl...

Posted by The Lone Wolfling on 02 March 2015 - 05:31 PM in Peripherals and Turtle Upgrades

I'm getting a recurring crash - it's a nasty one, I had to manually go in and edit a startup script to let me stop it, as it kept crashing before I had a chance to break the offending turtle.

It was a turtle trying to pull from an empty MFR tank.

---- Minecraft Crash Report ----
// Hi. I'm Minecraft, and I'm a crashaholic.
Time: 02/03/15 1:02 PM
Description: Ticking block entity
java.lang.NullPointerException: Ticking block entity
at noki.moreturtles.turtle.tool.ToolLiquid.dig(ToolLiquid.java:156)
at noki.moreturtles.turtle.tool.ToolLiquid.useTool(ToolLiquid.java:104)
at dan200.computercraft.shared.turtle.core.TurtleToolCommand.execute(TurtleToolCommand.java:36)
at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:796)
at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:104)
at dan200.computercraft.shared.turtle.blocks.TileTurtle.func_145845_h(TileTurtle.java:271)
at net.minecraft.world.World.func_72939_s(World.java:1939)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:489)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)