What's wrong with this code? menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Iaccidentallytwink's Avatar Elite User
    Reputation
    591
    Join Date
    Aug 2007
    Posts
    1,020
    Thanks G/R
    1/16
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's wrong with this code?

    Code:
    local timer = 0.263local f = CreateFrame("Frame");
    f:Hide();
    f:SetScript("OnUpdate",function(self,elapsed)
        f.delay = f.delay - elapsed;
        if f.delay <= 0 then
            _G[f.popup.."Button1"]:Click();
            f:Hide();
        end
    end);
    
    hooksecurefunc(StaticPopupDialogs["CONFIRM_BATTLEFIELD_ENTRY"],"OnAccept",function(self,data)    f.popup = StaticPopup_Visible("GOSSIP_CONFIRM");
        if f.popup then
            local _,_,home,world = GetNetStats();
            local fps = GetFramerate();
            f.delay = timer-(1/fps); 
            f:Show();
        end
    end);
    The above works. When I press enter battle with the XP elimination confirmation open it clicks both after a .263 second delay.

    But the following, for some reason, does not. Why? It's supposed to click "I no longer wish to gain XP" and confirm it at the same time (which works outside of this) after clicking Enter Battle.

    Code:
    local timer = 0.263local f = CreateFrame("Frame");
    f:Hide();
    f:SetScript("OnUpdate",function(self,elapsed)
        f.delay = f.delay - elapsed;
        if f.delay <= 0 then
            local g = GetGossipOptions()
                    if g=="I no longer wish to gain experience." then
                    SelectGossipOption(1,"",true)
                    end
            f:Hide();
        end
    end);
    
    hooksecurefunc(StaticPopupDialogs["CONFIRM_BATTLEFIELD_ENTRY"],"OnAccept",function(self,data)
            local _,_,home,world = GetNetStats();
            local fps = GetFramerate();
            f.delay = timer-(1/fps); 
            f:Show();
    end);

    What's wrong with this code?
  2. #2
    FattyXP's Avatar Member
    Reputation
    20
    Join Date
    Feb 2009
    Posts
    168
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After a whole lot of code tags and edits and whatnot... I give up for the night, I need sleep.
    the hook of the secure function is set to OnAccept, which is only popping off when you click accept bg invite. You need to add an event that fires when the queue comes up, to accept the XP confirm dialog At some point before this happens you also need to have already done the gossip so the xp dialog is up while you wait for the queue.

    Take a look at Automaton over at curse, it will give you a good idea of how to automate the events.
    Last edited by FattyXP; 09-01-2012 at 03:35 AM.

Similar Threads

  1. [C++ Script] What is wrong with this code
    By Nokia123 in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 06-03-2012, 02:03 PM
  2. What is wrong with this item teleportation Lua script ?
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 08-13-2009, 08:50 AM
  3. What is wrong with this script?
    By XxCyanidexX in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 03-01-2009, 12:13 PM
  4. [helpzerz] What is wrong with this lua script?
    By w21froster in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 05-21-2008, 09:45 PM
  5. [Need help] What's wrong with this script?
    By Arthas117 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 01-10-2008, 02:04 PM
All times are GMT -5. The time now is 03:38 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search