Posted 09 April 2013 - 03:12 PM
Hello there, I'm newbie and i'm having some problems calling functions in my program that are in another API.
'tunnel' Program
http://pastebin.com/CqBSGd2F
and the API
http://pastebin.com/k8NAxnFc
The error
tunnel: 66: attempt to index ? (a nil value)
== I replaced that line with the code in the function
THEN
tunnel: 84: attempt to index ? (a nil value)
Attempts to load the API via 'lua' in computer throws this error
Steps attempted
1. So I have tried replacing code for line 66, and that did work but then it just fell through at line 84 again
2. I know the API does not load properly and throws a hissy fit at line 130 but I don't see what's wrong
Much help would be much appreciated, Thank you in advance.
Sincerely,
UltraNoobian.
'tunnel' Program
http://pastebin.com/CqBSGd2F
and the API
http://pastebin.com/k8NAxnFc
The error
tunnel: 66: attempt to index ? (a nil value)
== I replaced that line with the code in the function
-if (turt.hasModem() == true) then
+if(peripheral.getType("right") == "modem") then
THEN
tunnel: 84: attempt to index ? (a nil value)
turt.straightCut(height)
Attempts to load the API via 'lua' in computer throws this error
bios:338: [string "turt"]: 130: '<name>' expected
false
Steps attempted
1. So I have tried replacing code for line 66, and that did work but then it just fell through at line 84 again
2. I know the API does not load properly and throws a hissy fit at line 130 but I don't see what's wrong
for (slot = 1, 15, 1) do
Much help would be much appreciated, Thank you in advance.
Sincerely,
UltraNoobian.