Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
- peripheral.wrap(motorSide)
- peripheral.call(motorSide,"move",2,false,false)
- --2
- --drive.move(2,false,false)
- end
- function east()
- peripheral.wrap(motorSide)
- peripheral.call(motorSide,"move",5,false,false)
- --5
- --drive.move(5,false,false)
- end
- function south()
- peripheral.wrap(motorSide)
- peripheral.call(motorSide,"move",3,false,false)
- --3
- --drive.move(3,false,false)
- end
- function west()
- peripheral.wrap(motorSide)
- peripheral.call(motorSide,"move",4,false,false)
- --4
- --drive.move(4,false,false)
- end
- function down()
- peripheral.wrap(motorSide)
- peripheral.call(motorSide,"move",0,false,false)
- --0
- --drive.move(5,false,false)
- end
- function up()
- peripheral.wrap(motorSide)
- peripheral.call(motorSide,"move",1,false,false)
- --1
- --drive.move(6,false,false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement