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.

Public Channel Join Command Script for eggdrop!

Old posts that have not been replied to for several years.
Locked
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Public Channel Join Command Script for eggdrop!

Post by awyeah »

Hello,

I have made a PUBLIC CHANNEL JOIN COMMAND
for eggdrops like as the .+chan #channel command
in DCC and also a channel remover command in
PUBLIC CHANNEL MSG as the .-chan #channel command
in DCC.

I don't know why they aren't working.
I've found many scripts on www.tclscript.com
which have these and I tried almost all and they
don't work. I dont know why!

I just want to type .+chan #anychann on my chan
and want my bot to add that channel in the chan bot
list bot.chan and join that channel and do the same for
.-chan to remove the channel from the bot.chan file
and the list.

I can't get it to work unfortunately.
Some one was saying you need to unbind the .+chan
join DCC command first then bind it? or what.

Even suppose I can change the trigger, it doesnt really
need to bind on .+chan, it can be !addchan or !chanadd
and !delchan or !chandel. But I've tried almost likely every
possible combination and they still don't seem to work.

Please help me, kthx.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

could u post what u made ? or tryed .. (script)

simple example

Code: Select all

bind pub n !join join:pub

proc join:pub {nick host hand chan arg} {
  channel add [lindex $arg 0]
  putserv "PRIVMSG $chan :Bot is joining \(\002[lindex $arg 0]\002\)."
}
check ur help dir and read the docu look for channel add channel del channel..
XplaiN but think of me as stupid
User avatar
K
Voice
Posts: 34
Joined: Wed Jan 28, 2004 7:31 pm
Location: Romania @sibiu
Contact:

a simpele tcl

Post by K »

Very simple

Code: Select all

bind pub m .+chan pub:+chan
bind pub m .-chan pub:-chan

#part
proc pub:-chan {nick uhost hand chan args} {
        set args [cleanarg $args]
        if {[llength $args]<1} {
                notice $nick "Usage: .-chan <#channel>"
                return 0
        }
        channel remove $args
}

#join
proc pub:+chan {nick uhost hand chan args} {
        set args [cleanarg $args]
        if {[llength $args]<1} {
                notice $nick "Usage: .+chan <#channel>"
                return 0
        }
        channel add $args {+greet -bitch -autoop -bitch -stopnethack}
}


User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: a simpele tcl

Post by user »

wtf is 'cleanarg'? :o Try reading the manual page for 'proc' and pay extra close attention to the part about 'args'.
Have you ever read "The Manual"?
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Not to mention there is no "notice" command provided by eggdrop by default.
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

I think he wanted to make

Code: Select all

set args [split [cleanarg $args]]
But he did wrong :mrgreen:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Thanks for your help everyone.
I appreciate it.

I'll try to use the ones you people have given in your replies and try to work them out.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

By the way I found a proc of cleanarg some where on the web for eggdrops.

This is would be it, I suppose guys??
proc cleanarg {arg} {
set response ""
for {set i 0} {$i < [string length $arg]} {incr i} {
set char [string index $arg $i]
if {($char != "\12") && ($char != "\15")} {
append response $char
}
}
return $response
}
But why do we need to use this complicated process??

OR

This line below cannot do the same work, in a less complicated way?

channel add [lindex $arg 0]
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

changing the variable name (args) would make it even easier. Read about 'args' here: http://tcl.tk/man/tcl8.5/TclCmd/proc.htm
Have you ever read "The Manual"?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Thanks I got, the script with the proc cleanarg working in
good and fine condition.

The channel add, remove both are working fine, I can execute
them in private query with the bot which is easier when DCC sucks
as well as on public channels.

Althought I had to put it in the first file of my tcls in the first
line, in between it was causing troubles, maybe clashing with
the others or I don't know what.

Thanks again, everyone!
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked