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.

join script

Old posts that have not been replied to for several years.
Locked
s
scorchin
Voice
Posts: 13
Joined: Mon Jun 07, 2004 5:28 am

join script

Post by scorchin »

how do i make a script that will allow me to type !invite bot #chan and it will send the eggdrop to that channel? but i only want it to work for me. i have been able to do this in mIRC but nothing like this in tcl :x :o :x
cheers
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Try tcl-commands.doc ;) This should work:

Code: Select all

bind pub m "!invite" pub:invite

proc pub:invite {nick uhost hand chan args} {
channel add $args
}

bind pub m "!leave" pub:leave

proc pub:leave {nick uhost hand chan args} {
channel remove $args
}
When you will type !invite #channel, bot will join channel you typed after !invite...Same goes for !leave...Only people with m flag can make bot join or leave channel...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Here is the one I use.
You can change/modify the binding triggers according
to your own needs. This one is a bit complicated than
the one posted above.

Code: Select all

### Public command channel join/part script ###

bind pub n !join pub:+chan 
bind pub n !part pub:-chan 
bind pub n .+chan pub:+chan 
bind pub n .-chan pub:-chan 


proc pub:+chan  {nick uhost hand chan text} {
        set args [split [cleanarg $text]]
        if {[llength $text]<1} {
                putserv "NOTICE $nick :Usage: .+chan <#channel>"
                return 0
        }
        channel add $text
        save
  putserv "NOTICE $nick :I have added $args to my channel list."
  return 0
}


proc pub:-chan {nick uhost hand chan text} {
        set args [split [cleanarg $text]]
        if {[llength $text]<1} {
                putserv "NOTICE $nick :Usage: .-chan <#channel>"
                return 0
        }
        channel remove $text
        save
   putserv "NOTICE $nick :I have removed $text from my channel list."
  return 0
}


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
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

1) Do I put that in the config? eggdrop.conf or where exactly.

2) And according to your script whenever I type !join in X channel the bot will join #x, and if I type !leave in X channel, bot will leave #x.

By x i mean any channel.

And whenever I add/remove a script do I have to restart bot or can I just do a command from dcc chat?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

You can type !join #x or !leave #x on any channel bot is on...You save this:

Code: Select all

bind pub m "!invite" pub:invite 

proc pub:invite {nick uhost hand chan args} { 
channel add $args 
} 

bind pub m "!leave" pub:leave 

proc pub:leave {nick uhost hand chan args} { 
channel remove $args 
}
as join.tcl and put it in Eggdrop scripts folder.When you do this, put line source scripts/join.tcl in your eggdrop.conf, after that you need to rehash bot (.rehash) and then script should work :mrgreen:
Locked