| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Mar 15, 2022 6:08 am Post subject: pub modes command sets odd banmasks |
|
|
im using this code for a while and cant figure out why it sets weird banmasks
on certain nicks i was told on eggdrop support channel not to use split but even after consulting the docs i couldnt figure it out
this is the code :
| Code: |
bind pubm n|n "#% +?*" pub:massmodez317
bind pubm n|n "#% -?*" pub:massmodez317
proc pub:massmodez317 {nick host hand chan text} {
set modex [join [lindex [split $text] 0]]
set restmodes [lrange [split $text] 1 end]
if { [onchan [string map {+ "" - ""} $modex] $chan] } { return 0 }
if { [llength [split $text]] == 2 } {
putnow "MODE $chan $modex $restmodes"
} else { return 0 }
}
|
for example when i set a ban on a nick like [somenick] or {somenick} like this
+b [somenick]
+b {somenick}
it sets it as +b {{[somenick]}}
it sets it as +b {{{somenick}}}
i was told it has to do with the split that was used |
|
| 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: Tue Mar 15, 2022 9:15 am Post subject: |
|
|
thanks CC for your response but im kinda lost how to use it proper
would you have an examples ? |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Mar 15, 2022 10:15 am Post subject: |
|
|
Simple method:
| Code: | bind pubm n|n "#% +?*" pub:massmodez317
bind pubm n|n "#% -?*" pub:massmodez317
proc pub:massmodez317 {nick host hand chan text} {
set modex [join [lindex [split $text] 0]]
set restmodes [join [lrange [split $text] 1 end]]
if { [onchan [string map {+ "" - ""} $modex] $chan] } { return 0 }
if { [llength [split $text]] == 2 } {
putnow "MODE $chan $modex $restmodes"
} else { return 0 }
} |
Better method:
| Code: | bind pubm n|n "#% +?*" pub:massmodez317
bind pubm n|n "#% -?*" pub:massmodez317
proc pub:massmodez317 {nick host hand chan text} {
if {[llength [split $text]]!=2} { return 0}
set modex [join [lindex [split $text] 0]]
if { [onchan [string map {+ "" - ""} $modex] $chan] } { return 0 }
set restmodes [join [lrange [split $text] 1 end]]
putnow "MODE $chan $modex $restmodes"
} |
_________________ 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: Tue Mar 15, 2022 12:25 pm Post subject: |
|
|
| thanks CC both seem to work well , any reason why the second would be more proper ? |
|
| Back to top |
|
 |
|