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 

A relay script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
BlackTux
Voice


Joined: 19 Aug 2005
Posts: 5

PostPosted: Sun Oct 09, 2005 2:19 pm    Post subject: A relay script Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Oct 09, 2005 2:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
BlackTux
Voice


Joined: 19 Aug 2005
Posts: 5

PostPosted: Sun Oct 09, 2005 8:16 pm    Post subject: ok Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Oct 10, 2005 5:26 am    Post subject: Reply with quote

Try whatever you write and see.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
BlackTux
Voice


Joined: 19 Aug 2005
Posts: 5

PostPosted: Tue Oct 18, 2005 10:44 pm    Post subject: Still not working Reply with quote

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


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Wed Oct 19, 2005 7:28 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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