PBDO Need Task Help :S

02/24/2013 19:19 Requi#1
Hey Guys,

I need help for a Task. Because on int2 is PvP so easy and I don't want be shoot down at botting I made in the Taskcreator, Shootback = True.

But how I can switch the Ammo there?

If a Enemy shoot on me, it should switch on x4 and shoot him down.

But how?

My Task atm:

Code:
using System.Threading;
using System.Collections.Generic;
using PBDOBot.Helper;
using PBDOBot.Api;
using PBDOBot.Api.Task;

namespace Tasks
{
    public class Task : BBaseTask
    {

        public override void OnReset()
        {
		TaskScript = new TaskScript(
		delegate()
		{

			if (BMain.Me.SelectedShip != null && BMain.Me.SelectedShip.Name == BMain.Npc.Streuner | BMain.Me.SelectedShip.Name == BMain.Npc.Lordakia | BMain.Me.SelectedShip.Name == BMain.Npc.BossLordakia | BMain.Me.SelectedShip.Name == BMain.Npc.BossStreuner)
			{
                                    if (BMain.Me.SelectedShip.Shield > 0) {LaserAmmoType = Enums.LaserAmmoType.LCB_10;} else {LaserAmmoType = Enums.LaserAmmoType.LCB_10;}
                                    MinDurability = 50;
                                    StandardConfiguration = 1;
                                    UsePet = false;
			}
			else
			{
                                    MinDurability = 20;
                                    StandardConfiguration = 1;
                                    UsePet = false;

			}
			return -1;
		},
		delegate()
				{
			return true;
		},
		1000);

            Enums.ResourceType[] protectedCollection = new Enums.ResourceType[] { 

             };
            this.ProtectResourcesList.AddRange(protectedCollection);

			Dictionary<string, Enums.ResourceType> boostCollection = new Dictionary<string, Enums.ResourceType>();

			this.BoostDictionary = boostCollection;
        }

        public override void ChooseLogic()
        {
           if (!ActionList.Contains("PBDO-Bot Task"))
            {
                BMain.WriteLog("Task created with Taskcreator by Dr. Moc");
                Reset();


                TaskMap = "x-2";
                HuntNpcsList.Add(BMain.Npc.Streuner);
                HuntNpcsList.Add(BMain.Npc.Lordakia);
                HuntNpcsList.Add(BMain.Npc.BossLordakia);
                HuntNpcsList.Add(BMain.Npc.BossStreuner);

                AttackNpcs = true;
                BMain.WriteLog("We will attack NPCs");
                AttackTaggedNpcs = true;
                AttackBossNpcs = true;
                BMain.WriteLog("We will attack boss NPCs");
                AnswerAttacks = true;
                AttackPlayersShipsList.Add(Enums.ShipType.Phoenix);
                AttackPlayersShipsList.Add(Enums.ShipType.Yamato);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Veteran);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Bastion);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Exalted);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Venom);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Sentinel);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Dimisher);
                AttackPlayersShipsList.Add(Enums.ShipType.Aegis);
                AttackPlayersShipsList.Add(Enums.ShipType.Spearhead);
                AttackPlayersShipsList.Add(Enums.ShipType.Citadel);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Spectrum);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Solace);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath);
                AttackPlayersShipsList.Add(Enums.ShipType.Goliath_Enforcer);
                AttackPlayersShipsList.Add(Enums.ShipType.Leonov);
                AttackPlayersShipsList.Add(Enums.ShipType.Bigboy);
                AttackPlayersShipsList.Add(Enums.ShipType.Defcom);
                AttackPlayersShipsList.Add(Enums.ShipType.Leonov_Home);
                AttackPlayersShipsList.Add(Enums.ShipType.Liberator);
                AttackPlayersShipsList.Add(Enums.ShipType.Nostromo);
                AttackPlayersShipsList.Add(Enums.ShipType.Piranha);
                AttackPlayersShipsList.Add(Enums.ShipType.Vengeance);
                AttackPlayersShipsList.Add(Enums.ShipType.Vengeance_Lightning);
                AttackPlayersShipsList.Add(Enums.ShipType.Vengeance_Avenger);
                AttackPlayersShipsList.Add(Enums.ShipType.Vengeance_Revenge);
                AttackPlayersShipsList.Add(Enums.ShipType.Vengeance_Adept);

                Repair = true;
                MinDurability = 20;
                BMain.WriteLog("We will repair if hitpoint are lower then 20%");
                StandardConfiguration = 1;
                CollectBonusBoxes = true;
                BMain.WriteLog("We will collect bonusboxes");
                SafeBotting = true;
                TimeBetweenBoxes = 4;
                LaserAmmoType = Enums.LaserAmmoType.LCB_10;
                RocketAmmoType = Enums.RocketAmmoType.PLT_2026;
                RocketLauncherAmmoType = Enums.RocketLauncherAmmoType.ECO10;

                ActionList.Add("PBDO-Bot Task");
            }
        }
    }
}

Regards,
ya Pony
02/24/2013 19:23 »[●!đełтα●føя¢e!™●]«#2
[Only registered and activated users can see links. Click Here To Register...]
02/24/2013 19:51 Scytex#3
Code:
if (BMain.Me.AttackedByPlayer)
                {
                    if (BMain.Me.GetAmmoCount(Enums.LaserAmmoType.RSB_75) >= 1000 && BMain.Me.GetAmmoCount(Enums.LaserAmmoType.UCB_100) >= 1000)
                    {
                        if (LaserAmmoType != Enums.LaserAmmoType.RSB_75)
                        {
                            BMain.Me.SetLaserAmmo(Enums.LaserAmmoType.RSB_75);
                            return 500;
                        }

                        if (LaserAmmoType != Enums.LaserAmmoType.UCB_100)
                        {
                            BMain.Me.SetLaserAmmo(Enums.LaserAmmoType.UCB_100);
                            return 3000;
                        }
                    }
 }
Code von Sshanesilberfalke ausm PBDO Forum :D
02/24/2013 19:59 Peshо#4
Just put

AnswerAttacks = true;