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

Robot AI

Recommended Posts

My Robot AI uses blocks beneath the robot to identifiy a path to move along.

Everything is said in the script. Here is the pastebin:

https://pastebin.com/zKiLgp0N

pastebin get zKiLgp0N 

It uses robot inventory slots to compare the path blocks.

--[[
Ok so heres how this works.
You must place the control blocks in robot slots
1-5. 1: Forward, 2: Right, 3: Left, 4: Up,
5: Down.
]]--





local robot = require("robot")
while true do
robot.select(1)
if robot.compareDown() == true then
robot.forward()
end
robot.select(2)
if robot.compareDown() == true then
robot.turnRight()
robot.forward()
end
robot.select(3)
if robot.compareDown() == true then
robot.turnLeft()
robot.forward()
end
robot.select(4)
if robot.compareDown() == true then
robot.up()
robot.forward()
end
robot.select(5)
if robot.compareDown() == true then
robot.forward()
robot.down()
end
end

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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