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 !join !part script

Old posts that have not been replied to for several years.
Locked
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Public !join !part script

Post by dotslasher »

how can i make an eggy Join a channel with a public command?
i got a .join (for dcc) but i dunno what to change

Code: Select all

## .JOIN ##
bind dcc m JOIN dcc_join_chan
proc dcc_join_chan {handle idx arg} {
   global botnick chan
   set chan  [lindex $arg 0]
   set chans [channels]
   set why [lrange $arg 1 end]
   foreach chann $chans {
      if {[string tolower $chann] == [string tolower $chan]} {
         putdcc $idx "$handle JOIN Error: I'm already on $chan "
         return 0
      }
   }
   if {$chan == ""} {
      putdcc $idx "$handle JOIN Error: Usage: .join <Channel>"
      return 0
   }
   if {[string index $chan 0] != "#"} {
      set chan "#$chan"
   }
   channel add $chan {
    chanmode "+nt"
    idle-kick 20
    need-op {request_ops $chan }
    need-invite {gimmie_da_key $chan }
    need-key {gimmie_da_key $chan }
    need-unban {gimmie_da_key $chan }
    need-limit {gimmie_da_key $chan }
    flood-chan 10:60
    flood-deop 3:10
    flood-kick 3:10
    flood-join 5:60
    flood-ctcp 3:60
   }
   channel set $chan -bitch +secret -autoop -clearbans -stopnethack +enforcebans 
   channel set $chan -greet -revenge +dynamicbans -protectops -statuslog +userbans
   channel set $chan +shared -autovoice +cycle +seen +dontkickops +dontdeopops
   putlog "$handle added $chan to my monitor list"
   return 1
}


## .PART ##
bind dcc m PART dcc_part_chan
proc dcc_part_chan {handle idx vars} {
  global botnick
  set where [lindex $vars 0]
  set chans [channels]
  if {$where == ""} {
    putdcc $idx "$handle PART Error: Usage: part <Channel you want me to leave>"
    return 0
  }
  if {[string index $where 0] != "#"} {
    set where "#$where"
  }
  if {![string match *[string tolower $where]*  [string tolower $chans]]} {
    putdcc $idx "$handle PART Error: I'm not on $where."
    return 0
  }
  channel remove $where
  putlog "No longer monitoring $where as per request from $handle."
  return 1
}
i know i have to change dcc to pub but i got this error:
Tcl error [pub_triggerj]: called "pub_triggerj" with too many arguments

my edit:

Code: Select all

set trigj "!Join" ;         
set trigp "!Part" ;         

## .JOIN ##
bind pub - $trigj pub_triggerj
proc pub_triggerj {handle idx arg} {
help is greatly apreciated :)
Online
User avatar
CrazyCat
Revered One
Posts: 1280
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

try this:

Code: Select all

## .JOIN ##
bind pub m|- "!JOIN" pub_join_chan
proc pub_join_chan {unick uhost handle uchan arg} {
   global botnick
   set chan  [lindex $arg 0]
   set chans [channels]
   set why [lrange $arg 1 end]
   foreach chann $chans {
      if {[string tolower $chann] == [string tolower $chan]} {
         putserv "PRIVMSG $unick :$unick JOIN Error: I'm already on $chan "
         return 0
      }
   }
   if {$chan == ""} {
      putserv "PRIVMSG $unick :$unick JOIN Error: Usage: !join <Channel>"
      return 0
   }
   if {[string index $chan 0] != "#"} {
      set chan "#$chan"
   }
   channel add $chan {
    chanmode "+nt"
    idle-kick 20
    need-op {request_ops $chan }
    need-invite {gimmie_da_key $chan }
    need-key {gimmie_da_key $chan }
    need-unban {gimmie_da_key $chan }
    need-limit {gimmie_da_key $chan }
    flood-chan 10:60
    flood-deop 3:10
    flood-kick 3:10
    flood-join 5:60
    flood-ctcp 3:60
   }
   channel set $chan -bitch +secret -autoop -clearbans -stopnethack +enforcebans
   channel set $chan -greet -revenge +dynamicbans -protectops -statuslog +userbans
   channel set $chan +shared -autovoice +cycle +seen +dontkickops +dontdeopops
   putserv "PRIVMSG $nick :$nick added $chan to my monitor list"
   return 1
}


## .PART ##
bind pub m|- "!PART" pub_part_chan
proc pub_part_chan {unick uhost handle uchan vars} {
  global botnick
  set where [lindex $vars 0]
  set chans [channels]
  if {$where == ""} {
    putserv "PRIVMSG $nick :$nick PART Error: Usage: !part <Channel you want me to leave>"
    return 0
  }
  if {[string index $where 0] != "#"} {
    set where "#$where"
  }
  if {![string match *[string tolower $where]*  [string tolower $chans]]} {
    putserv "PRIVMSG $nick :$nick PART Error: I'm not on $where."
    return 0
  }
  channel remove $where
  putserv "PRIVMSG $nick :No longer monitoring $where as per request from $handle."
  return 1
}
Not change a lot, just binds, proc calls and way to respond...
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

tyvm mate :)

much apreciated
m
masterstanf2k
Voice
Posts: 29
Joined: Fri Oct 03, 2003 6:15 pm

Post by masterstanf2k »

I'm using it, and it's not working :(
m
masterstanf2k
Voice
Posts: 29
Joined: Fri Oct 03, 2003 6:15 pm

Post by masterstanf2k »

???? What's wrong?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

nothing's wrong, make sure you .rehash after loading the script.
Locked