This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
simo
Revered One
Posts: 1079 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Mon Sep 28, 2020 2:27 pm
hey there,
i was curious how this code that was checking for ban +b m:*!*@* could be modified we actually wanted to check for channel mode +U and -U
if +U is set we wanted to have a timer remove it after 20 min
and if some chanops unsets it #channel -U before the timer has expired to kill the timer
Code: Select all
bind mode - "#% +b" runban
bind mode - "#% -b" stopban
proc runban {nick uhost handle chan mode target} {
if {[string match -nocase m:*!*@* $target]} {
set ::btimer($chan) [list [timer 20 [list rmban $chan]]]
}
}
proc stopban {nick uhost handle chan mode target} {
if {[string match -nocase m:*!*@* $target]} {
rmban $chan
}
}
proc rmban {chan} {
if { [array exists ::btimer] && [info exists ::btimer($chan)] } {
if { [lsearch -index 2 [timers] $::btimer($chan)] != -1} {
killtimer $::btimer($chan)
}
unset ::btimer($chan)
}
if { [ischanban m:*!*@* $chan] } {
pushmode $chan -b m:*!*@*
}
}
and instead of pushmode we wanted to use a regular mode used
simo
Revered One
Posts: 1079 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Mon Sep 28, 2020 5:25 pm
so basically if channel mode +U has been set to have a timer unset it in 20 minutes but if a chanop or anything else unsets it manually -U to halt the timer as its no longer needed
simo
Revered One
Posts: 1079 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Mon Sep 28, 2020 5:42 pm
i tried this but it didnt react as it prob doesnt recognize the channel mode +U
-U
Code: Select all
bind mode - "#% +U" runbanX5
bind mode - "#% -U" stopbanX5
proc runbanX5 {nick uhost handle chan mode target} {
if {[string first U [getchanmode $target]] ne "-1"} {
set ::btimer($chan) [list [timer 20 [list rmbanX5 $chan]]]
}
}
proc stopbanX5 {nick uhost handle chan mode target} {
if {[string first U [getchanmode $target]] ne "-1"} {
rmbanX5 $chan
}
}
proc rmbanX5 {chan} {
if { [array exists ::btimer] && [info exists ::btimer($chan)] } {
if { [lsearch -index 2 [timers] $::btimer($chan)] != -1} {
killtimer $::btimer($chan)
}
unset ::btimer($chan)
}
if {[string first U [getchanmode $chan]] ne "-1"} {
putnow "mode $chan -U"
}
}
simo
Revered One
Posts: 1079 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Mon Oct 05, 2020 9:08 am
Is there any way to achieve this?