| View previous topic :: View next topic |
| Author |
Message |
achilles1900 Voice
Joined: 21 Apr 2008 Posts: 30
|
Posted: Wed Dec 10, 2008 4:22 am Post subject: [SOLVED] Script allows Bot to Kick and Ban Itself: Help! |
|
|
Hi Forum people,
I have a public command script for users with +o in the bot.
Problem is when executing !kick (botnick) & !ban (botnick); the bot kicks and bans itself.
Can someone please go through it and see where the error is? I thank you in advance, cause' it would really help our channel.
Best regards. (script follows)
| Code: |
# Process Kick
proc proc_kick { nick uhost hand chan text } {
global botnick
if {[onchan $text]} {
if {$text != $botnick} {
putquick "KICK $chan $text :Requested"
}
} else { putserv "PRIVMSG $chan :\002$text\002 Not In Channel: \002$chan\002" }
}
# Ban Process
proc proc_ban { nick uhost hand chan text } {
global botnick
if {[onchan $text]} {
if {$text == $botnick} { return 0 }
set banmask [maskhost [getchanhost $text $chan]]
putquick "MODE $chan +b $banmask"
putkick $chan $text :Requested
} else { putserv "PRIVMSG $chan :$text Is Not In The Channel" }
}
|
Last edited by achilles1900 on Wed Dec 10, 2008 12:17 pm; edited 1 time in total |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Wed Dec 10, 2008 4:53 am Post subject: |
|
|
I guess the problem is case sensitive nick matching. Change {$text != $botnick} to {![isbotnick $text]} _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
achilles1900 Voice
Joined: 21 Apr 2008 Posts: 30
|
Posted: Wed Dec 10, 2008 7:33 am Post subject: Thanks! The !kick Part is solved but |
|
|
Hi User,
thanks man, your expert advice solved the !kick part. That works like a charm!
However the !ban part is still banning even though I replaced:
if {$text == $botnick} { return 0 }
with
if {![isbotnick $text]} {
That killed the bot from shell with this error:
Tcl error in file 'bot.conf':
missing close-brace
while executing
"proc proc_ban { nick uhost hand chan text } {
global botnick
if {[onchan $text]} {
if {![isbotnick $text]} {
set banmask [maskhost [getcha..."
(file "scripts/opcmds.tcl" line 70)
invoked from within
* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
-
DCC session closed
Any other information you need please let me know, i really appreciate you taking the effort - Achilles |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Dec 10, 2008 9:20 am Post subject: |
|
|
Replace
| Code: | | if {$text == $botnick} { return 0 } |
with
| Code: | | if {[isbotnick $text]} { return 0 } |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
achilles1900 Voice
Joined: 21 Apr 2008 Posts: 30
|
Posted: Wed Dec 10, 2008 12:16 pm Post subject: |
|
|
Hi Sir_Fz
thanks for the reply and the help. I just tried it out and it works like a charm! Great advice!
My deepest appreciation to User & to Sir_Fz, this really helped us out
/me dances a jig....you guys have a good one.
with much appreciation,
Achilles |
|
| Back to top |
|
 |
|