TCLDROP
Would you like to react to this message? Create an account in a few clicks or log in to continue.
TCLDROP

Eggdrop And TCL Help, Support And Chat
 
HomeHome  PublicationsPublications  FAQFAQ  SearchSearch  MemberlistMemberlist  Latest imagesLatest images  UsergroupsUsergroups  RegisterRegister  Log in  CalendarCalendar  WebsiteWebsite  ChatRoomChatRoom  

 

 PubCMD

Go down 
3 posters
Go to page : Previous  1, 2, 3  Next
AuthorMessage
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty7/7/2020, 15:36

Code:

proc do_ban { nick uhost hand chan text } {
   if {![botisop $chan]} {
      putserv "privmsg $chan :I'm Not Op'd"
      return 0
   }
   set bnick [lindex [split $text] 0 ]
   if {[isbotnick $bnick]} {
      putkick $chan $nick "Banning The Bot Wont Be Tolerated"
   } elseif {[matchattr [nick2hand $bnick] $::topflag]} {
      putserv "PRIVMSG $chan :I won't ban an owner!"
      putkick $chan $nick "Never Ban The Owner"
   } else {
      if {[onchan $bnick $chan]} {
         set host "[maskhost $bnick![getchanhost $bnick $chan] 2]"
         if {[isvoice $bnick $chan]} {
            pushmode $chan -v $bnick
         }
         pushmode $chan +b $host
         flushmode $chan
      } else {
         pushmode $chan +b $bnick
      }
   }
}

proc do_mute {nick uhost hand chan text} {
   if {![botisop $chan]} {
      putserv "privmsg $chan :I'm Not Op'd"
      return 0
   }
   set mnick [lindex [split $text] 0 ]
   if {[isbotnick $mnick]} {
      putserv "PRIVMSG $chan :$nick, Muting The Bot Wont Be Tolerated"
   } elseif {[matchattr [nick2hand $mnick] n]} {
      putserv "PRIVMSG $chan :I won't Mute an owner!" 
   } else {
      if {[onchan $mnick $chan]} {
         set mhost "[maskhost $mnick![getchanhost $mnick $chan] 2]"
         if {[isvoice $mnick $chan]} {
            pushmode $chan -v $mnick
         }
         pushmode $chan +b $mhost
         flushmode $chan
         putserv "PRIVMSG $chan :$mnick Has Been Muted"
      }
   }
}

proc do_voice {nick uhost hand chan text } {
  if {![botisop $chan]} {
      putserv "privmsg $chan :I'm not op'd"
  } else {
      if {[lindex [split $text] 0 ] !=""} {
         if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
            foreach cible [chanlist $chan] {
               if {![isbotnick $cible]} {
                  pushmode $chan +v $cible
               }
            }
            flushmode $chan
         } else {
            foreach cible [split $text] {
               if {![isbotnick $cible]} {
                  pushmode $chan +v $cible
               }
            }
            flushmode $chan
         }
      } else {
         pushmode $chan +v $nick
      }
   }
}


proc do_devoice {nick uhost hand chan text } {
  if {![botisop $chan]} {
      putserv "privmsg $chan :I'm not op'd"
  } else {
      if {[lindex [split $text] 0 ] !=""} {
         if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
            foreach cible [chanlist $chan] {
               if {![isbotnick $cible]} {
                  pushmode $chan -v $cible
               }
            }
            flushmode $chan
         } else {
            foreach cible [split $text] {
               if {![isbotnick $cible]} {
                  pushmode $chan -v $cible
               }
            }
            flushmode $chan
         }
      } else {
         pushmode $chan -v $nick
      }
   }
}

proc do_op { nick uhost hand chan text } {
  if {![botisop $chan]} {
      putserv "privmsg $chan :I'm not op'd"
  } else {
      if {[lindex [split $text] 0 ] !=""} {
         if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
            foreach cible [chanlist $chan] {
               if {![isbotnick $cible]} {
                  pushmode $chan +o $cible
               }
            }
            flushmode $chan
         } else {
            foreach cible [split $text] {
               if {![isbotnick $cible]} {
                  pushmode $chan +o $cible
               }
            }
            flushmode $chan
         }
      } else {
         pushmode $chan +o $nick
      }
   }
}
         

