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.

Help with Kicksource Script - Bot not responding

Help for those learning Tcl or writing their own scripts.
Post Reply
D
DeFirence
Voice
Posts: 8
Joined: Tue Oct 31, 2006 2:58 am

Help with Kicksource Script - Bot not responding

Post by DeFirence »

Lo all, ive just finished setting up a windrop eggdrop bot and now i need to add kicksource script to it.

I am having two problems, firstly, in console (dcc chat) with the bot, it wont understand if i type .kicksource
The next thing i need to do if change the console command into a trigger (!)

i am also running egghttp before this script.

please excuse me if its something really simple, i only learned wot Tcl was 12 hours ago...

Code: Select all

 bind pub n .kicksource kicksource

proc kicksource {nick host handle chan text} {
#ip:
set server "localhost"
#port:
set port "8000"
#login: (wird erzeugt aus (ab ins mirc) //echo $encode(admin:PASS,m) bei
#pass auch das pass angeben ^^ und dann eintragen sonst tut das nicht
#login (get it in mirc with //echo $encode(admin:PASS,m)
set login "$encode(admin:pass,m)"

# **********  don't change anything under this


set sock [socket $server $port]
puts $sock "GET /admin.cgi?mode=kicksrc HTTP/1.1"
puts $sock "User-Agent:Mozilla"
puts $sock "Host: $server"
puts $sock "Authorization: Basic $login"
puts $sock ""
flush $sock
}
putlog "sourcekick script loaded" 
Thanks for your help.
DeFirence
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

You should've spent that 12 hours actually reading the documentation, particularly the tcl-commands.doc that comes with eggdrop, and then you would have come across the documentation about "bind" and in particular:

(4) PUB
bind pub <flags> <command> <proc>
procname <nick> <user@host> <handle> <channel> <text>

Description: used for commands given on a channel. The first word
becomes the command and everything else is the text argument.
Module: irc

and then you would have figured out the command ".kicksource" is a command you type in channel, not dcc.

As far as changing console triggers, that's not so easy, you'd have to modify the source code afaik. Fortunately, since you're dealing with a pub bind, you just need to change THAT command's trigger from ".kicksource" to "!kicksource" if you wish.

from: bind pub n .kicksource kicksource
to: bind pub n !kicksource kicksource

Of course, you could change the bind to a dcc bind, but be aware that the dcc bind uses different parameters for the proc:

(2) DCC
bind dcc <flags> <command> <proc>
procname <handle> <idx> <text>

Description: used for partyline commands; the command is the first
word and everything else becomes the text argument. The idx is
valid until the user disconnects. After that, it may be reused,
so be careful about storing an idx for long periods of time.
Module: core

The script segment you posted does not appear to use the parameters from the pub bind (nick host handle chan text) so it should be safe to change the bind to a dcc bind (but I'm assuming there is not more to the script that uses any of those parameters.)

If you change the bind to a dcc bind, you also have to change the parameters given to the proc:

Code: Select all

bind dcc n kicksource kicksource
proc kicksource {handle idx text} { 
BUT..
Even if you change it to a dcc bind/proc, you'd still have to use the "dot" character to use the command, in other words:

bind dcc - !mycommand whatever

would still have to be activated like:

.!mycommand

usually dcc binds, just use "command" without any predicate, so when you run them, you do "dot<command>"

You could also make the trigger a msg bind/proc, if you just want to use the command privately, read the tcl-commands.doc about the various bind types.

Also, is there a particular reason you're running egghttp rather than the http package that comes with eggdrop? egghttp is deprecated afaik, and was replaced with the http package.
D
DeFirence
Voice
Posts: 8
Joined: Tue Oct 31, 2006 2:58 am

Post by DeFirence »

ok, thanks for ur help, but it didnt actually help

hes wot i wanna do, without dcc or anything, just plain in the channel i want anyone to type !kick and it kicks the source

no matter if i use the code u gave me, the old one, other code from a website i cant get the bot to respond to a !kick or .kick ect command, it just ignores it

if theres a better package, pls help me get it, i cant find an http package anywhere other then egghttp

ta alot!

DeFirence

Code: Select all

bind pub n !kicks kicksource

proc kicksource {nick host handle chan text} {
#ip:
set server "localhost"
#port:
set port "8000"
#login: (wird erzeugt aus (ab ins mirc) //echo $encode(admin:PASS,m) bei
#pass auch das pass angeben ^^ und dann eintragen sonst tut das nicht
#login (get it in mirc with //echo $encode(admin:PASS,m)
set login "admin:pass"

# **********  don't change anything under this


set sock [socket $server $port]
puts $sock "GET /admin.cgi?mode=kicksrc HTTP/1.1"
puts $sock "User-Agent:Mozilla"
puts $sock "Host: $server"
puts $sock "Authorization: Basic $login"
puts $sock ""
flush $sock
}
putlog "sourcekick loaded"
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

DeFirence wrote:hes wot i wanna do, without dcc or anything, just plain in the channel i want anyone to type !kick and it kicks the source
It already does that:

Code: Select all

bind pub n !kicks kicksource 
In your channel simply type:

Code: Select all

!kicks
It would be unusuall if there were no instructions either within the script header or from where you downloaded it from.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply