Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(825 b)
Download
Updated: 03-14-14 03:15 PM
Compatibility:
Siege of Orgrimmar (5.4)
Escalation (5.3)
Updated:03-14-14 03:15 PM
Created:03-24-12 06:51 AM
Downloads:1,407
Favorites:9
MD5:

!sh (antispam)

Version: 2
by: semlar [More]

Blocks the same message from showing up more than once after loading ("Addon Loaded" messages).

This was made as an alternative to the outdated mod StopTheSpam.

Optional Files (0)


Archived Files (1)
File Name
Version
Size
Author
Date
 !sh
1
764B
semlar
03-24-12 06:51 AM


Post A Reply Comment Options
Unread 03-14-14, 05:38 PM  
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 624
File comments: 88
Uploads: 18
Originally Posted by Phanx
Rather than using the "Enabled" variable, why not just remove your hook when you're done with it?

Code:
f:SetScript('OnEvent', function(f)
	Chat.AddMessage = Add -- restore the original function
	f:UnregisterAllEvents()
end)
That was literally what the original code did. I had to leave the hook in place because other addons hooking AddMessage after the fact would have their hooks overwritten when I reverted it.

edit for clarification:
I store a reference to AddMessage.
I replace the original AddMessage with my own function.
An addon like Prat loads and hooks my AddMessage with their function.
My addon unloads and overwrites Prat's hook with the reference to the original AddMessage function, crippling a very popular chat addon.
Last edited by semlar : 03-14-14 at 05:56 PM.
semlar is online now Report comment to moderator  
Reply With Quote
Unread 03-14-14, 04:24 PM  
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view AddOns

Forum posts: 4591
File comments: 2102
Uploads: 42
Rather than using the "Enabled" variable, why not just remove your hook when you're done with it?

Code:
f:SetScript('OnEvent', function(f)
	Chat.AddMessage = Add -- restore the original function
	f:UnregisterAllEvents()
end)
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Last edited by Phanx : 03-14-14 at 04:37 PM.
Phanx is offline Report comment to moderator  
Reply With Quote
Unread 03-24-12, 07:57 AM  
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 624
File comments: 88
Uploads: 18
Originally Posted by Haleth
I like your style of coding, very compact
Thanks, let me know if it works okay, my addons aren't too spammy.
semlar is online now Report comment to moderator  
Reply With Quote
Unread 03-24-12, 07:17 AM  
Haleth
This Space For Rent
 
Haleth's Avatar
WoWInterface Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 1172
File comments: 1138
Uploads: 31
I like your style of coding, very compact
Haleth is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: