/// <summary> /// Step 1. /// Approach the Vendor and see if we have a profile for him. /// If we do, we subscribe to the render frame event to capture the next AC frame. /// We do this so that all AC data from this frame is given a chance to propagate to other plugins: Virindi Item Tool /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void WorldFilter_ApproachVendor(object sender, ApproachVendorEventArgs e) { try { if (!Settings.SettingsManager.AutoBuySell.Enabled.Value) return; if (VirindiItemTool.PluginCore.ActivityState != VirindiItemTool.PluginCore.ePluginActivityState.Idle) return; // Init our LootCore object at the very last minute (looks for VTClassic.dll if its not already loaded) if (lootProfile == null) lootProfile = new VTClassic.LootCore(); else ((VTClassic.LootCore)lootProfile).UnloadProfile(); FileInfo fileInfo = new FileInfo(PluginCore.PluginPersonalFolder + @"\" + CoreManager.Current.WorldFilter[e.MerchantId].Name + ".utl"); if (!fileInfo.Exists) { if (Settings.SettingsManager.AutoBuySell.TestMode.Value) Debug.WriteToChat("AutoBuySell.WorldFilter_ApproachVendor(), vendor profile file not found at: " + fileInfo.FullName); return; } // Load our loot profile ((VTClassic.LootCore)lootProfile).LoadProfile(fileInfo.FullName, false); CoreManager.Current.RenderFrame += new EventHandler<EventArgs>(Current_RenderFrame); } catch (Exception ex) { Debug.LogException(ex); } }
private void WorldFilter_ApproachVendor(object sender, ApproachVendorEventArgs e) { try { logFileName = pluginPersonalFolder.FullName + @"\" + CoreManager.Current.Actions.Landcell.ToString("X8") + " " + CoreManager.Current.WorldFilter[e.MerchantId].Name + ".csv"; FileInfo fileInfo = new FileInfo(logFileName); if (fileInfo.Exists) { fileInfo.Delete(); } using (StreamWriter writer = new StreamWriter(fileInfo.FullName, true)) { // "Timestamp,ContainerName,ContainerID,Landcell,Location,JSON" writer.WriteLine("\"BuyRate\",\"Categories\",\"Count\",\"MaxValue\",\"MerchantId\",,\"Quantity\",\"SellRate\""); writer.WriteLine("\"" + e.Vendor.BuyRate + "\",\"" + e.Vendor.Categories + "\",\"" + e.Vendor.Count + "\",\"" + e.Vendor.MaxValue + "\",\"" + e.Vendor.MerchantId + "\",\"" + e.Vendor.Quantity + "\",\"" + e.Vendor.SellRate + "\""); writer.Close(); } foreach (WorldObject wo in e.Vendor) { LogItem(wo); } CoreManager.Current.Actions.AddChatTextRaw("<{Mag-VendorLogger}>: " + CoreManager.Current.WorldFilter[e.MerchantId].Name + " log completed.", 5); } catch { } }
void WorldFilter_ApproachVendor(object sender, ApproachVendorEventArgs e) { Vendor vendor = e.Vendor; // The vendor obj has neat attributes about their buy and sell rates. wtc($"{vendor} triggered WorldFilter_ApproachVendor."); wtc($"{System.Reflection.MethodBase.GetCurrentMethod().Name}"); }
/// <summary> /// Step 1. /// Approach the Vendor and see if we have a profile for him. /// If we do, we subscribe to the render frame event to capture the next AC frame. /// We do this so that all AC data from this frame is given a chance to propagate to other plugins: Virindi Item Tool /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void WorldFilter_ApproachVendor(object sender, ApproachVendorEventArgs e) { try { if (!Settings.SettingsManager.AutoBuySell.Enabled.Value) { return; } if (VirindiItemTool.PluginCore.ActivityState != VirindiItemTool.PluginCore.ePluginActivityState.Idle) { return; } // Init our LootCore object at the very last minute (looks for VTClassic.dll if its not already loaded) if (lootProfile == null) { lootProfile = new VTClassic.LootCore(); } else { ((VTClassic.LootCore)lootProfile).UnloadProfile(); } FileInfo fileInfo = new FileInfo(PluginCore.PluginPersonalFolder + @"\" + CoreManager.Current.WorldFilter[e.MerchantId].Name + ".utl"); if (!fileInfo.Exists) { if (Settings.SettingsManager.AutoBuySell.TestMode.Value) { Debug.WriteToChat("AutoBuySell.WorldFilter_ApproachVendor(), vendor profile file not found at: " + fileInfo.FullName); } return; } // Load our loot profile ((VTClassic.LootCore)lootProfile).LoadProfile(fileInfo.FullName, false); CoreManager.Current.RenderFrame += new EventHandler <EventArgs>(Current_RenderFrame); } catch (Exception ex) { Debug.LogException(ex); } }
internal void WriteObject(ApproachVendorEventArgs obj) { if (ActiveSettings.Instance.DebugLevel == DebugLevel.None) return; lock (this._writeLock) { using (StreamWriter stream = new StreamWriter(this._currentPath, true)) { this.LogRawMessage(this.FormatWithPrefix("ApproachVendorEventArgs"), stream); this.LogRawMessage(string.Format(" MerchantId = {0}", obj.MerchantId), stream); this.LogRawMessage(" Vendor [Complex Type - Details Not Available]", stream); //this.WriteCurrentStateStuff(stream, false); this.LogRawMessage("", stream); } } }
void WorldFilter_ApproachVendor(object sender, ApproachVendorEventArgs e) { // DO STUFF HERE }
private void WorldFilter_ApproachVendor(object sender, ApproachVendorEventArgs e) { // DO STUFF HERE }