View previous topic :: View next topic |
Author |
Message |
BlackTux Voice
Joined: 19 Aug 2005 Posts: 5
|
Posted: Sun Oct 09, 2005 2:19 pm Post subject: A relay script |
|
|
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: | 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: |
proc bot:relay {b k a} {
puthelp "PRIVMSG #main :$a"
}
|
$a is what gets sent from another bot on my botnet. |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Oct 09, 2005 2:48 pm Post subject: |
|
|
You can use:
Code: | set word [lindex [split $a] 1] |
to get the 2nd word from the text. and
Code: | if {[string equal -nocase music $word]} { |
to match it. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
BlackTux Voice
Joined: 19 Aug 2005 Posts: 5
|
Posted: Sun Oct 09, 2005 8:16 pm Post subject: ok |
|
|
So if I wanted different strings to go to different channels I would make it like: Code: | 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. |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
Back to top |
|
 |
BlackTux Voice
Joined: 19 Aug 2005 Posts: 5
|
Posted: Tue Oct 18, 2005 10:44 pm Post subject: Still not working |
|
|
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? |
|
Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Oct 19, 2005 7:28 am Post subject: |
|
|
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: | (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... |
|
Back to top |
|
 |
|