This is a Snippet for the fight function to make it fly a short ranged ship that needs to MWD into range to be effective,
I was testing with a Blaster Diemos and with some help from Val i got it working pretty flawlessly
I added the safecheck though im not sure if its needed.
Anything else that may be usefull or that can be improved id love to hear it
I was testing with a Blaster Diemos and with some help from Val i got it working pretty flawlessly
Code:
function Fight()
{
Ship:Deactivate_Cloak
while ${Ship.IsCloaked}
{
wait 1
}
;Ship:Offline_Cloak
;Ship:Online_Salvager
; Reload the weapons -if- ammo is below 30% and they arent firing
Ship:Reload_Weapons[FALSE]
; Activate the weapons, the modules class checks if there's a target (no it doesn't - ct)
Me.ActiveTarget:Orbit[1500]
While ${Me.ActiveTarget.Distance} > 5500
{
Ship:Activate_AfterBurner
if ${Social.IsSafe}
{
wait 1
}
else
{
call This.Flee
}
;UI:UpdateConsole["Range to target = ${Me.ActiveTarget.Distance}"]
}
Ship:Deactivate_AfterBurner
Ship:Activate_Weapons
Ship:Activate_TargetPainters
Ship:Activate_StasisWebs
Ship.Drones:SendDrones
}
Anything else that may be usefull or that can be improved id love to hear it