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); } }
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); } }
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; }
public bool gotIt() { return(primary == null || AutoShop.gotItem(primary.Id) || (secondary != null && AutoShop.gotItem(secondary.Id))); }
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; }