| View previous topic :: View next topic |
| Author |
Message |
duarteper Voice
Joined: 06 Dec 2012 Posts: 12
|
Posted: Sat Feb 09, 2013 1:15 pm Post subject: join part tcl |
|
|
i need help with this tcl
| Code: |
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 ? |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sat Feb 09, 2013 1:26 pm Post subject: |
|
|
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: | 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
}
} |
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
duarteper Voice
Joined: 06 Dec 2012 Posts: 12
|
Posted: Sun Feb 10, 2013 9:13 pm Post subject: |
|
|
| thanks for your help Madalin |
|
| Back to top |
|
 |
|