max hub public kick battle
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

max hub public kick battle

Started by plop, 20 March, 2004, 00:16:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

plop

didn't feel like doing something serious 2day and this was the result.
enjoy.
-- 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
plop

* edit: tiny bug found. thx kepp.
* edit again: tiny bug found, now thx plop.
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

[NL]Pur


yepyepyep4711

did you give it some thought, about binding it to dc++k /CDM?

cheers

Carnage

Hehe i love it :)

just one little glitch  .. can't u make it so it doesn't count for OP's ?

plop

QuoteOriginally posted by yepyepyep4711
did you give it some thought, about binding it to dc++k /CDM?

cheers
yep but haven't made it yet. lol
but it's a real cool idea.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Carnage

No OP fix yet then ?

Damnz  :D

plop

QuoteOriginally posted by Carnage
No OP fix yet then ?

Damnz  :D
not checking OP's or not battling OP's??

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Carnage

Not checking OP's would be nice :)

Since my hub is in a network and most of the OP's are in all the hubs .. the limit sometimes is more then the allowed limit for normal users  8)

yepyepyep4711

#8
QuoteOriginally posted by plop
QuoteOriginally posted by yepyepyep4711
did you give it some thought, about binding it to dc++k /CDM?

cheers
yep but haven't made it yet. lol
but it's a real cool idea.

plop

waking up today with what I think is an idea to do it quite simply :D. Add the following command to the bot:
!abuser

This command can be used as a raw in ++k, as well as in main by a user.

So if someone (++k for example) goes:
!abuser UglyBastard using StealthDC

The bot then goes:
UglyBastard has been named an abuser by SheriffOfTheDay for the following reason: using StealthDC, pls countdown down from 10 to 0 and you could be the one to kick his ass!!

What do you think?

Cheers

plop

#9
both requests done but untested.
-- 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!
-- added bypase for op's
-- added command so op's can nominate users 2 (reason must be given)


Bot = "public_kickbattle"
MaxHubs = 20
FunTable = {}
FunComp = {}

function Main()
   frmHub:RegBot(Bot)
end

function DataArrival(user, data)
   if user.sMyInfoString and user.bOperator == nil 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+(%S+)")
      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
      elseif num == "!abuser" and user.bOperator then
         local s,e,vic,why=strfind(data, "%b<>%s+%S+%s*(%S*)%s*(.*)")
         if why == "" then
            user:SendData(Bot, "I need a user name!|")
            return 1
         elseif why == "" then
            user:SendData(Bot, "Sorry, need a reason!|")
            return 1
         elseif GetItemByName(vic) then
            if FunTable[vic] == nil then
               SendToAll(Bot, vic.." has been named an abuser by "..user.sName.." for the following reason: "..why..", pls countdown down from 10 to 0 and you could be the one to kick his ass!!|")
               FunTable[vic] = 10
               return 1
            end
         else
            user:SendData(Bot, "Unknown user!|")
            return 1
         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
plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

yepyepyep4711

great! Here the results of a few tests.

!abuser does nothing (doesn't say "I need a username", or whatever)
!abuser says "I need a username"
!abuser _ (space) starts the kickbattle with blank reason, and doesn't kick in the end
!abuser starts the kickbattle, but doesn't kick in the end.

The kickbattle for too many hubs does the same (doesn't kick).

The bypass for ops seems too work :]

plop

found the bug but it was really weird.
but won't bore you with it. lol
here it is.
-- 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!
-- added bypase for op's
-- added command so op's can nominate users 2 (reason must be given)


Bot = "public_kickbattle"
MaxHubs = 20
FunTable = {}
FunComp = {}

function Main()
   frmHub:RegBot(Bot)
end

function DataArrival(user, data)
   if user.sMyInfoString and user.bOperator == nil 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
      else
         local s,e,num=strfind(data, "^%b<>%s+(%S+)")
         if num == "!abuser" and user.bOperator then
            local s,e,vic,why=strfind(data, "%b<>%s+%S+%s*(%S*)%s*(.*)")
            if vic == "" then
               user:SendData(Bot, "I need a user name!|")
               return 1
            elseif why == "" then
               user:SendData(Bot, "Sorry, need a reason!|")
               return 1
            elseif GetItemByName(vic) then
               if FunTable[vic] == nil then
                  SendToAll(Bot, vic.." has been named an abuser by "..user.sName.." for the following reason: "..why..", pls countdown down from 10 to 0 and you could be the one to kick his ass!!|")
                  FunTable[vic] = 10
                  return 1
               end
            else
               user:SendData(Bot, "Unknown user!|")
               return 1
            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
plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

yepyepyep4711

#12
it works! :)

