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.

A relay script

Old posts that have not been replied to for several years.
Locked
B
BlackTux
Voice
Posts: 5
Joined: Fri Aug 19, 2005 8:07 pm

A relay script

Post by BlackTux »

I am looking for a relay script that looks at the second string and sends to the right channel.
If it was in mIRC lingo it would be like:

Code: Select all

on *:TEXT:*:#:{
              if ( music isin $2 ) /msg #music $2- | halt
              if ( software isin $2 ) /msg #software $2- | halt
 }
What I have so far is

Code: Select all

proc bot:relay {b k a} {
puthelp "PRIVMSG #main :$a"
}

$a is what gets sent from another bot on my botnet.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You can use:

Code: Select all

set word [lindex [split $a] 1]
to get the 2nd word from the text. and

Code: Select all

if {[string equal -nocase music $word]} {
to match it.
B
BlackTux
Voice
Posts: 5
Joined: Fri Aug 19, 2005 8:07 pm

ok

Post by BlackTux »

So if I wanted different strings to go to different channels I would make it like:

Code: Select all

bind bot R rmsg bot:relay
proc bot:relay {b k a} {
set word [lindex [split $a] 1]
     if {[string equal -nocase music $word]}{
    puthelp "PRIVMSG #main_music :$a"
  }
    if {[string equal -nocase movies $word]}{
    puthelp "PRIVMSG #main_movies :$a"
  }
}
Is that correct? Sorry for being Green when it comes to TCL I am used to mIRC scripts.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try whatever you write and see.
B
BlackTux
Voice
Posts: 5
Joined: Fri Aug 19, 2005 8:07 pm

Still not working

Post by BlackTux »

I am wondering if it has to do wtih the flags on the two bots.
Bot1 (bot sending info) has Bot2 added with flags +h

Bot2 (bot recieving info) has Bot1 added with flags +h

Do I have to use the console command?
Do I have the right flags set?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

are you considering that the first word actually will be $k and $a will be the 2nd to the last word, so maybe your keyword is the first word in $a?

relationg your flags question:

Code: Select all

  (A) BIND TYPES
...
    (18) BOT
...
          flags are ignored.
if the bots are linked, and command matchs, it will trigger.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked