| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Jul 31, 2020 7:35 am Post subject: doesnt set certain modes |
|
|
i was wondering why this sets like:
+k jhjhas
and like +o nick nick nick
but wont set like:
+l 22
+J 10
| Code: |
bind pubm - "#% +?*" pub:massmodez316
bind pubm - "#% -?*" pub:massmodez316
proc pub:massmodez316 {nick host hand chan text} {
if {![matchattr [nick2hand $nick] o|o $chan] && ![isop $nick $chan] && ![ishalfop $nick $chan]} { return 0 }
set modex [lindex [split $text] 0]
set nickz [join [lrange [split $text] 1 end]]
set nickz [string trim $nickz]
if {[onchan [string trimleft [split $modex 0] "+-"] $chan]} { return 0 }
if {![llength [split $nickz]]} {
pushmode $chan $modex
return 0
} else { foreach user [split $nickz] {
pushmode $chan $modex $user
}
}
flushmode $chan
}
|
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Fri Jul 31, 2020 8:22 am Post subject: |
|
|
Well, peharps do you play too much with list/string conversions...
And you call pushmode2, what is this procedure ?
finally, what is exactly doing
| Code: | | if {[onchan [string trimleft [split $modex 0] "+-"] $chan]} { return 0 } |
Here is how I think your proc must be:
| Code: | bind pubm - "#% +?*" pub:massmodez316
bind pubm - "#% -?*" pub:massmodez316
proc pub:massmodez316 {nick host hand chan text} {
if {![matchattr [nick2hand $nick] o|o $chan] && ![isop $nick $chan] && ![ishalfop $nick $chan]} { return 0 }
set modex [join [lindex [split $text] 0]]
if { [llength [split $text]]==1 } {
pushmode $chan $modex
} else {
foreach user [lrange [split $text] 1 end] {
pushmode $chan $modex $user
}
}
flushmode $chan
} |
_________________ 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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Jul 31, 2020 8:36 am Post subject: |
|
|
tnx for your reply crazycat
the : if {[onchan [string trimleft [split $modex 0] "+-"] $chan]} { return 0 }
is to check if the first parameter doesnt contain a nick wich is on channel
and the pushmode2 was a typo should be pushmode
i tried your code it works for +l 22 but not for like +J 10 |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Fri Jul 31, 2020 8:45 am Post subject: |
|
|
Ok, I was guessing something like that...
But $modex is just the mode, so don't complicate things:
| Code: | | if { [onchan [string map {+ "" - ""} $modex] $chan] } { return 0 } |
| simo wrote: | | i tried your code it works for +l 22 but not for like +J 10 |
Does pushmode only accept RFC modes ? I'll have a look on that _________________ 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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Jul 31, 2020 8:52 am Post subject: |
|
|
yes thommey told me pushmode only excepts RFC modes
but even using the custom pushmode thommey wrote for me doesnt seem to take it so it must be something else |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Jul 31, 2020 8:59 am Post subject: |
|
|
would there be a way to use without the pushmode to evade all these issues with RFC
like using user's massmode code:
| Code: |
proc massmode {chan mode arg} {
scan $mode {%[-+]%[bov]} p m
set j [llength $arg]
set k [expr {${::modes-per-line}-1}]
set out "";
for {set i 0} {$i<$j} {incr i} {
set args [lrange $arg $i [incr i $k]]
append out "MODE $chan $p[string repeat $m [llength $args]] [join
$args]\n"
}
putnow $out
}
|
http://forum.egghelp.org/viewtopic.php?t=7273&highlight=massmode |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jul 31, 2020 2:45 pm Post subject: |
|
|
Why do you bother with [matchattr [nick2hand $nick] o|o $chan] when:
1. you already got the user's account in the hand variable;
2. you should change the bind to bind pubm o|o directly and drop this part.
What issues you got with massmode? Apart it not seeing other flags apart than bov obviously?  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Jul 31, 2020 3:52 pm Post subject: |
|
|
oh euhm yea true didnt see that part thnx caesar heh
also the thing is if we use bind pubm o|o
it wont recognize like chanops and chanhalfops
as some may not have the flag set on them and there is no need to if they are chanops halfops
what would be the proper way to check if flag o is set on a nick to give it access to this command while also allowing regular chanops halfops access as well |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Aug 01, 2020 10:41 am Post subject: |
|
|
would there be any other method to have this set any channel mode instead of being restricted ?
these are the available channel modes on the ircd :
| Quote: |
IXbegwkBEFHJLQWdfjlxACDGKMNOPRSTUVcimnprstuz
|
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sat Aug 01, 2020 11:47 am Post subject: |
|
|
Read what caesar said and your proc:
| Code: | proc massmode {chan mode arg} {
scan $mode {%[-+]%[bov]} p m
set j [llength $arg]
set k [expr {${::modes-per-line}-1}]
set out "";
for {set i 0} {$i<$j} {incr i} {
set args [lrange $arg $i [incr i $k]]
append out "MODE $chan $p[string repeat $m [llength $args]] [join $args]\n"
}
putnow $out
} |
It appears that "bov" are in the first line, so try correcting it using:
| Code: | | scan $mode {%[-+]%[IXbegwkBEFHJLQWdfjlxACDGKMNOPRSTUVcimnprstuz]} p m |
_________________ 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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Aug 01, 2020 1:35 pm Post subject: |
|
|
| tnx crazycat i already figured that part but not sure how to use it with the code i posted |
|
| Back to top |
|
 |
|