What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Plugin] Simple Farm Cart Traderunner

deusx

Member
Joined
Feb 1, 2010
Messages
206
Reaction score
5
Ok so here is something you can use while waiting for Godot (Sida's plugin) :D

It requires user customization, but it should work

This is FARM CART ONLY plugin

Code:
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 + "pluginsSimpleFarmCartgoToWorkbench.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, 111.11, 222.22, 333.33, 0, true, 44); //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("Name Of Your Pack", 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("Name Of Your Pack", 1);
                Thread.Sleep(5000);
                Thread.Sleep(1000);
                BindSlave();  
       }
       
       public void getPackOut()
       {
       var d2 = getBestDoodadWithPack();
            foreach (var obj in getCreatures())
            {      
                if (obj.name == "Name Of Gold Seller")  //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(99999) == null)  //EDIT HERE ID OF YOUR TRADE PACK
                {
                while (d2 != null)
                {
                    ComeTo(d2, 2.3);
                    Thread.Sleep(1000);
                                        if (me.getEquipedItem(99999) == null)
                                            UseDoodadSkill(15309, d2, true);
                    Thread.Sleep(1500);
                                        if (me.getEquipedItem(99999) != null)
                                            SellBackpack(true);
                    Thread.Sleep(1500);
                    d2 = getBestDoodadWithPack();
                }
                }
                DespawnSlave();
       }
       public void PluginRun()
       {     
       while(true)
       {        
           if (me.getEquipedItem(99999) != null && gameState == GameState.Ingame)
                {
                    Thread.Sleep(1000);
                    BindSlave();
                Thread.Sleep(1000);
                gps = new Gps(this); 
                gps.LoadDataBase(Application.StartupPath + "pluginsSimpleFarmCartgoToGoldTrader.db3"); 
                gps.GpsMove("goldtrader");
                getPackOut();
                UseSkill("Recall");    
                }
                int PackCount = maxItemsWeCanCraft(9999) ;  //EDIT HERE ID OF YOUR PACK CRAFTING *SPELL*
                if (PackCount > 2 && me.getEquipedItem(99999) == null && gameState == GameState.Ingame)
                {
                GoToWorkbench();  
                getPackIn();    
                gps = new Gps(this); 
                gps.LoadDataBase(Application.StartupPath + "pluginsSimpleFarmCartgoToGoldTrader.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()
       {
       }
   }
}

What you need to EDIT:

- Line 66 edit the name of your mount
- Line 74 edit X, Y, Z and angle of spot you want to summon your cart to (UseItem Method (UInt32, Double, Double, Double, Int32, Boolean, Double)). You need to edit 111.11, 222.22, 333.33 to X, Y, Z coordinates where you want to summon your cart to, and 44 to angle you want your cart to be facing.
- Line 83 edit the name of your trade pack here, and everywhere else where it says "Name Of Your Pack" :D
- Line 102 edit the name of your gold trader NPC here - this was my workaround for when we get stuck mid way due to collision with other carts and stuff the char dont leave vehicle
- Line 110 edit the ID of your trade pack here, and everywhere else where it says "me.getEquipedItem(99999)" :D
- Line 142 edit the ID of your trade pack crafting RECIPE here

What you need to MAKE:

- Plugin needs to be in folder called SimpleFarmCart, /plugins/SimpleFarmCart
- GPS route from your recall point to crafting workbench called goToWorkbench.db3, containing end point called "workbench", ideally placed between workbench and place you want to summon your farm cart, in line of sight of both
- GPS route from point you summoned cart to gold trader called goToGoldTrader.db3, containing end point called "goldtrader"

This plugin uses Recall to go back after trade run, I assume the run will take more than 30 minutes (all of mine does). If you want some other means of going back after trade run, check other trade run plugins it should be easy to add code
This plugin can't use Fuel
There is no anti-stuck logic. Make sure you make GPS route not to collide with objects/lamposts/etc. When collides with other carts/public transportation carriage it will just wait a bit, then resume assuming the object we collided with will move. Resuming route will be buggy until this gets fixed: https://www.thebuddyforum.com/arche...eveloper-forum/182617-gps-route-resuming.html
 
Last edited:
reserved for adding some item/spell IDs when I get around to it.

Nuian:
- Solzreed Braised Meat, trade pack ID: 31834, recipe ID: 6205
- Solzreed Dried Food, trade pack ID: 31857, recipe ID: 6228
- Gweonid Dyed Feathers, trade pack ID: 31831, recipe ID: 6202
- Gweonid Apple Pies, trade pack ID: 31854, recipe ID: 6225
- Lilyut Hills Milk Soap, trade pack ID: 31836, recipe ID: 6207
- Lilyut Cooking Oil, trade pack ID: 31859, recipe ID: 6230
- Dewstone Fine Thread, trade pack ID: 31833, recipe ID: 6204
- Dewstone Distilled Liquor, trade pack ID: 31856, recipe ID: 6227
- White Arden Trail Mix, trade pack ID: 31835, recipe ID: 6206
- White Arden Figgy Pudding, trade pack ID: 31858, recipe ID: 6229
- Marianople Duck Down, trade pack ID: 31832, recipe ID: 6203
- Marianople Sweeteners, trade pack ID: 31855, recipe ID: 6226
- Two Crowns Cream, trade pack ID: 31837, recipe ID: 6208
- Two Crowns Pomme Cakes, trade pack ID: 31860, recipe ID: 6231

you can find them youself aswell here: Commerce - Vocation - Archeage Database 1.2
 
Last edited:
how do i get the X Y and Z and angle?
Log("x: " + (me.X).ToString() + ", y: " + (me.Y).ToString() + ", z: " + (me.Z).ToString()); - this will give you the location of your char. you can round it up to 2 decimals

as for angle, i did not figure out how it works. it is strange. just try some random numbers until you get what suits you :D
 
Last edited:
Thanks for this. I will try and set this up. None of the 2 "other" ppl who works on farm cart seems to have it fixed.
 
i get this error when trying to compile
4:59:02 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(74,9) : error CS1501: No overload for method 'UseItem' takes 8 arguments
 
i get this error when trying to compile
4:59:02 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(74,9) : error CS1501: No overload for method 'UseItem' takes 8 arguments
well that's because it uses 7 :D give me your exact line

You prolly left a comma (",") instead of dot(".") for one of coords. It should have Farm Cart Scroll ID, X, Y, Z, mana cost, autocome, angle. That's 7. You prolly just have a comma in there somwhere instead of dot. Paste your line of code anyway
 
Last edited:
UseItem("Sandmane Snowlion"); //EDIT HERE FOR YOUR MOUNT NAME
Thread.Sleep(2000);
}
SitToMount();
gps.GpsMove("workbench");
Thread.Sleep(2000);
DespawnMount();
Thread.Sleep(1000);
UseItem(36293, 23,307.34, 12505.17, 268.07, 0, true, 44); //EDIT HERE FOR CART SPAWN POINT AND ROTATION
Thread.Sleep(1000);
 
UseItem("Sandmane Snowlion"); //EDIT HERE FOR YOUR MOUNT NAME
Thread.Sleep(2000);
}
SitToMount();
gps.GpsMove("workbench");
Thread.Sleep(2000);
DespawnMount();
Thread.Sleep(1000);
UseItem(36293, 23,307.34, 12505.17, 268.07, 0, true, 44); //EDIT HERE FOR CART SPAWN POINT AND ROTATION
Thread.Sleep(1000);

there it is. remove that comma :D
 
getting this error 6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(65,54) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(65,62) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(65,77) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(148,62) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(148,70) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(148,85) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(159,62) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(159,70) : error CS1009: Unrecognized escape sequence
6:22:04 AM: c:\Users\wilder\Desktop\Archage Buddy\Plugins\SimpleFarmCart\SimpleFarmCart.cs(159,85) : error CS1009: Unrecognized escape sequence
 
Back
Top