Custom Greets

By Corrosive on Oct 23, 2007

Hello.

This is my second script

-------- Commands --------

!SetGreet - Set the greet for your nick
!Greet - Turn the custom greets for your channel on or off


Any problems with spelling or the code please tell me.

Enjoy

~Corrosive~

on *:JOIN:#: {
  if ( %greet [ $+ [ $nick ] ] != $null ) {
    if ( %greet [ $+ [ $chan ] ] == on) {
      msg $chan [[ $nick ]] %greet [ $+ [ $nick ] ]
    }
  }
  else {
    notice $nick You do not have a custom greet set, to set one please type !SetGreet
  }
}

on *:TEXT:!Setgreet *:#: {
  if ( %greet [ $+ [ $chan ] ] == ON ) {
    if ( $2- == $null ) {
      notice $nick You need to write something for your greet. | halt
    }
    if ( $2- != $null ) {  
      if ( %greet [ $+ [ $nick ] ] == $2- ) {
        notice $nick Your greet is already that. | halt
      }
    }
    set %greet [ $+ [ $nick ] ] $2-
    notice $nick Your greet has been set as $2-
  }
  if ( %greet [ $+ [ $chan ] ] == OFF ) {
    notice $nick Sorry $nick but the custom greets for this channel are turned off. | halt
  }
} 

on *:TEXT:!Greet *:#: {
  if ( $nick isop $chan ) || ( $nick ishop $chan ) {
    if ( $2 == ON ) {
      if ( %greet [ $+ [ $chan ] ] == ON ) {
        notice $nick The custom greets for this channel are on anyway | halt
      }
      set %greet [ $+ [ $chan ] ] ON
      notice $nick The custom greets for $chan has been turned 9ON 
    }
  }
  if ( $nick isop $chan ) || ( $nick ishop $chan ) {
    if ( $2 == OFF ) {
      if ( %greet [ $+ [ $chan ] ] == OFF ) {
        notice $nick The custom greets for this channel are off anyway | halt
      }
      set %greet [ $+ [ $chan ] ] OFF
      notice $nick The custom greets for $chan has been turned 4OFF
    }
  }
}
else { 
  notice $nick Sorry $nick but you cannot change the settings of this channels greet
}

Comments

Sign in to comment.
stargazer989   -  Mar 30, 2008

from Silenced to Corrosive, what next ?

 Respond  
Corrosive   -  Oct 24, 2007

RubixCube I put the halts there because another script didn\'t work without them and also I like vars :P

 Respond  
RubixCube   -  Oct 23, 2007

Nice idea, but why not use a txt, ini, or hash table as a storage base for data? It\'s pointless to set all those variables. And no need of the halts there. ;)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.