Hello,
i'm using the following plugin,written by Deusx, and also Sidalol's traderunner plugin from the buddystore. With both plugins my character fills each tradepack storage of my "Farm Cart" with 2 packs!!! Apparently there is some bug when checking if a tradepack storage is full. Please check it out!
Problem caused here:
Full plugin:
i'm using the following plugin,written by Deusx, and also Sidalol's traderunner plugin from the buddystore. With both plugins my character fills each tradepack storage of my "Farm Cart" with 2 packs!!! Apparently there is some bug when checking if a tradepack storage is full. Please check it out!
Problem caused here:
private DoodadObject getBestDoodadForPack()
{
foreach (var d in getDoodads())
{
if (d.phaseId == 8264 && d.uniqOwnerId == me.uniqId)
return d;
}
return null;
}
private int getBestDoodadWithPackCount()
{
int result = 0;
foreach (var d in getDoodads())
{
if (d.phaseId == 8265 && d.uniqOwnerId == me.uniqId)
result++;
}
return result;
}
private DoodadObject getBestDoodadWithPack()
{
foreach (var d in getDoodads())
{
if (d.phaseId == 8265 && d.uniqOwnerId == me.uniqId)
return d;
}
return null;
}
Full plugin:
using System;using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace DefaultNameSpace{
public class DefaultClass : Core
{
private Gps gps;
public static string GetPluginAuthor()
{
return "Deusx";
}
public static string GetPluginVersion()
{
return "1.0.0.0";
}
public static string GetPluginDescription()
{
return "Simple Farm Cart Plugin";
}
private DoodadObject getBestDoodadForPack()
{
foreach (var d in getDoodads())
{
if (d.phaseId == 8264 && d.uniqOwnerId == me.uniqId)
return d;
}
return null;
}
private int getBestDoodadWithPackCount()
{
int result = 0;
foreach (var d in getDoodads())
{
if (d.phaseId == 8265 && d.uniqOwnerId == me.uniqId)
result++;
}
return result;
}
private DoodadObject getBestDoodadWithPack()
{
foreach (var d in getDoodads())
{
if (d.phaseId == 8265 && d.uniqOwnerId == me.uniqId)
return d;
}
return null;
}
public void GoToWorkbench()
{
gps = new Gps(this);
gps.LoadDataBase(Application.StartupPath + "\\plugins\\SimpleFarmCart\\SimpleFarmCartgoToWorkbench.db3");
var myMount = getMount();
if (myMount == null)
{
UseItem("Buckskin Lilyut Horse"); //EDIT HERE FOR YOUR MOUNT NAME
Thread.Sleep(2000);
}
SitToMount();
gps.GpsMove("workbench");
Thread.Sleep(2000);
DespawnMount();
Thread.Sleep(1000);
UseItem(36293, 12869.38, 11909.88,131.53, 0, true, 2); //EDIT HERE FOR CART SPAWN POINT AND ROTATION
Thread.Sleep(6000);
BindSlave();
Thread.Sleep(1000);
UseSkill("Owner's Mark");
Thread.Sleep(1000);
DiscardSlave();
Thread.Sleep(1000);
}
public void getPackIn()
{
var d = getBestDoodadForPack();
while (isAlive() && d != null)
{
CraftItems("Two Crowns Cream", 1); //EDIT HERE NAME OF YOUR TRADE PACK
Thread.Sleep(5000);
ComeTo(d, 2.5);
Thread.Sleep(1000);
UseDoodadSkill(15307, d, true);
Thread.Sleep(1000);
d = getBestDoodadForPack();
}
CraftItems("Two Crowns Cream", 1);
Thread.Sleep(5000);
Thread.Sleep(1000);
BindSlave();
}
public void getPackOut()
{
var d2 = getBestDoodadWithPack();
foreach (var obj in getCreatures())
{
if (obj.name == "Pauline") //EDIT HERE NAME OF GOLD SELLER
{
UseSkill("Owner's Mark");
Thread.Sleep(1000);
DiscardSlave();
}
}
Thread.Sleep(1500);
SellBackpack(true);
Thread.Sleep(1500);
if(me.getEquipedItem(31837) == null) //EDIT HERE ID OF YOUR TRADE PACK
{
while (d2 != null)
{
ComeTo(d2, 2.3);
Thread.Sleep(1000);
if (me.getEquipedItem(31837) == null)
UseDoodadSkill(15309, d2, true);
Thread.Sleep(1500);
if (me.getEquipedItem(31837) != null)
SellBackpack(true);
Thread.Sleep(1500);
d2 = getBestDoodadWithPack();
}
}
DespawnSlave();
}
public void PluginRun()
{
while(true)
{
if (me.getEquipedItem(31837) != null && gameState == GameState.Ingame)
{
Thread.Sleep(1000);
BindSlave();
Thread.Sleep(1000);
gps = new Gps(this);
gps.LoadDataBase(Application.StartupPath + "\\plugins\\SimpleFarmCart\\SimpleFarmCartgoToGoldTrader.db3");
gps.GpsMove("goldtrader");
getPackOut();
UseSkill("Recall");
}
int PackCount = maxItemsWeCanCraft(6208) ; //EDIT HERE ID OF YOUR PACK CRAFTING *SPELL*
if (PackCount > 2 && me.getEquipedItem(31837) == null && gameState == GameState.Ingame)
{
GoToWorkbench();
getPackIn();
gps = new Gps(this);
gps.LoadDataBase(Application.StartupPath + "\\plugins\\SimpleFarmCart\\SimpleFarmCartgoToGoldTrader.db3");
gps.GpsMove("goldtrader");
getPackOut();
UseSkill("Recall");
Thread.Sleep(120000); //sometimes i have awfuly long loading screens but the bot still detects game state to ingame somehow, you can set this to less
}
}
}
public void PluginStop()
{
}
}
}