| View previous topic :: View next topic |
| Author |
Message |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Fri Sep 23, 2011 2:38 pm Post subject: Botnet relay script |
|
|
Hey!
I have found and tried to get this to work (IM NOT A TCL GURU!)
so it's proberly the wrong way i have done it, but atleast i have tried
Bot 1. where it should grab text from
| Code: |
bind pubm - "\$send" send:msg
proc send:msg {nick host hand chan text} {
set leaf "YoYo"
putlog $leaf $text
putserv "privmsg addpre $text"
putbot $leaf "output [join [lrange [split $text] 0 end]]"
}
putlog "output1.tcl - loaded"
|
BOT 2. - Where is should output the text
| Code: |
bind bot - "output" get:msg
proc get:msg {bot command text} {
putserv "privmsg #chan :[join $text]"
}
putlog "output2.tcl - loaded"
|
_________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Thu Sep 29, 2011 4:36 am Post subject: |
|
|
I'm not sure if it's the only problem but the mask in a pubm bind is matched against #channelname followed by channel text. In any event, even if it worked, your proc would only respond to $send and not $send <text here>.
| Code: |
bind PUBM - "#% \$send ?*" myproc
proc myproc {nick uhost hand chan text} {
# code to execute here
}
|
The above code would now work in response to $send followed by a space followed by anything at least 1 character in length and in any bot channel. It isn't perfect because presumably that one character could be another space. Adding some form of text checking routine inside the proc could prevent this. _________________ I must have had nothing to do |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Sep 29, 2011 12:19 pm Post subject: |
|
|
A few more remarks:
- putlog only expects one parameter, the text to be logged. You are currently passing two parameters; "YoYo" and the text written in the channel.
Enclose both variables within a string if you'd like to prefix the log message with YoYo:
| Code: | | putlog "$leaf $text" |
All irc command expects the last parameter to be prefixed by a colon : if it's the last command and it may contain spaces. For convenience, you may also use the same prefix with the last parameter even if it does not contain a space
| Code: | | putserv "PRIVMSG addpre :$text" |
lrange with ranges 0 - end will return the original list unaltered. Thus, the following piece of code is completely pointless:
| Code: | | join [lrange [split $text] 0 end] |
Eggdrop handles the botnet message as a string, and extracts the first word as the command, leaving the rest as the text. Thus, you don't need to bother with list conversions:
| Code: | | putbot $leaf "output $text" |
Within your get:msg proc, $text is already a string. Don't use join here.
Fixing the above (and arfer's) remarks, the code should look somewhat like this:
| Code: | bind pubm - "% \$send *" send:msg
proc send:msg {nick host handle channel text} {
putlog "YoYo => $text"
putserv "PRIVMSG addpre :$text"
putbot "output $text"
}
#####
bind bot - "output" get:msg
proc get:msg {bot command text} {
putserv "PRIVMSG #channel :$text"
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|