LUA script menu

Shout-Out

User Tag List

Thread: LUA script

Results 1 to 10 of 10
  1. #1
    Gosko's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA script

    Well I started scripting a little, and most of my scripts are working fine but I can't get them to heal or cast a spell when they get below a certain % Here is my script, anyway i can fix that part?

    Code:
    function TaunkaWindfury_Combat(pUnit, event)
    	pUnit:RegisterEvent("TaunkaWindfuryMoonfire",15000,0)
    	pUnit:RegisterEvent("TaunkaWindfuryRejuvenation",0001,1)
    	pUnit:RegisterEvent("TaunkaWindfuryRegrowth",0001,1)
     end
    
     function TaunkaWindfuryMoonfire(pUnit, event)
    	pUnit:CastSpellOnTarget(52502, pUnit:GetMainTank(0))
     end
    
     function TaunkaWindfuryRejuvenation(pUnit, event)
    	if pUnit:GetHealthPct() < 50 then
    	pUnit:CastSpell(20664)
     end
    end
    
     function TaunkaWindfuryRegrowth(pUnit, event)
    	if pUnit:GetHealthPct() < 30 then
    	pUnit:CastSpell(20664)
     end
    end
    
    function TaunkaWindfury_LeaveCombat(pUnit, event)
    	pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(27571, 1, "TaunkaWindfury_Combat")
    RegisterUnitEvent(27571, 2, "TaunkaWindfury_LeaveCombat")

    LUA script
  2. #2
    Juicyz's Avatar Active Member
    Reputation
    34
    Join Date
    Dec 2006
    Posts
    298
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function TaunkaWindfury_Combat(pUnit, Event)
    	pUnit:RegisterEvent("TaunkaWindfury_Moonfire",15000,0)
    	pUnit:RegisterEvent("TaunkaWindfury_Rejuvenation", 1000, 1)
    	pUnit:RegisterEvent("TaunkaWindfury_Regrowth", 1000, 1)
     end
    
    function TaunkaWindfury_Moonfire(pUnit, Event)
    	pUnit:CastSpellOnTarget(52502, pUnit:GetMainTank())
     end
    
    function TaunkaWindfury_Rejuvenation(pUnit, Event)
      if pUnit:GetHealthPct() == 50 then
    	pUnit:CastSpell(20664)
    end
    end
    
    function TaunkaWindfury_Regrowth(pUnit, Event)
      if pUnit:GetHealthPct() == 30 then
    	pUnit:CastSpell(20664)
    end
    end
    
    function TaunkaWindfury_LeaveCombat(pUnit, Event)
    	pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(27571, 1, "TaunkaWindfury_Combat")
    RegisterUnitEvent(27571, 2, "TaunkaWindfury_LeaveCombat")

    try that it should work now. if it doesnt work still look into your logs and see whats wrong and wrong it here

    DA Gift From Mr. Blain

  3. #3
    Gosko's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The script didn't load because it got a error

    Code:
    scripts/Taunka_Windfury.lua1: '=' expected near 'TaunkaWindfury_Combat'
    Last edited by Gosko; 01-04-2009 at 11:40 AM.

  4. #4
    Juicyz's Avatar Active Member
    Reputation
    34
    Join Date
    Dec 2006
    Posts
    298
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that error appeared on mine?? hmm

    DA Gift From Mr. Blain

  5. #5
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try OnEnterCombat & OnLeaveCombat instead of Combat & LeaveCombat as functions

  6. #6
    Gosko's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried that but still got same error

  7. #7
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try This

    Code:
    function TaunkaWindfury_Combat(pUnit, Event)
    pUnit:RegisterEvent("TaunkaWindfury_Moonfire",15000,0)
    pUnit:RegisterEvent("TaunkaWindfury_Phase2", 1000, 0)
    end
    
    function TaunkaWindfury_Moonfire(pUnit, Event)
    pUnit:CastSpellOnTarget(52502, pUnit:GetMainTank())
    end
    
    function TaunkaWindfury_Phase2(pUnit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents()        
    pUnit:RegisterEvent("TaunkaWindfury_Rejuvenation", 1000, 1)
    pUnit:RegisterEvent("TaunkaWindfury_Phase3", 1000, 0)
    end
    end
    
    function TaunkaWindfury_Rejuvenation(pUnit, Event)
    pUnit:CastSpell(20664)
    end
    
    function TaunkaWindfury_Phase3(pUnit, Event)
    if pUnit:GetHealthPct() < 30 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("TaunkaWindfury_Regrowth", 1000, 1)
    end
    end
    
    function TaunkaWindfury_Regrowth(pUnit, Event)
    pUnit:CastSpell(20664)
    end
    
    function TaunkaWindfury_LeaveCombat(pUnit, Event)
    pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(27571, 1, "TaunkaWindfury_Combat")
    RegisterUnitEvent(27571, 2, "TaunkaWindfury_LeaveCombat")
    Rewrote a fair amount to make the Pct checks work if theres any errors let me know..

  8. #8
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah. Kreegoths version should be right. You should register the events inside of the function like him for spells.

    I live in a shoe

  9. #9
    Gosko's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ty kreegoth it worked ^^

    Thanks to ever that helped but atm I'm out of rep cookies So just send me a PM later if I forget about it!

  10. #10
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Np glad i could help

Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. [GUIDE] How to activate LUA scripts
    By ~SaiLyn~ in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 12-25-2007, 11:52 AM
  3. Lua Scripts!
    By danis in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 12-15-2007, 03:16 PM
  4. How To LUA Script
    By Skuxta in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 12-13-2007, 04:24 AM
  5. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
All times are GMT -5. The time now is 10:09 AM. 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