Thread Tools Display Modes
06-23-11, 11:37 AM   #1
Gramexer
A Defias Bandit
Join Date: Jun 2011
Posts: 2
LF "Guild lotto" addon

Hi!

I'm running some "guild lottos" (I give gold away). The only thing that players have to do is whisper 1 number between 1-120. Then I will update that number to his/her officeer note.

Idk but is there any addon that can automate that updating process, like if someone whispers me "!lotto 22" it will update his number.
  Reply With Quote
06-23-11, 03:32 PM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
You can make this addon yourself if you like, first do this to create the addon itself:
1. Go to Wow\Interface\Addons
2. Create your addon folder for example "Lotto"
3. Inside this folder create "Lotto.toc" and put this in it:
Code:
## Interface: 401000
## Title: Lotto
## Notes: :3
thenameofthefile.lua
4. Create the file "thenameofthefile.lua" and in it put this:
Code:
local function InGuild(name)
  for i = 1, GetNumGuildMembers() do
    if name == GetGuildRosterInfo(i) then return i end
  end
end
local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_WHISPER")
f:SetScript("OnEvent", function(f, event, msg, sender)
  if IsInGuild() and CanEditOfficerNote() then
    if event == "CHAT_MSG_WHISPER" then
      local index = InGuild(sender)
      if index then
        local prefix, value = (" "):split(msg, 2)
        if prefix and value and prefix:lower():match("%!lotto") and value:match("^%d$") then
          GuildRosterSetOfficerNote(value, index)
        end
      end
    end
  end
end)
Save these two files and the addon should show on the addon list, when you login those that whisper "!lotto [any number]" will have their note updated.
  Reply With Quote
06-23-11, 06:09 PM   #3
Petrah
A Pyroguard Emberseer
 
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
May or may not be what you want, but they finally allowed this to be uploaded to Curse.

Well, I was gonna give you the link but Curse is performing emergency maintenance. Anyways, check over there for the Guild Lottery addon. I snatched that sucker up the first day it was uploaded lol.
__________________
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8.3.4.5.3 now loaded!", please add an option to disable it!
  Reply With Quote
06-24-11, 08:10 AM   #4
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
I only got the curseforge link :/

http://wow.curseforge.com/addons/guild-lottery/
  Reply With Quote
06-24-11, 12:51 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The Curse site came back up this morning.
http://wow.curse.com/downloads/wow-a...d-lottery.aspx
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-06-11, 07:50 AM   #6
Gramexer
A Defias Bandit
Join Date: Jun 2011
Posts: 2
Originally Posted by Vladinator View Post
You can make this addon yourself if you like, first do this to create the addon itself:
1. Go to Wow\Interface\Addons
2. Create your addon folder for example "Lotto"
3. Inside this folder create "Lotto.toc" and put this in it:
Code:
## Interface: 401000
## Title: Lotto
## Notes: :3
thenameofthefile.lua
4. Create the file "thenameofthefile.lua" and in it put this:
Code:
local function InGuild(name)
  for i = 1, GetNumGuildMembers() do
    if name == GetGuildRosterInfo(i) then return i end
  end
end
local f = CreateFrame("Frame")
f:RegisterEvent("CHAT_MSG_WHISPER")
f:SetScript("OnEvent", function(f, event, msg, sender)
  if IsInGuild() and CanEditOfficerNote() then
    if event == "CHAT_MSG_WHISPER" then
      local index = InGuild(sender)
      if index then
        local prefix, value = (" "):split(msg, 2)
        if prefix and value and prefix:lower():match("%!lotto") and value:match("^%d$") then
          GuildRosterSetOfficerNote(value, index)
        end
      end
    end
  end
end)
Save these two files and the addon should show on the addon list, when you login those that whisper "!lotto [any number]" will have their note updated.
Thanks and sorry for answering lately.

* It wont work other numbers than 1-9
* It will save that number to random player, not to that who sent message, sometime whole guild gets same number when I whisper to myself
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » LF "Guild lotto" addon


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off