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

 
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: 49
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
Owner


Joined: 13 Jan 2002
Posts: 972
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
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: 49
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: 771
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
Owner


Joined: 22 Mar 2015
Posts: 859

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: 49
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
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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