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.

to raise ops in any room where the bot is

Help for those learning Tcl or writing their own scripts.
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

to raise ops in any room where the bot is

Post by flink »

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: Select all

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... :)
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Not sure to understand your trouble.
Is your code working or not ? Where is your question ?
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

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... :)
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

remoteOp ver. 0.1

Post by SpiKe^^ »

flink,

See if this is close to what you had in mind??

Code: Select all

#  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
.
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

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... :)
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

I return to the subject with this tcl to see if you can help me if I put the command !op chan nick and the bot is not from @ I will reply: I'm not op'd. I need to be op'd to do that. and how could I make the bot auto @ e and complete the !op command like this.
I know the command for the server I use would be putquick "privmsg chan op $chan $botnick"
but I can't write it and it works can someone help me thanks
Mi ingles: no es el mejor, Manda el traductor... :)
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

I think this line of code from the script explains it well...

Code: Select all

if {[info exists self]} {  putserv "PRIVMSG $chan :I can't op myself:)."  }
I am not aware of a way the bot can op itself, that command you offered seems useless to me:).
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

Sorry for replying so many days later, in chatzona if the nick is with admin level in the room you can auto-opt yourself. I paste from a deop code to the bot what the bot does automatically and chan's help.

Code: Select all

 bind mode - "*-*o*" protect:autoreop
if {($target == $botnick) && ($nick != $botnick)} {
 putquick "privmsg chan op $chan $botnick"
 putquick "privmsg chan deop $chan $nick"
 putquick "privmsg $nick :$nick \002bla bla bla 002"
 putquick "privmsg MEMO send root :$nick remove @ the $botnick de $chan"
 }
}
Mi ingles: no es el mejor, Manda el traductor... :)
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Read your own words :
flink wrote:if the nick is with admin level in the room
You're asking a script to give op to someone to a potentially newly created channel, so noone but the creator is admin of the chan.
How can your eggdrop being admin ?
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

Hello CrazyCat, depending on the level of access you give the eggdrop it would have an administrator level , that's why I put in which server I need it.
That's why I put the example script of how to interact with the chan of said Sever
Mi ingles: no es el mejor, Manda el traductor... :)
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

I can't guess the right commands nor the access levels, you know that.
So do your script with the good commands, you know better than me how it works with your server.
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

ok Crazy Cat, thanks for the inconvenience
Mi ingles: no es el mejor, Manda el traductor... :)
User avatar
flink
Halfop
Posts: 70
Joined: Sun Feb 21, 2021 9:27 am
Location: Canarias

Post by flink »

I go back to the topic, it is happening to me that I have a nickcompletion anywhere in the sentence and when I put the command the bot does not recognize the nickcompletion with which I want to op a room's nick, any suggestions, thanks
  • @canario- ¦ !op #ChiCharrEroS 12[10-11-3>12n12I12k12s3<11-10-12]
    radioangelcaido(R.A.caidos@la.música.es.ese.lugar.en.el.que.todos.coincidimos.alguna.vez)- It is not found in #ChiCharrEroS: 12[10-11-3>12n12I12k12s3<11-10-12]
Mi ingles: no es el mejor, Manda el traductor... :)
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

without your script, we can not help you.
Talk to my crystal bowl or show us your code.
Post Reply