Orbiting and MWDing

Digi

Member
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

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  
	}
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
 

CyberTech

Rest in Peace
Staff member
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

Code:
    Me.ActiveTarget:Orbit[1500]
    While ${Me.ActiveTarget.Distance} > 5500
    {
       Ship:Activate_AfterBurner
       if ${Social.IsSafe}
        {
          wait 1
You're attempting to activate your AB every 1/10 of a second. Move it out of the loop.
 

Digi

Member
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]
    if ${Me.ActiveTarget.Distance} > 5000
    {
      Ship:Activate_AfterBurner
    }
    While ${Me.ActiveTarget.Distance} > 4000
    {
       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  
	}
That should be more elegant, activates the MWD on Pulse only if its to far to slowboat, and dosnt waste ammo if its out of optimal
 
Top Bottom