• 0

    posted a message on Minimap Tooltip Scanning
    Quote from Seerah
    This has been done before. Scaling the minimap down to about .01, placing it under the cursor to read the tooltip, and immediately putting it back. The few times it has been done, it was never pursued, as it proved quite disconcerting to see the minimap blink like that.


    That's an even better idea.

    Quote from yssaril
    what would be the practical application for this?


    The only practical use I could see is when flying and alt tabbed, you could play a sound when a node appears.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Minimap Tooltip Scanning
    The only way I could figure out how to get information about what is currently on the minimap is by mousing over the blips and scanning the tooltip. Now, you can't programmatically move the cursor over the minimap, but you can move the minimap under the cursor.

    I made a proof of concept that will print all of the minimap blips out to the chat frame.

    This is more of an intellectual exercise than for anything practical, since Blizzard would break its functionality if anyone actually started using it.

    local tmpX, tmpY = 20, 20
    local lastupdate = 0
    local speed = .05
    local step = 16
    isScanning = false
    
    local frame = CreateFrame("Frame")
    
    local function StopScanning()
    	isScanning = false
    	frame:SetScript("OnUpdate", nil)
    	Minimap:ClearAllPoints()
    	Minimap:SetParent(MinimapCluster)
    	Minimap:SetPoint("CENTER", MinimapCluster, "TOP", 9, -92)
    end
    
    local function OnUpdate(self, elapsed)
    	lastupdate = lastupdate + elapsed
    	if lastupdate >= speed then
    		lastupdate = 0
    		local x, y = GetCursorPosition()
    		Minimap:SetPoint("BOTTOMLEFT", x-tmpX, y-tmpY)
    		tmpX = tmpX + step
    		if tmpX > 120 then
    			tmpX = 20
    			tmpY = tmpY + step
    			if tmpY > 120 then
    				tmpY = 20
    				tmpX = 20
    				StopScanning()
    			end
    		end
    	end
    end
    
    function StartScanning()
    	Minimap:ClearAllPoints()
    	Minimap:SetParent(nil)
    	isScanning = true
    	frame:SetScript("OnUpdate", OnUpdate)
    end
    
    GameTooltip:HookScript("OnShow",
    	function(self)
    		if isScanning and MouseIsOver(Minimap) then
    			for i=1, GameTooltip:NumLines() do
    				local text = _G["GameTooltipTextLeft"..i]:GetText()
    				if text then
    					print(text)
    					GameTooltip:Hide()
    				end
    			end
    		end
    	end)
    
    
    StartScanning()
    
    Posted in: Lua Code Discussion
  • 0

    posted a message on Is there a way to parse tooltips?
    Quote from Lombra
    Personally I'd never code around the possibility that someone might've messed up bad. (intentionally or no)


    if not _G then
    	[B]--what goes here?[/B]
    else
    	local _G = _G
    end
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hiding ChatFrame ScrollingMessageFrame
    I have a checkbutton that overlays an editbox over the chatframe so I can easily copy the contents. I don't like the addons that put it in a popup box.

    The functionality is there, I just have to make the background black to hide the contents of the chatframe, since if they're both transparent, it's all jumbled.






    Posted in: Lua Code Discussion
  • 0

    posted a message on Hiding ChatFrame ScrollingMessageFrame
    How do I post pictures?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Hiding ChatFrame ScrollingMessageFrame
    Is there a way to hide just the chat frame scrolling message frame without having to re-anchor all the stuff that’s attached to it? I’d prefer not to have to detach all the buttons and editbox, etc.
    Posted in: Lua Code Discussion
  • 0

    posted a message on addon to stop chat when clicking outside the chat window?
    Quote from egingell
    It catches any character repeated more than 3 times.


    Would it catch any of the same four letters, or just any four letters?
    Posted in: Addon Ideas
  • 0

    posted a message on addon to stop chat when clicking outside the chat window?
    Quote from Mareid
    a) you've hit a certain key (like w!) more than 3 times


    How would you do this one? Like this or is there a better way?

    ChatFrame1EditBox:HookScript("OnTextChanged",
    	function(self, userInput)
    		if strfind(self:GetText(), "wwww") then
    			ChatFrame1EditBox:ClearFocus()
    		end
    	end)
    Posted in: Addon Ideas
  • 0

    posted a message on addon to stop chat when clicking outside the chat window?
    Quote from Phanx
    b) In theory, yes, but it would be an enormous amount of work, and so probably not worth doing.


    I came up with two solutions for this:

    local frame = CreateFrame("Frame")
    frame:SetScript("OnUpdate",
    	function(self, elapsed)
    		if IsMouseButtonDown() and GetMouseFocus() ~= ChatFrame1EditBox and not IsModifierKeyDown() then
    			ChatFrame1EditBox:ClearFocus()
    		end
    	end)


    or:

    local frame = CreateFrame("Frame")
    frame:SetScript("OnUpdate",
    	function(self, elapsed)
    		if IsMouseButtonDown() and GetMouseFocus() == WorldFrame then
    			ChatFrame1EditBox:ClearFocus()
    		end
    	end)


    The first will close the editbox if you click outside it without a modifier key (so you can still link stuff to the chat window), the second will close it if you click on the world frame.
    Posted in: Addon Ideas
  • 0

    posted a message on Formatted Text Length
    How do I get the length of text that has been formatted with escape sequences? For example, if I grab a line of text from the chat frame like this:

    ChatFrame1:GetMessageInfo(ChatFrame1:GetCurrentLine())


    When I do strlen(), it's including all the hidden formatting characters to determine the length. For example, when I link my hearthstone in a whisper to myself, this is what shows in the chat frame:

    To [Xchg]:  [Hearthstone]


    The length I count is 25 characters, but the length returned by strlen is 104, because the string it's counting looks like this:

    To |Hplayer:Xchg:12:WHISPER:XCHG|h[Xchg]|h:  |cffffffff|Hitem:6948:0:0:0:0:0:0:0:80:0|h[Hearthstone]|h|r



    Is there an easy way to get the visible/plain text length without having to do a bunch of complex gsubs to strip it out?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Looking to mute sound with LUA
    You can even just rename a blank .txt file to .wav. I just use a batch file to create all the directory structures and create empty .wav files like this:

    md "Sound\Ambience\GlueScreen"
    md "Sound\Spells\Fizzle"
    echo off > "Sound\Ambience\GlueScreen\Wrath_Login_1.wav"
    echo off > "Sound\Ambience\GlueScreen\Wrath_Login_2.wav"
    echo off > "Sound\Ambience\GlueScreen\Wrath_Login_3.wav"
    echo off > "Sound\Ambience\GlueScreen\Wrath_Login_4.wav"
    echo off > "Sound\Spells\Fizzle\FizzleFireA.wav"
    echo off > "Sound\Spells\Fizzle\FizzleFrostA.wav"
    echo off > "Sound\Spells\Fizzle\FizzleHolyA.wav"
    echo off > "Sound\Spells\Fizzle\FizzleNatureA.wav"
    echo off > "Sound\Spells\Fizzle\FizzleShadowA.wav"
    Posted in: Lua Code Discussion
  • 0

    posted a message on Tables and garbage memory
    Thanks, everyone. At least we were doing it right.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Tables and garbage memory
    632
    76656

    (76656-632)/1000 = 76.024

    :(

    Quote from Elsia
    I really don't get why there is this micro-dissection about memory use


    I was just curious, it’s not for practical use. I had read about it on wowwiki and then the original poster in this thread said their table used x bytes and I was wondering how they knew.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Using restricted environment in SecureHandler
    Sorry, missed that. Thanks.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Using restricted environment in SecureHandler
    I found this guide somewhere: SecureHeadersGuide - pre1.pdf and it says there is a function called control:GetTime() that is available in the secure environment.

    I tried to use it but it didn't work. There are some other functions listed, like control:Run(). I tried print(control.Run) and got a function, but when I print(control.GetTime) I get nil.

    Was this function removed? or am I doing it wrong. Also, is there any onupdate in the restricted environment?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.