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!
Valentin
Voice
Posts: 14 Joined: Sun Sep 04, 2022 12:54 am
Location: London
Contact:
Post
by Valentin » Tue Feb 07, 2023 10:39 pm
I`m use this script fot ircop bot to get @ in every chan. Is it posiable to make it to get + in #opers. In every chan will get @, exempt #opers. In #opers has to be with +
Code: Select all
bind join - * join:opbot
proc join:opbot { nick host hand chan } {
if {$nick eq $::botnick} {
putserv "SAMODE $chan +o $::botnick"
}
}
if there's a will, there's a way.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Feb 08, 2023 2:25 am
Code: Select all
bind join - * join:opbot
proc join:opbot { nick host hand chan } {
if {![isbotnick $nick]} return
set mode [expr {[string equal -nocase $chan "#opers"] ? "+o" : "++"}]
putserv "SAMODE $chan $mode $::botnick"
}
Replace the second '+' in '++' with whatever mode gives the bot the + flag cos honestly I don't know.
Once the game is over, the king and the pawn go back in the same box.
CrazyCat
Revered One
Posts: 1304 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Wed Feb 08, 2023 5:50 am
The "+" is a voice, so +v.
And you like complex code ?
Code: Select all
bind join - * join:opbot
proc join:opbot { nick host hand chan } {
if {![isbotnick $nick]} return
set mode "+o"
if {[string tolower $chan] eq "#opers"} { set mode "+v" }
putserv "SAMODE $chan $mode $::botnick"
}
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Feb 09, 2023 5:33 am
You scared of the
expr line?
It's basically if condition do this else do something else just wrapped up nicely.
Once the game is over, the king and the pawn go back in the same box.
CrazyCat
Revered One
Posts: 1304 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Thu Feb 09, 2023 11:18 am
I'm not scared of it, but Valentin won't understand your code if you don't explain it.
I think that one of the first goals of this forum is to teach TCL to others, but I'm peharps wrong
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Feb 09, 2023 1:40 pm
You are right, in this case here's a more traditional approach:
Code: Select all
bind join - * join:opbot
proc join:opbot { nick host hand chan } {
if {![isbotnick $nick]} return
if {[string equal -nocase $chan "#opers"]} {
set mode "+v"
} else {
set mode "+o"
}
putserv "SAMODE $chan $mode $::botnick"
}
Once the game is over, the king and the pawn go back in the same box.