Download
(26Kb)
Download
Updated: 08-31-08 11:56 AM
Pictures
File Info
Updated:08-31-08 11:56 AM
Created:unknown
Downloads:2,265
Favorites:2
MD5:

Focus Helper

Version: 1.1
by: obd [More]

Focus Helper by Obdu of Grim'Batol (Alliance) is a simple addon to play a warning sound and display a message if your arena opponent resets focus for example by using vanish. It also warns you if you accidentally focus a hunter's pet instead of an opponent player with the same name. Please report any bugs you might encounter and ideas how to improve this project!

Installion:
Extract Focus_Helper folder to your interface/addons directory.

Usage:
/fh sound <sound> for changing the warning sound effect - list of available sounds in soundlist.txt
/fh sct <0/1> turn Scrolling Combat Text support on or off (only enable if you have SCT installed)

To do:
- Improving the graphical display of warnings
- Maybe adding custom sound effects

1.1 Added SCT support, ability to change sounds and slash-commands
1.0 The first and very simple release
Optional Files (0)


Post A Reply Comment Options
Unread 03-06-10, 07:13 PM  
Oliax
A Defias Bandit

Forum posts: 3
File comments: 8
Uploads: 0
fix 3.3

source:http://www.arenajunkies.com/showthre...72#post1992272

function FocusHelper_Onvarload(arg)
end
function FocusHelper_Onload()
FocusHelper_Options = FocusHelper_Options or {}
if (not FocusHelper_Options.Sound) then FocusHelper_Options.Sound = "Sound\\Universal\\FM_Land.wav"; end
if (not FocusHelper_Options.SCTEnabled) then FocusHelper_Options.SCTEnabled = false; end
--FocusHelper_Options = {
--Sound = "Sound\\Universal\\FM_Land.wav";
--SCTEnabled = false;
--}
SlashCmdList_AddSlashCommand('FH_SLASH', function(msg)
Fh_Slash(msg or "")
end, 'focushelper', 'fh')
end

function Fh_Slash(msg)
local Cmd, SubCmd = MyAddon_GetCmd(msg);

if (Cmd == "sound" or Cmd =="Sound") then
if (SubCmd == "" or SubCmd == "help") then
DEFAULT_CHAT_FRAME:AddMessage("Focus Helper: Usage: /fh sound <sound name>")
DEFAULT_CHAT_FRAME:AddMessage("Focus Helper: A list of sounds can be found in the soundlist.txt")
else
FocusHelper_Options.Sound = SubCmd
PlayFocusSound()
DEFAULT_CHAT_FRAME:AddMessage("Focus Helper: If you hear a sound, new sound is set correctly.")
end

elseif(Cmd == "sct" or Cmd == "Sct" or Cmd == "SCT") then
if (SubCmd == "1" or SubCmd == "true") then
FocusHelper_Options.SCTEnabled = true
DEFAULT_CHAT_FRAME:AddMessage("Focus Helper: SCT support enabled")
elseif (SubCmd == "0" or SubCmd == "false") then
FocusHelper_Options.SCTEnabled = false
DEFAULT_CHAT_FRAME:AddMessage("Focus Helper: SCT support disabled")
else
DEFAULT_CHAT_FRAME:AddMessage("Focus Helper: Usage: /fh SCT <0/1>")
end
else
DEFAULT_CHAT_FRAME:AddMessage("Focus Helper 1.1 by Obdu of Grim'Batol (Alliance)")
DEFAULT_CHAT_FRAME:AddMessage("Commands:")
DEFAULT_CHAT_FRAME:AddMessage("/fh sound - sets the warning sound.")
DEFAULT_CHAT_FRAME:AddMessage("/fh SCT - Determines whether you want to use SCT support or not.")
end
end

function PlayFocusSound()
if (FocusHelper_Options.Sound == nil) then
FocusHelper_Options.Sound = "Sound\\Universal\\FM_Land.wav"
end
if (string.find(FocusHelper_Options.Sound, "\\") == nil) then
PlaySound(FocusHelper_Options.Sound)
else
PlaySoundFile(FocusHelper_Options.Sound)
end
end

function OnFocusChange()
if(UnitExists("focus") ~= 1) then
PlayFocusSound()
if (FocusHelper_Options.SCTEnabled) then
SCT:CmdDisplay("FOCUS")
SCT:CmdDisplay("LOST")
else
DEFAULT_CHAT_FRAME:AddMessage("WARNING! FOCUS LOST!", 1.0, 0.0, 0.0);
end
elseif(UnitIsPlayer("focus") ~= 1) then
PlayFocusSound()
if (FocusHelper_Options.SCTEnabled) then
SCT:CmdDisplay("PET")
SCT:CmdDisplay("FOCUSED")
else
DEFAULT_CHAT_FRAME:AddMessage("WARNING! PET FOCUSED!", 1.0, 0.0, 0.0);
end
end
end

--The following functions are borrowed from wowwiki:
function SlashCmdList_AddSlashCommand(name, func, ...)
SlashCmdList[name] = func
local command = ''
for i = 1, select('#', ...) do
command = select(i, ...)
if strsub(command, 1, 1) ~= '/' then
command = '/' .. command
end
_G['SLASH_'..name..i] = command
end
end
function MyAddon_GetCmd(msg)
if msg then
local a,b,c=strfind(msg, "(%S+)"); --contiguous string of non-space characters
if a then
return c, strsub(msg, b+2);
else
return "";
end
end
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: