unlocked lua autoloot on kill menu

User Tag List

Results 1 to 2 of 2
  1. #1
    shahab200's Avatar Member
    Reputation
    1
    Join Date
    Jul 2010
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unlocked lua autoloot on kill

    i tried to write this script by searching in api s that i can use (i just started learning lua) so here is my code

    Code:
    local name = GetUnitName("target")
    print(name.." is locked!)
    
    local frame = CreateFrame("FRAME", "FooAddonFrame")
    
    frame:RegisterEvent("PLAYER_TARGET_CHANGED")
    
    local function eventHandler(self, event, ...)
    print("function called!")
    frame:UnregisterEvent("PLAYER_TARGET_CHANGED")
    print("unregistered")
    TargetLastTarget()
    InteractUnit("target")
    print("looted!")
    end
    
    frame:SetScript("OnEvent", eventHandler)

    why the result is some thing like this?

    Serpentrix is locked!
    function called!
    unregistered!
    loot done!
    function called!
    unregistered!
    loot done!


    it calls my func 2x while i want to call it once (o.0)

    unlocked lua autoloot on kill
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    If you print out 'self' and the 'event' then you should get a bit more debug information as to why the event is firing twice.

Similar Threads

  1. [Guide] Lua Gossip on Items (Average)
    By AngelSandy in forum WoW EMU Guides & Tutorials
    Replies: 8
    Last Post: 06-20-2009, 07:15 PM
  2. [Bug] [Rogue] Shorter Cooldown on Killing Spree
    By sheeesh in forum World of Warcraft Exploits
    Replies: 12
    Last Post: 11-27-2008, 12:42 AM
  3. [LUA] Teleport on spell use
    By Eponyx in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 05-24-2008, 10:10 AM
  4. [Bug] Victory Rush / On Kill Moves
    By Pwntzyou in forum World of Warcraft Exploits
    Replies: 11
    Last Post: 04-20-2008, 02:39 PM
  5. lua guide on spawning mobs after death
    By runiker in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 03-10-2008, 01:57 AM
All times are GMT -5. The time now is 03:07 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search