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.

check flags

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

check flags

Post by smash »

I have been looking for a script, where the bot will check to see if it has +ao flags on quakenet with Q/L service bots and if its oped in channel every 15 minuits, if it has no servece flags or is not oped in that channel, the bot will auto part.

need to set it in dcc .setchan #channel +checkflags
any help please
Thanks.
quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

How to check for +ao flags? through whois?
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

Post by smash »

yes can do that with!

putserv "privmsg Q :whois $::botnick"

putserv "privmsg L :whois $::botnick"
quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

and receive what?
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

Post by smash »

Sir_Fz wrote:and receive what?
Msg q whois FBAlien
: FBAlien is online right now.
: FBAlien is authed as RailJunkie.
: Last auth: [Friday, 2007-06-22 22:24:19]
: Channel list:
: Access level +aot on channel #frag-agency
: Access level +av on channel #KingChaos
: Access level +ao on channel #Deadly-Bots
: Access level +ao on channel #fragbots
: Access level +ao on channel #dtdesign
: Access level +av on channel #onlylinux
: Access level +v on channel #hkq3
: Access level +av on channel #forwarded
: End of list.

Msg L whois FBAlien
: FBAlien is authed as RailJunkie.
: Last auth: Fri Jun 22 22:24:20 2007
: Known on the following channels:
: channel access flags
: ---------------------------------------
#fragbottest v
: #f0v aov
: #fragbots.staff ao
: #fadmin ao
: #railjunkies.com amo
: RailJunkie is known to you on 5 channel/s (max 20 channels).
End of list.
quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Ok so these do not look like notices.. you have to give us the raw numerics of the server replies.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

they are notices.


Code: Select all

bind notc -|- {*} flags:check

setudef flag checkflags

proc flags:check {nickname hostname handle dest text} {
  if {$nickname == "Q"} {
    if {[regexp -nocase {^Access level (.*?) on channel (.*?)$} $text -> flags channel]} {
      putlog "I have $flags on $channel - Q"
      if {[validchan $channel] && [channel get $channel checkflags] && ![string match -nocase *a* $flags] && ![string match -nocase *o* $flags]} {
        putlog "bot does not have +ao in $channel - Q"
        putquick "PART $channel :you need to give me +ao on Q/L"
        channel remove $channel
        putlog "removed $channel due to no +ao - Q"
      }
    }
  } elseif {$nickname == "L"} {
    if {[regexp -nocase {^#(.*?)\s{1,40}(.*?)$} $text -> channel flags]} {
      set channel "#$channel"
      putlog "I have $flags on $channel - L"
      if {[validchan $channel] && [channel get $channel checkflags] && ![string match -nocase *a* $flags] && ![string match -nocase *o* $flags]} {
        putlog "bot does not have +ao on $channel - L"
        putquick "PART $channel :you need to give me +ao on Q/L"
        channel remove $channel
        putlog "removed $channel due to no +ao - L"
      }
    }
  }
}
this is only an example, not tested...
Last edited by r0t3n on Wed Jun 27, 2007 11:01 am, edited 3 times in total.
r0t3n @ #r0t3n @ Quakenet
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

Post by smash »

thanks Tosser^^ :wink:

I got this error mat.

Tcl error [flags:check]: can't read "flags": no such variable
quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time!
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

I made a regexp error for the Q flags, used the variable reference $ when not needed. I edited the version above with the fix.
r0t3n @ #r0t3n @ Quakenet
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

Post by smash »

Hmm, theres no error now m8.

but nothing happens, bots in 2 channels with no op, but dont part the channel.
quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time!
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

I,ve made an edited version above with some putlog's for debugging. Give it a try and post back the results from putlog.
r0t3n @ #r0t3n @ Quakenet
b
bootdisk
Voice
Posts: 12
Joined: Mon Jun 11, 2007 10:22 am

Post by bootdisk »

Tosser^^ wrote:they are notices.


Code: Select all

bind notc -|- {*} flags:check

setudef flag checkflags

proc flags:check {nickname hostname handle dest text} {
  if {$nickname == "Q"} {
    if {[regexp -nocase {^Access level (.*?) on channel (.*?)$} $text -> flags channel]} {
      putlog "I have $flags on $channel - Q"
      if {[validchan $channel] && [channel get $channel checkflags] && ![string match -nocase *a* $flags] && ![string match -nocase *o* $flags]} {
        putlog "bot does not have +ao in $channel - Q"
        putquick "PART $channel :you need to give me +ao on Q/L"
        channel remove $channel
        putlog "removed $channel due to no +ao - Q"
      }
    }
  } elseif {$nickname == "L"} {
    if {[regexp -nocase {^#(.*?)\s{1,40}(.*?)$} $text -> channel flags]} {
      set channel "#$channel"
      putlog "I have $flags on $channel - L"
      if {[validchan $channel] && [channel get $channel checkflags] && ![string match -nocase *a* $flags] && ![string match -nocase *o* $flags]} {
        putlog "bot does not have +ao on $channel - L"
        putquick "PART $channel :you need to give me +ao on Q/L"
        channel remove $channel
        putlog "removed $channel due to no +ao - L"
      }
    }
  }
}
this is only an example, not tested...


How to change this code so it checks the flags when it joins the channel, and if the bot do not have the flags, then it will msg the channel and say that it need the flags and then wait 5min, check again. and if the bot still not have the flags it will part the channel.

Anyone wanna try to add that to this script?
s
smash
Halfop
Posts: 45
Joined: Mon Jul 31, 2006 12:33 pm

Post by smash »

nothing at all in the bots logs mate :?
quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time!
Post Reply