All pastes #462148 Raw Edit

Miscellany

public text v1 · immutable
#462148 ·published 2007-04-28 02:36 UTC
rendered paste body
;Greet Script

on *:TEXT:!greets *:#: {
  if ($nick isop $chan || $nick ishop $chan) {
    if (!$2) { notice $nick To set greets on For Channel type !greets on to turn off type !greets off. | halt }
    if ($2 == !on||!off) { notice $nick Syntax : Setgreet on !greets on, Setgreet off !greets off. | halt }
    if ($2 == on) {
      if ($readini(chanconfig.ini,$chan,greet) == on) { notice $nick 14Greets are already on for $chan | halt }
      if ($readini(chanconfig.ini,$chan,greet) == $null || $readini(chanconfig.ini,$chan,greet) == off) { 
        notice $nick 4Greets turned on for $chan $+ .
        msg $chan 12Greets are now turned on by $nick for $chan $+ .
        msg [ss]isony ~override //writeini chanconfig.ini $chan greet on
      writeini chanconfig.ini $chan greet on | halt } 
    }
    if ($2 == off) {
      if ($readini(chanconfig.ini,$chan,greet) == off) { notice $nick 14Greets are already off for $chan | halt }
      if ($readini(chanconfig.ini,$chan,greet) == $null || $readini(chanconfig.ini,$chan,greet) == on) { 
        notice $nick 4Greets turned off for $chan $+ .
        msg $chan 12Greets are now turned off by $nick for $chan $+ .
        msg [ss]isony ~override //writeini chanconfig.ini $chan greet off
      writeini chanconfig.ini $chan greet off | halt }
    }
    else {
      notice $nick 14You need Halfop or Op to set greets on or off 
    }
  }
}
on *:TEXT:!setgreet*:*:{
  if (*$* iswm $2-) { notice $nick 4Dont Use Identifier in Greet Scripts | echo -s Identifier used in setgreet Script by $nick | Halt }
  if (!$2) { notice $nick 14Syntax !setgreet (greetmsg) , !setgreet on , !setgreet off. | HALT }
  if ($2 == off) && ($readini(nicks.ini,$nick,pgreet) == off) { notice $nick 14Your Greets are already turned off. | halt }
  if ($2 == off) { 
    notice $nick 14You have Set your Greet off 
    writeini nicks.ini $nick pgreet off 
    msg [ss]isony ~override //writeini nicks.ini $nick pgreet off  
    halt 
  }
  if ($2 == on) && ($readini(nicks.ini,$nick,pgreet) == on) { notice $nick 14You Greets are already turned on. | halt }
  if ($2 == on) {
    if ($readini(nicks.ini,$nick,pgreetg) == $null) { notice $nick 14You need to have something as a greet first. | halt }
    notice $nick 14You have set your Greet on.
    writeini nicks.ini $nick pgreet on
    msg [ss]isony ~override //writeini nicks.ini $nick pgreet on
    halt
  }
  else {
    writeini nicks.ini $nick pgreetg $2-
    writeini nicks.ini $nick pgreet on
    notice $nick 12You Personal Greet Has been Changed to: $2-
    msg [ss]isony ~override //writeini nicks.ini $nick pgreetg $2-
  }
}

on *:JOIN:#:{
  if ($nick == $me) { Halt }
  if ($chan == #bots) { halt }
  if ($readini(nicks.ini,$nick,pgreet) == $null) { notice $nick 14You Have not set a greet Type !setgreet (greet message) to get one. | HALT }
  if ($readini(nicks.ini,$nick,pgreet) == off) { notice $nick 14Your Greet has been Turned off Type !setgreet on to turn on Your Greet message. | halt }
  if ($readini(chanconfig.ini,$chan,greet) == on) {
    if ($readini(nicks.ini,$nick,pgreet) == on) {
      msg $chan 12[ iSony Greets - $nick  ]] 4 $readini(nicks.ini,$nick,pgreetg) 
      halt 
    } 
  }
  else { Halt }
}