egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ident ban instead of hostban if irccloud user
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Stefano1990
Voice


Joined: 04 Jun 2018
Posts: 8
Location: Greccee

PostPosted: Mon Jun 11, 2018 3:12 pm    Post subject: Hello Reply with quote

now i check it the problem , can't use non-numeric string as operand of "*"
only timed doesnt work, without timed ban works fine
_________________
Use your common sense and try not to make me look too much like I know what I'm doing.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 538
Location: Tennessee, USA

PostPosted: Mon Jun 11, 2018 8:22 pm    Post subject: irccloud_kb.tcl v0.1 Reply with quote

Great. An error we can fix Smile

Found a cut n paste error in three of my expressions.

Please check this next version.

..
Code:

## >> irccloud_kb.tcl v0.1 << ##

################  Use the default kick reason:  Requested  ################
# !kb ted          :kick & ban ted  (this script doesn't remove this ban)
# !kb ted 20       :kick & ban ted  (remove ban in 20 minutes)
# !kb ted 20m      :kick & ban ted  (remove ban in 20 minutes)
# !kb ted 90s      :kick & ban ted  (remove ban in 90 seconds)
# !kb ted 4h       :kick & ban ted  (remove ban in 4 hours)
# !kb ted 1d       :kick & ban ted  (remove ban in 24 hours)

################  Use a custom kick reason  ################
# !kb ted Damn spammer   :kick & ban ted  (kick reason:  Damn spammer)
# !kb ted 20 stop that   :kick with reason: stop that (ban for 20 minutes)

################  Do just a kick, or just a ban  ################
# !k ted                :kick ted with default reason:  Requested
# !k ted Damn spammer   :kick ted with reason:  Damn spammer
# !b ted                :ban ted  (this script doesn't remove this ban)
# !b ted 1h             :ban ted  (remove this ban in 1 hour)



bind pub o|o !kb pubm:kickban
bind pub o|o !k pubm:kick
bind pub o|o !b pubm:ban

proc pubm:kick {nick host hand chan text} {
  pubm:kickban $nick $host $hand $chan $text k Kick
}
proc pubm:ban {nick host hand chan text} {
  pubm:kickban $nick $host $hand $chan $text b Ban
}


proc pubm:kickban {nick host hand chan text {do kb} {say "Kick and Ban"} } {
  set text [split [string trim $text]]
  if {![llength $text]} {
    puthelp "NOTICE $nick :Must provide a target nick to $say."
    return 0
  }
  set text [lassign $text whom]
  if {[isbotnick $whom] || ![botisop $chan] || [matchattr [nick2hand $whom $chan] mn]} {
    return 0
  }
  if {[set chost [getchanhost $whom $chan]] eq ""} {
    puthelp "NOTICE $nick :$whom is not on $chan"
    return 0
  }
  append say " $whom"

  if {[string match *b $do]} {
    if {[string match "*.irccloud.com" $chost]} {
      set mask *![lindex [split $chost @] 0]@*
    } else {  set mask [maskhost "$whom!$chost" 2]  }

    append say " ($mask"
    if {[llength $text]} {
      set rest [lassign $text exp]
      if {[regexp {^([1-9][0-9]{0,3})([smhd]?)$} $exp - num dur]} {
        if {$dur eq ""} {  set dur m  }

        set tcall [list timed:unban $mask $chan $nick $num $dur]
        if {$dur eq "d"} {  timer [expr {$num * 1440}] $tcall
        } elseif {$dur eq "h"} {  timer [expr {$num * 60}] $tcall
        } elseif {$dur eq "s"} {  utimer $num $tcall
        } else {  utimer [expr {$num * 60}] $tcall  }

        append say " for $num$dur"
        set text $rest
      }
    }
    append say ")"
  }

  if {[string match k* $do]} {  set reason "Requested"
    if {[llength $text]} {  set reason [join $text]  }
    append say " --> With Reason: $reason"
  }

  putquick "NOTICE $nick :$say"

  if {[string match *b $do]} {  putserv "MODE $chan +b $mask"  }
  if {[string match k* $do]} {  putserv "KICK $chan $whom :$reason"  }
}


proc timed:unban {mask chan nick num dur} {
  if {[botisop $chan] && [ischanban $mask $chan]} {
    putserv "MODE $chan -b $mask"
  }
}

putlog "irccloud_kb.tcl v0.1 Loaded."


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
Back to top
View user's profile Send private message Visit poster's website
simo
Master


Joined: 22 Mar 2015
Posts: 231

PostPosted: Tue Jun 12, 2018 10:53 am    Post subject: Reply with quote

tested and seems to work fine

nice work SpiKe^^
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber