Self-Replicating Turtle - Revisited
#21
Posted 14 May 2014 - 06:57 AM
Thanks for posting the problem area. I have only looked at the image so far, and it is the presence of flint that is worrying me. the dig.digNew{} method should have identified and disposed of flint, and you never see it in the inventory, so I need to refine it. Also sticks and signs are still in the inventory because storageSigns and storageSticks chests have not yet been created and placed. I will perhaps change the code so that signs cannot be crafted until a storage chest has been placed.
@originalbit
Thanks also to the for the ideas concerning the file system. These will definitely be implemented. I am a bit OCD with code, and I like to anticipate any and all possibilities.
@darkrising
You are of course correct. lua means moon, and as it has been adopted as a proper noun to name the OS, then Lua with capitalisation on the first letter is the correct way of writing it. You will not see it again in all caps from me, and when I next edit my posts, it will be corrected.Nice to see others are also OCD...
First part of the tutorial has been written, should be uploading to the tutorials forum later today.
#22
Posted 15 May 2014 - 11:36 AM
Line 614: dig.checkForItem: checkForItems = 'ironore','gravel','coal' Line 615: slot.update: Slot 8 contains 1 item2 status = unknown
Not sure what item1 is at this stage as it has been there for a while, but item2 is almost certainly gravel or flint
Line 620: dig.checkForItem: checkForItems = 'ironore','gravel','coal' Line 621: slot.update: Slot 9 contains 1 item3 status = unknown
item2 and item3 are almost certainly gravel and flint
dig.checkForItem: checkForItems = 'ironore','gravel','coal'
At this stage another gravel dug into slot 8, allowing a test to be made, as need 2 blocks to test:
checkSandGravel: gravel or sand dropped, moving down checkSandGravel: checking for gravel/sand - found gravel in slot 8 checkSandGravel: checking for gravel/sand - found gravel in slot 8 dig.newDig: sorting inventory after identifying new item sortInventory: Sorting started, moveItems = true sortInventory: resetting unknown items sortInventory: debug log sortInventory: slot 1 slotCount = 9 of wood slotState = known sortInventory: slot 2 slotCount = 1 of chests slotState = known sortInventory: slot 3 slotCount = 52 of dirt slotState = known sortInventory: slot 4 slotCount = 2 of saplings slotState = known sortInventory: slot 5 slotCount = 61 of cobble slotState = known sortInventory: slot 6 slotCount = 3 of sand slotState = known sortInventory: slot 7 slotCount = 2 of gravel slotState = known sortInventory: slot 8 slotCount = 1 of item1 slotState = unknown sortInventory: slot 9 slotCount = 3 of item2 slotState = unknown
The gravel in slot 8 (item2) has been identified and sortInventory() has re-allocated the itemX names to the remaining unidentified items, after moving gravel into slot 7, so all identified items are grouped together.
I guess item1 is now definitely flint. The reason it was not identified is the function checkSandGravel() only tries to identify the item in the slot passed to it. As sand was already known, there was no need to confirm gravel by breaking it until flint is produced. This was obviously a mistake, so the function has been re-written to confirm gravel by breaking it until it turns to flint, then the new flint, and any already present can be dumped in one go.
The function has now been moved into the dig() object and renamed clsDig.checkSandGravel()
I will be uploading the changes to pastebin very shortly, with a version number on the first line of 1.0.1
Part 2 of the tutorial is nearly ready
#23
Posted 15 May 2014 - 08:48 PM
2- If it find enoght gold, craft advanced turtles
#24
Posted 18 May 2014 - 02:55 PM
harvestAllTrees: changing logFile Name from logStart.txt to logHarvestRight1.txt END OF LOGFILE! restoreTorches: started. side = rightside colNo = 0 start.lua:10317: attempt to compare number with string expected, got number
I am using MC 1.6.4 CC 1.6.3.
Edited by Pizza Fox, 01 April 2020 - 09:44 AM.
#25
Posted 19 May 2014 - 03:28 PM
Could you please post the seed of the world you are using, the coordinates of the tree, and the direction you are facing when placing the turtle.
#26
Posted 20 May 2014 - 09:39 PM
Inksaver, on 19 May 2014 - 03:28 PM, said:
Could you please post the seed of the world you are using, the coordinates of the tree, and the direction you are facing when placing the turtle.
My coordinates from standing behind the turtle facing the tree, with the chest thing facing me (East) are, X 161, Y 67, Z 282 I am using the seed oakforest like in the instructions.
Edited by Pizza Fox, 01 April 2020 - 09:44 AM.
#27
Posted 21 May 2014 - 10:32 AM
Please give me an idea as to why this is happening
the seed is: -2785521036684775193
and my coords are: -227x, 64y, 239 facing south
the error occurs straight after returning to ground level after completely mining the firstTree, I'm assuming the turtle tries to place the chest it crafted and then dump stuff into it, however the chest does not get placed and the turtle just spits its items out
I also had one on saplingCheck just now during the firstTree object
Hoping this helps
#28
Posted 22 May 2014 - 07:43 AM
The version has changed a couple of times since I first posted, and I did not keep backups of the earlier versions, so the error at line 10317 no longer gives the correct error point.
Could you download the latest version from Pastebin The first line of the script reads -- start.lua Version 1.0.2
Try it again and if it comes up with the same error, give the message as you did before, with the line number hopefully being more meaningful.
Also if you post the logfile either as an attachment here, or on pastebin, that would be very helpful.
When I used the location you posted, the tree is not big enough, and the turtle ran out of fuel at the end of its first run, so try a different position. I have edited my original post to emphasise the tree height is important.
@mistamad001
Could you check the seed you posted is exactly the same, as the one above is nowhere near any trees, so I am guessing there might be a number missing, or in the wrong place
Edited by Inksaver, 22 May 2014 - 07:44 AM.
#29
Posted 22 May 2014 - 08:58 AM
#30
Posted 22 May 2014 - 10:03 AM
turtle.select(slot.getItemSlot(slot, "planks"))This means there is no slot containing planks, which in turn means they were not crafted on the previous line
craft{craftItem = "planks", craftQuantity = numLogs * 4, sourceItem1 = "wood", destSlot = 0, doSort = false}The only reason I can think why this might happen is if the tree was less than 6 blocks high.
Try altering the last few lines of code in firstTree() to
numLogs = turtle.getItemCount(slot:getItemSlot("wood")) - 1 if numLogs < 3 then saveToLog("firstTree: Only "..numLogs.." logs available. Not enough to continue. Re-start at a taller tree", true) error() end if numLogs > 4 then numLogs = 4 end if craft{craftItem = "planks", craftQuantity = numLogs * 4, sourceItem1 = "wood", destSlot = 0, doSort = false} then turtle:select(slot.getItemSlot("planks")) turtle.refuel() slot.update{self = slot, item = "planks", delete = true} else saveToLog("firstTree: Failed to craft planks. Check if more than 1 wood available", true) error() endIt may be easier to re-download from Pastebin (Version 1.0.3)
Could you try that and report back, or even better reply with the seed of your world, and the coordinates of the tree you are placing your turtle
Edited by Inksaver, 22 May 2014 - 10:11 AM.
#31
Posted 22 May 2014 - 10:24 AM
[spoiler]
[/spoiler]
and/or
[namedspoiler=name]
[/namedspoiler]
in the OP so that its not as long just nicer to have things grouped, etc.
#32
Posted 22 May 2014 - 10:49 AM
if suggestion == "good idea" or suggestion == "makes sense" then os.run("execute suggestion") end
#33
Posted 22 May 2014 - 07:43 PM
start.lua:6501: attempt to index ? (a nil value)
the line is if self.slotContains[i] == item then
It just finished sorting inventory when it stopped.
#34
Posted 22 May 2014 - 08:27 PM
Change
turtle.select(slot.getItemSlot("planks"))
to
turtle.select(slot:getItemSlot("planks"))on line 7170
Note colon instead of dot
Edited by Inksaver, 22 May 2014 - 08:38 PM.
#35
Posted 22 May 2014 - 08:51 PM
Inksaver, on 22 May 2014 - 08:27 PM, said:
Change
turtle.select(slot.getItemSlot("planks"))
to
turtle.select(slot:getItemSlot("planks"))on line 7170
Note colon instead of dot
Did, quit at the same spot, it expected a number there...
#36
Posted 22 May 2014 - 10:55 PM
I got it running on cc 1.6.3 but with a strange error when it came to placing the torch in front of the chest placed to act as a storage chest for torches. At this point I mis-spelt the variable used to hold text in the line
local markerlogText = "placeStorage: placing marker "..storageName(line 6199)
Then when called to write to the logfile, because I put:
saveToLog(markerLogText, true, false)(Note the capital L)
this called:
function saveToLog(text, toScreen, verbose) toScreen = toScreen or true verbose = verbose or false if toScreen then print(text) end if fso:getUseLog() then fso:appendLine(text, verbose) end endOn cc 1.5.2 this had no effect that I was trying to write Nil to a text file, but on 1.6.3 the code simply stopped, with no error report.
To prevent this happening again, I modified the code to:
function saveToLog(text, toScreen, verbose) toScreen = toScreen or true verbose = verbose or false text = text or "Nil instead of text supplied, check your code!" if toScreen then print(text) end if fso:getUseLog() then fso:appendLine(text, verbose) end end
Re-uploaded to pastebin as version 1.0.5
#37
Posted 23 May 2014 - 02:33 AM
It did not give an error however it dug 2 sand underneath the sugarcane and started just spitting out this forever
dig.newDig: did not succeed after detect(), bedrock reached dig = 0 of bedrock into slot 0 at x=273 y=60 z=257
It's odd as it only hit smooth stone...
The turtle did however find the top of the sugarcane and dig down onto it, but then just dug the 2 sand underneath and broke
i had to terminate the program afterwards...
The same problem sort of happened again, however this time it didn't encounter the sugarcane and instead started or tried to start it's mine right next to water and when it went down a couple of blocks it said something about a cobble stopper, but didn't do anything, so i blocked off the water and he worked again, he even mined in the water a bit afterwards which confused me.
the water is the problem, after it dug up the second side on the mine, it encountered water above it while trying to go up, and calls it bedrock... removing the water works. Also i think my turtle got in a loop on checking if the sand is gravel. Eventually it stops and sorts, and then goes at it again. The line it tells me about is line 356 when i terminated which, guess what, you didn't have anything there about if it WAS sand.
Edited by Dragon53535, 23 May 2014 - 03:48 AM.
#38
Posted 23 May 2014 - 06:23 AM
It would be very helpful if you could post the seed of your world and the coordinates and direction facing at the first tree
(press T while playing then type /seed Enter)
Edit: sand and gravel check now working. Just need to look at the water problem, will upload ASAP
Also discovered a redstone from storage problem at the turtle crafting stage.
Edited by Inksaver, 23 May 2014 - 11:36 AM.
#39
Posted 23 May 2014 - 04:27 PM
x:264 y:65 z:254 Seed is -991485530 i faced west on the tree and started the turtle facing that way.
There was no sugarcane nearby so i put the sugarcane on x:273 z:257
Edited by Dragon53535, 23 May 2014 - 04:28 PM.
#40
Posted 24 May 2014 - 02:37 AM
There are several things that I am noticing are a bit odd, every time the turtle collects a sapling (spruce) it is spitting it out and not checking to see if it in fact a sapling, saying instead that it is an apple.
Im not sure if this is because of 1.4.7 or what but it is strange.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users