PtokaX forum

Archive => Archived 5.1 boards => Finished Scripts => Topic started by: Mozzilla? on 16 November, 2006, 12:35:36

Title: Top Leecher
Post by: Mozzilla? on 16 November, 2006, 12:35:36
Something added to the script from Dessamator

--By Dessamator
--Top Leecher

-- Added by Mozzilla™ - 16 November 2006
-- Choice as to which profile gets checked

min = 30 -- time to wait b4 reporting top leecher

bot = "TopLeecher" -- bots name

-- Set check on or off for a given profile [0 = don't check    1 = check]
cChecks = {
[-1] = 1, --Unregistered User
[0] = 0, --Master
[1] = 0, --Operator
[2] = 1, --VIP
[3] = 1, --Registered User
[4] = 0, --Moderator
[5] = 0, --NetFounder
[6] = 0, --Owner
}

function Main()
SetTimer(60*1000*min)
StartTimer()
end

function OnTimer()
local hubs = 0
for pos, user in pairs(frmHub:GetOnlineUsers()) do
if cChecks[user.iProfile] == 1 then
local prof = GetProfileName(user.iProfile) or "Unregistered User"
if user.iHubs > hubs then
temp="\r\n\r\nCongratulations "..prof.." "..user.sName..", you are the top leecher in "..frmHub:GetHubName()..".\r\n\tAt this very moment you are in "..user.iHubs.." hubs with "..user.iSlots.." slots open!"
hubs = user.iHubs
end
end
end
SendToAll(bot,temp)
temp, hubs= nil, nil
end

Title: Re: Top Leecher
Post by: Dessamator on 16 November, 2006, 17:32:56
Interesting, I forgot i had even done that, but anyways  you can also remove this :
temp, hubs= nil, nil

and change this : local hubs=0
to this: local hubs,temp=0
Title: Re: Top Leecher
Post by: Mozzilla? on 16 November, 2006, 23:00:19
Thanks Dessamator