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 

Bot self kick/ban & Protected flag User Protection

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
illusionist
Voice


Joined: 09 Mar 2020
Posts: 25

PostPosted: Sat Jul 04, 2020 2:28 am    Post subject: Bot self kick/ban & Protected flag User Protection Reply with quote

Hello There i need help with this TCL.
Bot adding -ao+d flag for a user if he kicks bot or a Protected flag nick.
I want to remove this function from code.
And also
Bot put modes like
** eggdrop sets mode(s) -o flagkicker
** eggdrop sets mode(s) +b *!*flagkicker@*.domain


I need like this

** eggdrop sets mode(s) -o+b flagkicker *!*flagkicker@*.domain

Really appreciated if someone can help me with this...
Thanks in advance
Code:
#
      #Protected Flag
set jaDuflag "P";                                                 #
#                                                                 #
# Ban Time for DeOping
set deoptime "15";                                                #
#                                                                 #
# Ban time for kicking
set kicktime "20";                                                #
#                                                                 #
# Ban time For Banning
set banstime "60";                                                #
#                                                                 #
# Flag for exceptions other than m|m and bot ?� (A-Z or userflag) #
set exceflag "E";                                                 #
#                                                                 #
# Msg user informing him how to get his ops back (0/1) ?�         #
set msgeuser "1";                                                 #
#                                                                 #
# If you want to log every thing jaDuX                          #
# does uncomment the this line out. (recommend)                   #
#                                                                 #
#logfile 7 * "/path/to/log/jaDuX.log";                          #
#                                                                 #
######################### END OF SYSTEM SETTINGS ##################

######### BINDS ##############
bind mode - *-o* jaDuX:deop
bind kick - * jaDuX:kick
bind mode - *+b* jaDuX:ban
bind chon - * jaDuX:console
######### BINDS ##############

### Set jaDu sys console #####
proc jaDuX:console { hand idx } {
   set chan [lindex [console $idx] 0]
   if {[matchattr $hand m|m]} { console $idx +1 }
   return 0
}
#### End of set console ######