here the results of the tests:

!abuser gives nothing
!abuser_ (space) gives "Sorry, need a reason!"
nothing important, but maybe having it say "syntax is !abuser " in both cases would be nice.

It doesn't print out the real reason to the kicked person, so if for example I use

!abuser testuser you are a test user

it kicks testuser with the text:
your kicked for the insane amount of hub's your in, greets from the users of this hub! specialy from yepyepyep4711 as he won the battle.

It would be nice to incorporate the reason stated in the commandin this :)

last but not least, it doesn't kick, it drops. I intend to use this to let the users do the work and letting them have fun doing it, so I would need it to kick on behalf of the user that won, so that it get registred by TopTen :D

EDIT: omg I have another idea for this script :D
make different punishment possible, like !abuse.d will end in a drop, !abuse.k will end in a kick, !abuse.nb will end in a nickban, etc...
I guess issueing the corresponding command in main on behalf of the winner would do the trick nicely, what do you think?

plop

shows the correct reason now on users who get nominated by the !abuser command.
-- 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!
-- added bypase for op's
-- added command so op's can nominate users 2 (reason must be given)


Bot = "public_kickbattle"
MaxHubs = 20
FunTable = {}
FunComp = {}
Reason = {}

function Main()
   frmHub:RegBot(Bot)
end

function DataArrival(user, data)
   if user.sMyInfoString and user.bOperator == nil 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.."!|")
                           if Reason[vic.sName] then
                              vic:SendPM(Bot, "your kicked for "..Reason[vic.sName]..", greets from the users of this hub! specialy from "..user.sName.." as he won the battle.|")
                           else
                              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.|")
                           end
                           vic:Disconnect()
                        end
                     end
                  end
               end
            end
         end
      else
         data = strsub(data, 1, (strlen(data)-1))
         local s,e,num=strfind(data, "^%b<>%s+(%S+)")
         if num == "!abuser" and user.bOperator then
            local s,e,vic,why=strfind(data, "%b<>%s+%S+%s*(%S*)%s*(.*)")
            if vic == "" then
               user:SendData(Bot, "I need a user name!|")
               return 1
            elseif why == "" then
               user:SendData(Bot, "Sorry, need a reason!|")
               return 1
            elseif GetItemByName(vic) then
               if FunTable[vic] == nil then
                  SendToAll(Bot, vic.." has been named an abuser by "..user.sName.." for the following reason: "..why..", pls countdown down from 10 to 0 and you could be the one to kick his ass!!|")
                  FunTable[vic] = 10
                  Reason[vic]=why
                  return 1
               end
            else
               user:SendData(Bot, "Unknown user!|")
               return 1
            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
plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Odin

Weee, this is GREAT stuff :)

just one thing, its not compatible with deflood.lua
Users cant partisipate,  they get flood warnings (the flood bot removes numbers from chat).

so.. how bout using word's instead of numbers in this count down?
If U manage to pull random words from a text file this will be a real challenge!
And, if possible, ad a command to set numbers of words needed, so admins can rais the level of difficulty when the users improve their typing skills?
Norges DC hub nummer 1!
dchub://odin.vikingshub.com:1337  

plop

QuoteOriginally posted by Odin
Weee, this is GREAT stuff :)

just one thing, its not compatible with deflood.lua
Users cant partisipate,  they get flood warnings (the flood bot removes numbers from chat).

