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
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    }  } }
BdS Moderator
Posts : 33 Points : 33 Reputation : 0 Join date : 2020-05-08 Location : France
Subject: Re: PubCMD 13/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 } } } } } }
will post the piece of code i think should be good
BdS Moderator
Posts : 33 Points : 33 Reputation : 0 Join date : 2020-05-08 Location : France
Subject: Re: PubCMD 14/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" } }
I think their is a unrealircd module, that deals with users having +v and +b the same time, but Your script above, seems brilliant
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
BdS Moderator
Posts : 33 Points : 33 Reputation : 0 Join date : 2020-05-08 Location : France
Subject: Re: PubCMD 9/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.
Hmm, good point, and creating a code to write to a file, would be difficult?
Havent done it before myself
BdS Moderator
Posts : 33 Points : 33 Reputation : 0 Join date : 2020-05-08 Location : France
Subject: Re: PubCMD 9/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