Jump to content

Ordush

Elite user
  • Posts

    1167
  • Joined

  • Last visited

Posts posted by Ordush

  1. So i've tested this out, and ofc. it works fine it remembers the variables i set.
    The problem is that it does actions based on those variables which are blocked by blizzard. So the first thing that happens when i do anything using those variables i have saved in my ToC (SavedVariables) blizzard blocks my addon.
    Is there not any way to save lua variables without using SavedVariables in-game? Since addons are also checked for secure usage.

  2. 4 minutes ago, forerun said:

    The bot is using method Interact which is a mapping to right click on x y z ( in that case mob position ) look what will happen when you click something using right click :) You may check if the autoattack is on and then stop it using IsAutoRepeatAction(slot) function? ( I suppouse )

    Yeah i know that it's using "interact with" that is what starts the auto shoot, what i wanted was for it to turn that off, i am not sure as to what you mean by IsAutoRepeatAction, can you explain pretty please? :)

    Edit: I could make a solution by doing isMove false as a condition for the stopattack since it has to stand still to auto shoot anyway, that just looks wacky.

  3. 3 minutes ago, forerun said:

    The macro /stopattack is for that and only this is working on tbc I think.

    I mean, if i don't use the bot (stop it or pause it) it will not auto attack

    The bot is actively starting attack if you have an unfriendly target. :)

    But i will try with /stopattack  thanks.

    Although it is a bit weird to spam /stopattack to prevent it from attacking, should be the other way around. :P

    Edit: Yeah that is not working, it will stutter and not be able to move because it will be spamming /stopattack.

  4. Hey all

    Anyone ever found out how to turn OFF hunter auto attack?

    I have a function that stops the rotation

    All my abilities has

    if RotaOn then canCast = "true" else canCast = "false" end

    as a lua condition. Works fine, no spells are cast.

    Problem is:
    It is still casting auto shoot. If i target a mob it will begin auto shooting it.

    I have tried giving the same condition to many things like

    Auto Shoot
    Attack
    auto
    Shoot

    None of them works. It seems to me as if the auto attack happens b4 the fight class, as in if i make an empty fight class it will still auto shoot.

  5. 14 minutes ago, reapler said:

    I've altered your second snippet, because it threw some errors:

    
                if (GetCVar("HuntersMarkDisabled") == nil) then
                    RegisterCVar("HuntersMarkDisabled", "default")
                end
                if (GetCVarBool("HuntersMarkDisabled")) then
                     SetCVar("HuntersMarkDisabled", 0 );
                     DEFAULT_CHAT_FRAME:AddMessage("enabled frame: HuntersMark");
                else
                     SetCVar( "HuntersMarkDisabled", 1 );
                     DEFAULT_CHAT_FRAME:AddMessage("disabled frame: HuntersMark");
                end

    But since you are using only lua, i think there's a better solution but lua is not my favorite language ;) Maybe someone else can other offer a better answer.

    Yeah i had an end too many. =P
    I removed my reply because i realized what you meant, however. what you did there was what i already did, i just didn't do it c#. So unfortunately it doesn't work. :(

  6. Didn't know what to call the topic honestly. Hope people understand. :)
     

    Been trying to wrap my brain around this function for ages now. Anyone who can help me?

    function CombatSpellsToggleButton(ability, position)
    		local frameButton = "SettingsFrame."..ability.."btn"
    		local frameDisabled = ability.."Disabled"
    
    		frameButton = CreateFrame("BUTTON", nil, SettingsFrame, "UIPanelCloseButton")
    		frameButton:SetWidth(16)
    		frameButton:SetHeight(16)
    		if frameDisabled then
    			frameButton:SetNormalTexture("Interface/Buttons/UI-PlusButton-Up")
    			frameButton:SetPushedTexture("Interface/Buttons/UI-PlusButton-Down")
    		else
    			frameButton:SetNormalTexture("Interface/Buttons/UI-MinusButton-Up")
    			frameButton:SetPushedTexture("Interface/Buttons/UI-MinusButton-Down")
    		end
    		frameButton:SetPoint("TOPRIGHT",SettingsFrame, -2,position) 
    		frameButton:SetScript("OnClick", function() 
    			if frameDisabled then 
    				frameDisabled = false
    				frameButton:SetNormalTexture("Interface/Buttons/UI-MinusButton-Up")
    				frameButton:SetPushedTexture("Interface/Buttons/UI-MinusButton-Down")
    			else 
    				frameDisabled = true	
    				frameButton:SetNormalTexture("Interface/Buttons/UI-PlusButton-Up")
    				frameButton:SetPushedTexture("Interface/Buttons/UI-PlusButton-Down")
    			end 
    		end)
    		frameButton:SetAlpha(1)
    		frameButton:Show()
    	end
    
    	-- Settings Frame (Combat Spells) Hunter's Mark Toggle Button
    	CombatSpellsToggleButton("HuntersMark", -86)

    It does make the button, but the variable generated by frameDisabled does not work
    So if i do
    if HuntersMarkDisabled then
      do something
    end
    that something doesn't happen

  7. 6 minutes ago, forerun said:
    
    if vUAflag==nil then vUAflag=0 end; 
    -- If we're CURRENTLY casting UA and the timestamp isn't already set...
    if ({UnitCastingInfo("player")})[1]=="Unstable Affliction" and vUAts==nil then 
    	-- Record that UA is being cast and record the time at which we observed the ongoing cast.
    	-- Setting the flag to 1 will prevent UA from being cast again.
    	vUAflag=1 vUAts=GetTime() 
    end;
    -- If the flag is set...but the time at which it was set was more than 2 seconds ago...
    if vUAflag==1 and GetTime()-vUAts>2 then 
    	-- Reset the flag and timestamp to allow UA again.
    	vUAflag=0 vUAts=nil 
    end
    

    Ripped example - here you see how to cast Unstable Affliction when the time difference between start and now is > 2.

    If vUaFlag=0 then cast

    Perfect! Thank you so much! <3

  8. 3 minutes ago, forerun said:

    CS rotation only perhaps. Some kind of pseudo code ( to prevent double cast of immolate in this example )
     

    
    public long immolate_StartTime;
    public bool immolate_ResetTimer = true;
    public bool immolate_CanCast = true;
    public long immolate_Time = 1500;
    .....
    wManager.wManagerSetting.CurrentSetting.EventsLuaWithArgsWaitTime = 1;
    EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) =>
    {
    if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_START)
    {
    if (args.Count >= 2 && args[0] == "player" && args[1] == "Immolate")
    {
    if (immolate_ResetTimer == true)
    {
    immolate_StartTime = GetTime();
    immolate_ResetTimer = false;
    }
    }
    
    }
    
    if ((GetTime() - immolate_StartTime) > immolate_Time)
    {
    immolate_CanCast = true;
    immolate_ResetTimer = true;
    }
    else
    {
    immolate_CanCast = false;
    }
    
    public long GetTime()
    {
    long startTick = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
    return startTick;
    }

    In this example the immolate will be casted again only after 1500 ms ( and this is preventing to overcasting ) To check when something start and count the time to push the event again. Well. IDK :)

    Thank you for the quick answer!
    If i use lua script to cast my spell with SpellInfo, couldn't i in theory also use the GetTime in lua to achieve this? :)

  9. 1 minute ago, forerun said:

    I only use macro ingame to pass the value to the wrobot cs rotation. You can create a global variable assign a value to that variable and read it in wrobot.

    Lua.LuaDoString(@"SLASH_HELLOWORLD1, SLASH_HELLOWORLD2 =  ""/Lux"",""/lux""; local function handler(msg, editbox)  setglobal( ""Lux"", msg ) end SlashCmdList[""HELLOWORLD""] = handler; ");

    In that example when user in game write : /lux 1 the global value Lux will be set to 1 and then inside the cs you can read the value in something like that:

    var Lux = Lua.LuaDoString<int>("value = Lux;", "value");

    Of course if you make an addon which is setting the certain globals in certain way you will be able then to read the values from inside the wrobot. So something like that is possible and it was done in pqr with pqi.

     

     

     

    Of course, why didn't i think of that?
    Thanks a ton mate!
    I used to use PQR for WOTLK, where i made an in-game addon INSIDE pqr, i did exactly that to save my variables, i just totally forgot that i had done it, since it was ages ago. Thank you for the response! <3

  10. Hey all! Is there any way that i can set the "timer" for an ability with lua?
    Example: I want to be able to change the timer on steady shot, so it matches gun/bow/crossbow speed. Instead of having to adjust the Class Profile, i'd like to make it so you can set your speed with lua. Now this can be edited in many ways an example could be if i set the timer as a variable: timer = WeaponSpeed

    Then one would be able to change the weapon speed in-game with /run WeaponSpeed = 3.5

  11. 7 hours ago, Matenia said:

    Not sure if you saw my answer on Discord, but I recommend getting Bugsack and Buggrabber, you'll still see the Lua errors of injected code that way.
    That usually can put you on the right path.

    I saw your post, and i have both. Thing is, it's not lua errors, it's a 'compile' bug from wrobot to lua output @ wow. Which means the errors you get in-game say nothing about the error. An error that i would get as an example would be you are missing an \ in front of n (It would never be this specific.) Where when reading my code i'd be like "I have a \ in front of n, what are you talking about?". So most of the errors i have been encountering, has been because i'm using advanced lua instead of just small snippets. So it's not as thoroughly tested and fixed. :)

  12. After hours and hours of doing this and that, i finally figured the error lies within wrobot. Apparently it dones't translate \\ into /
    So as soon as i changed

    StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",});

    into

    StatusFrame:SetBackdrop({bgFile = "Interface/Buttons/WHITE8X8",});

    Everything worked.

  13. Hey all
    I tried to make an in-game frame using lua just the way i would with lua in-game in any other way (macros etc).
    So in the "spellname" area in the creator i wrote in my code, and i set it to "not spell, is lua script"
    Ending up with this:

          <SpellName>if not FrameCreated then
      FrameCreated = true
    
        StatusFrame = CreateFrame("Frame")
          StatusFrame:ClearAllPoints()
        StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",})
        StatusFrame:SetBackdropColor(0,0,0,.4)
        StatusFrame:SetHeight(60)
        StatusFrame:SetWidth(122)
        StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90)
    	StatusFrame:SetMovable(true)
    	StatusFrame:EnableMouse(true)
    	StatusFrame:RegisterForDrag("LeftButton")
    	StatusFrame:SetScript("OnDragStart", frame.StartMoving)
    	StatusFrame:SetScript("OnDragStop", frame.StopMovingOrSizing)
        StatusFrame:Show()
    end</SpellName>


    Is there any reason why this does not work?

    Note: I did try removing the

    StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",})


    In case it just couldn't find the BgFile, no difference. :) Also tried writing it like this:
     

    StatusFrame:SetBackdrop({bgFile = [[Interface\Buttons\WHITE8X8]],})

    Any help would be appreciated cheers! :)

    This is a copy paste from my other post, since i realized that i posted i the wrong forum. :)

    Edit: I even tried changing it to use lua script as a condition and then just leave the spellname empty liket his:
     

    <LuaScript>if not FrameCreated then
    	StatusFrame=CreateFrame("Frame");
    	StatusFrame:ClearAllPoints();
    	StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",});
    	StatusFrame:SetBackdropColor(0,0,0,.4);
    	StatusFrame:SetHeight(60);
    	StatusFrame:SetWidth(122);
    	StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90);
    	StatusFrame:SetMovable(true);
    	StatusFrame:EnableMouse(true);
    	StatusFrame:RegisterForDrag('LeftButton');
    	StatusFrame:SetScript('OnDragStart', frame.StartMoving);
    	StatusFrame:SetScript('OnDragStop', frame.StopMovingOrSizing);
    	FrameCreated = true
    end</LuaScript>

     

  14. Hey all
    I tried to make an in-game frame using lua just the way i would with lua in-game in any other way (macros etc).
    So in the "spellname" area in the creator i wrote in my code, and i set it to "not spell, is lua script"
    Ending up with this:

          <SpellName>if not FrameCreated then
      FrameCreated = true
    
        StatusFrame = CreateFrame("Frame")
          StatusFrame:ClearAllPoints()
        StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",})
        StatusFrame:SetBackdropColor(0,0,0,.4)
        StatusFrame:SetHeight(60)
        StatusFrame:SetWidth(122)
        StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90)
    	StatusFrame:SetMovable(true)
    	StatusFrame:EnableMouse(true)
    	StatusFrame:RegisterForDrag("LeftButton")
    	StatusFrame:SetScript("OnDragStart", frame.StartMoving)
    	StatusFrame:SetScript("OnDragStop", frame.StopMovingOrSizing)
        StatusFrame:Show()
    end</SpellName>


    Is there any reason why this does not work?

    Note: I did try removing the

    StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",})


    In case it just couldn't find the BgFile, no difference. :) Also tried writing it like this:
     

    StatusFrame:SetBackdrop({bgFile = [[Interface\Buttons\WHITE8X8]],})

    Any help would be appreciated cheers! :)

     

    Edit: I even tried changing it to use lua script as a condition and then just leave the spellname empty liket his:
     

    <LuaScript>if not FrameCreated then
    	StatusFrame=CreateFrame("Frame");
    	StatusFrame:ClearAllPoints();
    	StatusFrame:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8X8",});
    	StatusFrame:SetBackdropColor(0,0,0,.4);
    	StatusFrame:SetHeight(60);
    	StatusFrame:SetWidth(122);
    	StatusFrame:SetPoint("TOPLEFT",ChatFrame1, 0,90);
    	StatusFrame:SetMovable(true);
    	StatusFrame:EnableMouse(true);
    	StatusFrame:RegisterForDrag('LeftButton');
    	StatusFrame:SetScript('OnDragStart', frame.StartMoving);
    	StatusFrame:SetScript('OnDragStop', frame.StopMovingOrSizing);
    	FrameCreated = true
    end</LuaScript>
×
×
  • Create New...