| View previous topic :: View next topic |
| Author |
Message |
mCev1L Voice
Joined: 12 Dec 2005 Posts: 5
|
Posted: Tue Jan 24, 2006 9:22 am Post subject: help me |
|
|
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 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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Jan 24, 2006 1:03 pm Post subject: |
|
|
| Code: |
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. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Tue Jan 24, 2006 7:05 pm; edited 1 time in total |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Jan 24, 2006 5:53 pm Post subject: |
|
|
| Code: | | [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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Jan 24, 2006 7:06 pm Post subject: |
|
|
Oups! Duno how that got there. 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. |
|
| Back to top |
|
 |
|