EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Not Understanding Error (https://www.eqemulator.org/forums/showthread.php?t=38581)

sklead 08-06-2014 10:26 PM

Not Understanding Error
 
So I've been trying to figure out this lua system for writing quests since all my perl quest files don't work. It was pretty much alright until recently. I wrote 2 different quests and modified one I had wrote before. The one I modified worked perfectly, but the 2 new ones didn't work. When I did a #questerrors on the NPCs I got the following error:
Code:

quests/eastkarana/Translocator_Nerduin.lua:6: ')' expected near ';'
I figured that meant I put an extra semi-colon in there somewhere, but I've read, re-read, and even did a ctrl+f search for ; on the quest and the only ones there are the ones that should be there. Here's one of the 2 quests I'm getting the error on:

Code:

function event_say(e)
        local level = e.other:GetLevel();
       
                if(level >= 15) then
                        if(e.message:findi("hail")) then
                                e.self:Say("Whenever you're [" .. eq.say_link("ready",false,"ready" .. "] just give me word and hold on!");
                        elseif(e.message:findi("ready")) then
                                e.other:MovePC(333, 1300.3, 190.4, -57.9, 64.0);
                        end
                end
        else
                e.self:Say("I'm sorry, but Balian has instructed me to keep you here until you've become stronger. Come back when you feel better and I'll send you to the Shadowhaven.");
        end
end

So where is this extra semi-colon or what else is the problem? The quest that's working fine looks like this:

Code:

function event_say(e)
        if(e.message:findi("hail")) then
                e.self:Say("I see you're finally awake! You were almost left behind, but Balian refused to let that happen. It seems your armor was lost, though. Luckily we can [" .. eq.say_link("craft",false,"craft") .. "] some new armor for you!");
        elseif(e.message:findi("craft")) then
                e.self:Say("Crafting armor, weapons, and other items will be paramount to your success here. Almost everything will have a use in crafting! Take this kit, then go get some armor patterns from the merchant. Once you collect enough [" .. eq.say_link("materials",false,"materials") .. "] simply combine them with the pattern in the crafting kit to create your armor. It won't be much, but we can't have you fighting without protection!");
                e.other:SummonItem(8886);
        elseif(e.message:findi("materials")) then
                e.self:Say("If you wear leather you need Gnoll Hides, or plate you need Metal Bits, for chain you need Chain Links, and lastly cloth you need Silk Patches. All of these can be found from the Gnolls in the area that roam, or if you have a group you may try the Gnoll camp to the West.");
        end
end


Scorpious2k 08-06-2014 11:10 PM

Try changing
Code:

e.self:Say("Whenever you're [" .. eq.say_link("ready",false,"ready" .. "] just give me word and hold on!");
to

Code:

e.self:Say("Whenever you're [" .. eq.say_link("ready",false,"ready") .. "] just give me word and hold on!");

demonstar55 08-06-2014 11:26 PM

Semi-colons ( ; ) are optional in lua (only required if you want to do multiple statements on a single line.)
Also these are all equivalent (as they are with Perl)

Code:

eq.say_link("materials", false, "materials")
eq.say_link("materials", false)
eq.say_link("materials")


sklead 08-07-2014 09:17 PM

Quote:

Originally Posted by Scorpious2k (Post 232623)
Try changing
Code:

e.self:Say("Whenever you're [" .. eq.say_link("ready",false,"ready" .. "] just give me word and hold on!");
to

Code:

e.self:Say("Whenever you're [" .. eq.say_link("ready",false,"ready") .. "] just give me word and hold on!");

Unfortunately that just presented me with another error. Removing the level check fixed the problem, although now anyone below level 15 can use the porter, which isn't what I intended.

demonstar55 08-07-2014 10:14 PM

You have an extra end. (Line 9 if I counted right)


All times are GMT -4. The time now is 05:28 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.