[Guide] Troubleshooting LUA 101 menu

User Tag List

Results 1 to 3 of 3
  1. #1
    EcHoEs's Avatar lol why u mad
    Reputation
    374
    Join Date
    Sep 2006
    Posts
    1,647
    Thanks G/R
    3/1
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide] Troubleshooting LUA 101

    Hai!
    Today, I'm going to teach you to troubleshoot LUA, because I see too many threads asking help with LUA just because they can't find the error themselves (Happened to me before, I'm just trying to reduce the amount of help threads.)

    Step 1. Locate the error
    When you are trying to start the Ascent with script, if it displays error, it will display the error message. I am not absolutely sure what it is, but it will tell you something about line number. Get that number down, because that is the line in which you have the error.

    Step 2. Finding the error in script
    If you are using Notepad, this is little harder, because it does not display numbers. Notepad ++, for example, does, which makes the process alot easier.
    If using notepad, you need to count the lines. If using other with numbered lines, just scroll down to the error line.

    Step 3. Fixing the error
    To fix the error you should check the whole function. Here is a good example of broken script.
    Code:
    function test_phase1(pUnit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:FullCastSpell(ID)
    Unit:RegisterEvent("test_phase2", 1000, 0)
    end
    end
    
    function test_phase2(pUnit, Event)
    And so on..
    Try locating the error yourself now. Once you have, take a look to the following code box. (If you don't you're just cheating yourself, not anyone else.)
    Code:
    The error is in Unit:RegisterEvent function. We have been using pUnit instead of Unit, so using Unit wont work. You can't change it.
    So we have to change it. If you would now fix it, it should work perfectly.

    In larger and more complicated scripts finding errors might be harder, because you might be declaring lots of different functions, and calling for them in other functions. If people like this, I might make advanced error detecting guide ^_^

    That's it for today! You have learned to successfully find and fix the error.


    [Guide] Troubleshooting LUA 101
  2. #2
    malthi's Avatar Member
    Reputation
    3
    Join Date
    Sep 2007
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks but i have a problem i made a lua warp npc and the npc dosent do anything when i talk to it and in the ascent i cant see a error

  3. #3
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need the updated LUA library from Lua++

Similar Threads

  1. Beginner's Guide to Lua Gossip
    By Dr. Livingstone in forum WoW EMU Guides & Tutorials
    Replies: 13
    Last Post: 10-22-2008, 05:33 PM
  2. Scripting LUA 101
    By SectorSeven in forum WoW EMU Guides & Tutorials
    Replies: 131
    Last Post: 10-18-2008, 07:39 PM
  3. Guide: Warrior Tanking 101
    By Checkers in forum WoW Instances & Raiding
    Replies: 16
    Last Post: 07-16-2008, 04:29 PM
  4. [Guide] Another LUA Scripting Guide
    By Bapes in forum WoW EMU Guides & Tutorials
    Replies: 13
    Last Post: 05-08-2008, 05:01 PM
  5. [Guide]More LUA ascent 2.3 scripts
    By Pragma in forum WoW EMU Guides & Tutorials
    Replies: 27
    Last Post: 04-10-2008, 01:06 PM
All times are GMT -5. The time now is 08:54 PM. 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