Jump to content
  • 3.3.5a While using Quester Bot skips over without finishing RunCode step if got into fight


    BetterSister
    • Product: WRobot General Type: Bug Status: Not a Bug

    So i got trainers to work but problem is after i hit the lvl i want i tell it to go to trainer using wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(9517.421f, -6871.368f, 18.61072f), 16275, -1, false);

    There is 99% chance it gets attacked while walking there. After it finishes fighting it skips right over the step it just was working on. Copy from logs:

    16:40:37 - Level UP! Reload Fight Class.

    16:40:38 - [Looting] Loot Plaguebone Pillager

    [D] 16:40:40 - [Quester] If[35] (ObjectManager.Me.WowClass == WoWClass.Paladin) | Result: True
    [D] 16:40:41 - [Quester] RunCode[36]: wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(9517.421f, -6871.368f, 18.61072f), 16275, -1, false);

    16:40:50 - [Fight] Player Attacked by Plaguebone Pillager (lvl 6)

    16:41:10 - [ToTown] Go to vendor Vara (Repair)

    16:41:38 - [ToTown] Vendor found Vara
    16:41:38 - [ToTown] Repair items
    16:41:39 - [ToTown] Sell items (try 1)
    16:41:47 - [ToTown] Sell items (try 2)
    [D] 16:41:56 - [Quester] Wait[37]: 5000 ms
    [D] 16:42:01 - [Quester] RunCode[38]: wManager.Wow.Helpers.Lua.RunMacroText("/script SelectGossipOption(1)");

    [D] 16:42:01 - [Quester] Wait[39]: 5000 ms
    [D] 16:42:06 - [Quester] RunLuaCode[40]: LoadAddOn"Blizzard_TrainerUI" f=ClassTrainerTrainButton f.e = 0 if f:GetScript"OnUpdate" then f:SetScript("OnUpdate", nil)else f:SetScript("OnUpdate", function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end)end
    [D] 16:42:06 - [Quester] Wait[41]: 5000 ms
    [D] 16:42:12 - [Quester] New step (43): filler8>Pulse

    Edited by betterSister



    User Feedback

    Recommended Comments

    Hello, put all codes in one step. Use step type "While" and in param put:

    if (ObjectManager.Me.WowClass == WoWClass.Paladin)
            {
                if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(9517.421f, -6871.368f, 18.61072f), 16275, -1, false))
                {
                    Thread.Sleep(5000);
                    wManager.Wow.Helpers.Lua.RunMacroText("/script SelectGossipOption(1)");
                    wManager.Wow.Helpers.Lua.LuaDoString("LoadAddOn'Blizzard_TrainerUI' f=ClassTrainerTrainButton f.e = 0 if f:GetScript'OnUpdate' then f:SetScript('OnUpdate', nil)else f:SetScript('OnUpdate', function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end)end");
                    Thread.Sleep(5000);
                    return false; // return false, finish can exit While step
                }
                return true; // return true, not finish, need to run again While step
            }
            else
            {
                return false; // return false, finish because not paladin, not need to run again While step
            }

    (don't forget to add the "EndWhile")

    Link to comment
    Share on other sites

    that's not gonna work... It doesn't like to use if as first parameter. i tried to edit it but i just can't make it work even when i switch interactwithnpc to under tread.sleep and add distance check instead making it legit if parameter

    [E] 02:04:54 - Compilator Error :
    c:\Users\Epri\AppData\Local\Temp\fj5nh5ik.0.cs(21,12) : error CS1525: Invalid expression term 'if'
    c:\Users\Epri\AppData\Local\Temp\fj5nh5ik.0.cs(36,10) : error CS1525: Invalid expression term ')'


    [D] 02:04:56 - [Quester] While[3] (if (ObjectManager.Me.WowClass == WoWClass.Warrior)
            {
                if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(9517.421f, -6871.368f, 18.61072f), 16275, -1, false))
                {
                    Thread.Sleep(5000);
                    wManager.Wow.Helpers.Lua.RunMacroText("/script SelectGossipOption(1)");
                    wManager.Wow.Helpers.Lua.LuaDoString("LoadAddOn'Blizzard_TrainerUI' f=ClassTrainerTrainButton f.e = 0 if f:GetScript'OnUpdate' then f:SetScript('OnUpdate', nil)else f:SetScript('OnUpdate', function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end)end");
                    Thread.Sleep(5000);
                    return false; // return false, finish can exit While step
                }
                return true; // return true, not finish, need to run again While step
            }
            else
            {
                return false; // return false, finish because not paladin, not need to run again While step
            }) | Result: False

     

    After editing to what it should be like it still doesn't work:

     

    [E] 02:02:12 - Compilator Error :
    c:\Users\Epri\AppData\Local\Temp\hbc0lfvw.0.cs(21,88) : error CS1026: ) expected
    c:\Users\Epri\AppData\Local\Temp\hbc0lfvw.0.cs(21,88) : error CS1002: ; expected
    c:\Users\Epri\AppData\Local\Temp\hbc0lfvw.0.cs(33,9) : error CS1525: Invalid expression term 'else'
    c:\Users\Epri\AppData\Local\Temp\hbc0lfvw.0.cs(33,13) : error CS1002: ; expected
    c:\Users\Epri\AppData\Local\Temp\hbc0lfvw.0.cs(37,1) : error CS1525: Invalid expression term ')'


    [D] 02:02:16 - [Quester] While[3] (ObjectManager.Me.WowClass == WoWClass.Warrior && ObjectManager.Me.Level == 1
            {
                if (ObjectManager.Me.Position.DistanceTo2D(new Vector3(311.352f, -4827.79f, 9.580031f)) < 3000)
                {
                    Thread.Sleep(5000);
                    wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(311.352f, -4827.79f, 9.580031f), 3169, 1, false);
                    wManager.Wow.Helpers.Lua.LuaDoString("LoadAddOn'Blizzard_TrainerUI' f=ClassTrainerTrainButton f.e = 0 if f:GetScript'OnUpdate' then f:SetScript('OnUpdate', nil)else f:SetScript('OnUpdate', function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end)end");
                    Thread.Sleep(5000);
                    return false;
                }
                return true;
            }
            else
            {
                return false;
            }
    ) | Result: False

    Link to comment
    Share on other sites



    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 account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...