Esempio n. 1
0
        private void onLoad(EventArgs args)
        {
            gameStart = now;
            Game.PrintChat("AutoBuyerSharp by DeTuKs");
            try
            {
                Config = new Menu("AutoBuyerSharp", "AutoBuyerSharp", true);

                //Extra
                Config.AddSubMenu(new Menu("Extra Sharp", "extra"));
                Config.SubMenu("extra").AddItem(new MenuItem("buyItems", "Buy Items")).SetValue(true);
                Config.AddToMainMenu();

                Drawing.OnDraw += onDraw;
                Game.OnUpdate  += OnGameUpdate;

                //Setup shop
                AutoShop.init();
                AutoShop.setBuild(BuildManager.getBestBuild());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Esempio n. 2
0
        private void OnGameUpdate(EventArgs args)
        {
            //dont try to buy every tiock and some delay after game start
            if (lastTick + 888 > now || gameStart + 4090 > now)
            {
                return;
            }
            lastTick = now;

            if (!Config.Item("buyItems").GetValue <bool>())
            {
                return;
            }
            try
            {
                AutoShop.buyNext();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Esempio n. 3
0
 public ConditionalItem(ItemId pri, ItemId sec = ItemId.Unknown, ItemCondition cond = ItemCondition.TAKE_PRIMARY)
 {
     primary   = AutoShop.getData((int)pri);
     secondary = (sec == ItemId.Unknown) ? null : AutoShop.getData((int)sec);
     condition = cond;
 }
Esempio n. 4
0
 public bool gotIt()
 {
     return(primary == null || AutoShop.gotItem(primary.Id) || (secondary != null && AutoShop.gotItem(secondary.Id)));
 }
Esempio n. 5
0
 public ConditionalItem(int pri, int sec = -1, ItemCondition cond = ItemCondition.TAKE_PRIMARY)
 {
     primary   = AutoShop.getData(pri);
     secondary = (sec == -1) ? null : AutoShop.getData(sec);
     condition = cond;
 }