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.

transfer notices from 1 channel to another

Old posts that have not been replied to for several years.
Locked
l
lunchbox
Voice
Posts: 5
Joined: Mon Dec 13, 2004 3:05 am

transfer notices from 1 channel to another

Post by lunchbox »

hi.. im trying to make a script that will forward a channel notice from 1 channel to another on the same network.. i would prefer to do this with 1 bot.. the bot is in both channels.. the notice will always be the same (atleast the first few words) so i tried to set it up as a trigger.. but i dont know how to set the trigger to recognize on notice.. anyone mind giving me some ideas or some snippets?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

For recognizing the notice you can use bind notc or raw bind raw - "NOTICE" proc :)
l
lunchbox
Voice
Posts: 5
Joined: Mon Dec 13, 2004 3:05 am

Post by lunchbox »

Code: Select all

bind notc - "Entries" workit 
proc workit { nick hand arg } { 
   set chan2 "#cctv"
   set backout "$arg"
   puthelp "PRIVMSG $chan2 :ATTENTION $nick $backout ."
}
i know that looks bad but this is one of my first attempts at making my own eggdrop script.. maybe someone can fix it up for me? cause its not working now..

the trigger i want it to transfer the notice on is "Entries are now open.."(after this the notice becomes variable).. all i basically want it to do is repeat it into another channel (#cctv).. there are color codes in the notice.. i dont know if this effects the trigger.. thanks in advance..
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

mh... other question: wouldn't it be easier to just send the message twice? (i mean in both chans at once). so you wouldn't have to trigger and re-send it...

@your code:
1. check the required arguments for a notice bind
2. see about "*"-sign and string matching
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

lunchbox wrote:

Code: Select all

bind notc - "Entries" workit 
proc workit { nick hand arg } { 
   set chan2 "#cctv"
   set backout "$arg"
   puthelp "PRIVMSG $chan2 :ATTENTION $nick $backout ."
}
i know that looks bad but this is one of my first attempts at making my own eggdrop script.. maybe someone can fix it up for me? cause its not working now..

the trigger i want it to transfer the notice on is "Entries are now open.."(after this the notice becomes variable).. all i basically want it to do is repeat it into another channel (#cctv).. there are color codes in the notice.. i dont know if this effects the trigger.. thanks in advance..
Here is a more simpler way. I will add no variables to set, since you know tcl yourself, just replace #chan1 and #chan2 by the channels you want.

Code: Select all

bind notc - "*" relay:notice

proc relay:notice {nick uhost hand text {chan ""}} {
 if {([string equal -nocase "*$chan1*" $chan])} {
  putserv "NOTICE $chan2 :$text"
  return 0
  }
}
Alternatively you can make the bot check if it is on chan2 as well, or it is opped on either chans, or both chans etc.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

and what about the string matching he needs?
he wants to transfer only specific notices.
if you want to correct his code then you should correct everything ;)
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Sorry, I might have not read his second post, because he didn't mention about matching a specific text in the first one, then only relaying the notice to the other channel.

Anyway that it simple and here is the final code:

Code: Select all

#Set the channel to catch notices from
set chan1 "#mychan"

#Set the channel to send notices on
set chan2 "#yourchan"

#Set the matching text to send the notices on
set relaymatch "Entries are now open"


bind notc - "*" relay:notice

proc relay:notice {nick uhost hand text {chan ""}} {
 global chan1 chan2 relaymatch
  if {([string equal -nocase "*$chan1*" $chan]) && ([string match -nocase "*$relaymatch*" $text])} {
   putserv "NOTICE $chan2 :$text"
   return 0
   }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

not quite final (string equal wont return 1).
photon?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

spock wrote:not quite final (string equal wont return 1).
LOL, I've been busy alot, a few months, seems I forgot the touch. ;)

Code: Select all

#Set the channel to catch notices from
set chan1 "#mychan"

#Set the channel to send notices on
set chan2 "#yourchan"

#Set the matching text to send the notices on
set relaymatch "Entries are now open"


bind notc - "*" relay:notice

proc relay:notice {nick uhost hand text {chan ""}} {
 global chan1 chan2 relaymatch
  if {([string equal -nocase $chan1 $chan]) && ([string match -nocase "*$relaymatch*" $text])} {
   putserv "NOTICE $chan2 :$text"
   return 0
   }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked