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 Previous  1, 2
 
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: Wed Dec 14, 2022 8:19 am    Post subject: Reply with quote

Hello CrazyCat, thanks for answering, I thought it was understood, since I return to the topic of something you requested at the time and SpiKe^^ created me and let it work and now I have the problem that you say that it does not recognize when I use the nickcompletion anywhere from the phrase that is the help I request, even so I paste the code and what happens to me when I try to op some user in a room where the bot is @ thanks again.

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


    @canario- ¦ !op #ChiCharrEroS 12[ 10- 11- 3> 12n 12I 12k 12s 3< 11- 10- 12]
    radioangelcaido(RAcaidos@la.música.es.ese.lugar.en.el.que.todos. coincidemos.alguna.vez)- No se encuentra en #ChiCharrEroS: 12[ 10- 11- 3> 12n 12I 12k 12s 3< 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: Wed Dec 14, 2022 9:49 am    Post subject: Reply with quote

The trouble doesn't come from the script but your autocompletion adds weird codes (colors ?)
Change the way it works. I don't know which irc client you use, but this one must be trashed quick Smile
_________________
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: Wed Dec 14, 2022 10:15 am    Post subject: Reply with quote

Thanks for answering CrazyCat, I thought there was a way in which the bot would pay attention when we write in colors, in this case it's a nickcomletion addons that write it anywhere in the sentence, the answer doesn't solve my question, thanks anyway for participation. I stay in the same situation with the one that entered does not work in colors Smile
_________________
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: Wed Dec 14, 2022 10:23 am    Post subject: Reply with quote

flink

I might try to help if I had any idea what you were talking about:)
_________________
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: Wed Dec 14, 2022 10:29 am    Post subject: Reply with quote

try this it strips color codes from text but if your nickcompleter adds additional characters it wont work its not clear to me what real nickname you tried to op


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 !xor Xpub_remote_opX

proc Xpub_remote_opX {nick uhost hand chan text} {
  if {![string equal -nocase $chan $::adminChan]} {  return 0  }

  set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]

  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

Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed Dec 14, 2022 10:34 am    Post subject: Reply with quote

perhaps you could give examples of nick with nickcompleter and the actual real nick
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Wed Dec 14, 2022 10:51 am    Post subject: Reply with quote

Looks like he tested with [-->nIcks<--]
_________________
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
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed Dec 14, 2022 12:40 pm    Post subject: Reply with quote

oh ok then i have to agree with you CrazyCat such nick completer script shouldnt be used or edited to use actual nicks when using !commands
wich i use as well

for example for mirc :

Code:


ON *:INPUT:#: {
  if ($left($1,1) == /) || ($ctrlenter)  return
    if ($left($1,1) == !) {  say  $1-  | halt  }
  say  $regsubex($1-,/([\w-_`^\\\[\]\{\}|]+)/g,$iif(\1 $iif(\1 == $target,iswm,ison) $target,$+($chr(3),$base($gettok(00 08 09 11 15,$r(1,5),32),10,10,2),$chr(44),$base($gettok(1 2 3 5 6 10 12 14,$r(1,8),32),10,10,2),$chr(32)) $theme2011($pn2011(\1, $chan)) $chr(32)  , \1)))
  halt
}

ALIAS theme2011 { return $1 }
ALIAS -l pn2011 {
  if ($len($nick($2,$1).pnick) != $len($1)) {
    var %nick $+($left($nick($2,$1).pnick,1),$1)
    return  %nick
  }
  else return $nick
}




Last edited by simo on Wed Dec 14, 2022 12:54 pm; edited 2 times in total
Back to top
View user's profile Send private message
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Wed Dec 14, 2022 12:41 pm    Post subject: Reply with quote

Hello again, the nick without color would be this: [-->nIks<--] and when the nickcompletion colors it, it would be like this: 12[10-11-3>02n02I02k02s3<11-10-12] 
_________________
Mi ingles: no es el mejor, Manda el traductor... Smile
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed Dec 14, 2022 12:46 pm    Post subject: Reply with quote

if u use mirc my above example code should work fine
Back to top
View user's profile Send private message
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Wed Dec 14, 2022 1:20 pm    Post subject: Reply with quote

Good Simo, yes apparently adding to the code
Code:
set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }]


It does recognize colors, but the ones eggdrop doesn't recognize are characters such as \\\[\]\{\} etc. The contribution of the second code for the mIrc would be the same as deactivating the nickcompletion addons, the idea that the same code for the mIrc would be put in the eggdrop so that it could read them.Thanks again for the contribution
_________________
Mi ingles: no es el mejor, Manda el traductor... Smile
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed Dec 14, 2022 1:25 pm    Post subject: Reply with quote

that will over complicate stuff as u add characters to nicks and then want eggdrop to strip all extra added characters while they can be part of a nick
its best to fix this on client level

im not sure what client you are using else i could edit it to send actuall nicks when using !commands and else output with nick completer
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1027

PostPosted: Wed Dec 14, 2022 1:34 pm    Post subject: Reply with quote

and the mirc code i posted doesnt disable nickcompleter totally it only does when using !commands
Back to top
View user's profile Send private message
flink
Halfop


Joined: 21 Feb 2021
Posts: 70
Location: Canarias

PostPosted: Wed Dec 14, 2022 1:45 pm    Post subject: Reply with quote

I understand, I'll remove the characters from l nickcompletion and I'll just leave the colors since the eggdrop reads them perfectly and finished sooner and so I don't complicate your life with questions Smile thanks again for the help.
PD: hi SpiKe^^ sorry for not greeting you friend Smile
_________________
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
Goto page Previous  1, 2
Page 2 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