egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

to raise ops in any room where the bot is
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Thu Jun 23, 2022 7:40 am    Post subject: to raise ops in any room where the bot is Reply with quote

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... Smile
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Fri Jun 24, 2022 2:48 am    Post subject: Reply with quote

Not sure to understand your trouble.
Is your code working or not ? Where is your question ?
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Fri Jun 24, 2022 6:12 am    Post subject: Reply with quote

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... Smile
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 826
Location: Tennessee, USA

PostPosted: Fri Jun 24, 2022 12:06 pm    Post subject: remoteOp ver. 0.1 Reply with quote

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
View user's profile Send private message Visit poster's website
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Fri Jun 24, 2022 1:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Fri Jun 24, 2022 2:56 pm    Post subject: Reply with quote

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... Smile
Back to top
View user's profile Send private message
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Sun Sep 11, 2022 3:26 pm    Post subject: Reply with quote

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... Smile
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 826
Location: Tennessee, USA

PostPosted: Sun Sep 11, 2022 4:47 pm    Post subject: Reply with quote

I think this line of code from the script explains it well...
Code:
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
.
Back to top
View user's profile Send private message Visit poster's website
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Thu Sep 15, 2022 2:15 pm    Post subject: Reply with quote

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:
 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... Smile
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Thu Sep 15, 2022 6:35 pm    Post subject: Reply with quote

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 ?
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Sun Sep 18, 2022 11:53 am    Post subject: Reply with quote

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... Smile
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Sun Sep 18, 2022 6:01 pm    Post subject: Reply with quote

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.
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Mon Sep 19, 2022 8:20 am    Post subject: Reply with quote

ok Crazy Cat, thanks for the inconvenience
_________________
Mi ingles: no es el mejor, Manda el traductor... Smile
Back to top
View user's profile Send private message
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Tue Dec 13, 2022 5:23 pm    Post subject: Reply with quote

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... Smile
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Tue Dec 13, 2022 7:23 pm    Post subject: Reply with quote

without your script, we can not help you.
Talk to my crystal bowl or show us your code.
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber