Stresse 2 Posted August 2, 2018 Share Posted August 2, 2018 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! Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/ Share on other sites More sharing options...
Droidz 2742 Posted August 3, 2018 Share Posted August 3, 2018 Hello, use this code to disable looting: wManager.wManagerSetting.CurrentSetting.LootMobs = false; Stresse 1 Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46326 Share on other sites More sharing options...
Stresse 2 Posted August 3, 2018 Author Share Posted August 3, 2018 8 hours ago, Droidz said: Hello, use this code to disable looting: wManager.wManagerSetting.CurrentSetting.LootMobs = false; 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. Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46339 Share on other sites More sharing options...
Avvi 98 Posted August 3, 2018 Share Posted August 3, 2018 6 hours ago, Stresse said: But is there a way to put that on a timer? Or maybe an even smarter idea I haven't had yet? I think that that WRobot will only try looting after it kills something. So if the line that droidz (LootMobs = false;) sent was used, and you killed 20 mobs, it would only loot things for after when you did LootMobs = true Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46352 Share on other sites More sharing options...
Stresse 2 Posted August 3, 2018 Author Share Posted August 3, 2018 @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). Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46353 Share on other sites More sharing options...
Avvi 98 Posted August 3, 2018 Share Posted August 3, 2018 (edited) 1 hour ago, Stresse said: @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). Oh, well then that's great news! In that case, you can swap out my plugin template's pluginLoop with this: public void pluginLoop() { bool lootStuff = false; while (Products.IsStarted && _isLaunched) { if (!Products.InPause) { wManager.wManagerSetting.CurrentSetting.LootMobs = lootStuff; lootStuff= !lootStuff; Thread.Sleep(300000); } } } It will wait 300,000 (5 minutes ) milliseconds and then it will flip the LootMobs value from False to True. After another 300,000 milliseconds (5 minutes ) it will go from True to False. It will flip it over and over until the WRobot it turned off. Regarding my template, there are a lot of extra things in there. I added them so that there would be examples of many things ? . If you'd like, you can create a Setting that lets you set the milliseconds manually. Or, you can copy what I've done below. (Replace pluginLoop and pluginSettings : Settings public void pluginLoop() { bool lootStuff = false; while (Products.IsStarted && _isLaunched) { if (!Products.InPause) { wManager.wManagerSetting.CurrentSetting.LootMobs = lootStuff; lootStuff= !lootStuff; Thread.Sleep(_settings.timetowait); } } } [Serializable] public class pluginSettings : Settings { public pluginSettings() { timetowait = 300000; } [Setting] [Category("General Settings")] [DisplayName("Time to wait before looting stuff")] [Description("This is a Description.")] public int timetowait { get; set; } public static pluginSettings CurrentSetting { get; set; } public bool Save() { try { return Save(AdviserFilePathAndName("TemplateProjectName", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("TemplateProjectName > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("TemplateProjectName", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<pluginSettings>(AdviserFilePathAndName("TemplateProjectName", ObjectManager.Me.Name + "." + Usefuls.RealmName)); return true; } CurrentSetting = new pluginSettings(); } catch (Exception e) { Logging.WriteError("TemplateProjectName > Load(): " + e); } return false; } } Edited August 4, 2018 by Avvi Stresse 1 Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46354 Share on other sites More sharing options...
Stresse 2 Posted August 3, 2018 Author Share Posted August 3, 2018 @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. Avvi 1 Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46355 Share on other sites More sharing options...
Avvi 98 Posted August 4, 2018 Share Posted August 4, 2018 (edited) unfortunately, that won't work. That will make it do the following: Set looting to the variables value. Wait 5 minutes before doing anything Flip the looting variable to the opposite value Wait for 1 minute Repeat So you'll get something like this: Variable value = false: Set looting to false. Make plugin wait 5 minutes before doing anything Set looting variable to true Make plugin wait 1 minute before doing anything Repeat: Set looting to True. Make plugin wait 5 minutes before doing anything Set looting variable to False Make plugin wait 1 minute before doing anything Repeat Set looting to false. Make plugin wait 5 minutes before doing anything Set looting variable to true Make plugin wait 1 minute before doing anything Repeat I think your desired outcome is something else. I'm guessing you want it to sometimes wait 5 minutes, and sometimes wait 1 minute? 14 minutes ago, Stresse said: 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! I am glad I could help ? !!! Edited August 4, 2018 by Avvi Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46356 Share on other sites More sharing options...
Avvi 98 Posted August 4, 2018 Share Posted August 4, 2018 (edited) If your desire is to wait 5 minutes, and sometimes wait 1 minute, then something like this will work: public void pluginLoop() { bool lootStuff = false; int longerTimeToWait = 300000; int shortTimeToWait = 60000; int actualTimeToWait = shortTimeToWait; while (Products.IsStarted && _isLaunched) { if (!Products.InPause) { wManager.wManagerSetting.CurrentSetting.LootMobs = lootStuff; lootStuff= !lootStuff; if(actualTimeToWait == longerTimeToWait){ actualTimeToWait = shortTimeToWait; } else{ actualTimeToWait = longerTimeToWait } Logging.Write("Waiting this long until switching looting status: " + actualTimeToWait); Thread.Sleep(actualTimeToWait); } } } Edited August 4, 2018 by Avvi Link to comment https://wrobot.eu/forums/topic/9886-fastestbest-way-to-regularly-toggle-looting-offon/#findComment-46357 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now