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.

On deop Msg to me

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

On deop Msg to me

Post by CyberWar »

Hi all

i have now some script about pub and binds and msg/notice. but how looks a script e.g.

Bot was deoped by Nick

Bot send a msg to me: I'm deoped on $channel please op me

i think it's very easy? but how i do that?

when someone set the bot -o he write a msg in my query
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

maybe this will work:

Code: Select all

bind mode - *o log:mode

proc log:mode {nick uhost hand channel text} {
global botnick
 if {$text == "-o $botnick"} {
    putserv "PRIVMSG CyberWar :$nick deoped $botnick on $channel."
 }
}

there's most likely a better way than "$text == '-o $botnick'". unfortunately i don't know it. :?

tueb
#Quiz.de @ irc.GameSurge.net
JavaChat
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

# --> alertnicks
# nicks to alert bot is deopped and to reop it
# can be 1,2,3 or 50,000 nicks (MUST seperate each by a space)
variable alertnicks "nick1 nick2 etc etc"

bind mode - *-o* check:deop

proc check:deop {nick uhost hand chan mc victim} {
  if {[isbotnick $victim]} {
    foreach n [split $::alertnicks] { 
      if {[isop $n $chan]} {
        set deopflag 1
        # if alertnicks is greater than 5, we use puthelp
        # to avoid bot being flooded off irc.
        if {[llength [split $::alertnicks]] > 5} {
          puthelp "privmsg $n :I \($victim\) have just been deopped in $chan by $nick. Please reop me."
        } else {
          putserv "privmsg $n :I \($victim\) have just been deopped in $chan by $nick. Please reop me."
        }
      }
    }
    # if there is nobody from the alertnicks list 
    # in the channel with ops, let's not ask them
    # for ops, they can't help. let's instead make a
    # public channel announcement about it.
    if {![info exists deopflag]} {
      putserv "privmsg $chan :\[automated message\] $nick has broken the rules on $chan by deopping me. There is \
               no one in my list with ops that I can ask to op me. I am making this public message in the hopes \
               someone will op me. Thank you."
    }
  }
}
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

Thank you very much guys :D awesome both scripts works fine :) thanks
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

Well this script is awesome speechles

Now i have one question. I will tell u my problem.

The Bot Seen is op in a channel. e.g. #bla
Then if i deop Seen he give me a privmsg in my query: <Seen> .opme #bla

That was my test.

Now we have an another Bot with oline.

If someone deop Seen he dont write to this Bot with oline. why?

Here is my currently Script

Code: Select all

variable alertnicks "HeliBot CyberWar"

bind mode - *-o* check:deop

proc check:deop {nick uhost hand chan mc victim} {
  if {[isbotnick $victim]} {
    foreach n [split $::alertnicks] {
      if {[isop $n $chan]} {
        set deopflag 1
        if {[llength [split $::alertnicks]] > 3} {
          puthelp "PRIVMSG $nick :.opme $chan"
        } else {
          putserv "PRIVMSG $nick :.opme $chan"
        }
      }
    }
    if {![info exists deopflag]} {
      putserv "privmsg #botsynch :\[automated message\] $nick has broken the rules on $chan by deopping me."
    }
  }
}
Seen write only to me a privmsg i've tested with some another guys on our irc. But the bot write only me not HeliBot or the another test users.

If i write in the partyline:
.msg Helibot .opme #bla
then it works

Whats the Problem? i have one error in the partyline:

Code: Select all

[13:25] Tcl error [log:mode]: wrong # args: should be "log:mode nick uhost hand channel text"
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

I hope someone see my problem i've tested yesterday 8hours
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

CyberWar wrote:Well this script is awesome speechles

Now i have one question. I will tell u my problem.

The Bot Seen is op in a channel. e.g. #bla
Then if i deop Seen he give me a privmsg in my query: <Seen> .opme #bla

That was my test.

Now we have an another Bot with oline.

If someone deop Seen he dont write to this Bot with oline. why?

Here is my currently Script

Code: Select all

variable alertnicks "HeliBot CyberWar"

bind mode - *-o* check:deop

proc check:deop {nick uhost hand chan mc victim} {
  if {[isbotnick $victim]} {
    foreach n [split $::alertnicks] {
      if {[isop $n $chan]} {
        set deopflag 1
        if {[llength [split $::alertnicks]] > 3} {
          puthelp "PRIVMSG $nick :.opme $chan"
        } else {
          putserv "PRIVMSG $nick :.opme $chan"
        }
      }
    }
    if {![info exists deopflag]} {
      putserv "privmsg #botsynch :\[automated message\] $nick has broken the rules on $chan by deopping me."
    }
  }
}
Seen write only to me a privmsg i've tested with some another guys on our irc. But the bot write only me not HeliBot or the another test users.
it's this line: if {[isop $n $chan]} {
That tells the bot don't even bother asking an unopped person in that channel for ops, even if they are on the list. Read below this part of the original script (you shortened it without realizing what it said).

Code: Select all

    # if there is nobody from the alertnicks list
    # in the channel with ops, let's not ask them
    # for ops, they can't help. let's instead make a
    # public channel announcement about it.
    if {![info exists deopflag]} {
      putserv "privmsg $chan :\[automated message\] $nick has broken the rules on $chan by deopping me. There is \
               no one in my list with ops that I can ask to op me. I am making this public message in the hopes \
               someone will op me. Thank you."
    } 
CyberWar wrote:If i write in the partyline:
.msg Helibot .opme #bla
then it works

Whats the Problem?
The problem is the difference between what your doing and what the script can. Your using an direct client connection (dcc) command, while the script uses an internet relayed one (privmsg). If you have commands available to op through that oline'd bot using private message, the script can be adapted for that quite easily.
CyberWar wrote:i have one error in the partyline:

Code: Select all

[13:25] Tcl error [log:mode]: wrong # args: should be "log:mode nick uhost hand channel text"
That would be tueb's script. That code is expecting an older version of eggdrop. On newer eggdrops you get that error about arguments not matching parameters. Just unload that script. Then op Helibot and your other friends in the alertnicks list and try again. :)

*** Note: It's also acceptable to KEEP comments in the script, they act as notes to help the next time you make modifications. Others wishing to (and yourself later when you forget what parts of your code do..heh) can learn from your commented code and understand it based upon the comments explaining its expected behavior. When I see people strip them completely it leaves tears in my eyes... :cry:
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

Well it works thanks to all for help'ing me :)
D
Danik
Halfop
Posts: 49
Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:

Post by Danik »

I have this kind of error
[23:33] Tcl error [check:deop]: invalid command name "б═"
Post Reply