Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --http://www.youtube.com/watch?v=Eq27GOX71TU
- bot = 1 --assign OpenMech ID
- mech = peripheral.wrap("right") --attach robot controller
- mobs = mech.getMobIds(bot) --find mobs
- for k, mobId in pairs(mobs) do --get info on Mobs
- mob = mech.getMobData(bot, mobId)
- if mob ~= nil then --ensure we don't try to do the following if there aren't any mobs
- if mob.type ~= "entity.OpenPeripheral.RobotWarrior.name" then --don't target the OpenMech
- print("Targeting: "..mob.type) --print target mob
- mech.lookAt(bot, mob.position.x + mechX, mob.position.y + mechY + 1, mob.position.z + mechZ) --look at mob
- mech.fireLight(bot) --shoot light weapon
- end
- os.sleep(.1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement