package management
This commit is contained in:
28
neural/neuralSword.lua
Normal file
28
neural/neuralSword.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
_G.requireInjector(_ENV)
|
||||
|
||||
local ni = require('neural.interface')
|
||||
local Util = require('util')
|
||||
|
||||
local os = _G.os
|
||||
|
||||
while true do
|
||||
local target = Util.find(ni.sense(), 'name', 'joebodo')
|
||||
if target then
|
||||
if math.abs(target.x) < 2 and
|
||||
math.abs(target.z) < 2 then
|
||||
ni.lookAt(target)
|
||||
ni.swing()
|
||||
os.sleep(.5)
|
||||
else
|
||||
local angle = math.atan2(-(target.x - .5), target.z - .5)
|
||||
ni.walkTo({
|
||||
x = target.x + 1.5 * math.sin(angle),
|
||||
y = 0,
|
||||
z = target.z - 1.5 * math.cos(angle)
|
||||
}, 1)
|
||||
end
|
||||
else
|
||||
print('no target')
|
||||
os.sleep(1)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user