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 

[SOLVED] Script allows Bot to Kick and Ban Itself: Help!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
achilles1900
Voice


Joined: 21 Apr 2008
Posts: 30

PostPosted: Wed Dec 10, 2008 4:22 am    Post subject: [SOLVED] Script allows Bot to Kick and Ban Itself: Help! Reply with quote

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
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Dec 10, 2008 4:53 am    Post subject: Reply with quote

I guess the problem is case sensitive nick matching. Change {$text != $botnick} to {![isbotnick $text]}
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
achilles1900
Voice


Joined: 21 Apr 2008
Posts: 30

PostPosted: Wed Dec 10, 2008 7:33 am    Post subject: Thanks! The !kick Part is solved but Reply with quote

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 Very Happy - Achilles
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Dec 10, 2008 9:20 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
achilles1900
Voice


Joined: 21 Apr 2008
Posts: 30

PostPosted: Wed Dec 10, 2008 12:16 pm    Post subject: Reply with quote

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 Very Happy
/me dances a jig....you guys have a good one.

with much appreciation,
Achilles
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 -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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