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: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Tue Feb 23, 2021 12:29 pm
i was wondering how this could be modified to use with private msging the bot instead of public command on channel
Code: Select all
bind pub n|n .chanset pub:chanset
proc pub:chanset {nick uhost hand chan text} {
set value [lassign $text mode]
if {![info exists value] || $value eq ""} {
catch {channel set $chan $mode} error
} else {
catch {channel set $chan $mode $value} error
}
if {$error == ""} {
putnow "NOTICE $nick :Successfully set $text"
} else {
putnow "NOTICE $nick :Error setting $text: [lindex $error 0]..."
}
}
so instead of .chanset +somesetting on channel
to use chanset #channel +somesetting in PM of Bot
Last edited by
simo on Tue Feb 23, 2021 5:29 pm, edited 1 time in total.
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Tue Feb 23, 2021 3:42 pm
i tried this but if the mode isnt filled it still seems to execute wich doesnt seem right
for example doing: chanset #channel
outputs: Successfully set on #channel
Code: Select all
bind msg n chanset pm_chanset
proc pm_chanset {nick host hand text} {
lassign [split $text] chanX2 chansetpart
if {![info exists chanX2] || $chansetpart eq ""} {
catch {channel set $chanX2 $chansetpart} error
} else {
catch {channel set $chanX2 $chansetpart} error
}
if {$error == ""} {
putnow "PRIVMSG $nick :Successfully set $chansetpart on $chanX2"
} else {
putnow "PRIVMSG $nick :Error setting $text: [lindex $error 0]..."
}
}
ComputerTech
Master
Posts: 399 Joined: Sat Feb 22, 2020 10:29 am
Contact:
Post
by ComputerTech » Tue Feb 23, 2021 3:54 pm
Code: Select all
bind MSG n|n chanset pub:chanset
proc pub:chanset {nick host hand text} {
set chan [lindex [split $text] 0]
set target [lindex [split $text] 1 end]
set value [lassign $target mode]
if {![info exists value] || $value eq ""} {
catch {channel set $chan $mode} error
} else {
catch {channel set $chan $mode $value} error
}
if {$error == ""} {
putnow "NOTICE $nick :Successfully set $text"
} else {
putnow "NOTICE $nick :Error setting $text: [lindex $error 0]..."
}
}
Not tested
ComputerTech
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Tue Feb 23, 2021 4:25 pm
thanks i tried that and it Gives me the Same result
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Tue Feb 23, 2021 5:29 pm
i tried it like this and it seems to work altho not sure if this is proper:
Code: Select all
#syntax:/msg bot chanset channel -+somesetting
bind msg n chanset pm_chanset
proc pm_chanset {nick uhost handle text} {
set chan [join [lindex [split $text] 0]]
set msg [join [lrange [split $text] 1 end]]
set items [split $text]
if {[llength $items] < 2} { putnow "notice $nick :Syntax chanset #channel +/-some-setting" ; return }
pub:chanset $nick $uhost $handle $chan $msg
}