Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

Stresse

Members
  • Content Count

    23
  • Joined

  • Last visited

About Stresse

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi y'all! So I'm working on a plugin for area farming (where looting every corpses looks bot as fuck). I'm going to include the whole code (just in case there is something there causing the error. You'll note I've commented out a lot of the code so that I'm mostly just focussing on why I can't seem to get the timers to work...I've been looking at other developer's code and I can't figure out how my usage is different. using robotManager.Helpful; using System.Threading; using robotManager.Products; using wManager.Wow.Enums; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using System; using System.Collections.Generic; using System.IO; using System.ComponentModel; using robotManager; public class Main : wManager.Plugin.IPlugin { private bool _isLaunched; private bool _isLooting; private bool _lootingTimedOut; private bool _killingTimedOut; private bool _lootingCompleted; private bool _killingCompleted; private bool _lootingDone; private bool _killingDone; private static int killingMaxTime; private static int killingMaxTimeMilli; private static int lootingMaxTime; private static int lootingMaxTimeMilli; //private var lootableCorpses; private static int maxCorpses; // private List<WoWObject> lootableCorpses; private static int lootableCorpseCount; private List<WoWUnit> lootableCorpses = new List<WoWUnit>(); // = ObjectManager.ObjectList().Where(u => u != null && u.IsValid && u.IsDead && u.IsLootable); // private List<WoWUnit> //var lootableCorpses = new List<WoWUnit unit>(); public static void Log(string text) { Logging.Write("[Lootoggle] " + text); } private static List<WoWUnit> GetLootableCorpses() { List<WoWUnit> result = new List<WoWUnit>(); try { foreach (WoWObject wo in ObjectManager.ObjectList) { WoWUnit o; switch (wo.Type) { case WoWObjectType.Unit: o = new WoWUnit(wo.GetBaseAddress); break; default: continue; } if (o != null && o.IsValid && o.IsDead && o.IsLootable) { result.Add(o); } } } catch (Exception arg) { Logging.WriteError("GetLootableCorpses error " + arg, true); } return result; } public void Initialize() { _isLaunched = true; _isLooting = true; LootoggleSettings.Load(); maxCorpses = LootoggleSettings.CurrentSetting.maxCorpses; Log("Started."); pluginLoop(); } public void Dispose() { _isLaunched = false; Log("Disposed."); } public void Settings() { LootoggleSettings.Load(); LootoggleSettings.CurrentSetting.ToForm(); LootoggleSettings.CurrentSetting.Save(); // Log("[Lootoggle] Settings saved."); } static robotManager.Helpful.Timer KillingTimer = new robotManager.Helpful.Timer(killingMaxTimeMilli); static robotManager.Helpful.Timer LootingTimer = new robotManager.Helpful.Timer(lootingMaxTimeMilli); public void StartLooting() { wManager.wManagerSetting.CurrentSetting.LootMobs = _isLooting = true; Log("Resetting looting timer to " + lootingMaxTime + "."); LootingTimer.Reset(); LootingTimer.Reset(); } public void StopLooting() { wManager.wManagerSetting.CurrentSetting.LootMobs = _isLooting = false; Log("Resetting killing timer to " + killingMaxTime + "."); KillingTimer.Reset(); LootingTimer.Reset(); } public void LogLootingEvents() { Log("Corpses: " + lootableCorpseCount + "/" + maxCorpses + " Countdown: " + KillingTimer + "Downtime" + "/" + killingMaxTime); Thread.Sleep(100); } // public void watchForEvents() // { // // Adding this mostly just to keep track of loot in logs. // EventsLuaWithArgs.OnEventsLuaWithArgs += (LuaEventsId id, List<string> args) => // { // if (id == "LOOT_CLOSED") // { // Log("Looting completed."); // }  // }; // } // public void pluginLoop() { KillingTimer = new robotManager.Helpful.Timer(killingMaxTimeMilli); KillingTimer.ForceReady(); LootingTimer.Reset(lootingMaxTimeMilli); KillingTimer.Reset(killingMaxTimeMilli); while (Products.IsStarted && Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause) { lootableCorpses = GetLootableCorpses(); lootableCorpseCount = lootableCorpses.Count; Log("There are " + lootableCorpseCount + " lootable corpses."); _lootingTimedOut = LootingTimer.IsReady; _lootingCompleted = (lootableCorpseCount < 1); _lootingDone = (_lootingTimedOut || _lootingCompleted); // Log(LootingTimer.IsReady); _killingTimedOut = KillingTimer.IsReady; _killingCompleted = (lootableCorpseCount >= maxCorpses); _killingDone = (_killingTimedOut || _killingCompleted); Log("Looting Time left: " + LootingTimer.TimeLeft()); Log("Countdown Time: " + LootingTimer.CountDowntime); Log("Killing Time left: " + KillingTimer.TimeLeft()); Thread.Sleep( 2000 ); /* while (_isLooting) { Log("Time left: " + LootingTimer.TimeLeft()); Log("IS LOOTING"); } while (!_isLooting) { Log("Time left: " + KillingTimer.TimeLeft()); if (KillingTimer.IsReady) { Log("Killing timer is ready"); } if (!KillingTimer.IsReady) { Log("Killing timer is NOT ready"); } Log("NO LOOTING"); } //Log("Killing done: " + _killingDone); } //List<WoWObject> lootableCorpses = new List<WoWObject>() {}; */ } } /* while (Products.IsStarted && _isLaunched) { while (_isLooting) { if (_lootingDone) { if (_lootingCompleted) { Log("Bot has finished looting available corpses."); } if (_lootingTimedOut) { Log("Bot has been looting for " + killingMaxTime + " minutes. (If you get this message often, you may want to adjust your settings.)"); } // Eventually I'd like to rework this to have the bot auto-adjust based on conditions. StopLooting(); } } while (!_isLooting) { if (_killingDone) { if (_killingCompleted) { Log("There are more than " + maxCorpses + " lootable mobs. Switching to looting."); } if (_killingTimedOut) { Log("Bot hasn't looted in over " + killingMaxTime + " minutes. Time to loot those corpses!"); } StartLooting(); } } } */ [Serializable] public class LootoggleSettings : Settings { [DefaultValue(3)] [Category("General Settings")] [DisplayName("Max Kill Time")] [Description("Maximum time bot will spend in pure killing mode between loot breaks")] public int killingMaxTime { get; set; } [DefaultValue(3)] [Category("General Settings")] [DisplayName("Max Loot Time")] [Description("Maximum time bot will spend looting before switching to looting phase")] public int lootingMaxTime { get; set; } [DefaultValue(40)] [Category("General Settings")] [DisplayName("Max Corpses")] [Description("Maximum number of lootable mobs bot will let lie before auto switching to looting (particularly helpful with group-farming).")] public int maxCorpses { get; set; } private LootoggleSettings() { killingMaxTime = 3; lootingMaxTime = 1; maxCorpses = 40; ConfigWinForm(new System.Drawing.Point(300, 400), "Lootoggle " + Translate.Get("Settings")); } public static LootoggleSettings CurrentSetting { get; set; } public bool Save() { try { return Save(AdviserFilePathAndName("Lootoggle", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("LootoggleSettings > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("Lootoggle", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<LootoggleSettings>(AdviserFilePathAndName("Lootoggle", ObjectManager.Me.Name+"."+Usefuls.RealmName)); return true; } CurrentSetting = new LootoggleSettings(); } catch (Exception e) { Logging.WriteError("LootoggleSettings > Load(): " + e); } return false; } } }
  2. Hey y'all! I'm actually SUPER bummed, because I've basically been working on this all day (learning c# as I go + I'm a bit slow...don't make fun of me). I finally had it all fixed down to only throwing one error...and now the bot won't even load the plugin. Can anyone see what's wrong? (All the log says is "Error to load plugin PATH\lootoggle.cs") using robotManager.Helpful; using System.Threading; using robotManager.Products; using wManager.Wow.Enums; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using System; using System.Collections.Generic; using System.IO; using System.ComponentModel; using robotManager; public class Lootoggle : wManager.Plugin.IPlugin { private bool _isLaunched; private bool _isLooting; private int KillTime; private int LootTime; private int timeToKill; private int timeToLoot; public void Initialize() { _isLaunched = true; _isLooting = true; LootoggleSettings.Load(); timeToKill = LootoggleSettings.CurrentSetting.KillMinutes * 60 * 1000; timeToLoot = LootoggleSettings.CurrentSetting.LootMinutes * 60 * 1000; Logging.Write("[Lootoggle] Started."); pluginLoop(); } public void Dispose() { _isLaunched = false; Logging.Write("[Lootoggle] Disposed."); } public void Settings() { LootoggleSettings.Load(); LootoggleSettings.CurrentSetting.ToForm(); LootoggleSettings.CurrentSetting.Save(); } public void pluginLoop() { while (Products.IsStarted && _isLaunched) { if (_isLooting) { wManager.wManagerSetting.CurrentSetting.LootMobs = _isLooting; Log("Bot will loot for " + LootTime + "."); Thread.Sleep(timeToLoot); Logging.Write("Disabling looting and continuing..."); _isLooting = !_isLooting; } if (!_isLooting) { wManager.wManagerSetting.CurrentSetting.LootMobs = _isLooting; Logging.Write("Bot will now stop looting and only kill for " + KillTime + "."); Thread.Sleep(timeToKill); _isLooting = !_isLooting; } } } [Serializable] public class LootoggleSettings : Settings { [DefaultValue(3)] [Category("General Settings")] [DisplayName("Kill Time")] [Description("How long (in minutes) should bot should kill shit?")] public int KillMinutes { get; set; } [DefaultValue(1)] [Category("General Settings")] [DisplayName("Loot Time")] [Description("How long (in minutes) should bot should loot before toggling looting back off.")] public int LootMinutes { get; set; } private LootoggleSettings() { KillMinutes = 3; LootMinutes = 1; ConfigWinForm(new System.Drawing.Point(300, 400), "Lootoggle " + Translate.Get("Settings")); } public static LootoggleSettings CurrentSetting { get; set; } /* Save/Load Functions */ public bool Save() { try { return Save(AdviserFilePathAndName("Lootoggle", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("LootoggleSettings > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("Lootoggle", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<LootoggleSettings>(AdviserFilePathAndName("Lootoggle", ObjectManager.Me.Name + "." + Usefuls.RealmName)); return true; } CurrentSetting = new LootoggleSettings(); } catch (Exception e) { Logging.WriteError("LootoggleSettings > Load(): " + e); } return false; } } }
  3. Howdy y'all! The title pretty much says it, but, at the moment, the second the bot is done harvesting an herb/mineral/skinning node/object, it will immediately go to stealth mode or change into ________ (at the moment it's Moonkin, since I'm going Boom) form...even if there is another mob to skin right next to it and even though the bot is then going to immediately mount (change into Flight Form). I imagine it's a c# condition to add to the fightclass? Problem is I don't know the bot states and can't figure out how this would be done.
  4. @Mike MailI agree! I'm hoping the same Lua script should probably help/work for World Quests, too. I think part of the issue is I still haven't found a particularly helpful source for figuring out how to use Lua for WoW (my frame of reference is mostly Python, so I'm not hating on Lua or anything). Mind helping me out? @eenyWhat "runcode" would I use (because right now, the bot stands there trying to interact with the NPCs for a really long time).
  5. Howdy y'all! What I'm Doing Here again because I need help (again)! I'm working on a project to simplify/automate more of the profile creation process. I'm not a baller with C# and LUA like so many of y'all, but I have figured out that, with the exception of actual coordinates (which, for NPCs can be gotten manually with Droidz cool helper tool, but will otherwise have to be done manually until such time we can convert from Zygor --> WRobot). I'll post the final python script once it's functional (can save hours and also lets you have the profile give incredibly useful logging). The Question Anyways, my current issue is that I can't figure out how to have the profile select the best reward option per class. If Zygor and other addons can do it, it seems to me it should be possible to have WRobot make the same calculation to determine which item will be the largest upgrade for the character...no? If not, there should be a way to at least pair classes/specs? with rewards and just use that to make decisions without accounting for equipped items or anything. What do we figure would be the best database to use (or code to cannibalize) to automate this?
  6. I think part of the issue is I still haven't found a particularly helpful source for figuring out how to use Lua for WoW (my frame of reference is mostly Python, so I'm not hating on LUA or anything). @eenyWhat "runcode" would I use (because right now, the bot stands there trying to interact with the NPCs for a really long time).
  7. Hi y'all! Sooo, I'm finally creating some profiles. Currently working on one for the Anglers Dailies. However, I can't seem to find a good example of a profile where the bot checks to make sure the quests are available before trying to pick them up (I assume it is something we add as a "Can Condition"). If I have twelve possible quests, three of which will be available each day from one of seven NPCs, what is the best way to have it quickly go to each NPC, grab the available quests, and then go about its business? Thanks in advance!
  8. @Avvi You are so awesome! I honestly can't thank you enough (I actually need to spend some time going around and "liking" all the posts you have made that have been so so helpful to me while I try to figure all this out)! You are my god! One question: If I wanted different times for killing vs looting (if it splits it 50-50, there is going to be a lot of dead time during the looting phase), would I change it to: public void pluginLoop()  { while (Products.IsStarted && _isLaunched) { bool lootStuff = false; if (!Products.InPause) {  wManager.wManagerSetting.CurrentSetting.LootMobs = lootStuff; Thread.Sleep(300000); // spend 5 minutes killing shit lootStuff= !lootStuff; Thread.Sleep(60000); //spend 1 minute looting shit } } } I'm going to try that and see what happens, but I have a sneaky suspicion I am going to have overlooked something.
  9. @Avvi No, it loots whatever is lootable (currently when I have two grouped up killing low-level mobs, one of them will start just following the other around looting their stuff).
  10. Thanks! But is there a way to put that on a timer? Or maybe an even smarter idea I haven't had yet? Because when you are farming low-level mobs, you don't just kill and loot them individually (especially if you are in a group). You kill a shit ton of them, then y'all loot.
  11. Hey y'all! So I'm having my bots farm in groups at the moment and need some simple way to get them to spend a couple minutes killing things before doing a mass-loot (both because it's more efficient and because otherwise they end up looking very bot-like. I was hoping I would be able to figure it out using Avvi's sample plugin, but I am still in a little over my head (I am also wondering if his sample plugin might have way more code in there than I need, and I'm not particularly well-equipped to identify). Thanks for any help!
×
×
  • Create New...