This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

setban time script(Solved)

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

setban time script(Solved)

Post by blake »

Hey im looking for a simple bit of scripting that will do the following set +b on a user and beable to set a ban time it will then message chanserv and chanserv will kick the user this is what im using at the moment just cant get the variable btime to to work

Code: Select all

bind msg ho|ho bankick cmd:bankick
proc cmd:bankick {nick uhost hand arg} {
  set chan [lindex [split $arg] 0]
  set username [lindex [split $arg] 1]   
  set reason [lrange [split $arg] 2 end]  
  putserv "MODE $chan +b $username"
  putserv "PRIVMSG chanserv kick $chan $username $reason (Issued By $nick"   
}
Last edited by blake on Sun Nov 29, 2009 1:12 pm, edited 1 time in total.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

It dosen't need a bantime but if one is given it will be <#chan> <nickname> <reason> <bantime>

Code: Select all

 proc cmd:bankick {nick host hand text} {
  set chan [lindex [split $text] 0]
  set user [lindex [split $text] 1]
  set why [join [lrange [split $text] 2 end-1]]
  set chk [join [lrange [split $text] end end]]
  if {![regexp -- {^[0-9]} $chk]} {set why [join [lrange [split $text] 2 end]]} else {set bantime [join [lrange [split $text] end end]]}
   if {[info exists bantime]} {
    putserv "MODE $chan +b $user"
    putserv "PRIVMSG ChanServ KICK $chan $user $why) (Issued By $nick"
    timer $bantime [list putserv "MODE $chan -b $user"]
    return 1
   } else {
    putserv "MODE $chan +b $user"
    putserv "PRIVMSG ChanServ KICK $chan $user $why) (Issued By $nick"
    return 1
   }
 }

 bind msg ho|ho bankick cmd:bankick
The ChanServ KICK thing? is that suppose to be AKICK? if so you can make the bot remove the akick as well as the channel ban it places. :idea:
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

No just need the bot to set mode +b user message chanserv kick command so chanserv kicks out

_-4:53pm-_ * Botnick sets mode: +b Training_Drone1!*@*
_-4:53pm-_ * Training_Drone1 was kicked by testnetwork (You were banned from #TrainingRoom for impersonating a member of staff (15 minutes) (Issued By test)

the above is how it does it at the moment your script will enable us to use timed bans of 15 30 and 1 hour bans


Works a treat thanks TCL_no_TK appreciate it
Post Reply