out.tcl

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

out.tcl

Postby zNigel- » Sun Jul 05, 2009 7:41 pm

Hey there..

Asked r0t3n to make this for me a while ago.

Usage;
-out nick ?reason/preset?


You can change all the presets by opening the script in a scripteditor.
Find the line "array set preset {" and add by this format: {name} {value} .
Name will be the preset name, and value is the kickmessage.

For example, if I set the name as "noob" and the kickmessage as "You f*cking noob".. I'll show you.
<zNigel-> -out r0t3n noob
r0t3n was kicked by Bot <You f*cking noob - ID: 1337>


ID's will be shown automatically, so there is no need to add ID in preset kickmessage.
Also if you dont use any reason or preset, it will take the default one which is "You are OUT!"

All bans are 2min bans but can be changed at the variable "Bantime"
Triggers can also be changed. Just go to the variable "trigger" and change it to whatever you want.

Another example:
<zNigel-> -out r0t3n
r0t3n was kicked by Bot <You are OUT! - ID: 1338>


Here goes the script:
Code: Select all
namespace eval out {

    variable version "1.02"
   variable author "r0t3n aka blap"
   variable script "[lindex [split [info script] /] end]"
   
   variable trigger "-out"
   variable flags "m|m"
   
   variable bantime "120"; # in seconds
   
   if {[array exists preset]} { array unset preset }
   
   # format: {name} {value}
   
   array set preset {
      {spam} {Spam detected! User shutdown...}
      {default} {You are OUT!}
   }
   
   setudef int out_kid
   
   bind pub $flags "$trigger" [namespace current]::out
   
   proc out {nickname hostname handle channel text} {
       global lastbind botnick
       if {$text == ""} {
          putserv "NOTICE $nickname :SYNTAX: $lastbind <nick> ?reason/preset?."
      } elseif {![onchan [set who [lindex [split $text] 0]] $channel]} {
          putserv "NOTICE $nickname :'$who' is not on $channel."
      } else {
          set reason [join [lrange $text 1 end]]
         if {$reason == ""} {
             set reason "[join $out::preset(default)]"
         } elseif {[info exists out::preset([string tolower $reason])]} {
             set reason "[join $out::preset([string tolower $reason])]"
         }
         if {[string match -nocase *users.quakenet.org [set banmask *!*[string trimleft [getchanhost $who $channel] ~]]]} {
             set banmask *!*@[lindex [split $banmask @] 1]
         }
         channel set $channel out_kid "[set kid [expr {[channel get $channel out_kid]+1}]]"
         append reason "- ID: $kid"
         putquick "MODE $channel +b $banmask"
         putquick "KICK $channel $who :$reason"
         utimer $out::bantime [list pushmode $channel -b $banmask]
         putserv "NOTICE $nickname :Done. User '$who' is now banned for $out::bantime seconds."
      }
   }
   
   putlog "<$script> Version: $version Author: $author loaded."
   
}



Also if anyone would be very nice, a convert to MSL would be appreciated.
Last edited by zNigel- on Mon Jul 06, 2009 5:22 pm, edited 1 time in total.
zNigel-
 

Re: out.tcl

Postby Cristian » Sun Jul 05, 2009 8:22 pm

a re-coded script, I hope it does as the actual tcl script did. Otherwise contact me ;)

Code: Select all
alias -l bantime { return 120 }
alias -l preset {
  if ($1 = spam) { return Spam detected! User shutdown... }
  else { return You are OUT! }
}

on @*:TEXT:-out*:#: {
  if (!$2) {
    .notice $nick SYNTAX: $1 <nick> ?reason/preset?.
  }
  elseif ($2 !ison $chan) {
    .notice $nick $+(',$2,') is not on $chan $+ .
  }
  else {
    if ($3) { set %reason $3 }
    if ($preset($3)) { set %reason $preset($3) }

    .set %banmask $address($2,$iif(*.users.quakenet.org iswm $address($2,2),2,1))
    .hinc -m kickcount $chan 1
    .set %reason %reason - ID: $hget(kickcount,$chan)

    .ban $+(-ku,$bantime) $chan %banmask
    .kick $chan $2 %reason

    .notice $nick Done. User $+(',$2,') is now banned for $bantime seconds."
  }
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: out.tcl

Postby zNigel- » Sun Jul 05, 2009 8:31 pm

Thx alot mate.. I'll try it out soonish :)



EDIT: Thx alot.. Works perfectly :)
zNigel-
 

Re: out.tcl

Postby StareX » Wed Aug 12, 2009 7:33 am

Really nice !
StareX
 


Return to TCL Scripting Release

Who is online

Users browsing this forum: No registered users and 1 guest

cron