proc do_deop { nick uhost hand chan text } {
  if {![botisop $chan]} {
      putserv "privmsg $chan :I'm not op'd"
  } else {
      if {[lindex [split $text] 0 ] !=""} {
         if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
            foreach cible [chanlist $chan] {
               if {![isbotnick $cible]} {
                  pushmode $chan -o $cible
               }
            }
            flushmode $chan
         } else {
            foreach cible [split $text] {
               if {![isbotnick $cible]} {
                  pushmode $chan -o $cible
               }
            }
            flushmode $chan
         }
      } else {
         pushmode $chan -o $nick
      }
   }
}

proc do_kick {nick uhost hand chan text} {
   if {![botisop $chan]} {
      putserv "privmsg $chan :I'm not op'd"
      return 0
   }
   set 2kick [lindex [split $text] 0 ]
   if {[isbotnick $2kick]} {
      putkick $chan $nick "Kicking The Bot Wont Be Tolerated"
   } elseif {[matchattr [nick2hand $2kick] $::topflag]} {
      putserv "privmsg $chan :I Wont Kick A Owner"
   } else {
      if {[lrange $text 1 end] !=""} {
         set reason "[lrange $text 1 end] ($nick)"
      } else {
         set reason "Requested kick by $nick"
      }
      if {[onchan $2kick $chan]} {
         putkick $chan $2kick "$reason"
      } else {
         putserv "PRIVMSG $chan :I don't see \"$2kick\" on $chan."
      }
   }
}

proc do_kickban {nick uhost hand chan text} {
   if {![botisop $chan]} {
      putserv "privmsg $chan :I'm Not Op'd"
      return 0
   }
   set kbnick [lindex [split $text] 0 ]
   if {[isbotnick $kbnick]} {
      putserv "privmsg $chan :$nick, Ban The Bot Wont Be Tolerated."
   } elseif {[matchattr [nick2hand $kbnick] $::topflag]} {
      putserv "privmsg $chan :$nick, You Can't Ban An Owner."
   } else {
      if {[lrange $text 1 end] !=""} {
         set reason "[lrange $text 1 end] ($nick)"
      } else {
         set reason "Requested kickban by $nick"
      }
      set host "[maskhost $kbnick![getchanhost $kbnick $chan] 2]"
      if {[onchan $kbnick $chan]} {
         pushmode $chan +b $host
         flushmode $chan
         putkick $chan $kbnick "$reason"
      }
   }
}

proc do_set_topic {nick ushost handle chan text} {
   if {![botisop $chan]} {
      putserv "privmsg $chan :I'm Not Op'd"
   } else {
      set new2topic [lrange $text 0 end]
      puthelp "topic $chan :$new2topic"
   }
}

proc do_nick {nick uhost hand chan text} {
   set newnick [lindex [split $text] 0 ]
   putserv "NICK $newnick"
}

proc do_mode {nick uhost hand chan text} {
   if {![botisop $chan]} {
      putserv "privmsg $chan :I'm Not Op'd"
   } else {
      set 2mode [lindex [split $text] 0 ]
      if {[string equal -nocase $2mode "+l"] || [string equal -nocase $2mode "+k"]} {
         set nbl [lindex [split $text] 1 ]
         pushmode $chan $2mode $nbl
      } elseif {[string equal -nocase $2mode "-k"]} {
         set nbl [lindex [split $text] 1 ]
         pushmode $chan $2mode $nbl
      } else {
         pushmode $chan $2mode
      }
   }
}


proc do_invite {nick uhost hand chan text} {
   foreach 2invite [split $text] {
      putserv "INVITE $2invite $chan"
   }
}

proc do_cycle {nick uhost hand chan text} {
   if {[lindex [split $text] 0 ] != ""} {
      set 2cycle [lindex [split $text] 0 ]
   } else {
      set 2cycle $chan
   }
   putserv "PART $2cycle"
}

Back to top Go down
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty9/7/2020, 00:51

That code looks awesome Bds, will try it right away

also come chat and help me test this script at our new network  TechNet  irc.technet.xi.ht

could do with a bit of help and we can test Smile

ComputerTech likes this post

Back to top Go down
http://www.computer-tech1.webnode.co.uk
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty12/7/2020, 02:25

Bds, for this code that voices multiple users at once, how can we create a similiar code that bans multiple user's hostmasks at once.
can you make this code work but get each user's hostmask and ban it
would be appreciated, as always my dude Boxer

