| View previous topic :: View next topic |
| Author |
Message |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Sun Feb 20, 2011 6:51 am Post subject: grabbing notices from operserv and relay them to a channel ? |
|
|
Hi,
Ok i have an eggie that is netadmin on my net.
what i need it when operserv notices it, it will take that notice and say it in channel #opers.
Or just point me to the right command for this ?
Thanks
Gemster |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 21, 2011 2:13 am Post subject: |
|
|
| Code: |
bind notc O * oper:notice
proc oper:notice {nick uhost hand text dest} {
if {$dest != ""} return
putserv "PRIVMSG #opers :$text"
}
|
Add OperServ to your bot's userlist and give it the 'O' flag. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Mon Feb 21, 2011 9:39 am Post subject: |
|
|
Thanks caesar, i tryed that but it dont do anything and no errors.
I think its a snotice not a normal notice.
Anyways forget about that, i have a better idea. I have my eggie sat in channel #services and it says this:
[13:28] <Global> OperServ: Gemster: admin list
it says that in that chan on all operserv commands used.
So could it be possable for the bot to grap that and say in channel #opers something like this:
"$nick just used command OperServ: admin list"
Thanks
Gemster |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 21, 2011 9:54 am Post subject: |
|
|
Try with this instead:
| Code: |
bind raw * notice oper:notice
proc oper:notice {from keyword text} {
putserv "PRIVMSG #opers :$text"
}
|
edit: fixed. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Mon Feb 21, 2011 10:06 am; edited 1 time in total |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Mon Feb 21, 2011 10:02 am Post subject: |
|
|
Nope nothing, no errors just nothing :/
It would be best to relay anything from #services that says operserv:
for example:
[13:57] <Global> LOGUSERS: mibbot_stats (mibbot_sta@HIDDEN.com) (Mibbit net stats bot) left the network (Mystic.demonirc.net).
[13:57] <Global> OperServ: Gemster: oper list
[13:57] <Global> NickServ: Master-Sima-Yi!Mibbit@HIDDEN.nl identified for nick Master-Sima-Yi
[13:58] <Global> LOGUSERS: IRCTools (IRCTools@HIDDEN) (IRCTools :IRCTools) [HIDDEN] connected to the network (Mystic.demonirc.net).
But i only want it to relay this part:
[13:57] <Global> OperServ: Gemster: oper list
Thanks
Gemster |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 21, 2011 10:05 am Post subject: |
|
|
Aww, crap. Replace:
| Code: |
bind raw * oper:notice
|
with:
| Code: |
bind raw * notice oper:notice
|
You should get something.. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Mon Feb 21, 2011 10:22 am Post subject: |
|
|
Yes that worked but not on all operserv commands as some dont notice like "/operserv staff"
Anyways please forget about the notice but do:
| Quote: | It would be best to relay anything from #services that says operserv:
for example:
[13:57] <Global> LOGUSERS: mibbot_stats (mibbot_sta@HIDDEN.com) (Mibbit net stats bot) left the network (Mystic.demonirc.net).
[13:57] <Global> OperServ: Gemster: oper list
[13:57] <Global> NickServ: Master-Sima-Yi!Mibbit@HIDDEN.nl identified for nick Master-Sima-Yi
[13:58] <Global> LOGUSERS: IRCTools (IRCTools@HIDDEN) (IRCTools :IRCTools) [HIDDEN] connected to the network (Mystic.demonirc.net).
But i only want it to relay this part:
[13:57] <Global> OperServ: Gemster: oper list |
I think this way would be more efficent as it will post all commands that are sent to operserv
Thanks
Gemster |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Feb 21, 2011 10:34 am Post subject: |
|
|
| Code: |
bind pubm * "OperServ: *" relay:pubm
proc relay:pubm {nick uhost hand chan text} {
putserv "PRIVMSG #opers :$text"
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Sun Feb 27, 2011 2:06 pm Post subject: |
|
|
Hi caesar,
| Code: |
bind raw * notice time:test
proc time:test {from keyword text} {
putserv "PRIVMSG ###1 :$text"
} |
takes all notices and relays them to channel ###1.
But...
How do i make it only send this notice:
-irc.myserver.net- *** Notice -- TS Control - U:line set time to be 1298829367 (timediff: 0)
I tryed
| Code: | if {"$text" != "NOTICE- *** Notice -- TS Control"} {
return
} |
But that dont work :/
?
Thanks
Gemster |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Feb 27, 2011 2:34 pm Post subject: |
|
|
The notice starts with "TS Control"? If id dose, then:
| Code: |
if {![string equal [lrange [split $text] 0 1] "TS Control"]} return
|
should do what you want. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Sun Feb 27, 2011 2:54 pm Post subject: |
|
|
nope it dont work and no errors.
The notice the bot sees in its partyline chat is this:
-NOTICE- *** Notice -- TS Control - U:line set time to be 1298832788 (timediff: 0)
Thanks
Gemster |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Feb 27, 2011 3:12 pm Post subject: |
|
|
Be very careful using raw bindings, especially with the return values.
lrange returns a list, not a string, though "TS Control" is trivial enough to make it through safe enough. Personally, I'd use string match with a suitable glob-pattern instead.
| Code: | bind raw - NOTICE time:test
proc time:test {from keyword text} {
if {[string match {\*\*\* Notice -- TS Control *} $text]} {
puthelp "PRIVMSG ###1 :$text"
}
return 0
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Sun Feb 27, 2011 4:08 pm Post subject: |
|
|
Nope, that dont work either and no errors :/
Thanks
Gemster |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Feb 27, 2011 4:12 pm Post subject: |
|
|
Needs better pattern then..
Try this, and post the output you get on ###1
| Code: | bind raw - NOTICE time:test
proc time:test {from keyword text} {
if {[string match {* TS Control *} $text]} {
puthelp "PRIVMSG ###1 :SNOTICE matched \" *TS Control *\": \"$text\""
} {
puthelp "PRIVMSG ###1 :SNOTICE did not match \" *TS Control *\": \"$text\""
}
return 0
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Sun Feb 27, 2011 4:15 pm Post subject: |
|
|
Ya it needed "* TS Control *" as match patten. After the last reply i was messing with it and got it working and was just about to reply back saying that
Thanks
Gemster |
|
| Back to top |
|
 |
|