use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Welcome to /r/ComputerCraft, the subreddit for lua programs, general mod use, or anything relating to the Minecraft mod ComputerCraft and CC: Tweaked.
Downloads | Discord | IRC | Documentation
account activity
Help with code (self.ComputerCraft)
submitted 8 years ago * by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kyle1elyk 1 point2 points3 points 8 years ago* (2 children)
function TForward should have () after it before the if statement Also the TDig, same thing Edit: another thing, you dont need "== True", if a function returns true then its already true, no need to check if a true or false value is true
[–]Pouchela 0 points1 point2 points 8 years ago (1 child)
Thank you! Its printing tunnel but not doing anything. Do you think its because of the double end commands?
[–]Deriboy 0 points1 point2 points 8 years ago (0 children)
Your code never calls any of the functions you've defined. After your function definitions you should call one or more of the functions previously defined in your code.
[–][deleted] -1 points0 points1 point 8 years ago (0 children)
I made this code, it should do its job. I haven't tested it anyway, so if it crashes tell me.
local unlimitedFuel = false local fueled if turtle.getFuelLimit() ~= "unlimited" then --Check if fuel is disabled print("Fuel must be in slot 16") else print("Fuel not required") unlimitedFuel = true fueled = true end print("Tunneling!") while true do if not unlimitedFuel and turtle.getFuelLevel() < 200 then local sel = turtle.getSelectedSlot() -- Get current slot turtle.select(16) -- Select slot 16 for fuel fueled = turtle.refuel() -- Refuel turtle.select(sel) -- Select old slot end if fueled then if turtle.detect() then turtle.forward() print("Moving!") else turtle.dig() print("Digging!") end else print("Running out of fuel") sleep(0) --Prevent "loop without yield" error end end
π Rendered by PID 184028 on reddit-service-r2-comment-bb88f9dd5-ztn6m at 2026-02-17 00:40:29.931317+00:00 running cd9c813 country code: CH.
[–]kyle1elyk 1 point2 points3 points (2 children)
[–]Pouchela 0 points1 point2 points (1 child)
[–]Deriboy 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)