Code:
 proc do_ban {nick uhost hand chan text } {
 Â 
 Â if {![botisop $chan]} {
 Â     putserv "privmsg $chan :I'm not op'd"
 Â } else {
 Â     if {[lindex [split $text] 0 ] !=""} {
 Â        if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
 Â           foreach cible [chanlist $chan] {
 Â              if {![isbotnick $cible]} {
 Â                 pushmode $chan +b $cible
 Â              }
 Â           }
 Â           flushmode $chan
 Â        } else {
 Â           foreach cible [split $text] {
 Â              if {![isbotnick $cible]} {
 Â                 pushmode $chan +b $cible
 Â              }
 Â           }
 Â           flushmode $chan
 Â        }
 Â     } else {
 Â        pushmode $chan +b $nick
 Â     }
 Â  }
}
Back to top Go down
http://www.computer-tech1.webnode.co.uk
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty13/7/2020, 10:56

I haven't had time to fully test it, but it should work great.

Code:

proc do_ban { nick uhost hand chan text } {
   if {![botisop $chan]} {
      putserv "privmsg $chan :I'm Not Op'd"
      return 0
   } else {
      if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
            foreach bnick [chanlist $chan] {
              if {![isbotnick $bnick] && ![matchattr [nick2hand $bnick] $::topflag]} {
               if {[isvoice $bnick $chan]} {
                  pushmode $chan -v $bnick
               }
               set host "[maskhost $bnick![getchanhost $bnick $chan] 2]"
               pushmode $chan +b $host
            }
            }
            flushmode $chan
      } else {
         if {[llength [split $text]] > 1} {
            foreach bnick [split $text] {
               if {![isbotnick $bnick] && ![matchattr [nick2hand $bnick] $::topflag]} {
                  if {[isvoice $bnick $chan]} {
                     pushmode $chan -v $bnick
                  }
                  set host "[maskhost $bnick![getchanhost $bnick $chan] 2]"
                  pushmode $chan +b $host
               }
            }
            flushmode $chan
         } else {
            set bnick [lindex [split $text] 0 ]
            if {[isbotnick $bnick]} {
               putkick $chan $nick "Banning The Bot Wont Be Tolerated"
            } elseif {[matchattr [nick2hand $bnick] $::topflag]} {
               putserv "PRIVMSG $chan :I won't ban an owner!"
               putkick $chan $nick "Never Ban The Owner"
            } else {
               if {[onchan $bnick $chan]} {
                  set host "[maskhost $bnick![getchanhost $bnick $chan] 2]"
                  if {[isvoice $bnick $chan]} {
                     pushmode $chan -v $bnick
                  }
                  pushmode $chan +b $host
                  flushmode $chan
               } else {
                  pushmode $chan +b $bnick
               }
            }
         }
      }
   }
}
Back to top Go down
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty13/7/2020, 12:48

Nice Job Bds Cool ,seem's like it would work to me Very Happy

Will test it out now Wink
Back to top Go down
http://www.computer-tech1.webnode.co.uk
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty21/7/2020, 08:55

More idéa:

binds:
Code:

bind pub ${flag} ${pubcmd}halfop do_halfop
bind pub ${flag} ${pubcmd}dehalfop do_dehalfop

Process:
Code:

proc do_halfop { nick uhost hand chan text } {
  if {![botisop $chan]} {
      putserv "privmsg $chan :Désolé mais je ne suis pas @ sur $chan"
  } else {
      if {[lindex [split $text] 0 ] !=""} {
         if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
            foreach cible [chanlist $chan] {
               if {![isbotnick $cible]} {
                  pushmode $chan +h $cible
               }
            }
            flushmode $chan
         } else {
            foreach cible [split $text] {
               if {![isbotnick $cible]} {
                  pushmode $chan +h $cible
               }
            }
            flushmode $chan
         }
      } else {
         pushmode $chan +h $nick
      }
   }
}
         

proc do_dehalfop { nick uhost hand chan text } {
  if {![botisop $chan]} {
      putserv "privmsg $chan :Désolé mais je ne suis pas @ sur $chan"
  } else {
      if {[lindex [split $text] 0 ] !=""} {
         if {[string equal -nocase [lindex [split $text] 0 ] "all"]} {
            foreach cible [chanlist $chan] {
               if {![isbotnick $cible]} {
                  pushmode $chan -h $cible
               }
            }
            flushmode $chan
         } else {
            foreach cible [split $text] {
               if {![isbotnick $cible]} {
                  pushmode $chan -h $cible
               }
            }
            flushmode $chan
         }
      } else {
         pushmode $chan -h $nick
      }
   }
}
Back to top Go down
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty21/7/2020, 12:27

