Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

zeek6728

Members
  • Content Count

    2
  • Joined

  • Last visited

Posts posted by zeek6728

  1. I made my first tier 3 robot and I gave it the same program that I gave to my other but i change the program so it will repeat if an object is still in front of it
    i give it the same tool for mining like i always have a Diamond Drill from industrialcraft
    but it just swing at the Block doing the little puff of smoke animation without breaking the block i even gave it a normal pick
    I tried to pick it up and put it back down but it's the same thing I even restarted the world
     

    in case it's my programming that is wrong here's my script

    local robot = require("robot")
    local component = require("component")
    local g = component.generator
    
    
    local x = 0
    
    function dig()
      
      repeat
        if g.count() < 10 and robot.count(2) > 1 then
          robot.select(2)
          g.insert(1)
          robot.select(1)
        end
        if robot.detectUp == true then
          repeat
            robot.swingUp()
            os.sleep(1)
          until(robot.detectUp == false)
        end
        if robot.detect == true then
          repeat
            robot.swing()
            os.sleep(1)
          until(robot.detect == false)
        end
        robot.forward()
        if robot.detectDown() == false then
          robot.placeDown()
        end
        x = x + 1
      until(robot.durability() == 0 or robot.count(robot.inventorySize()) > 0)
      robot.turnAround()
      repeat
        robot.swing()
        robot.forward()
        x = x - 1
      until(x == 0)
      
      repeat
        os.sleep(1)
      until(robot.durability() > 0 and robot.count(robot.inventorySize()) == 0)
      robot.turnLeft()
      for i = 0,2 do
        if robot.detectUp == true then
          repeat
            robot.swingUp()
            os.sleep(1)
          until(robot.detectUp == false)
        end
        if robot.detect == true then
          repeat
            robot.swing()
            os.sleep(1)
          until(robot.detect == false)
        end
        robot.forward()
        if robot.detectDown() == false then
          robot.placeDown()
        end
      end
      robot.turnLeft()
    end
    
    while(true) do
      dig()
    end

     

  2. I'm new with lua and I'm trying to set up a tablet to send  strings or values to a bot but all i know is how to broadcast but I don't know how to respond to the broadcast 
    what i was planning on doing is have a way to write programs on my tablet to send strings or values to the robot, when the robot receive these certain strings or values i would have the robot do certain functions in response
    I can figure out that part all I would like to know is how to get the robot tack the broadcast that that it got form the tablet and set it to a value for it or something

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.