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.

help me

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
mCev1L
Voice
Posts: 5
Joined: Mon Dec 12, 2005 3:23 pm

help me

Post by mCev1L »

hi,

i set in my eggdrop tcl command like every body with none flag - can control bot only when they type !join #chan .. i need small :roll: tcl that can i add some chans bot will not join it if the user type !join


example:

KellyWAG: !join #sucker
mynot: sorry, chan on my bad list
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

set dont_join "#foo #MoO #BaR"

bind pub - !join all:pub:join

proc all:pub:join {nick uhost handle channel text} {
  global dont_join
  if {![llength [set chan [lindex [split $text] 0]]]} {
    putserv "NOTICE $nick :Usage: !join #channel"
    return
  }
  if {[validchan $chan]} {
    set msg "Sorry, the $chan channel is already a known channel to me."
    if {![botonchan $chan] || [channel get $chan inactive]} {
      append msg " Currently I'm not on the $chan channel, possible reasons: limit, invite only, banned or channel is se to +inactive."
      } else {
      append msg " Currently I'm on the $chan channel."
    }
    putserv "NOTICE $nick :$msg"
    return
  }
  if {[regexp -nocase $chan $dont_join]} {
    putserv "NOTICE $nick :Sorry, $chan channel is on my bad list."
    return
  }
  putserv "NOTICE $nick :Allright, I'll join $chan channel."
  channel add $chan
}
Feel free to modify it to suit your needs.

Edit: Fixed.
Last edited by caesar on Tue Jan 24, 2006 7:05 pm, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

[regexp -nocase {$chan} $dont_join]
this will always return 0 unless there is the word "$chan" in $dont_join, removing the braces will solve the problem.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Oups! Duno how that got there. :oops: I swear I've removed it once. Weird, anyway, thanks for pointing that out Sir_Fz. :)
Once the game is over, the king and the pawn go back in the same box.
Post Reply