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 part tcl

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
duarteper
Voice
Posts: 12
Joined: Thu Dec 06, 2012 10:55 pm

join part tcl

Post by duarteper »

i need help with this tcl

Code: Select all

bind pub n|n !join pub:join 
bind pub n|n !join pub:part 

proc pub:join {nick host hand chan text} { 
set newchan [lindex [split $text] 0] 
if {$newchan == ""} { 
puthelp "NOTICE $nick :No Channel Given." 
return 0 
} 
putallbots "bjoin $newchan" 
if {![validchan "$newchan"]} { 
channel add $newchan 
return 1 
} else { 
puthelp "NOTICE $nick :I'm already on that channel" 
return 0 
} 
} 

proc pub:part {nick host hand chan text} { 
set oldchan [lindex [split $text] 0] 
if {$oldchan == ""} { 
puthelp "NOTICE $nick :Please give a channel name." 
return 0 
} 
putallbots "bpart $oldchan" 
if {[validchan "$oldchan"]} { 
channel remove $oldchan 
return 1 
} else { 
puthelp "NOTICE $nick :I'm not on \002$oldchan\002" 
return 0 
} 
} 

some say that doesnt have the part where the other linked bots receive the JOIN/PART command.

how can i make it work ?
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

This is the correct or atleast this is what the script would look like

When you would type !join/part #channel the command will be sent over botnet and other bots linked will join/part depending on the command

Code: Select all

bind pub n|n !join pub:join
bind pub n|n !join pub:part

### BOTNET begin
bind BOT - bjoin bjoin
bind BOT - bpart bpart

proc bjoin {from key arg} {

	if {![validchan [lindex [split $arg] 0]]} {
		channel add [lindex [split $arg] 0]
	}
}

proc bpart {from key arg} {

	if {[validchan [lindex [split $arg] 0]]} {
		channel remove [lindex [split $arg] 0]
	}
}

### botnet end

proc pub:join {nick host hand chan text} {
	set newchan [lindex [split $text] 0]
	if {$newchan == ""} {
		puthelp "NOTICE $nick :No Channel Given."
		return 0
	}
	putallbots "bjoin $newchan"
	if {![validchan "$newchan"]} {
		channel add $newchan
		return 1
	} else {
		puthelp "NOTICE $nick :I'm already on that channel"
		return 0
	}
}

proc pub:part {nick host hand chan text} {
	set oldchan [lindex [split $text] 0]
	if {$oldchan == ""} {
		puthelp "NOTICE $nick :Please give a channel name."
		return 0
	}
	putallbots "bpart $oldchan"
	if {[validchan "$oldchan"]} {
		channel remove $oldchan
		return 1
	} else {
		puthelp "NOTICE $nick :I'm not on \002$oldchan\002"
		return 0
	}
}
d
duarteper
Voice
Posts: 12
Joined: Thu Dec 06, 2012 10:55 pm

Post by duarteper »

thanks for your help Madalin
Post Reply