Good idea Bds cheers

for the above code will it work like this?

!ban nick1 nick2

?

also should we add for mute, extended ban? like..

+b ~q:hostmask

like that?
Back to top Go down
http://www.computer-tech1.webnode.co.uk
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty21/7/2020, 14:12

ComputerTech wrote:

for the above code will it work like this?

!ban nick1 nick2

?

Yes if you make "!ban ComputerTech BdS" the bot ban the two users (or more if you put more nicks).
Back to top Go down
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty21/7/2020, 14:13

ComputerTech wrote:

also should we add for mute, extended ban? like..

+b ~q:hostmask

like that?

I do that whenever I have a moment.
Back to top Go down
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty9/8/2020, 21:52

Thinking of adding ~t time ban

will post the piece of code i think should be good Very Happy
Back to top Go down
http://www.computer-tech1.webnode.co.uk
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty14/8/2020, 10:58

BdS wrote:
ComputerTech wrote:

also should we add for mute, extended ban? like..

+b ~q:hostmask

like that?

I do that whenever I have a moment.

The problem is that if the person is voice, with the given host the robot won't know who to devoice.
I'm just saying, but the !mute command is similar to the !ban command. It's a bit of a duplicate.

Otherwise the idea would be this one:

Code:

proc do_mute {nick uhost hand chan text} {
  if {![botisop $chan]} {
      putserv "privmsg $chan :I'm Not Op'd"
      return 0
  }
  set mnick [lindex [split $text] 0 ]
  if {[isbotnick $mnick]} {
      putserv "PRIVMSG $chan :$nick, Muting The Bot Wont Be Tolerated"
  } elseif {[matchattr [nick2hand $mnick] n]} {
      putserv "PRIVMSG $chan :I won't Mute an owner!"
  } else {
      if {[onchan $mnick $chan]} {
        set mhost "[maskhost $mnick![getchanhost $mnick $chan] 2]"
        if {[isvoice $mnick $chan]} {
            pushmode $chan -v $mnick
        }
        pushmode $chan +b $mhost
        flushmode $chan
        putserv "PRIVMSG $chan :$mnick Has Been Muted"
      } else {
       pushmode $chan +b $mnick
        flushmode $chan
        putserv "PRIVMSG $chan :$mnick Has Been Muted"
  }
}
Back to top Go down
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty8/9/2020, 21:16

I think their is a unrealircd module, that deals with users having +v and +b the same time, but Your script above, seems brilliant cheers

I was also thinking to create a code, that would make the user to be able to set the trigger.

e.g
Code:

!triggger ?

trigger now becomes from ! to ?

If you see my idea Razz
Back to top Go down
http://www.computer-tech1.webnode.co.uk
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty9/9/2020, 09:17

You can make a code that changes the trigger, but at each rehash or restart, it will take over the one that is hard written in the source file.
Unless you have a file read, (where you change the trigger) where is the trigger, at each rehash or restart.
Back to top Go down
ComputerTech
Owner
Owner
ComputerTech


Posts : 99
Points : 268
Reputation : 0
Join date : 2020-04-30

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty9/9/2020, 11:41

Hmm, good point, and creating a code to write to a file, would be difficult?

Havent done it before myself Razz
Back to top Go down
http://www.computer-tech1.webnode.co.uk
BdS
Moderator
Moderator
BdS


Posts : 33
Points : 33
Reputation : 0
Join date : 2020-05-08
Location : France

PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty9/9/2020, 14:54

The only problem, and I don't know if it's a problem, is that you have to restart the egg each time you change the trigger.
Otherwise the old binds is still active with the old trigger
Back to top Go down
Sponsored content





PubCMD - Page 2 Empty
PostSubject: Re: PubCMD   PubCMD - Page 2 Empty

Back to top Go down
 
PubCMD
Back to top 
Page 2 of 3Go to page : Previous  1, 2, 3  Next

Permissions in this forum:You cannot reply to topics in this forum
TCLDROP :: TCL :: Script Support & Releases-
Jump to: