private void ResetCurrentItem() { _currentItem = null; _isSelected = false; _currentBids = new List <long>(); _currentId = 0; }
private void CheckItems() { if (_currentItem == null) { foreach (var filter in Filters) { if (!filter.Enabled) { continue; } if (filter.MarketItemData == null) { continue; } if (filter.MarketItemData.x0060_RegistredCount == 0) { continue; } if (filter.SessionCurrent >= filter.SessionMax) { continue; } _currentItem = filter; break; } } else { BuyItems(); } }
private int GetPurchaseAmount(ItemBuyObject item, int desiredCount) { if (item.SessionCurrent + desiredCount > item.SessionMax) { return(item.SessionMax - item.SessionCurrent); } return(desiredCount); }
private void SelectItem(ItemBuyObject item) { var oldAdr = item.MarketItemData.SellInfoList.ReadPointer8b(0x0); while (item.MarketItemData.SellInfoList.ReadPointer8b(0x0) == oldAdr) { Pipe.Call.DoString("HandleClicked_ItemMarket_GroupItem(1," + item.MarketItemData.x0010_MarketItemId + ")"); Thread.Sleep(500); } _isSelected = true; }
private bool WaitUntilBought(ItemBuyObject item, int prevInven, long prevAmount) { bool failed = false; while (!isNakMessageVisible()) { Thread.Sleep(10); } Thread.Sleep(500); int dif = 0; DateTime start = DateTime.Now; if (GetBuyState() == BuyState.Purchased) { var curInv = GetInventoryItemCount(item); while (curInv == prevInven) { if (start.AddSeconds(3) <= DateTime.Now) { break; } curInv = GetInventoryItemCount(item); Thread.Sleep(1); } dif = curInv - prevInven; } else { failed = true; } _currentItem.SessionCurrent += dif; ResetNakMessage(); if (failed) { return(false); } return(true); }
private int GetInventoryItemCount(ItemBuyObject item) { int count = 0; if (item.IsStack) { var inventoryItem = GetInventoryItem(item.ItemId, item.EnchantLevel); if (inventoryItem != null) { count = inventoryItem.x0008_ItemCount; } } else { count = GetInventoryItems(item.ItemId, item.EnchantLevel).Count; } return(count); }
private int GetRegistredAmount(ItemBuyObject item) { return((int)item.MarketItemData.x0060_RegistredCount); }