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 

a little ban problem

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


Joined: 11 Apr 2007
Posts: 23
Location: Canada

PostPosted: Tue Apr 24, 2007 6:30 am    Post subject: a little ban problem Reply with quote

i have take a existing script and modify it a little bit...
maybe the structure is not very good but it work exept for 1 thing

Code:
bind pub f !spam uw:spamkb

proc uw:spamkb {nick host hand chan text} {
   global botnick
   set rsn SPAM
   uw:ban $nick $host $hand $chan $text
}

proc uw:ban {nick host hand chan text} {
global botnick uw:spamkb rsn uw:viruskb
set target [lindex $text 0]
set reason [lindex $rsn 0 end]
set bhost [getchanhost $target $chan]
set banmask "*!*@[lindex [split $bhost @] 1]"
if {[matchattr $target fmo|fmo $chan]} {return 0}
if {[matchattr $nick n|-] == "1"} {
  putserv "MODE $chan +b $banmask"
  putserv "KICK $chan $target :$reason"
  } elseif {$target != $botnick} {
if {[matchattr $target n|-] == "0"} {
if {[matchattr $target fmo|fmo $chan]} {return 0}
 if {[matchattr $nick -|o $chan] == 1} {
  putserv "MODE $chan +b $banmask"
  putserv "KICK $chan $target :$reason"
   } elseif {[matchattr $target -|o $chan] == 0} {
  putserv "MODE $chan +b $banmask"
  putserv "KICK $chan $target :$reason"
  } else {
  putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
 }
} elseif {[matchattr $target n|-] == 1} {
    putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
}
} else {
 putquick "NOTICE $nick : [censored] you"
}
}


if i make !spam nick in the channel it ban like a want.. ex: *!*@host

but if a make the command with a nick who isnt in the chan anynore the bot place a ban *!*@ and thats the part i dont want...

i know its a little thing but i cant find how to resolve it.... its probably a if command but i cant find the variable (im a neeb in tcl] Wink

i want to keep those flag
Code:

if {[matchattr $target fmo|fmo $chan]} {return 0}


so probably this is going to garbage
Code:

if {[matchattr $nick n|-] == "1"}
if {[matchattr $target n|-] == "0"}
 if {[matchattr $nick -|o $chan] == 1}
} elseif {[matchattr $target n|-] == 1}


i juste whant to keep de kick/ban procedure in proc uw:ban and protect the fmo flag from beeing ban...

and if you have some idea how to improve or simplify the script all the commentary are welcome

thanks[/code]
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Apr 24, 2007 5:41 pm    Post subject: Reply with quote

Simplest thing would be to add a new test:

if {![onchan $target $chan]} {putcmdlog "'target' isn't on '$chan'";return 0}
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