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 

Botnet relay script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Fri Sep 23, 2011 2:38 pm    Post subject: Botnet relay script Reply with quote

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 Smile

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
View user's profile Send private message MSN Messenger
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Thu Sep 29, 2011 4:36 am    Post subject: Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Sep 29, 2011 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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