Jump to content

Iworb

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Iworb

  1. Sorry for last post. I've found this. Now it works pretty good. while true do if rs.getInput("top") then sleep(12) local drive = peripheral.wrap("back") while true do local status, error = pcall(drive.move, 4, false, false) if status then break else print(error) sleep(1) end end else sleep(1) end end
  2. I have found this code: local drive = peripheral . wrap ( side ) local motionSucceeded , errorMessage , obstructX , obstructY , obstructZ = drive . move_anchored ( direction ) if ( motionSucceeded ) return if ( obstructX == nil ) do whatever in case of general error return do whatever in case of obstruction using the coordinates given But when I try to use "drive . move_anchored ( direction )" (direction = 4) I get an error "Attemp to call nil"
  3. If carriage moves function returns true, but if it can't move it close program. But what I need to do if I want to wait few seconds. It's like: wait and try to move carrige every 1 second. Here is my code (unworkable): while true do if rs.getInput("top") then sleep(12) drive = peripheral.wrap("back") while drive.move(4,true,false) ~= true do sleep(1) end drive.move(4,false,false) else sleep(1) end end
×
×
  • Create New...