Posted 10 January 2014 - 06:12 PM
Ok, so I'm kinda new to LUA, though, I know Java.
The error I get is that :21: is giving me a nil value.
The error I get is that :21: is giving me a nil value.
local motorSide = "right"
function info()
-- For directions, 0 is down, 1 is up, 2 is north (-Z), 3 is south (+Z), 4 is west (-X), and 5 is east (+X).
-- For the simulation flag, true is simulate (don't actually move anything) and false is don't simulate (actually move the carriage).
-- For the anchoring flag, true is the controller will stay where it is, and false is move the controller with the carriage.
-- If the command is not issued with correct syntax, or
-- if the carriage is somehow obstructed or malformed, an error1 will be printed;
-- If the carriage is not configured properly, the return code will be "false" and a plain-English error1 message;
-- If the carriage is obstructed, the return code will be "false", a plain-English error1 message, and the X/Y/Z coordinates of the obstruction;
-- Otherwise, the return code will be "true".
--drive=peripheral.wrap("left")
--drive.move(3,false,true)
--peripheral.call(motorSide,"move",2,false,false)
end
function north()
p=peripheral.wrap(motorSide)
peripheral.call(motorSide,"move",2,false,false)
--2
--drive.move(2,false,false)
end
function east()
p=peripheral.wrap(motorSide)
peripheral.call(motorSide,"move",5,false,false)
--5
--drive.move(5,false,false)
end
function south()
p=peripheral.wrap(motorSide)
peripheral.call(motorSide,"move",3,false,false)
--3
--drive.move(3,false,false)
end
function west()
p=peripheral.wrap(motorSide)
peripheral.call(motorSide,"move",4,false,false)
--4
--drive.move(4,false,false)
end
function down()
p=peripheral.wrap(motorSide)
peripheral.call(motorSide,"move",0,false,false)
--0
--drive.move(5,false,false)
end
function up()
p=peripheral.wrap(motorSide)
peripheral.call(motorSide,"move",1,false,false)
--1
--drive.move(6,false,false)
end
Edited by