egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

join part tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
duarteper
Voice


Joined: 06 Dec 2012
Posts: 12

PostPosted: Sat Feb 09, 2013 1:15 pm    Post subject: join part tcl Reply with quote

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
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sat Feb 09, 2013 1:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
duarteper
Voice


Joined: 06 Dec 2012
Posts: 12

PostPosted: Sun Feb 10, 2013 9:13 pm    Post subject: Reply with quote

thanks for your help Madalin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber