-- it anounces users who enter who are in more then the max hubs set. -- after that the users have 2 count down from 10 to 0. -- the fastest user gets the honor of the kick. -- why?? because it's fun! Bot = "public_kickbattle" MaxHubs = 20 FunTable = {} FunComp = {} function Main() frmHub:RegBot(Bot) end function DataArrival(user, data) if user.sMyInfoString then s,e,thubs=strfind(user.sMyInfoString, "H:([%d%/]+)") if thubs ~= nil then hubs = 0 if tonumber(thubs) == nil then gsub(thubs, "(%d+)", function (num) hubs = hubs +tonumber(num) end) else hubs = tonumber(thubs) end if hubs >= MaxHubs then if FunTable[user.sName] == nil then SendToAll(Bot, user.sName.." was found in the hub while he's in "..hubs.." hubs, pls countdown down from 10 to 0 and you could be the one to kick his ass!!|") FunTable[user.sName] = 10 end end end end if( strsub(data, 1, 1) == "<" ) then local s,e,num=strfind(data, "%b<>%s+(%d+)") if tonumber(num) then num = tonumber(num) if num <= 10 then if FunComp[user.sName] == nil then FunComp[user.sName]=10 if num == 10 then FunComp[user.sName]= 9 for a,b in FunTable do if num == b then FunTable[a]=(b-1) end end end elseif num == (FunComp[user.sName]) then FunComp[user.sName]= FunComp[user.sName] -1 for a,b in FunTable do if num == b then FunTable[a]=(b-1) if FunTable[a] == -1 and FunComp[user.sName] == -1 then local vic = GetItemByName(a) FunTable[a]=nil FunComp=nil FunComp = {} if vic then SendToAll(Bot, user.sName.." is the lucky winner and kicked "..vic.sName.."!|") vic:SendPM(Bot, "your kicked for the insane amount of hub's your in, greets from the users of this hub! specialy from "..user.sName.." as he won the battle.|") vic:Disconnect() end end end end end end end end end function NewUserConnected(user) s,e,thubs=strfind(user.sMyInfoString, "H:([%d%/]+)") if thubs ~= nil then hubs = 0 if tonumber(thubs) == nil then gsub(thubs, "(%d+)", function (num) hubs = hubs +tonumber(num) end) else hubs = tonumber(thubs) end if hubs >= MaxHubs then if FunTable[user.sName] == nil then SendToAll(Bot, user.sName.." has entered the hub while he's in "..hubs.." hubs, pls countdown down from 10 to 0 and you could be the one to kick his ass!!|") FunTable[user.sName] = 10 end end end end function RunTable(user, num) for a,b in FunTable do if num == b then FunTable[a]=(b-1) if FunTable[a] == -1 then local vic = GetItemByName(a) FunTable[a]=nil SendToAll(Bot, user.sName.." is the lucky winner and banned "..vic.sName.."!|") vic:SendPM(Bot, "your banned for the insane amount of hub's your in, greets from the users of this hub! specialy from "..user.sName.." as he won the battle.|") vic:Ban() end end end end