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.

Need help converting a script to tcl

Old posts that have not been replied to for several years.
Locked
9
94tbird

Need help converting a script to tcl

Post by 94tbird »

hi. i have a small script, a few lines of code that automatically kick clones and guest nicks as soon as they join my channel. i was wonderin if someone could help me convert it to a tcl so i can load it onto my eggy. thanks

Code: Select all

ON *:JOIN:#Godz-Zone: {
  if ( $ialchan( $wildsite, $chan, 0 ) > 1) {
    if ( ( $ialchan( $wildsite, $chan, 1 ).nick isop $chan ) || ( $ialchan( $wildsite, $chan, 2 ).nick isop $chan ) ) { halt }
    if ( ( $ialchan( $wildsite, $chan, 1 ).nick ishop $chan ) || ( $ialchan( $wildsite, $chan, 2 ).nick ishop $chan ) ) { halt }
    if ( ( $ialchan( $wildsite, $chan, 1 ).nick isvoice $chan ) || ( $ialchan( $wildsite, $chan, 2 ).nick isvoice $chan ) ) { halt }
    ban -u1800 $chan $nick 9
    kick $chan $nick Clones are not allowed in $chan $+ . 30 min ban.
  }
  if ( $lower( $left( $nick, 6 ) ) == [godz]- ) {
    .mode $chan +v $nick
  }
  if ( $lower( $left( $nick, 5 ) ) == guest ) {
    ban -u60 $chan $nick 9
    kick $chan $nick Guest nicks are not allowed this channel. Please change your nick. 1 min ban.
  }
}
ON *:NICK: {
  if ( $newnick isin #Godz-Zone ) {
    ban -u60 $chan $newnick 9
    kick $chan $nick Guest nicks are not allowed this channel. Please change your nick. 1 min ban.
  }
}
9
94tbird

Post by 94tbird »

NE1?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

In eggdrop, we use the 'bind' command instead of 'on'. Check tcl-commands.doc for different bind types -- you need the 'join' bind.

Next, the 'maskhost' command will give you a mask in the form *!ident@*.domain.com.

Then get the channel list with 'chanlist' and cycle through it, getting each host with 'getchanhost' and matching it with 'string match'. You can use 'isop', 'ishalfop', and 'isvoice' to check if the matched nicks have those flags.

Then use newchanban and putkick to ban and kick.
Locked