View previous topic :: View next topic |
Author |
Message |
flink Halfop

Joined: 21 Feb 2021 Posts: 49 Location: Canarias
|
Posted: Thu Jun 23, 2022 7:40 am Post subject: to raise ops in any room where the bot is |
|
|
hello,
to upload ops in any room where the bot is. but the command is passed in the admin room and the bot operates it in the radio room for example: !op #radio pepe, thanks
Code: | bind pub n !op pub_do_op
proc pub_do_op {nick host handle chan testes} {
global Channel
if {([lsearch -exact [string tolower $Channel] [string tolower $chan]] != -1) || ($Channel == "")} {
set who [lindex $testes 0]
if {$who == ""} {
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not op'd. I need to be op'd to do that."
return 1
}
if {[isop $chan]} {
putserv "PRIVMSG $chan :YOU are ALREADY op'd in $chan."
return 1
}
putserv "MODE $chan +o $nick"
return 1
}
if {![botisop $chan]} {
putserv "PRIVMSG $chan :I'm not op'd. I need to be op'd to do that."
return 1
}
if {[isop $who $chan]} {
putserv "PRIVMSG $chan :$who is ALREADY op'd in $chan."
return 1
}
putserv "MODE $chan +o $who"
putserv "PRIVMSG $chan :Op'd $who on $chan."
putlog "$nick made me op $who in $chan."
}
}
#End of pub_do_op |
_________________ Mi ingles: no es el mejor, Manda el traductor...  |
|
Back to top |
|
 |
CrazyCat Owner

Joined: 13 Jan 2002 Posts: 986 Location: France
|
|
Back to top |
|
 |
flink Halfop

Joined: 21 Feb 2021 Posts: 49 Location: Canarias
|
Posted: Fri Jun 24, 2022 6:12 am Post subject: |
|
|
very good CrazyCat if it works but only in the room where the command is passed. the bot is in 3 rooms, and I want to pass the command in the admin room and be able to upload any user in some of the rooms through the bot. Thank you
example:
room #admin
room #one
room #two
in the admin room put the command
!op #two pepe
and the bot op in that room to the user who puts _________________ Mi ingles: no es el mejor, Manda el traductor...  |
|
Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 781 Location: Tennessee, USA
|
Posted: Fri Jun 24, 2022 12:06 pm Post subject: remoteOp ver. 0.1 |
|
|
flink,
See if this is close to what you had in mind??
Code: |
# remoteOp ver. 0.1 #
### for example: !op #radio pepe, thanks ###
### or: !op #springfield bart lisa homer ###
set adminChan "#admin" ;# !!! Set a single admin channel !!! #
###############################
bind pub n !op pub_remote_op
proc pub_remote_op {nick uhost hand chan text} {
if {![string equal -nocase $chan $::adminChan]} { return 0 }
set wholist [lassign [split [string trim $text]] where]
if {![llength $wholist] || ![validchan $where]} {
putserv "PRIVMSG $chan :Command syntax: \002!op #validchannel nick(s)\002"
return 1
}
if {![botisop $where]} {
putserv "PRIVMSG $chan :I'm not op'd in ${where}. I need to be op'd to do that."
return 1
}
foreach nk $wholist {
if {[isbotnick $nk]} { set self 1
} elseif {![onchan $nk $where]} { lappend gone $nk
} elseif {[isop $nk $where]} { lappend iso $nk
} else { lappend ok $nk }
}
if {[info exists self]} { putserv "PRIVMSG $chan :I can't op myself:)." }
if {[info exists gone]} {
putserv "PRIVMSG $chan :Not found in ${where}: \002[join $gone]\002"
}
if {[info exists iso]} {
putserv "PRIVMSG $chan :Already op'd in ${where}: \002[join $iso]\002"
}
if {[info exists ok]} {
set mode [string repeat "o" [llength $ok]]
putserv "MODE $where +$mode [set ok [join $ok]]"
putserv "PRIVMSG $chan :Op'd \002${ok}\002 in ${where}."
putlog "$nick made me op $ok in ${where}."
}
return 1
}
#End of pub_remote_op
|
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 880
|
Posted: Fri Jun 24, 2022 1:03 pm Post subject: |
|
|
tested it for multiple nicks and it works fine, to make it perfect is to have it work both ways remote and in channel
for example:
!op #channel nick nick
!op nick nick
nice code spike^^ as always for those that want to manage from a single channel |
|
Back to top |
|
 |
flink Halfop

Joined: 21 Feb 2021 Posts: 49 Location: Canarias
|
Posted: Fri Jun 24, 2022 2:56 pm Post subject: |
|
|
Hi SpiKe^^ As my friend says, simo works great, even with multiple nicknames at the same time. It was what I needed
I did the same for deop, voice, devoice. Thanks again.
for my part the help is closed _________________ Mi ingles: no es el mejor, Manda el traductor...  |
|
Back to top |
|
 |
|