neural cleanup
This commit is contained in:
@@ -43,17 +43,10 @@ function Neural.launchTo(pt, strength)
|
||||
math.pow(pt.x, 2) +
|
||||
math.pow(pt.z, 2))
|
||||
strength = math.sqrt(math.max(32, dist) / 3)
|
||||
debug(strength)
|
||||
end
|
||||
Neural.launch(yaw, 225, strength or 1)
|
||||
end
|
||||
|
||||
function Neural.dropArmor()
|
||||
for i = 3, 5 do
|
||||
Neural.unequip(i)
|
||||
end
|
||||
end
|
||||
|
||||
function Neural.walkTo(pt, speed)
|
||||
Neural.walk(pt.x, pt.y, pt.z, speed)
|
||||
os.sleep(1)
|
||||
@@ -81,6 +74,12 @@ function Neural.getEquipmentList()
|
||||
return l
|
||||
end
|
||||
|
||||
function Neural.dropArmor()
|
||||
for i = 3, 5 do
|
||||
Neural.unequip(i)
|
||||
end
|
||||
end
|
||||
|
||||
function Neural.equip(slot)
|
||||
return Neural.getEquipment and Neural.getEquipment().suck(slot) or 0
|
||||
end
|
||||
@@ -89,14 +88,6 @@ function Neural.unequip(slot)
|
||||
return Neural.getEquipment and Neural.getEquipment().drop(slot)
|
||||
end
|
||||
|
||||
function Neural.getUniqueNames()
|
||||
local t = { }
|
||||
for _,v in pairs(Neural.sense()) do
|
||||
t[v.name] = v.name
|
||||
end
|
||||
return Util.transpose(t)
|
||||
end
|
||||
|
||||
function Neural.lookAt(pt)
|
||||
if pt then
|
||||
local yaw, pitch = Angle.towards(pt.x, pt.y, pt.z)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
local Angle = require('neural.angle')
|
||||
local Util = require('util')
|
||||
|
||||
local device = _G.device
|
||||
local os = _G.os
|
||||
|
||||
local module = device['plethora:kinetic'] or error('Missing kinetic')
|
||||
|
||||
local Kinetic = Util.shallowCopy(module)
|
||||
|
||||
function Kinetic.lookAt(pt)
|
||||
if pt then
|
||||
local yaw, pitch = Angle.towards(pt.x, pt.y, pt.z)
|
||||
return Kinetic.look(yaw, pitch)
|
||||
end
|
||||
end
|
||||
|
||||
function Kinetic.fireAt(pt)
|
||||
local yaw, pitch = Angle.towards(pt.x, pt.y, pt.z)
|
||||
return Kinetic.fire(yaw, pitch, .5)
|
||||
end
|
||||
|
||||
function Kinetic.walkTo(pt)
|
||||
Kinetic.walk(pt.x, 0, pt.z)
|
||||
os.sleep(1)
|
||||
repeat until not Kinetic.isWalking()
|
||||
end
|
||||
|
||||
function Kinetic.walkAgainst(pt, radius)
|
||||
local angle = math.atan2(pt.x, pt.z)
|
||||
local x = pt.x - ((radius or .8) * math.sin(angle))
|
||||
local z = pt.z - ((radius or .8) * math.cos(angle))
|
||||
|
||||
Kinetic.walk(x, 0, z)
|
||||
os.sleep(1)
|
||||
repeat until not Kinetic.isWalking()
|
||||
end
|
||||
|
||||
function Kinetic.testWalk()
|
||||
local e = Kinetic.getMetaByName('kepler155c')
|
||||
Kinetic.walkToEntity(e)
|
||||
end
|
||||
|
||||
|
||||
return Kinetic
|
||||
Reference in New Issue
Block a user