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 

help me

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


Joined: 12 Dec 2005
Posts: 5

PostPosted: Tue Jan 24, 2006 9:22 am    Post subject: help me Reply with quote

hi,

i set in my eggdrop tcl command like every body with none flag - can control bot only when they type !join #chan .. i need small Rolling Eyes tcl that can i add some chans bot will not join it if the user type !join


example:

KellyWAG: !join #sucker
mynot: sorry, chan on my bad list
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Jan 24, 2006 1:03 pm    Post subject: Reply with quote

Code:

set dont_join "#foo #MoO #BaR"

bind pub - !join all:pub:join

proc all:pub:join {nick uhost handle channel text} {
  global dont_join
  if {![llength [set chan [lindex [split $text] 0]]]} {
    putserv "NOTICE $nick :Usage: !join #channel"
    return
  }
  if {[validchan $chan]} {
    set msg "Sorry, the $chan channel is already a known channel to me."
    if {![botonchan $chan] || [channel get $chan inactive]} {
      append msg " Currently I'm not on the $chan channel, possible reasons: limit, invite only, banned or channel is se to +inactive."
      } else {
      append msg " Currently I'm on the $chan channel."
    }
    putserv "NOTICE $nick :$msg"
    return
  }
  if {[regexp -nocase $chan $dont_join]} {
    putserv "NOTICE $nick :Sorry, $chan channel is on my bad list."
    return
  }
  putserv "NOTICE $nick :Allright, I'll join $chan channel."
  channel add $chan
}

Feel free to modify it to suit your needs.

Edit: Fixed.
_________________
Once the game is over, the king and the pawn go back in the same box.


Last edited by caesar on Tue Jan 24, 2006 7:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jan 24, 2006 5:53 pm    Post subject: Reply with quote

Code:
[regexp -nocase {$chan} $dont_join]

this will always return 0 unless there is the word "$chan" in $dont_join, removing the braces will solve the problem.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Jan 24, 2006 7:06 pm    Post subject: Reply with quote

Oups! Duno how that got there. Embarassed I swear I've removed it once. Weird, anyway, thanks for pointing that out Sir_Fz. Smile
_________________
Once the game is over, the king and the pawn go back in the same box.
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