so.. how bout using word's instead of numbers in this count down?
If U manage to pull random words from a text file this will be a real challenge!
And, if possible, ad a command to set numbers of words needed, so admins can rais the level of difficulty when the users improve their typing skills?
really cool idea, gone do it.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

??????Hawk??????

BOOT Added  :P

-- 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!
-- added bypase for op's
-- added command so op's can nominate users 2 (reason must be given)
-- Added A BOOT ??????Hawk??????

Bot = "public_kickbattle"
MaxHubs = 20
FunTable = {}
FunComp = {}
Reason = {}
speed = 200
Height = "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"..
"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"..
"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
Heighta = "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"..
"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"..
"\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"
function Main()
   frmHub:RegBot(Bot)
	SetTimer(speed)
end

function DataArrival(user, data)
   if user.sMyInfoString and user.bOperator == nil 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
                        vic = GetItemByName(a)
                        FunTable[a]=nil
                        FunComp=nil
                        FunComp = {}
                        if vic then

BootUser = user.sName
StartTimer()
                           if Reason[vic.sName] then
                              vic:SendPM(Bot, "your kicked for "..Reason[vic.sName]..", greets from the users of this hub! specialy from "..user.sName.." as he won the battle.|")
                           else
                              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.|")
                           end
                           vic:Disconnect()
                        end
                     end
                  end
               end
            end
         end
      else
         data = strsub(data, 1, (strlen(data)-1))
         local s,e,num=strfind(data, "^%b<>%s+(%S+)")
         if num == "!abuser" and user.bOperator then
            local s,e,vic,why=strfind(data, "%b<>%s+%S+%s*(%S*)%s*(.*)")
            if vic == "" then
               user:SendData(Bot, "I need a user name!|")
               return 1
            elseif why == "" then
               user:SendData(Bot, "Sorry, need a reason!|")
               return 1
            elseif GetItemByName(vic) then
               if FunTable[vic] == nil then
                  SendToAll(Bot, vic.." has been named an abuser by "..user.sName.." for the following reason: "..why..", pls countdown down from 10 to 0 and you could be the one to kick his ass!!|")
                  FunTable[vic] = 10
                  Reason[vic]=why
                  return 1
               end
            else
               user:SendData(Bot, "Unknown user!|")
               return 1
            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 OnTimer()
LoadBootText(vic, Height)
Height = strsub(Height, 1, (strlen(Height)-4))
if Height == "" then
LoadBootTexta()
SendToAll(Bot,BootText.."  "..BootUser.." is the lucky winner and kicked "..vic.sName.."!|")
StopTimer()
else
SendToAll(Bot,BootText)
end
end

function LoadBootText(vic)
BootText = Heighta.."____\r\n"..
"[=--=/\r\n"..
"}  :(___.--.\r\n"..
"(    __ '    )\r\n"..
"'===='''----'        "..
Height.."\r\n"..vic.sName
end

function LoadBootTexta()
BootText = Heighta.."____\r\n"..
"[=--=/\r\n"..
"}  :(___.--.\r\n"..
"(    __ '    )\r\n"..
"'===='''----'        "
end

yepyepyep4711

cool Hawk. : )
If you're working on this a well, maybe you could solve the following problem: if someone doesn't get kicked (because they leave the hub before the countdown is done), the next abuser doesn't get kicked (the script is still stuck on the last one that wasn't kicked).

cheers

??????Hawk??????

#18
hmmm  i cant seem to replicate it here but try this .  it should clear all tables after every kick.

can't put it here because of the forum adding extra  

'  & quot;  '  on some of the lines ..  

yepyepyep4711

sounds great.

I'm realising users get irritated if the script doesn't say anything (because the victim already got out). It would be great if it said something like "userxxx won the kickbattle but victimyyy ran away in fear! ;-)"

can you do that?

thy already and cheers

??????Hawk??????

#20
try this m8  ...


can't put it here because of the forum adding extra  

'  & quot;  '  on some of the lines ..  

yepyepyep4711

Hi Hawk, I've now tried you boot versions, all of them, and I get the following error:

