Jump to content


Photo

[Fixed] Beginnin Lua with WOW addons

ChatlinkToolbar

  • Please log in to reply
2 replies to this topic

#1 joelabney

joelabney

    Glass Joe

  • Members
  • 2 posts

Posted 12 November 2013 - 07:46 AM

The book told me to post here. I hope this is the right place.

I have looked at the code over and over and can't find any differences from the book but it gives me an error-  " 9: '=' expected near 'function' "   Here's what I wrote. What's wrong with this?

 

local function showTooltip(...)
     print(...)
end
 
local function hideTooltip(...)
     print(...)
end
 
Local function setOrHookHandler(frame, script, func)  --This is where is says the error is
     if frame:GetScript(script) then
          frame:HookScript(script, func)
     else
          frame:SetScript(script, func)
     end
end
 
for i = 1, NUM_CHAT_WINDOWS do
     local frame = getglobal("ChatFrame"..i)
     if frame then
          setOrHookHandler(frame, "OnHyperLinkEnter", showTooltip)
          setOrHookHandler(frame, "OnHyperLinkLeave", hideTooltip)
     end
end
 


#2 MysticalOS

MysticalOS

    French Hacker

  • ♦ Administrators
  • 970 posts
  • LocationGeorgia

Posted 13 November 2013 - 07:19 AM

Change

Local

to

local

  • joelabney likes this

#3 joelabney

joelabney

    Glass Joe

  • Members
  • 2 posts

Posted 14 November 2013 - 04:45 AM

Thank you so much. It's such a small thing but I couldn't see it. Needed an outside perspective.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users