public IEnumerable <DirectOrder> GetMyOrders(bool bid = false) { //if (!DirectEve.HasSupportInstances()) //{ // DirectEve.Log("DirectEve: Error: This method requires a support instance."); // return null; //} var mq = DirectEve.GetLocalSvc("marketQuote"); var mu = DirectEve.GetLocalSvc("marketutils"); if (!IsReady) { return(null); } //IEnumerable<DirectOrder> orders = mq.Call("GetMyOrders").ToList().Select(o => new DirectOrder(this, o)); if (!bid) { return (PyWindow.Attribute("sr").Attribute("market").Attribute("sr").Attribute("myorders").Attribute("sr").Attribute("sellScroll").Attribute("sr").Attribute("entries").ToList().Select(o => new DirectOrder(DirectEve, o.Attribute("order")))); } else { return (PyWindow.Attribute("sr").Attribute("market").Attribute("sr").Attribute("myorders").Attribute("sr").Attribute("buyScroll").Attribute("sr").Attribute("entries").ToList().Select(o => new DirectOrder(DirectEve, o.Attribute("order")))); } }
/// <summary> /// Update quote information /// </summary> /// <returns></returns> public bool GetQuotes() { if (!NeedsQuote) { return(false); } return(DirectEve.ThreadedCall(PyWindow.Attribute("OnGetQoutes"))); }
/// <summary> /// Perform the actual reprocessing /// </summary> /// <returns></returns> public bool Reprocess() { if (NeedsQuote) { return(false); } return(DirectEve.ThreadedCall(PyWindow.Attribute("OnOK"))); }
public bool RepairAll() { //if (!DirectEve.HasSupportInstances()) //{ // DirectEve.Log("DirectEve: Error: This method requires a support instance."); // return false; //} return(DirectEve.ThreadedCall(PyWindow.Attribute("RepairAll"))); }
public bool Add(DirectItem item) { if (item.LocationId == -1) { return(false); } //This method instead of _AddItem to prevent quantity popup return(DirectEve.ThreadedCall(PyWindow.Attribute("sr").Attribute("my").Attribute("invController").Attribute("_BaseInvContainer__AddItem"), item.ItemId, item.LocationId, item.Quantity)); }
internal DirectTradeWindow(DirectEve directEve, PyObject pyWindow) : base(directEve, pyWindow) { MyAccepted = (int)PyWindow.Attribute("sr").Attribute("myAccept").Attribute("state") == 1; HerAccepted = (int)PyWindow.Attribute("sr").Attribute("herAccept").Attribute("state") == 1; HerCharacterId = (int)PyWindow.Attribute("sr").Attribute("herinfo").Attribute("ownerID"); HerName = (string)PyWindow.Attribute("sr").Attribute("herinfo").Attribute("ownerName").ToUnicodeString(); MyOfferedIsk = (string)PyWindow.Attribute("sr").Attribute("myMoney").Attribute("text").ToUnicodeString(); HerOfferedIsk = (string)PyWindow.Attribute("sr").Attribute("herMoney").Attribute("text").ToUnicodeString(); }
//private DirectEve DirectEve; internal DirectContainerWindow(DirectEve directEve, PyObject pyWindow) : base(directEve, pyWindow) { //IsReady = (bool) pyWindow.Attribute("startedUp"); IsOneWay = (bool)pyWindow.Attribute("oneWay"); ItemId = (long)pyWindow.Attribute("itemID"); LocationFlag = (int)pyWindow.Attribute("locationFlag"); HasCapacity = (bool)pyWindow.Attribute("hasCapacity"); currInvIdName = (string)PyWindow.Attribute("currInvID").ToList().First(); currInvIdItem = (long)PyWindow.Attribute("currInvID").ToList().Last(); }
public bool RepairItems(List <DirectItem> items) { //if (!DirectEve.HasSupportInstances()) //{ // DirectEve.Log("DirectEve: Error: This method requires a support instance."); // return false; //} var PyItems = items.Select(i => i.PyItem); return(DirectEve.ThreadedCall(PyWindow.Attribute("DisplayRepairQuote"), PyItems)); }
internal DirectScannerWindow(DirectEve directEve, PyObject pyWindow) : base(directEve, pyWindow) { var charId = DirectEve.Session.CharacterId; var obj = PyWindow.Attribute("busy"); var analyseBtnEnabled = (bool)pyWindow.Attribute("sr").Attribute("analyzeBtn").Attribute("enabled"); //Log("obj type = " + obj.GetPyType().ToString()); //Log("obj value = " + ((bool) obj).ToString()); IsReady = charId != null && obj.IsValid && (bool)obj == false && analyseBtnEnabled; }
/// <summary> /// Start a system scan; i.e. click the Analyze button. /// </summary> /// <returns>false if scan already running. true if new scan was started</returns> public bool Analyze() { // only perform a scan for paid users var scanningProbes = PySharp.Import("__builtin__").Attribute("sm").Attribute("services").DictionaryItem("scanSvc").Attribute("scanHandler").Attribute("scanningProbes"); // Check for an active scan. If we call Analyze while a scan is running Eve will throw an exception if (scanningProbes.IsValid == false) { _systemScanResults = null; // free old results return(DirectEve.ThreadedCall(PyWindow.Attribute("Analyze"))); } return(false); }
/// <summary> /// Select the tree entry with the given name and ID /// </summary> /// <param name="entryName"></param> /// <param name="entryID"></param> /// <returns></returns> public bool SelectTreeEntry(string entryName, long entryID) { var dict = PyWindow.Attribute("treeEntryByID").ToDictionary(); var entry = dict.Where(d => (string)d.Key.ToList().First() == entryName && (long)d.Key.ToList().Last() == entryID); if (entry == null) { return(false); } if (entry.Count() != 1) { return(false); } return(DirectEve.ThreadedCall(PyWindow.Attribute("OpenOrShow"), entry.First().Key)); }
public string AvgDamage() { //if (!DirectEve.HasSupportInstances()) //{ // DirectEve.Log("DirectEve: Error: This method requires a support instance."); // return null; //} try { return((string)PyWindow.Attribute("sr").Attribute("avgDamage").Attribute("text")); } catch { return(""); } }
public bool LoadOrders() { //if (!DirectEve.HasSupportInstances()) //{ // DirectEve.Log("DirectEve: Error: This method requires a support instance."); // return false; //} var mu = DirectEve.GetLocalSvc("marketutils"); var mq = DirectEve.GetLocalSvc("marketQuote"); if (!IsReady) { return(false); } return(DirectEve.ThreadedCall(PyWindow.Attribute("sr").Attribute("market").Attribute("LoadOrders"))); //return ThreadedLocalSvcCall("marketQuote", "RefreshOrderCache"); }
/// <summary> /// Expand the tree entry with the given name and ID /// </summary> /// <param name="entryName"></param> /// <returns></returns> internal bool ExpandTreeEntry(string entryName) { var dict = PyWindow.Attribute("treeEntryByID").ToDictionary(); var entry = dict.Where(d => (string)d.Key.ToList().First() == entryName); if (entry == null) { return(false); } if (entry.Count() != 1) { return(false); } entry.First().Value.Call("ExpandFromRoot"); PyWindow.Call("RefreshTree"); return(true); }
/// <summary> /// Close the tree entry with the given ID /// </summary> /// <param name="entryID"></param> /// <returns></returns> public bool CloseTreeEntry(long entryID) { var dict = PyWindow.Attribute("treeEntryByID").ToDictionary(); var entry = dict.Where(d => (long)d.Key.ToList().Last() == entryID); if (entry == null) { return(false); } if (entry.Count() != 1) { return(false); } //can NOT do threaded calls because these need to be executed in order PyWindow.Call("RemoveTreeEntry", entry.First().Value); PyWindow.Call("RefreshTree"); return(true); }
/// <summary> /// Open the current container view in a new window /// </summary> /// <returns></returns> public bool OpenAsSecondary() { var invID = PyWindow.Attribute("currInvID"); //check if it's already open, in that case do nothing. var windows = DirectEve.Windows.OfType <DirectContainerWindow>(); var lookForInvID = (string)invID.ToList().First(); var alreadyOpened = windows.FirstOrDefault(w => w.Name.Contains(lookForInvID) && !w.IsPrimary()); if (alreadyOpened != null) { return(true); } var form = PySharp.Import("form"); var keywords = new Dictionary <string, object>(); keywords.Add("invID", invID); keywords.Add("usePrimary", false); return(DirectEve.ThreadedCallWithKeywords(form.Attribute("Inventory").Attribute("OpenOrShow"), keywords)); }
/// <summary> /// Get a list of IDs as longs associated with each entry of a inventory tree /// </summary> /// <param name="itemsOnly">only look for wrecks and containers</param> /// <returns>List of IDs of the inventory tree</returns> public List <long> GetIdsFromTree(bool itemsOnly = true) { var dict = PyWindow.Attribute("treeEntryByID").ToDictionary(); var result = new List <long>(); foreach (var treeItem in dict.Keys) { var invIDName = (string)treeItem.ToList().First(); var invID = (long)treeItem.ToList().Last(); if (itemsOnly) { if (invIDName.Contains("Item")) { result.Add(invID); } } else { result.Add(invID); } } return(result); }
public bool Speak(string message) { PyWindow.Attribute("input").Call(("SetValue"), message); return(DirectEve.ThreadedCall(PyWindow.Attribute("InputKeyUp"))); }
/// <summary> /// Add bookmarks to this container window /// </summary> /// <param name="bookmarkIds"></param> /// <returns></returns> public bool AddBookmarks(IEnumerable <long> bookmarkIds) { return(DirectEve.ThreadedCall(PyWindow.Attribute("AddBookmarks"), bookmarkIds)); }
/// <summary> /// Selects the previous tab /// </summary> /// <returns>true if successful, false otherwise</returns> public bool PrevTab() { return(DirectEve.ThreadedCall(PyWindow.Attribute("sr").Attribute("tabs").Attribute("SelectPrev"))); }
/// <summary> /// Performs a directional scan /// </summary> /// <returns>true if successful, false otherwise</returns> public bool DirectionSearch() { _scanResults = null; // free old results return(DirectEve.ThreadedCall(PyWindow.Attribute("DirectionSearch"))); }
public bool ToggleAccept() { return(DirectEve.ThreadedCall(PyWindow.Attribute("OnClickAccept"))); }
/// <summary> /// Cancel the action /// </summary> /// <returns></returns> public bool Cancel() { return(DirectEve.ThreadedCall(PyWindow.Attribute("Cancel"))); }
/// <summary> /// Accept the action /// </summary> /// <returns></returns> public bool Accept() { var call = IsBuyAction ? "Buy" : "Sell"; return(DirectEve.ThreadedCall(PyWindow.Attribute(call))); }
/// <summary> /// Returns the selected tab index /// </summary> /// <returns>the tab index</returns> public int GetSelectedIdx() { return((int)PyWindow.Attribute("sr").Attribute("tabs").Call("GetSelectedIdx")); }
public bool LoadTypeId(int typeId) { return(DirectEve.ThreadedCall(PyWindow.Attribute("LoadTypeID_Ext"), typeId)); }
public bool OfferMoney(double amount) { return(DirectEve.ThreadedCall(PyWindow.Attribute("tradeSession").Attribute("OfferMoney"), amount)); }
/// <summary> /// Selects a tab by index /// </summary> /// <returns>true if successful, false otherwise</returns> public bool SelectByIdx(int tab) { return(DirectEve.ThreadedCall(PyWindow.Attribute("sr").Attribute("tabs").Attribute("SelectByIdx"), tab)); }