-
Posted by kmcg on Sat, 17 May 2008 23:34:44
Like the book so far, even though a few case sensitivity issues in the early examples left me scratching my head for a while.
One problem that i run into with all my characters is picking up action buttons from my bars while in combat. I know there is an interface option to lock bars, but I would to make an addon that will lock the bars only while in combat. Looking through the api I don't seem to see a function that can do this. Can it be done?
-
Posted by jnwhiteh on Sat, 17 May 2008 23:34:43
Wow thanks for the very quick reply! I was mainly looking just for the cvar, but going above and beyond was cool on your part!
Unfortunately in this place the CVar only does half of the job (since it won't take effect until the UI is reloaded).
The issues i had were I was on page 234 where there was a call to the message function. wow would not recognize and throw an error when there was a call to the global function Message("text") and would only execute as message("test"). I also had a similar error with a ChatFrame1:AddMessage vs :addMessage that I had pulled from an earlier example when i was trying to debug the problem.
It should be ChatFrame1:AddMessage(), but Message is definitely incorrect. Thanks for the report, we'll get this added to the errata page for that chapter.
I think my main issue was that lua has very cryptic error messages so it seems like my string was showing as a nil value parameter to the global function Message instead of wow saying undefined global function message, which sent me looking for something that wasn't the problem.
You actually get used to the error messages and they start making quite a bit of sense. Believe it or not, they're better than most beginning programming languages :P
3 quick questions and I will be on my merry way: 1. What exactly is taint? is this explained later in the book?
Yes, in particular it's touched upon in Chapter 17 and the later secure templates chapters.
- When is the list of CVARS going to be up on the site?
As soon as I get that coded. They won't have any explanations of what they are but they will be listed and editable.
- I had noticed that patch 2.4 had marked my version as out of date. I managed to get the current version from Wowlua, but how does one get the current interface version number?
This is discussed in one of the Chapters, but you can obtain it by extracting the Blizzard Interface Data and looking at UI.toc. It's really easy to figure out normally tho. For example, 20400 is 2.4, 20300 is 2.3.
Thanks again! This book has really resparked my interest in casual programming outside of my job.
Glad you're enjoying it, please keep up with us on any issues you might be having. We really want to get any of the errors and issues cleared up and posted!
-
Posted by kmcg on Sat, 17 May 2008 23:34:44
Wow thanks for the very quick reply! I was mainly looking just for the cvar, but going above and beyond was cool on your part!
The issues i had were I was on page 234 where there was a call to the message function. wow would not recognize and throw an error when there was a call to the global function Message("text") and would only execute as message("test"). I also had a similar error with a ChatFrame1:AddMessage vs :addMessage that I had pulled from an earlier example when i was trying to debug the problem.
I think my main issue was that lua has very cryptic error messages so it seems like my string was showing as a nil value parameter to the global function Message instead of wow saying undefined global function message, which sent me looking for something that wasn't the problem.
3 quick questions and I will be on my merry way: 1. What exactly is taint? is this explained later in the book? 2. When is the list of CVARS going to be up on the site? 3. I had noticed that patch 2.4 had marked my version as out of date. I managed to get the current version from Wowlua, but how does one get the current interface version number?
Thanks again! This book has really resparked my interest in casual programming outside of my job.
-
Posted by jnwhiteh on Sat, 17 May 2008 23:34:44
Like the book so far, even though a few case sensitivity issues in the early examples left me scratching my head for a while.
I apologize sincerely for any errors you might encounter while reading the book. We will likely have an opportunity to fix issues such as this, so if you could please report any problems you run into we would appreciate it greatly. No excuse is good enough for producing a book with visible errors, but as you can imagine a book this large was quite an undertaking :P
One problem that i run into with all my characters is picking up action buttons from my bars while in combat. I know there is an interface option to lock bars, but I would to make an addon that will lock the bars only while in combat. Looking through the api I don't seem to see a function that can do this. Can it be done?
The locked action bars are controlled by the CVar
lockActionBars
and by the global variableLOCK_ACTIONBAR
. You can use the following code to toggle this value in-game without actually changing the saved setting:frame = CreateFrame("Frame") frame:RegisterEvent("PLAYER_REGEN_ENABLED") frame:RegisterEvent("PLAYER_REGEN_DISABLED") frame:SetScript("OnEvent", function(self, event, ...) if event == "PLAYER_REGEN_ENABLED" then LOCK_ACTIONBAR = "0" else LOCK_ACTIONBAR = "1" end end)
This script should work for you, but could potentially cause tainting issues in the actionbar system, but I wasn't able to make it break anything in my basic testing. Please note that it should be cleaned up and be placed in a proper addon, but it should work just fine.
In particular, this could be a problem if you use a character with a pet due to the way the system is currently set up. I'll try and see if I can find you a better solution, this was just my initial response.