Thread: Armory API

  1. #1
    Deleted

    Armory API

    Hey, sorry if this is the wrong section but i need help.

    I have no experience with the world of warcraft armory API, so i have no idea how to do this.

    Basically my guild does a lottery every week of all the weekly contributors (anyone over 0 contribution points is entered).

    I need a script that pulls everyone from the roster, removes anyone with 0 contribution then randomizes the list - leaving me with 5 names.


    I know it is possible but i dont know how!


    Thanks :P.

  2. #2
    Can you try this script? It's untested/drycoded though, since I don't have an active WoW subscription to test with atm
    Code:
    /run local t,c={},GetGuildRosterContribution for i=1,GetNumGuildMembers()do if c(i)>0 then tinsert(t,i)end end for i=1,5 do local r=random(#t)print(i,GetGuildRosterInfo(t[r]),c(t[r]))tremove(t,r)end

    beautified:
    Code:
    local t, c = {}, GetGuildRosterContribution
    
    for i = 1, GetNumGuildMembers() do
    	if c(i) > 0 then
    		tinsert(t, i)
    	end
    end
    
    for i = 1, 5 do
    	local r = random(#t)
    	print(i, GetGuildRosterInfo(t[r]), c(t[r]))
    	tremove(t, r)
    end

    It should print something like this:
    1, Kitty, 841
    2, Derpy, 395
    3, Swifty, 784
    4, Sheepy, 799
    5, Doggy, 912

  3. #3
    Deleted
    Sorry i should have been more specific, its for a website.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •