Mlarssa 2 Posted January 10, 2017 Share Posted January 10, 2017 Hi, can anyone tell me how to code the following? When bag are full use hearthstone to go to Town. Timadance 1 Link to comment https://wrobot.eu/forums/topic/4721-use-hearthstone-when-bags-are-full/ Share on other sites More sharing options...
Droidz 2742 Posted January 10, 2017 Share Posted January 10, 2017 Hello, use plugin like HearthstoneToGoToTown.cs (not tested): using System; using System.ComponentModel; using System.Threading; using System.Windows.Forms; using robotManager.Events; using robotManager.FiniteStateMachine; using robotManager.Helpful; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; public class Main : wManager.Plugin.IPlugin { public void Initialize() { FiniteStateMachineEvents.OnRunState += FiniteStateMachineEventsOnOnRunState; Logging.Write("[HearthstoneToGoToTown] Loadded."); } public void Dispose() { Logging.Write("[HearthstoneToGoToTown] Disposed."); } public void Settings() { MessageBox.Show("[HearthstoneToGoToTown] No settings for this plugin."); } private void FiniteStateMachineEventsOnOnRunState(Engine engine, State state, CancelEventArgs cancelable) { try { if (string.IsNullOrWhiteSpace(state.DisplayName) || state.DisplayName != "To Town") return; Logging.WriteDebug("[HearthstoneToGoToTown] Use Hearthstone."); var o = wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported; wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = false; MovementManager.StopMove(); Thread.Sleep(Usefuls.Latency + 150); Lua.LuaDoString("local itemName, _, _, _, _, _, _, _ = GetItemInfo(6948); RunMacroText('/use ' .. itemName);"); Thread.Sleep(Usefuls.Latency + 500); if (ObjectManager.Me.IsCast) { Usefuls.WaitIsCasting(); Thread.Sleep(Usefuls.Latency + 10000); // wait load screen } wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = o; } catch (Exception e) { Logging.WriteError("[HearthstoneToGoToTown] " + e); } } } Mlarssa and Matenia 2 Link to comment https://wrobot.eu/forums/topic/4721-use-hearthstone-when-bags-are-full/#findComment-21875 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