Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Problem]Zbyt inteligentny task.


foxx1009

Rekomendowane odpowiedzi

Opublikowano

Witam, czy mógłby ktoś mi przerobić tego taska tak aby nie używał RSB i x4 kiedy ktoś go atakuje?

 

 

 

using System;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using PBDOBot.Helper;
using PBDOBot.Api;
using PBDOBot.Api.Task;
/* _________ .__ .__.__ ___. _____ .__ __
/ _____/ _____| |__ _____ ____ ____ _____|__| |\_ |__ ____________/ ____\____ | | | | __ ____
\_____ \ / ___/ | \\__ \ / \_/ __ \ / ___/ | | | __ \_/ __ \_ __ \ __\\__ \ | | | |/ // __ \
/ \\___ \| Y \/ __ \| | \ ___/ \___ \| | |_| \_\ \ ___/| | \/| | / __ \| |_| <\ ___/
/_______ /____ >___| (____ /___| /\___ >____ >__|____/___ /\___ >__| |__| (____ /____/__|_ \\___ >
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
.___ _________ .__ .__
_____ ____ __| _/ / _____/ _______________________ ____ |__| ____ | |
______ \__ \ / \ / __ | ______ \_____ \_/ __ \_ __ \_ __ \__ \ / \| |/ __ \| |
/_____/ / __ \| | \/ /_/ | /_____/ / \ ___/| | \/| | \// __ \| | \ \ ___/| |__
(____ /___| /\____ | /\ /_______ /\___ >__| |__| (____ /___| /__|\___ >____/
\/ \/ \/ )/ \/ \/ \/ \/ \/
____ ____
___ __ ___________ /_ | /_ |
\ \/ // __ \_ __ \ | | | |
\ /\ ___/| | \/ | | | |
\_/ \___ >__| |___| /\ |___|
\/ \/
*/
namespace PBDOBot.Api.Task
{
public class Task : BBaseTask
{
#region Task Configuration
/* You really should only need to change shiz here! */
bool UseHangarChange = false;
bool UseAmmoChanger = true;
bool UseShipAbilities = true;
bool UseRocketBuyCPU = true;
bool UseTechCenter = false;
bool RocketLauncher = true;
bool UseDroneChanger = true;
bool UseRsbChanger = false; //may waste ammo if you set to 'true' or interrupts shooting if you are out of Ammo
bool CloakOnSell = false;
bool RepairDronesTaskScript = true;
bool BreakScript = false;
public int RocketBuyConfig = 1;
public int HellstormBuyConfig = 2;
public int CollectionHangar = 5;
public int SellHangar = 6;
bool BoostLasersWithSeprom = true;
bool BoostRocketsWithSeprom = true;
bool BoostEnginesWithPromerium = true;
bool BoostShieldsWithSeprom = true;
public Enums.LaserAmmoType LaserAmmo = Enums.LaserAmmoType.MCB_25;
public Enums.RocketAmmoType RocketAmmo = Enums.RocketAmmoType.PLT_2021;
public Enums.RocketLauncherAmmoType RocketLauncherAmmo = Enums.RocketLauncherAmmoType.ECO10;
#endregion
#region ITaskScripts
/* ITaskScript MPCforum */
class IHangarChange : ITaskScript
{
public IHangarChange()
: base("HangarChange", 15000, 10, true)
{
}
public override int Run()
{
int hangarCollect = ((Task)Task).CollectionHangar;
int hangarSell = ((Task)Task).SellHangar;
int timer = Task.BMain.Me.Premium ? 5 : 20;
int cargo = Task.BMain.Me.FreeCargo - Task.MinFreeSlots;
// Fly to safety in 5-3
if (cargo <= 0 && Task.BMain.MapName == "5-3" && !Task.BMain.Me.InNoAttackZone && Task.BMain.LoggedIn)
{
Task.IdleInSafety = true;
Task.BMain.WriteLog("Flying to safety to change hangar");
}
// Logout when in safety
else if (cargo <= 0 && Task.BMain.MapName == "5-3" && Task.BMain.Me.InNoAttackZone && Task.BMain.LoggedIn)
{
Task.BMain.Actions.LogOff(180 + timer);
Task.BMain.WriteLog("Logging out to switch hangar");
}
// Trigger Selling in 5-3
else if (cargo <= 0 && Task.BMain.MapName == "5-2" && Task.BMain.LoggedIn)
{
Task.SellPalladium = true;
Task.Sell = true;
Task.BMain.WriteLog("Selling Palladium");
return 1500;
}
// Logout when sold
else if (cargo > 0 && Task.BMain.MapName == "5-2" && Task.BMain.Equip.Ship.CurrentHangar != hangarCollect && Task.BMain.Me.InNoAttackZone && Task.BMain.LoggedIn)
{
Task.IdleInSafety = true;
Task.BMain.Actions.LogOff(180 + timer);
Task.BMain.WriteLog("Logging out to switch hangar");
}
// Flee to safety to logout after selling
else if (cargo > 0 && Task.BMain.MapName == "5-2" && Task.BMain.Equip.Ship.CurrentHangar != hangarCollect && !Task.BMain.Me.InNoAttackZone && Task.BMain.LoggedIn)
{
Task.IdleInSafety = true;
Task.BMain.WriteLog("Flying to safety to change hangar");
}
// Login to selling hangar
if (!Task.BMain.LoggedIn && Task.BMain.MapName == "5-3")
{
Task.BMain.Equip.Ship.ChangeHangars(hangarSell);
Task.BMain.Actions.LogOn();
Task.BMain.WriteLog("Switching to chosen sell hangar");
}
// Login to collection hangar
else if (!Task.BMain.LoggedIn && Task.BMain.MapName == "5-2")
{
Task.BMain.Equip.Ship.ChangeHangars(hangarCollect);
Task.BMain.Actions.LogOn();
Task.BMain.WriteLog("Switching to chosen collect hangar");
}
return -1;
}
public override bool NeedRun()
{
return Task.BMain.EquipmentLoaded;
}
}
class IShootPeepz : ITaskScript
{
public IShootPeepz()
: base("AmmoChanger", 2000,10)
{
}
public override int Run()
{
if (Task.BMain.Me.SelectedShip.IsNpc)
{
if (Task.BMain.Me.SelectedShip.Shield > 300000) { Task.BMain.Actions.SetDroneFormation(Enums.DroneFormation.Heart); } else { Task.BMain.Actions.SetDroneFormation(Enums.DroneFormation.Chevron); }
if (Task.BMain.Me.SelectedShip.Shield > 0) { Task.BMain.Me.SetLaserAmmo(Enums.LaserAmmoType.SAB); } else { Task.BMain.Me.SetLaserAmmo(((Task)Task).LaserAmmo); }
}
else
{
if (Task.BMain.Me.GetAmmoCount(Enums.LaserAmmoType.RSB_75) >= 1000 && Task.BMain.Me.GetAmmoCount(Enums.LaserAmmoType.UCB_100) >= 1000)
{
if (Task.LaserAmmoType != Enums.LaserAmmoType.RSB_75)
{
Task.BMain.Me.SetLaserAmmo(Enums.LaserAmmoType.RSB_75);
return 500;
}
if (Task.LaserAmmoType != Enums.LaserAmmoType.UCB_100)
{
Task.BMain.Me.SetLaserAmmo(Enums.LaserAmmoType.UCB_100);
return 3000;
}
}
if (Task.BMain.Actions.CanUseInstaShield && Task.BMain.Me.Hitpoints <= 50000) Task.BMain.Actions.UseInstaShield();
if (Task.BMain.Actions.CanUseEmp && Task.BMain.Me.Hitpoints <= 30000) Task.BMain.Actions.UseEmp();
if (Task.BMain.Me.Shield <= Task.BMain.Me.MaxShield * 0.1 && Task.BMain.Actions.CanUseTech(Enums.TechType.ShieldBackup)) Task.BMain.Actions.UseTech(Enums.TechType.ShieldBackup);
}
return -1;
}
public override bool NeedRun()
{
return Task.BMain.Me.SelectedShip != null;
}
}
class ISurvive : ITaskScript
{
public ISurvive()
: base("ShipAbilities", 5000, 9)
{
}
public override int Run()
{
if (Task.BMain.Actions.CanUseAbility(Enums.ShipAbility.Aegis_Shield_Repair) && Task.BMain.Me.Shield <= (Task.BMain.Me.MaxShield - 75000))
{
Task.BMain.Actions.UseAbility(Enums.ShipAbility.Aegis_Shield_Repair);
}
if (Task.BMain.Actions.CanUseAbility(Enums.ShipAbility.Aegis_Health_Repair) && Task.BMain.Me.Hitpoints <= (Task.BMain.Me.MaxHitpoints - 100000))
{
Task.BMain.Actions.UseAbility(Enums.ShipAbility.Aegis_Health_Repair);
}
if (Task.BMain.Actions.CanUseAbility(Enums.ShipAbility.Aegis_Health_Pod) && Task.BMain.Me.Hitpoints <= 100000)
{
Task.BMain.Actions.UseAbility(Enums.ShipAbility.Aegis_Health_Pod);
}
return -1;
}
public override bool NeedRun()
{
return (Task.BMain.Actions.CanUseAbility(Enums.ShipAbility.Aegis_Shield_Repair) || Task.BMain.Actions.CanUseAbility(Enums.ShipAbility.Aegis_Health_Repair) || Task.BMain.Actions.CanUseAbility(Enums.ShipAbility.Aegis_Health_Pod));
}
}
class ICanHazRocketz : ITaskScript
{
public ICanHazRocketz()
: base("RocketBuyCPU", 2000, 7)
{
}
public override int Run()
{
int RocketCount = Task.BMain.Me.GetAmmoCount(((Task)Task).RocketAmmo);
if (RocketCount < 10)
{
Task.StandardConfiguration = ((Task)Task).RocketBuyConfig;
Task.SwitchConfigWhenShieldLow = false;
return 5000; // Config Change Cooldown
}
else
{
Task.StandardConfiguration = ((Task)Task).HellstormBuyConfig;
Task.SwitchConfigWhenShieldLow = true;
}
if (RocketCount > 300)
return 120000; // I doubt we will use 300 rockets in less than 2 mins. This gives the CPU back some processing time!
return -1;
}
public override bool NeedRun()
{
return true;
}
}
class IHazSuperPowerz : ITaskScript
{
public IHazSuperPowerz()
: base("TechCenter", 1000, 6)
{
}
public override int Run()
{
Task.BMain.Actions.UseTech(Enums.TechType.RocketPrecision);
return 1200000; // Precision Targeter Duration and Cooldown
}
public override bool NeedRun()
{
return Task.BMain.Actions.CanUseTech(Enums.TechType.RocketPrecision) && Task.BMain.Actions.GetTechAmount(Enums.TechType.RocketPrecision) > 10;
}
}
class IChangeDrones : ITaskScript
{
public IChangeDrones()
: base("IChangeDrones", 1000, 6)
{
}
public override int Run()
{
if(Task.BMain.Me.SelectedShip != null)
Task.BMain.Actions.SetDroneFormation(Enums.DroneFormation.Chevron);
else
Task.BMain.Actions.SetDroneFormation(Enums.DroneFormation.Heart);
return -1;
}
public override bool NeedRun()
{
return true;
}
}
class IRsbChanger : ITaskScript
{
private bool usingRsb = false;
public IRsbChanger()
: base("IRsbChanger", 1000, 6)
{
}
public override int Run()
{
if(Task.BMain.Me.SelectedShip != null)
{
if(usingRsb)
{
usingRsb = false;
Task.BMain.Me.SetLaserAmmo(Enums.LaserAmmoType.UCB_100);
return 3000;
}
else
{
usingRsb = true;
Task.BMain.Me.SetLaserAmmo(Enums.LaserAmmoType.RSB_75);
return 750;
}
}
return -1;
}
public override bool NeedRun()
{
return true;
}
}
public class IRepairDronesTaskScript : ITaskScript
{
public IRepairDronesTaskScript()
: base("RepairDronesTaskScript", 15 * 1000)
{
}
public override int Run()
{
var drones = Task.BMain.Equip.Ship.DroneInfo;
foreach (var drone in drones)
{
if (double.Parse(drone.HP.TrimEnd( new char[] { '%', ' ' } )) / 100 >= 0.91)
{
Task.BMain.WriteLog("Trying to repair Drone " + drone.I);
if (Task.BMain.Equip.Ship.RepairDrone(drone.I))
Task.BMain.WriteLog("Successfully repaired " + drone.I);
else
Task.BMain.WriteLog("Failed to repair " + drone.I);
}
}
return -1;
}
public override bool NeedRun()
{
return true;
}
}
public class IBreakScript : ITaskScript
{
public IBreakScript()
: base("BreakScript", 1000, 1)
{
}
public override bool NeedRun()
{
return true;
}
public override int Run()
{
{
if (!Task.Buffer.ContainsKey("time1")) {Task.Buffer.Add("time1", 0);}
if (!Task.Buffer.ContainsKey("time2")) {Task.Buffer.Add("time2", 0);}
if (!Task.Buffer.ContainsKey("counter1")) {
Task.Buffer.Add("counter1", BHelper.RandomNumber(600, 3420));
Task.BMain.WriteLog(">>>> PAUSE in " + ((int)Task.Buffer["counter1"] / 60) + " min <<<<");
}
if (!Task.Buffer.ContainsKey("counter2")) {Task.Buffer.Add("counter2", BHelper.RandomNumber(120, 420));}
if (!Task.Buffer.ContainsKey("process")) {Task.Buffer.Add("process", true);}
if((int)Task.Buffer["time1"] >= (int)Task.Buffer["counter1"] && Task.BMain.Me.SelectedShip == null) {
if((bool)Task.Buffer["process"]) {
Task.BMain.WriteLog(">>>> PAUSE für " + ((int)Task.Buffer["counter2"] / 60) + " min <<<<");
Task.Buffer["process"] = false;
Task.IdleInSafety = true;
}
if((int)Task.Buffer["time2"] >= (int)Task.Buffer["counter2"]) {
Task.Buffer["process"] = true;
Task.Buffer["counter1"] = BHelper.RandomNumber(600, 3420);
Task.Buffer["counter2"] = BHelper.RandomNumber(120, 420);
Task.BMain.WriteLog(">>>> PAUSE in " + ((int)Task.Buffer["counter1"] / 60) + " min für "+ ((int)Task.Buffer["counter2"] / 60) +" min <<<<");
Task.Buffer["time1"] = 0;
Task.Buffer["time2"] = 0;
Task.IdleInSafety = false;
}
if (Task.BMain.Me.InNoAttackZone || Task.BMain.Me.IsInBase) {
Task.Buffer["time2"] = ((int)Task.Buffer["time2"]) + 1;
}
}
Task.Buffer["time1"] = ((int)Task.Buffer["time1"]) + 1;
}
return -1;
}
}
#endregion
public override void OnReset()
{
this.BoostDictionary = new Dictionary<string, Enums.ResourceType> {
{ "Lasers", Enums.ResourceType.ore_seprom },
{ "Rockets", Enums.ResourceType.ore_seprom },
{ "Speed", Enums.ResourceType.ore_promerium },
{ "Shield", Enums.ResourceType.ore_seprom },
};
if (UseHangarChange)
this.TaskScripts.Add(new IHangarChange()); // Hangar Change
if (UseAmmoChanger)
this.TaskScripts.Add(new IShootPeepz()); // Ammo Changer
if (UseShipAbilities)
this.TaskScripts.Add(new ISurvive()); // Ship Abilities
if (UseRocketBuyCPU)
this.TaskScripts.Add(new ICanHazRocketz()); // Auto Rocket Buy
if (UseTechCenter)
this.TaskScripts.Add(new IHazSuperPowerz()); // Tech Center
if(UseDroneChanger)
this.TaskScripts.Add(new IChangeDrones()); //Dron Chnger
if(UseRsbChanger)
this.TaskScripts.Add(new IRsbChanger()); // Rsb Changer
if(RepairDronesTaskScript)
this.TaskScripts.Add(new IRepairDronesTaskScript()); //Drone Repair
if(BreakScript)
this.TaskScripts.Add(new IBreakScript()); //Break Script
}
public override void ChooseLogic()
{
if (!ActionList.Contains("Palladium Task :D"))
{
BMain.WriteLog("Palladium Task by Sshanesilberfalke");
BMain.WriteLog("\u00A9 Made by Sshanesilberfalke with special thanks to Serraniel,jD");
TaskMap = "5-3";
Restock = false;
#region Ammo
UseRocketLauncher = RocketLauncher;
LaserAmmoType = LaserAmmo;
RocketAmmoType = RocketAmmo;
RocketLauncherAmmoType = RocketLauncherAmmo;
#endregion
#region Konfi und so..
StandardConfiguration = 1;
Repair = true;
MinDurability = 40;
MaxDurability = 100;
#endregion
#region PET
UsePet = true;
PetMode = Enums.PetMode.Auto_Resource_Collector;
RestockPetFuel = true;
PetFuelMinAmount = 500;
PetFuelMaxAmount = 10000;
PetMinDurability = 1;
RepairPetWhenDead = true;
#endregion
#region Group Invite
AcceptGroupInvitationAccountList.AddRange(new string[] { "Player 1", "Player 2"});
#endregion
#region NPC
AttackNpcs = true;
AnswerAttacks = true;
AttackTaggedNpcs = false;
MinFightDistance = 250;
MaxFightDistance = 550;
#endregion
#region collection & sell
CollectBonusBoxes = false;
CollectCargoBoxes = false;
CollectResources = true;
if (UseHangarChange)
{
if (BMain.MapName == "5-3")
{
Sell = false;
SellPalladium = false;
SellSkylabPromerium = false;
}
else
{
Sell = true;
SellPalladium = true;
SellSkylabPromerium = true;
}
}
else
{
Sell = true;
SellPalladium = true;
SellSkylabPromerium = true;
}
SellSkylabPromerium = true;
#endregion
#region PET auf 5-3
if(BMain.MapName != "5-3") {UsePet = false;} else {UsePet = true;}
if(BMain.MapName != "5-3" && (BMain.Me.Hitpoints >= 200000) && (BMain.Me.Shield/BMain.Me.MaxShield)*100 == 100) {Cloak = true;} else {Cloak = false;}
#endregion
MinFreeSlots = 0;
MinPalladiumAmountToSell = 15;
ActionList.Add("Palladium Task :D");
}
}
}
}

silvertcsax.gif


Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...