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 

grabbing notices from operserv and relay them to a channel ?

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


Joined: 04 Oct 2010
Posts: 51

PostPosted: Sun Feb 20, 2011 6:51 am    Post subject: grabbing notices from operserv and relay them to a channel ? Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Feb 21, 2011 2:13 am    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Mon Feb 21, 2011 9:39 am    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Feb 21, 2011 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Mon Feb 21, 2011 10:02 am    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Feb 21, 2011 10:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Mon Feb 21, 2011 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Feb 21, 2011 10:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Sun Feb 27, 2011 2:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Feb 27, 2011 2:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Sun Feb 27, 2011 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Feb 27, 2011 3:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Sun Feb 27, 2011 4:08 pm    Post subject: Reply with quote

Nope, that dont work either and no errors :/

Thanks
Gemster
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Feb 27, 2011 4:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Sun Feb 27, 2011 4:15 pm    Post subject: Reply with quote

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 Very Happy

Thanks
Gemster
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