PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: catwo on 18 May, 2005, 19:32:03

Title: Hubs Top Leecher Script
Post by: catwo on 18 May, 2005, 19:32:03
Hi, anyone fancy writing a script that will check all users in hub for number of hubs the users are in and whoever is in most hubs the script displays something like the following in main chat?

Congratulations [XXX]Catwo you are the hubs top leecher you are in xx hubs with xx slots open!

To be checked and repeated every x minutes? Any help as always much appreciated. :D
Title:
Post by: Dessamator on 18 May, 2005, 20:09:50
hmmm sure simple to do, im on it, unless  somebody does it first :)
Title:
Post by: Dessamator on 18 May, 2005, 20:45:37
--By Dessamator
--Top Leecher

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

bot=frmHub:GetHubBotName() -- bots name
function Main()
SetTimer(60*1000*min)
StartTimer()
end

function OnTimer()
local hubs=0
for pos,user in frmHub:GetOnlineUsers() do
if user.iHubs>hubs then
temp="Congratulations "..user.sName.." you are the hubs top leecher you are in "..user.iHubs.." hubs with "..user.iSlots.." slots open!"
hubs=user.iHubs
end

end
SendToAll(bot,temp)
temp=nil
hubs=nil
end

Done !
Post edited
Title:
Post by: catwo on 18 May, 2005, 21:42:50
Thanks Dessamator, it seems to be just a random selection rather than picking the user in the most hubs?
Title:
Post by: Dessamator on 18 May, 2005, 21:47:57
QuoteOriginally posted by catwo
Thanks Dessamator, it seems to be just a random selection rather than picking the user in the most hubs?

nop, i edited the post, it was like that in the beginming, now it should work fine !, at least for me it does, :)
Title:
Post by: catwo on 18 May, 2005, 22:45:18
Awwww i get the following now lol
[21:42] Congratulations simon you are the hubs top leecher you are in 94 hubs with 1 slots open!
[21:42] Congratulations simon you are the hubs top leecher you are in 94 hubs with 1 slots open!
[21:42] Congratulations simon you are the hubs top leecher you are in 94 hubs with 1 slots open!
[21:42] Congratulations simon you are the hubs top leecher you are in 94 hubs with 1 slots open!
[21:42] Congratulations simon you are the hubs top leecher you are in 94 hubs with 1 slots open!
[21:42] Congratulations simon you are the hubs top leecher you are in 94 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
[21:43] Congratulations simon you are the hubs top leecher you are in 93 hubs with 1 slots open!
Title:
Post by: Dessamator on 19 May, 2005, 09:59:30
lol, yah i forgot to remove that after debugging, post edited above , :)
Title:
Post by: catwo on 19 May, 2005, 18:28:23
Thanks Dessamator works a treat, once again thanks for your time and efforts its much appreciated. :D
Title:
Post by: Dessamator on 19 May, 2005, 19:01:48
QuoteOriginally posted by catwo
Thanks Dessamator works a treat, once again thanks for your time and efforts its much appreciated. :D
ur welcome :)