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 pub join chan

Old posts that have not been replied to for several years.
Locked
L
Lph
Voice
Posts: 12
Joined: Mon Nov 22, 2004 11:21 am

help pub join chan

Post by Lph »

i want to cm in pub eg : !join #chan

my bot will join #chan

help me.Thank all for help
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Next time please browse tough the TCL Archive before posting. Thank you.
Once the game is over, the king and the pawn go back in the same box.
User avatar
avilon
Halfop
Posts: 64
Joined: Tue Jul 13, 2004 6:58 am
Location: Germany

Post by avilon »

Code: Select all

bind pub n !join foo

proc foo {n u h c a} {
	if {($a != "") && (![validchan $a])} {
		channel add $a
	}
}
Last edited by avilon on Tue Jan 18, 2005 5:31 am, edited 2 times in total.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

!join #{ and see what happens, then check what the proc manual has to say about the argument name 'args'
Have you ever read "The Manual"?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

try this, it's just a simple join thingy might wana add stuff for key and so on..

Code: Select all

bind pub n !join channel_add_pub

proc channel_add_pub {nick host hand chan arg} {
  set arg [string map {\\ \\\\ \" \\\" \[ \\\[ \] \\\] \{ \\\{ \} \\\} \( \\\( \) \\\)} $arg]
  if {[isChan [lindex $arg 0]] && ![botonchan [lindex $arg 0]]} {
    channel add $arg
  }
}

proc isChan {arg} {
  if {[string equal -length 1 \x23 $arg]} {
    return 1
  }
  return 0
}
XplaiN but think of me as stupid
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

1: don't escape those chars.
2: "#" is not the only channel name prefix and there's no point using "\x23".
Have you ever read "The Manual"?
Locked