VIP vote kick
 

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

VIP vote kick

Started by plop, 10 May, 2004, 22:11:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

plop

was asked 2 make this script for a hub.
with it VIP's can kick but only if x VIP's vote the user 2 be kicked.
-- VIP vote kick by plop
-- 

Bot = "fikkie"
cAmountKick = 2  -- amount of votes needed for the kick (2 is the minimum)
tToBeKicked = {} -- counting the votes
tKickers = {} -- making sure they can't vote double

function Main() 
   frmHub:RegBot(Bot)
end

function DoKick(user, victum)
   if victum == "" then
      return "I need a name to know who to kick!!"
   else
      local victem = GetItemByName(victum)
      if victem ~= nil then
         if victem.iProfile == 3 or victem.iProfile == -1 then
            if tToBeKicked[victem.sName] then
               if tKickers[victem.sName][user.sName] then
                  return "You allready voted to kick "..victum.."!"
               else
                  tToBeKicked[victem.sName] = tToBeKicked[victem.sName] + 1
                  if tToBeKicked[victem.sName] >= cAmountKick then
                     tToBeKicked[victem.sName] = nil
                     tKickers[victem.sName] = nil
                     SendToAll(Bot, "Enough VIP's have voted to kick "..victem.sName.."!|")
                     victem:Kick("Enough VIP's have voted to get you kicked!")
                     return vic.." has been kicked"
                  else
                     tKickers[victem.sName][user.sName] = 1
                     return "Your vote to kick "..victum.." has been processed!"
                  end
               end
            else
               tToBeKicked[victem.sName] = 1
               if tKickers[victem.sName] == nil then
                  tKickers[victem.sName] = {}
               end
               tKickers[victem.sName][user.sName] = 1
               return "Your vote to kick "..victum.." has been processed!"
            end
         else
            return "We don't kick Operators or VIP's!!"
         end
      else
         return victum.." Isn't in the hub!!"
      end
   end
end


function DataArrival(user, data)
   if user.iProfile == 2 then
      if(strsub(data, 1, 4) == "$To:") then
         local s,e,whoTo = strfind(data,"$To:%s+(%S+)")
         if whoTo == Bot then 
            data=strsub(data,1,strlen(data)-1) 
            local s,e,cmd = strfind(data, "%$%b<>%s+(%S+)")
            if cmd == "!kick" then
               local s,e,victum = strfind(data, "%$%b<>%s+%S+%s*(%S*)")
               user:SendData(Bot, DoKick(user, victum).."|")
               return 1
            end
         end
      elseif( strsub(data, 1, 1) == "<" ) then
         data=strsub(data,1,strlen(data)-1) 
         local s,e,cmd = strfind(data,"%b<>%s+(%S+)") 
         if cmd == "!kick" then
            local s,e,victum = strfind(data, "%b<>%s+%S+%s*(%S*)")
            user:SendData(Bot, DoKick(user, victum).."|")
            return 1
         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 <----<<

honda

NIce script and very help full after the last discussion we have about vips ;-)

Greeting

plop

QuoteOriginally posted by honda
NIce script and very help full after the last discussion we have about vips ;-)

Greeting
it's a nice diplomatic way 2 let vips do some kicking. lol
they can kick but it's hard 2 cause a bad kick because of the voting.

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 <----<<

psf8500

Hehe. loving this script. btw "procest" should be "processed".

Had a good suggestion for something similar. An op types something like !userkick

Then users get 30 seconds or something to vote if they think that user should be kicked (the users have to type !votekick or whatever)

Give the users a chance to do a bit of kicking ;-)

Any chance of that plop?

plop

QuoteOriginally posted by psf8500
Hehe. loving this script. btw "procest" should be "processed".

Had a good suggestion for something similar. An op types something like !userkick

Then users get 30 seconds or something to vote if they think that user should be kicked (the users have to type !votekick or whatever)

Give the users a chance to do a bit of kicking ;-)

Any chance of that plop?
fixed the spelling error, thx.
and for that other request take a look here.
they don't have 30 seconds but need 2 count from 10 to 0.
the fastest does the kick.

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 <----<<

deeq

Now 2 vote and kick..How i change 3 vote and kick?

plop

QuoteOriginally posted by deeq
Now 2 vote and kick..How i change 3 vote and kick?
change this line.
cAmountKick = 1

the current minimum is 2 votes.

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 <----<<

Reefa

Hi Plop :)

Is it possible to put in a timer, so the VIPs only have two minutes to vote and then the vote is cancelled and they have to start again?

Thanks ;)

Appel

Hi guys,

I know that the favour I am going to ask is huge. But I try...

We run our hub on Linux, using Verlihub. We like the idea of a votekick bot for VIP users, and would like to ask you to help altering this script for BCDC.  The users eligible to vote via votekick bot would be registered in the bot by an OP. It has nothing to do with VIP levels in Verlihub. An OP could type, for instance, !regvote 'username', and that sets that user eligible to use the bot untill an OP inputs  !delregvote 'username'. (!listreg is also helpful) Users registered to votekick can enter !votekick 'baduser', (up to the voter's choice, either in main chat so it is visible for 'baduser' and might stop him, or in PM, so the voter remain anonymous). After a given number (probabaly 2) of votes for 'baduser', he gets kicked, with a preset message, like "VIP users have voted you out of this hub. Please keep our rules and behave friendlier" A record on votes might be useful for OPs, but not necesarry.

Any of you feel like coding such a script? Maybe plop? I would highly appreciate it, really.
Thx.

SMF spam blocked by CleanTalk