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 

Help with Kicksource Script - Bot not responding

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


Joined: 31 Oct 2006
Posts: 8

PostPosted: Tue Oct 31, 2006 3:05 am    Post subject: Help with Kicksource Script - Bot not responding Reply with quote

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:
 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
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Oct 31, 2006 4:24 am    Post subject: Reply with quote

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:

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.
Back to top
View user's profile Send private message
DeFirence
Voice


Joined: 31 Oct 2006
Posts: 8

PostPosted: Tue Oct 31, 2006 5:11 am    Post subject: Reply with quote

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:
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"
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Oct 31, 2006 8:54 am    Post subject: Reply with quote

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:
bind pub n !kicks kicksource


In your channel simply type:
Code:
!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
Back to top
View user's profile Send private message Visit poster's website
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