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 

check flags

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
smash
Halfop


Joined: 31 Jul 2006
Posts: 45

PostPosted: Thu Jun 21, 2007 10:23 am    Post subject: check flags Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jun 21, 2007 11:25 am    Post subject: Reply with quote

How to check for +ao flags? through whois?
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
smash
Halfop


Joined: 31 Jul 2006
Posts: 45

PostPosted: Fri Jun 22, 2007 11:15 pm    Post subject: Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jun 23, 2007 4:57 am    Post subject: Reply with quote

and receive what?
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
smash
Halfop


Joined: 31 Jul 2006
Posts: 45

PostPosted: Sat Jun 23, 2007 11:56 am    Post subject: Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jun 23, 2007 5:27 pm    Post subject: Reply with quote

Ok so these do not look like notices.. you have to give us the raw numerics of the server replies.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sun Jun 24, 2007 5:23 pm    Post subject: Reply with quote

they are notices.



Code:
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...
_________________
r0t3n @ #r0t3n @ Quakenet


Last edited by r0t3n on Wed Jun 27, 2007 11:01 am; edited 3 times in total
Back to top
View user's profile Send private message MSN Messenger
smash
Halfop


Joined: 31 Jul 2006
Posts: 45

PostPosted: Sun Jun 24, 2007 7:37 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Jun 25, 2007 10:46 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
smash
Halfop


Joined: 31 Jul 2006
Posts: 45

PostPosted: Tue Jun 26, 2007 3:24 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Wed Jun 27, 2007 11:02 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
bootdisk
Voice


Joined: 11 Jun 2007
Posts: 12

PostPosted: Wed Jun 27, 2007 1:17 pm    Post subject: Reply with quote

Tosser^^ wrote:
they are notices.



Code:
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?
Back to top
View user's profile Send private message
smash
Halfop


Joined: 31 Jul 2006
Posts: 45

PostPosted: Sun Jul 01, 2007 3:18 pm    Post subject: Reply with quote

nothing at all in the bots logs mate Confused
_________________
quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time!
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 -> Script Requests 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