Syntax error: expected;
  last token read: `&' at line 29 in file `...X\test Versions\0.330.b15.25.dbg\scripts\public_kickbattle.orig.lua'

yepyepyep4711

#22
since Hawk can't post his version, I'll post mine, it has one extra (bot desc, speed, etc...) and correct english ;p

Hawk helped me strip his version from the boot animation as well, so this one only prints the boot once.


-- public_kickbattle by plop
-- it announces users who enter who are in more than 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!
-- added bypass for op's
-- added command so op's can nominate users 2 (reason must be given)
-- Added A BOOT ??????Hawk??????
-- added bot email, speed, desc and share from a bot I had lying around -- yepyepyep4711

gb = 1024 * 1024 * 1024 

--- you can change these

Bot = "public_kickbattle"
bot_email = "kick@yours.com"
bot_speed = "4711 kbs"
bot_descr = "behold the mighty boot"
bot_share_size = 47.11 * gb
MaxHubs = 47

--- don't change anything further below

FunTable = {}
FunComp = {}
Reason = {}
function Main()
   frmHub:RegBot(Bot)
   my_info_string = "$MyINFO $ALL "..Bot.." "..bot_descr.."$ $"..bot_speed..strchar( 1 ).."$"..bot_email.. 
"$"..bot_share_size.."$" 
end

function DataArrival(user, data)


   if user.sMyInfoString and user.bOperator == nil 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
		OfflineBootNick = user.sName
               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
                        vic = GetItemByName(a)
                        FunTable[a]=nil
                        FunComp=nil
                        FunTable = {}
				FunComp = {}
                        if vic then
				BootUser = user.sName
                           if Reason[vic.sName] then
                              vic:SendPM(Bot, "you're kicked for "..Reason[vic.sName]..", greets from the users of this hub! specialy from "..user.sName.." as he won the battle.|")
					KickBoot()
                           else
                              vic:SendPM(Bot, "you're 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.|")
					KickBoot()
                           end
                        else
					BootUser = user.sName
					KickBoot()
                        end
                     end
                  end
               end
            end
         end
      else
         data = strsub(data, 1, (strlen(data)-1))
         local s,e,num=strfind(data, "^%b<>%s+(%S+)")
         if num == "!abuser" and user.bOperator then
            local s,e,vic,why=strfind(data, "%b<>%s+%S+%s*(%S*)%s*(.*)")
            if vic == "" then
               user:SendData(Bot, "I need a user name!|")
               return 1
            elseif why == "" then
               user:SendData(Bot, "Sorry, need a reason!|")
               return 1
            elseif GetItemByName(vic) then
               if FunTable[vic] == nil then
			OfflineBootNick = vic
                  SendToAll(Bot, vic.." has been named an abuser by "..user.sName.." for the following reason: "..why..", pls countdown down from 10 to 0 and you could be the one to kick his ass!!|")
                  FunTable[vic] = 10
                  Reason[vic]=why
                  return 1
               end
            else
               user:SendData(Bot, "Unknown user!|")
               return 1
            end
         end
      end
   end
end

function NewUserConnected(user)

   user:SendData( my_info_string ) 

   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 OpConnected(curUser) 
   curUser:SendData( my_info_string ) 
end 

function KickBoot()
LoadBootText()
if GetItemByName(OfflineBootNick) == nil then
   SendToAll(Bot,BootText.."  "..BootUser.." is the lucky winner but "..OfflineBootNick.." has already run away!|")
else
   SendToAll(Bot,BootText.."  "..BootUser.." is the lucky winner and kicked "..vic.sName.."!|")
   vic:Disconnect()
end

end

function LoadBootText()
BootText = "\r\n"..
"____\r\n"..
"[=--=/\r\n"..
"}  :(___.--.\r\n"..
"(    __ '    )\r\n"..
"'===='''----'        "..
"\r\n"..OfflineBootNick
end

??????Hawk??????

ok seems this is the only way i can share it


Click Here to d/l the animated version

SMF spam blocked by CleanTalk