| View previous topic :: View next topic |
| Author |
Message |
smash Halfop
Joined: 31 Jul 2006 Posts: 45
|
Posted: Thu Jun 21, 2007 10:23 am Post subject: check flags |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
smash Halfop
Joined: 31 Jul 2006 Posts: 45
|
Posted: Fri Jun 22, 2007 11:15 pm Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
smash Halfop
Joined: 31 Jul 2006 Posts: 45
|
Posted: Sat Jun 23, 2007 11:56 am Post subject: |
|
|
| 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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Jun 23, 2007 5:27 pm Post subject: |
|
|
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 |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Jun 24, 2007 5:23 pm Post subject: |
|
|
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 |
|
 |
smash Halfop
Joined: 31 Jul 2006 Posts: 45
|
Posted: Sun Jun 24, 2007 7:37 pm Post subject: |
|
|
thanks Tosser^^
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 |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Jun 25, 2007 10:46 am Post subject: |
|
|
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 |
|
 |
smash Halfop
Joined: 31 Jul 2006 Posts: 45
|
Posted: Tue Jun 26, 2007 3:24 pm Post subject: |
|
|
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 |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Wed Jun 27, 2007 11:02 am Post subject: |
|
|
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 |
|
 |
bootdisk Voice
Joined: 11 Jun 2007 Posts: 12
|
Posted: Wed Jun 27, 2007 1:17 pm Post subject: |
|
|
| 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 |
|
 |
smash Halfop
Joined: 31 Jul 2006 Posts: 45
|
Posted: Sun Jul 01, 2007 3:18 pm Post subject: |
|
|
nothing at all in the bots logs mate  _________________ quakenet #fraguk www.fraguk.com
hosting 113 scripts @ this time! |
|
| Back to top |
|
 |
|