######### jaDu deop ##########
proc jaDuX:deop {nick host hand chan mdechg dnick} {
global botnick jaDuflag exceflag deoptime msgeuser
 if {([matchattr $hand m|m $chan]) || ([matchattr $hand $exceflag|$exceflag]) || ([matchattr $hand b])} {return 0}
 if {[string tolower $nick] == [string tolower $botnick]} {return 0}
  if {[string tolower $dnick] == [string tolower $botnick]} {
   if {[validuser $hand]} {
    if {[matchattr $hand |o $chan]} {
     putserv "PRIVMSG $nick :You have lost your op on $chan for that !!"
     chattr $hand |-ao+d $chan
     if {$msgeuser} {putserv "PRIVMSG $nick :If you want your op back please talk to one of my masters. Masters on channel $chan are now: [chanlist $chan m|m]"}
     if {![string match "$deoptime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Deoped me !! [ctime [unixtime]] - $deoptime min ban." $deoptime}
     putloglev 7 * "Protectison system: $nick!$host !$hand! deoped me on $chan !!"
     return 0
     } else {
     chattr $hand |-ao+d $chan
     if {![string match "$deoptime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Deoped me !! [ctime [unixtime]] - $deoptime min ban." $deoptime}
     putloglev 7 * "Protectison system: $nick!$host !$hand! deoped me on $chan !!"
     return 0
     }
  }
   if {![string match "$deoptime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Deoped me !! [ctime [unixtime]] - $deoptime min ban." $deoptime}
   putloglev 7 * "Protectison system: $nick!$host !$hand! deoped me on $chan !!"
   return 0
 }
 if {![matchattr [nick2hand $dnick $chan] $jaDuflag|$jaDuflag $chan]} {return 0}
 if {[string tolower $dnick] == [string tolower $nick]} {return 0}
 if {[botisop $chan]} {
   pushmode $chan -o $nick
   pushmode $chan +o $dnick
   if {![string match "$deoptime" "0"]} {pushmode $chan +b [maskhost $host]}
   flushmode $chan
     if {[matchattr $hand |o $chan]} {
       chattr $hand |-ao+d $chan
       putserv "KICK $chan $nick :Do NOT deop $dnick !! - You have lost your op on $chan for that !!"
       if {$msgeuser} {putserv "PRIVMSG $nick :If you want your op back please talk to one of my masters. Masters on channel $chan are now: [chanlist $chan m|m]"}
     } else {
       if {[validuser $hand]} {
       chattr $hand |-ao+d $chan
       }
       putserv "KICK $chan $nick :Do NOT deop $dnick !! - $deoptime min shitlist."
       if {![string match "$deoptime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Deoped [nick2hand $dnick $chan] [ctime [unixtime]] - $deoptime min ban." $deoptime}
     }
 }
putloglev 7 * "Protectison system: $nick!$host !$hand! deoped $dnick![getchanhost $dnick $chan] ![nick2hand $dnick $chan]! on channel $chan !!"
return 0
}
######### End proc deop ####

######### jaDu kick ##########
proc jaDuX:kick {nick host hand chan knick reason} {
global botnick jaDuflag exceflag kicktime msgeuser
 if {([matchattr $hand m|m $chan]) || ([matchattr $hand $exceflag|$exceflag]) || ([matchattr $hand b])} {return 0}
 if {[string tolower $nick] == [string tolower $botnick]} {return 0}
  if {[string tolower $botnick] == [string tolower $knick]} {
   if {[validuser $hand]} {
    if {[matchattr $hand |o $chan]} {putserv "PRIVMSG $nick :You have lost your op on $chan for that !!"}
     chattr $hand |-ao+d $chan
     if {$msgeuser} {putserv "PRIVMSG $nick :If you want your op back please talk to one of my masters. Masters on channel $chan are now: [chanlist $chan m|m]"}
     if {![string match "$kicktime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Kicked [nick2hand $knick $chan] [ctime [unixtime]] - $kicktime min ban." $kicktime}
     putloglev 7 * "Protectison system: $nick!$host !$hand! kicked me off $chan reason: $reason"
     return 0
     } else {
     chattr $hand |-ao+d $chan
     if {![string match "$kicktime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Kicked me !! [nick2hand $knick $chan] [ctime [unixtime]] - $kicktime min ban." $kicktime}
     putloglev 7 * "Protectison system: $nick!$host !$hand! kicked me off $chan reason: $reason"
     return 0
     }
   if {![string match "$kicktime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Kicked me !! [ctime [unixtime]] - $kicktime min ban." $kicktime}
   putloglev 7 * "Protectison system: $nick!$host !$hand! kicked me off $chan reason: $reason"
   return 0
 }
 if {![matchattr [nick2hand $knick $chan] $jaDuflag|$jaDuflag $chan]} {return 0}
 if {[string tolower $knick] == [string tolower $nick]} {return 0}
 if {[botisop $chan]} {
   pushmode $chan -o $nick
   if {![string match "$kicktime" "0"]} {pushmode $chan +b [maskhost $host]}
   flushmode $chan
     if {[matchattr $hand |o $chan]} {
       chattr $hand |-ao+d $chan
       putserv "KICK $chan $nick :Do NOT Kick $knick !! - You have lost your op on $chan for that !!"
       if {$msgeuser} {putserv "PRIVMSG $nick :If you want your op back please talk to one of my masters. Masters on channel $chan are now: [chanlist $chan m|m]"}
     } else {
       if {[validuser $hand]} {
       chattr $hand |-ao+d $chan
       }
       putserv "KICK $chan $nick :Do NOT Kick $knick !! - $kicktime min shitlist."
       if {![string match "$kicktime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Kicked [nick2hand $knick $chan] [ctime [unixtime]] - $kicktime min ban." $kicktime}
     }
 }
putloglev 7 * "Protectison system: $nick!$host !$hand! kicked $knick![getchanhost $knick $chan] ![nick2hand $knick $chan]! off channel $chan reason: $reason"
}
######### End proc kick ####

######### jaDu ban ##########
proc jaDuX:ban {nick host hand chan mdechg ban} {
global botnick botname jaDuflag  exceflag banstime msgeuser
 if {([matchattr $hand m|m $chan]) || ([matchattr $hand $exceflag|$exceflag]) || ([matchattr $hand b])} {return 0}
 if {[string tolower $nick] == [string tolower $botnick]} {return 0}
   if {[string match "$ban" "$botname"]} {
    pushmode $chan -o $nick
    putserv "MODE $chan -b $ban"
    if {![string match "$banstime" "0"]} {pushmode $chan +b [maskhost $host]}
    flushmode $chan
     if {[matchattr $hand |o $chan]} {
       chattr $hand |-ao+d $chan
       putserv "KICK $chan $nick :Do NOT ban me !! - You have lost your op on $chan for that !!"
       if {$msgeuser} {putserv "PRIVMSG $nick :If you want your op back please talk to one of my masters. Masters on channel $chan are now: [chanlist $chan m|m]"}
     } else {
       if {[validuser $hand]} {chattr $hand |-ao+d $chan}
       putserv "KICK $chan $nick :Do NOT ban me !! - $banstime min shitlist."
       if {![string match "$banstime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Banned me [ctime [unixtime]] - $banstime min ban." $banstime}
     }
    putloglev 7 * "Protectison system: $nick!$host !$hand! banned me on $chan !!"
  }
 set pnicks [chanlist $chan $jaDuflag|$jaDuflag]
  foreach pnick $pnicks {
   if {[string match "$ban" "$pnick![getchanhost $pnick $chan]"]} {
    pushmode $chan -o $nick
    pushmode $chan -b $ban
    if {![string match "$banstime" "0"]} {pushmode $chan +b [maskhost $host]}
    flushmode $chan
     if {[matchattr $hand |o $chan]} {
       chattr $hand |-ao+d $chan
       putserv "KICK $chan $nick :Do NOT ban $pnick !! - You have lost your op on $chan for that !!"
       if {$msgeuser} {putserv "PRIVMSG $nick :If you want your op back please talk to one of my masters. Masters on channel $chan are now: [chanlist $chan m|m]"}
     } else {
       if {[validuser $hand]} {chattr $hand |-ao+d $chan}
       putserv "KICK $chan $nick :Do NOT ban $pnick !! - $banstime min shitlist."
       if {![string match "$banstime" "0"]} {newchanban $chan [maskhost $host] jaDuX "Banned [nick2hand $pnick $chan] [ctime [unixtime]] - $banstime min ban." $banstime}
     }
    putloglev 7 * "Protectison system: $nick!$host !$hand! banned $pnick![getchanhost $pnick $chan] ![nick2hand $pnick $chan]!on channel $chan !!"
  }
 }
}
######### End proc ban ####

Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Sat Jul 04, 2020 2:49 pm    Post subject: Re: Bot self kick/ban & Protected flag User Protection Reply with quote

illusionist wrote:
Hello There i need help with this TCL.
Bot adding -ao+d flag for a user if he kicks bot or a Protected flag nick.
I want to remove this function from code.

Remove the line:
Code:
chattr $hand |-ao+d $chan

illusionist wrote:
And also
Bot put modes like
** eggdrop sets mode(s) -o flagkicker
** eggdrop sets mode(s) +b *!*flagkicker@*.domain


I need like this

** eggdrop sets mode(s) -o+b flagkicker *!*flagkicker@*.domain

You can't do that. The script already use the correct way to put modes.
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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