hi there, currently Im tesing your plugin. nice work, but why do them always wait after a quest was turned in? 5 times and it noticed there is a loop, could you fix that?
The repo > https://raf-quester.googlecode.com/svn/RaFQuester/ < is asking for a username and password now. When going to 'raf-quester.googlecode.com' directly, I get page not found. Seems like this was an awesome idea, and was making good progress, but svn access would be nice to have again please.
Seems to work flawlessly except for the fact that HB crashes all the time. Maybe it cant handle 3 characters dinging at the same time. Might try different HB installations. see if that fixes it.
I believe the problem is all those "Thread.Sleep" causing it to crash, also it will interact with the NPCs so many times in a short period of time while waiting for the other bots that is not a normal thing I would be careful with that.
Agree with you, at the momen for me i searching another way for w8ing party members. and Macatho, different folders doesn't rescue you, becouse i use defferent folders allways, and have same crashes a lot of time... =(
Can i use it with Dungeonbuddy, has someone had eany experience using it with the quests in dungeons ?
DungeonBuddy already take dungeon quests you have options for that you dont need this plugin. They are usually in range when turning as well.
Looks like we're gonna have to fork out cash to get this one again. The SVN requires auth or is down. lol
I modified this plugin so it uses Coroutine.Sleep() instead of Thread.Sleep() as per compatability guidelines for correct pausing of the thread in an HonorBuddy plugin/bot. View attachment 133326 This is not tested, however it *should* work fine and resolve the crashing issues. I also removed a duplicate OR condition for checking quest status.
And if you use Visual Studio it did not trigger you the warning about how you're using your async? Edit: Also you forgot to add void after async and to add the using for coroutines and tasks.
Sorry... edited it in Notepad ... lol. change was a simple one. Post code blocks on what it should be please.
Okay guys, I have made some adjustments. Sorry it took me a while to locate WHERE exactly Coroutine is located. It was not in Styx -- it was in Buddy . Please try and let me know how it goes. RaFQuester.cs Code: /* +----------------------------------------------------------------------------- | RaFQuester, RaFQuester/RaFQuester.cs | ==================================== | Created By KinG modified by hackersrage | Version 1.0.6a | Last updated 2014-06-18 +----------------------------------------------------------------------------- */ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Media; using Styx; using Styx.Common; using Styx.Common.Helpers; using Styx.CommonBot; using Styx.CommonBot.AreaManagement; using Styx.CommonBot.Database; using Styx.CommonBot.Frames; using Styx.CommonBot.Inventory; using Styx.CommonBot.Profiles; using Styx.CommonBot.POI; using Styx.CommonBot.Routines; using Styx.Helpers; using Styx.Pathing; using Styx.Plugins; using Styx.WoWInternals; using Styx.WoWInternals.Misc; using Styx.WoWInternals.World; using Styx.WoWInternals.WoWObjects; using Styx.TreeSharp; using Buddy.Coroutines; using Sequence = Styx.TreeSharp.Sequence; using Action = Styx.TreeSharp.Action; using CommonBehaviors.Actions; using Levelbot.Actions.Combat; namespace RaFQuester { public class Main : HBPlugin { public static LocalPlayer Me { get { return StyxWoW.Me; } } public static bool IsInGroup { get { return Me.GroupInfo.IsInParty; } } public uint partySize = 0; public int me_level = 0; public int resetTurnIn = 0; public long inRange = 0; public bool check_members_level = false; public Random rng = new Random(); public WoWUnit lastQGtarget = null; public override string Name { get { return "RaF Quester"; } } public override string Author { get { return "KinG modified by hackersrage"; } } public override Version Version { get { return new Version(1, 0, 6); } } public override bool WantButton { get { return false; } } public override void Initialize() { Logging.Write(Colors.SkyBlue, Name + " - Loaded Version " + Version + "a"); partySize = Me.GroupInfo.PartySize; me_level = Me.Level; Logging.Write(Colors.SkyBlue, Name + " - We are " + partySize.ToString() + " party members."); } public override void Pulse() { try { if (!IsInGroup) { Logging.Write(Colors.Red, Name + " - I am not in a party, stopping the bot."); TreeRoot.Stop(Name); } partyMemberLevelCheck(); TargetQGT(); } catch (Exception ex) { Logging.WriteException(ex); } } private async void TargetQGT() { if (partySize != Me.GroupInfo.PartySize) { partySize = Me.GroupInfo.PartySize; Logging.Write(Colors.SkyBlue, Name + " - We are " + partySize.ToString() + " party members."); } if (Me.CurrentTarget != null) { if (Me.CurrentTarget.QuestGiverStatus == QuestGiverStatus.TurnIn) { if (Me.CurrentTarget.WithinInteractRange) { WoWMovement.MoveStop(); if (partyMemberInRange()) { if (lastQGtarget != Me.CurrentTarget || Me.CurrentTarget == null) { Logging.Write(Colors.SkyBlue, Name + " - All members are within range."); Logging.Write(Colors.SkyBlue, Name + " - Waiting 8 seconds before turning in the quest."); inRange = 0; await Coroutine.Sleep(8000); //Will turn in quest here if all arguments are passed. } if (Me.CurrentTarget != null) lastQGtarget = Me.CurrentTarget; return; } else { if (Styx.CommonBot.Frames.QuestFrame.Instance.IsVisible || Styx.CommonBot.Frames.GossipFrame.Instance.IsVisible) { Styx.CommonBot.Frames.QuestFrame.Instance.Close(); Styx.CommonBot.Frames.GossipFrame.Instance.Close(); } return; } } } } if (lastQGtarget != null) { if (lastQGtarget.WithinInteractRange) { if (lastQGtarget.QuestGiverStatus == QuestGiverStatus.TurnIn) { lastQGtarget.Target(); TargetQGT(); } if (lastQGtarget.QuestGiverStatus == QuestGiverStatus.Available || lastQGtarget.QuestGiverStatus == QuestGiverStatus.AvailableRepeatable || lastQGtarget.QuestGiverStatus == QuestGiverStatus.LowLevelAvailable || lastQGtarget.QuestGiverStatus == QuestGiverStatus.None) { int waitTime = rng.Next(5, 8); Logging.Write(Colors.SkyBlue, Name + " - I am in a " + waitTime.ToString() + " seconds wait period."); WoWMovement.MoveStop(); Me.ClearTarget(); await Coroutine.Sleep(waitTime * 1000); if (Me.PartyMembers.Count(player => player != null && player.IsValid && player.CurrentTarget == lastQGtarget && lastQGtarget != null) > 0) { Logging.Write(Colors.SkyBlue, Name + " - My other party member(s) is still turning in the quest(s), waiting again."); resetTurnIn++; if (resetTurnIn == 2) { Logging.Write(Colors.SkyBlue, Name + " - I've waited 2 times extra now, assuming we only were stuck in a loop."); resetTurnIn = 1; lastQGtarget = null; return; } TargetQGT(); } } } lastQGtarget = null; } return; } private bool partyMemberInRange() { if (!IsInGroup) return false; int membersInRange = Me.PartyMembers.Count(player => player != null && Me.Location.Distance(player.Location) <= 10); if (membersInRange == partySize && membersInRange != 0) { return true; } else { if (inRange != (partySize - membersInRange)) { inRange = (partySize - membersInRange); Logging.Write(Colors.SkyBlue, Name + " - " + (partySize - membersInRange).ToString() + " player(s) are out of range."); } return false; } } private void partyMemberLevelCheck() { //If we are under level 10 and we are different classes remove range check. if (lastQGtarget == null) { // We don't want to reload the profile while we are turning in quests or waiting for other members. if (Me.Level == (me_level + 1)) { Logging.Write(Colors.SkyBlue, Name + " - I have leveled up! I am now level " + Me.Level + ", checking if my party members are the same level."); me_level = Me.Level; check_members_level = true; } if (check_members_level) { if (Me.PartyMembers.Count(player => player != null && player.IsValid && player.Level == Me.Level) == partySize && Me.Level >= 10) { Logging.Write(Colors.SkyBlue, Name + " - We are all the same level, reloading profile to see if we need to change area."); ProfileManager.LoadNew(ProfileManager.XmlLocation, true); check_members_level = false; } } } return; } /*private bool knownBadTurnIn(WoWUnit questGiver){ if(questGiver == "name") }*/ } }
@razer -- could you post the log. I can see what I can do to fix it. It should show where it's having an exception. I did implement the Coroutines rather lazy. Also, is it still crashing on Quest hand-in ? Cheers.
>> To other coders << I think another quick fix (which may cause some quests to not hand in at the same time -- hence the 30 second wait after), would be something like the following. I don't know all the HonorBuddy commands to do this, however the logical process would be something like the following : Pseudo code Code: If (QuestCompleted and AtTurnInPoint and !QuestTurnedIn) { DoWait = 0 SafeHandIn = False If PartyLeader HasQuest AND QuestTurnedIn { DoWait = Me.PartyPosition * Random(1-4) SafeHandIn = True } else { DoWait = Random(5-10) } await Coroutine.Sleep(DoWait, Function(SafeHandIn) { If SafeHandIn = True { HandInQuest() } } ) await Coroutine.Sleep(30) }