PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: #jdslkfjals# on 03 January, 2005, 20:58:24

Title: a script with simple kicks
Post by: #jdslkfjals# on 03 January, 2005, 20:58:24
i need a script so you can do like
!ban nick porn

and then the user will be  banned for sharing porn

or like !kick nick program files
and then the user will be kicked for sharing program files


please can someone get me a script like that ?
Title:
Post by: imby on 03 January, 2005, 21:19:01
-- Modded version VIPK by Plop
-- Fasted & easyest way haha (to make that is)

Bot = "=SimpleKick="

function Main()
frmHub:RegBot(Bot)
end

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

function DoKick(user, data)
   local s,e,name, reason = strfind(data, "%b<>%s+%S+%s*(%S*)%s*(.*)")
   if name == "" then
      return "*** I need a name to know who to kick!!"
   elseif reason == "" then
      return "*** I need a reason to kick the user!"
   else
      local victem = GetItemByName(name)
      if victem ~= nil then
         if victem.bOperator == nil then
            victem:SendData(Bot, "You have been kicked by: "..user.sName.." because of: "..reason.."|")
            victem:Disconnect()
            return name.." has been kicked!"
         else
            return "*** We don't kick Operators!!"
         end
      else
         return "*** "..name.." Isn't in the hub!!"
      end
   end
end

For !kick. Ban is inbuilt into ptokax if I'm not mistaken.
Title:
Post by: #jdslkfjals# on 03 January, 2005, 21:55:28
hmm i think you didnt understand what i meant

im talking about like

!kick porn


and then it would come somethin like

you are being kicked for sharing porn

and like hauxir is kicking somebody because: sharing porn
Title:
Post by: imby on 03 January, 2005, 22:07:16
Doesn't the above script do that? Or is it the actual kick messages that concern you?
Title:
Post by: #jdslkfjals# on 03 January, 2005, 22:17:05
no i just want to make it more easy for operators

so they dont have to make up a reason themselves :)
Title:
Post by: bastya_elvtars on 03 January, 2005, 22:20:53
lol

then they must use usercommands  :P
Title:
Post by: imby on 03 January, 2005, 22:25:27
Ah ok, I don't know how to script for the hub to send user commands, someone else might be able to help you with that. A decent solution for this would be, in your DC++ client, go to File > Settings > Advanced > User Commands > Add >

For command type Select > Chat

For context check all 3 of them.

in Parameters, Name it !kick porn for example

In command add, <%[mynick]> !kick %[nick] your_reason_here|

i.e.:

<%[mynick]> !kick %[nick] illegal porn|

Click OK. You can add as many as you'd like, and tell your Ops to do the same. This all may prove inadaquate, or I may of lost you, but it's one solution.

Now if you right click a nick you should be able to kick them straight away with that reason.
Title:
Post by: bastya_elvtars on 03 January, 2005, 22:30:17
(http://rnrdoctor.sytes.net/usercmd.jpg)
Title:
Post by: #jdslkfjals# on 03 January, 2005, 22:44:24
ok thank you very much :)
Title:
Post by: n1ck on 04 January, 2005, 00:56:49
could a short cut type script be used for this?
Example (really rough one)

if !kick = 1 then 'dont share illegal porn'
           = 2 then 'you dont have enough slots open'


 You get the idea?
Title:
Post by: ((UKSN))shad_dow on 04 January, 2005, 11:56:13
hi

here  is my Kick by rules bot , just dont have time to  but it does exclay wot u wont , i cheack back tonight and see if i can update it alittle

Rules kicker (saves typeing a reason) >>> http://board.univ-angers.fr/thread.php?threadid=2240&boardid=12&sid=70cad8af1a9f963fab99ec72472aa344 (http://board.univ-angers.fr/thread.php?threadid=2240&boardid=12&sid=70cad8af1a9f963fab99ec72472aa344)

yours

shad