This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TehBinky's profile picture

My first program has an error i don't know how to fix

Started by TehBinky, 03 December 2013 - 06:27 PM
TehBinky #1
Posted 03 December 2013 - 07:27 PM
Hello anyone and everyone reading this I am a newbie with ComputerCraft and I am just getting started i wanted to write a program to run continuously cutting down a tree to make charcoal rather than using someone else's program I thought the best way to learn would be to try it myself although I'm having some troubles getting the program to function here is the code http://pastebin.com/KXiXJptg any help would be greatly appreciated.

The error I am getting is bios:339: [string "charcoal"]:94: 'end' expected (to close 'function' at line 68)
Edited by
Okyloky9 #2
Posted 03 December 2013 - 07:48 PM
The function is just "sleep(time)" so in your case, sleep(180). Also, your function getBone is missing an end. One for the function and one for the if statement
Edited on 03 December 2013 - 06:49 PM
Robotonic #3
Posted 03 December 2013 - 07:58 PM
Also, end the function and the if.
TehBinky #4
Posted 03 December 2013 - 08:23 PM
Thank you so much for the help i changed what you said was wrong and now im getting :82 attempt to call nil here is an updated version of the code http://pastebin.com/uF0sERq4
awsmazinggenius #5
Posted 03 December 2013 - 08:33 PM
You call just getSap(), not turtle.getSap(). Same for the other functions. Have you read the "Read this before Asking Questions" sticky?