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.

grabbing notices from operserv and relay them to a channel ?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

grabbing notices from operserv and relay them to a channel ?

Post by Gemster »

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
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

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.
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

Post by Gemster »

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
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Try with this instead:

Code: Select all

bind raw * notice oper:notice 

proc oper:notice {from keyword text} {
  putserv "PRIVMSG #opers :$text"
} 
edit: fixed.
Last edited by caesar on Mon Feb 21, 2011 10:06 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

Post by Gemster »

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
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Aww, crap. Replace:

Code: Select all

bind raw * oper:notice 
with:

Code: Select all

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.
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

Post by Gemster »

Yes that worked but not on all operserv commands as some dont notice like "/operserv staff"

Anyways please forget about the notice but do:
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
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

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.
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

Post by Gemster »

Hi caesar,

Code: Select all

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: Select all

if {"$text" != "NOTICE- *** Notice -- TS Control"} { 
        return 
        }
But that dont work :/

?

Thanks
Gemster
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The notice starts with "TS Control"? If id dose, then:

Code: Select all

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.
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

Post by Gemster »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

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
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

Post by Gemster »

Nope, that dont work either and no errors :/

Thanks
Gemster
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Needs better pattern then..
Try this, and post the output you get on ###1

Code: Select all

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
G
Gemster
Halfop
Posts: 51
Joined: Mon Oct 04, 2010 5:43 pm

Post by Gemster »

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 :D

Thanks
Gemster
Post Reply