This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
Useful Sneaky or Complicated Macros
Post Reply
Return to board index
Post by
pelf
So, from here:
http://www.lua.org/manual/5.1/manual.html#pdf-math.random
It seems like random is part of math? How do you say that properly? e.g. in C# you'd say "random is part of the math namespace" or "random is part of the math class". Is the WoW random the same one except you can call it without math.? Or is the one that isn't part of math. actually something blizzard implemented?
Post by
Wanderingfox
It is said as "random is part of the math library", but WoW's Lua sandbox is wrapping it to just random.
What's the difference? Looks like one is printing how much money you made? Also, I'd like to keep the if MerchantFrame:IsShown() thing so grays don't get equipped. My version doesn't equip them. The GetMerchantItemInfo(1) bit is checking the same thing as MerchantFrame:IsShown(). The difference being GetMerchantItemInfo(1) is one character shorter, and instead of checking for a visible frame, it's checking to see if the targeted merchant has something for sale.
Post by
pelf
Oh very nice. Sneaky indeed.
And this question that I hid after the other, unrelated, one?
Is the WoW random the same one except you can call it without math.? Or is the one that isn't part of math. actually something blizzard implemented?
Post by
Wanderingfox
It is said as "random is part of the math library", but
WoW's Lua sandbox is wrapping it to just random
.
What's the difference? Looks like one is printing how much money you made? Also, I'd like to keep the if MerchantFrame:IsShown() thing so grays don't get equipped. My version doesn't equip them. The GetMerchantItemInfo(1) bit is checking the same thing as MerchantFrame:IsShown(). The difference being GetMerchantItemInfo(1) is one character shorter, and instead of checking for a visible frame, it's checking to see if the targeted merchant has something for sale.
Lua's random:
function math.random(lower, upper)
. . .
end
WoW's random:
function random(lower, upper)
return math.random(lower, upper)
end
Or at least, I believe that's how its working. It's outside the scope of the sandbox, so we can only guess :P
Post by
pelf
Yeah, that's what I figured. Alright, I'll just say that's what it is.
What do you think about the format?
Post by
283705
This post was from a user who has deleted their account.
Post by
pelf
Thanks for the post! The GetName macros are generally replaced by
/framestack
nowadays. Also, I tend to prefer to use an addon to move frames ... MoveAnything or FluidFrames are the ones I'm familiar with. Is there any benefit to not using an addon to move frames that I'm not aware of? The benefit cannot be reduction in addon count as the weight of a frame movement addon is negligible.
Post by
Wanderingfox
Yeah, that's what I figured. Alright, I'll just say that's what it is.
What do you think about the format?
Only thing I see is that your for loops are slightly more inefficient. They always loop to 32 bag slots, even if the bag that's equipped is smaller than that.
Post by
462169
This post was from a user who has deleted their account.
Post by
HighFive
for x = (Pelf, WanderingFox, WildHorn, HighFive, ...)
if x==noob then
Cataclysm()
end
end
Moar liek:for _, u in pairs(Wowhead.forums.GetFrequentVisitors()) do
if Lua.noobList.contains(u) then
Cataclysm();
end
end
Post by
pelf
Yeah, that's what I figured. Alright, I'll just say that's what it is.
What do you think about the format?
Only thing I see is that your for loops are slightly more inefficient. They always loop to 32 bag slots, even if the bag that's equipped is smaller than that.
So fix them for me
:)
. I'm posting stuff here as living document. I post in here like an idiot (re: how much I post) so any improvements to any of these macros will get updated into the main document quite quickly -- especially once I get the first post formatted.
EDIT
: And, by "format" I meant, the markup, the bulleted lists, the italics, small, quote boxes -- do you find it readable and pleasingly consistent?
One question though. I can RTFM like anyone else, but other than the blizz documentation, would you recommend any other places to start getting some very basic exposure to Lua? Personally, I reference and point folks to Wildhorn's macro guide and don't even send folks to the blizz pages any more. Any such sources for a true Lua noob?
That's a good suggestion for what to put above the first \ in the first post. For here:
http://www.lua.org/pil/
,
http://www.wowwiki.com/API
,
http://wowprogramming.com/
,
http://lua-users.org/
Post by
Wanderingfox
Ya, the readability is fine
:P
.
To fix the inefficiency, you just need to replace that constant (32) with GetContainerNumSlots(b)
^_^
Post by
pelf
Done. Or, it will be when I get to that section.
Post by
HighFive
Where is the "raid warning to only myself"? I came here looking for it. Did you stop updating this thread?
Post by
22686
This post was from a user who has deleted their account.
Post by
614479
This post was from a user who has deleted their account.
Post by
pelf
Heyo someone bumped this! I still need to finish this ... sorry I'm a lazy bastid. I need to make a few 4.0.x updates as well.
Thanks for the scripts, M. I'll check those out and hopefully get this finished out.
Thanks for the compliment, J. I'd like to think that well-formatted is one of my middle names
:)
.
Post by
614479
This post was from a user who has deleted their account.
Post by
550132
This post was from a user who has deleted their account.
Post by
550132
This post was from a user who has deleted their account.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.