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 

Voice joiners to a channel

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


Joined: 25 Aug 2007
Posts: 1

PostPosted: Sat Aug 25, 2007 6:02 pm    Post subject: Voice joiners to a channel Reply with quote

Hopefully this should be fairly simple.

Hope you can provide a tcl equivalent of this mrc code :-

ON *:JOIN:#:{
if $left($nick,6) == [Clan] && $me isop # && $nick != $me { mode # +v $nick }
}


Basically channels where the bot is an op to voice users who's nick match certain criteria i.e. their names are [Clan].
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Aug 25, 2007 7:49 pm    Post subject: Reply with quote

Add a user using the required nick as a host and setting the channel flags '+fg'.

Code:
.+user [Clan]
.+host [Clan] [Clan]!*@*
.chattr [Clan] +fg #channel

_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Wed Aug 29, 2007 5:32 pm    Post subject: Reply with quote

this would be the same as tcl:

Code:
#check on join:
bind join - * voice_on_joined

#procedere on join:
proc voice_on_joined {nick host handle channel} {

  #set the name of your chanserv. just "chanserv" won't work.
  set chanserv "chanserv@services.gamesurge.net"

  #set the channel in which the user will be voiced. $channel will be all
  set voicechannel "#Quiz.de"

  #setting criteria
  set criteria "\[Clan\]"


   if {![regexp -nocase -- $nick $criteria] || $channel != $voicechannel} {
 
    #if nick won't match the criteria or nick doesnt join the right channel  the script will halt
    return
    }

    #sending voice-command to chanserv
    putquick "PRIVMSG $chanserv :$channel voice $nick"
 
}
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Aug 29, 2007 7:51 pm    Post subject: Reply with quote

-typ- wrote:
this would be the same as tcl:

Code:
if {![regexp -nocase -- $nick $criteria] || $channel != $voicechannel} {

that isn't equivalent to $left($nick,6)... remember, he used "if $left($nick,6) == [Clan]"
Code:
if {![string match [join [lrange [split $nick] 0 5]] $criteria] || $channel != $voicechannel} {

This is actually closer to $left's function in mirc/basic. Wink
But all this is actually irrelevant, as using eggdrops "built-in" capability (aka, Alchera's suggestion) to do this supersedes in both speed and function the equivalent in a tcl script.

Alchera most likely meant to use .+host [Clan] [Clan]*!*@* as well. So any person using the [clan] prefix on their nickname would be voiced and match the entry.
Back to top
View user's profile Send private message
cannot_delete
Voice


Joined: 24 Nov 2006
Posts: 31

PostPosted: Thu Aug 30, 2007 4:09 am    Post subject: Reply with quote

ok, I don't know mirc Wink

and yes, alchera's way is much easier but i thought he was looking for an tcl-script. and i was bored... Wink

regards,

-typ-
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