View Single Post
04-18-09, 01:26 AM   #28
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
What about creating the variables outside the OnUpdate function and then change the values?

As such:
Code:
local var
local foo
local crap
frame:SetScript('OnUpdate', function()
var = "var"
foo = "foo"
crap = "crap"
	if dostuff then
		dostuff
	end
end)
It's what i did when i had performance issues and it helped loads, this is obviously not a working function and you would have to tweak it to your liking.
I'm nowhere near the others in terms of knowledge of LUA though, so this might not be the optimal solution.

EDIT: This also solves the issue where a global foo is not found.
__________________
All I see is strobe lights blinding me in my hindsight.