All pastes #554952 Raw Edit

Ultimate Greet System - By RuneR

public text v1 · immutable
·published 2007-06-10 09:39 UTC
rendered paste body
on *:LOAD: { write gadmins.txt $address($me,2) }
on *:TEXT:!setgreet*:#: {
  if ($read(greets.txt, s,$address($nick,2))) {
  notice $nick [Greet] You already have a greet of $qt($remove($ifmatch,$address($nick,2))) please delete it first then try again! | halt } 
  if ($read(bgreets.txt, s,$address($nick,2))) {
  notice $nick [Greet] You have been banned from using the greets system $qt($remove($ifmatch,$address($nick,2))) | halt }
  if (!$read(greets.txt, s,$address($nick,2))) {
    write greets.txt $address($nick,2) $replace($2-,$,$chr(36),%,$chr(37))
    notice $nick [Greet] Your greet of $qt($2-) is now saved under your host $qt($address($nick,2))
  }
}
on *:TEXT:!delgreet*:#: {
  if ($read(greets.txt, s,$address($nick,2))) {
    write $+(-ds,$address($nick,2)) greets.txt
  notice $nick [Greet] Your greet of $qt($remove($ifmatch,$address($nick,2))) has been deleten | halt } 
  if ($read(bgreets.txt, s,$address($nick,2))) {
  notice $nick [Greet] You have been banned from using the greets system $qt($remove($ifmatch,$address($nick,2))) | halt }
  if (!$read(greets.txt, s,$address($nick,2))) {
    notice $nick [Greet] You dont have a greet to delete!
  }
}
on *:TEXT:!greet*:#: {
  if ($read(bgreets.txt, s,$address($nick,2))) {
  notice $nick [Greet] You have been banned from using the greets system $qt($remove($ifmatch,$address($nick,2))) | halt }
  if (!$read(bgreets.txt, s,$address($nick,2))) {  
    if ($2 == display) { set %display. [ $+ [ # ] ] $+($iif($3 == on,on),$iif($3 == off,off))
      msg # [Greet] Greets will now be $+($iif($3 == on,Shown),$iif($3 == off,Hidden)) on #
    }
    if ($2 == on) || ($2 == off) {
      set %display. [ $+ [ $nick ] ] $2
      notice $nick [Greet] Your greet will now be $iif($2 == on,Shown,Hidden)
    }
    if ($2 == ban) {
      if (!$read(gadmins.txt, w,$address($nick,2))) { notice $nick [Greet] You arn't a greets admin! | halt }
      if ($read(gadmins.txt, w,$address($nick,2))) {
        write bgreets.txt $address($3,2) $4-
        notice $nick [Greet] Added $3 $qt($address($3,2)) to greets ban list!
      }
    }
    if ($2 == unban) {
      if (!$read(gadmins.txt, w,$address($nick,2))) { notice $nick [Greet] You arn't a greets admin! | halt }
      if ($read(gadmins.txt, w,$address($nick,2))) {
        write $+(-ds,$address($3,2)) bgreets.txt
        notice $nick [Greet] Removed $3 $qt($address($3,2)) from greets ban list!
      }
    }
    if ($2 == addadmin) {
      if (!$read(gadmins.txt, w,$address($nick,2))) { notice $nick [Greet] You arn't a greets admin! | halt }
      if ($read(gadmins.txt, w,$address($nick,2))) {
        write gadmins.txt $address($3,2)
        notice $nick [Greet] $3 $qt($address($3,2)) is now a greet admin!
      }
    }
    if ($2 == deladmin) {
      if (!$read(gadmins.txt, w,$address($nick,2))) { notice $nick [Greet] You arn't a greets admin! | halt }
      if ($read(gadmins.txt, w,$address($nick,2))) {
        write $+(-ds,$address($3,2)) gadmins.txt
        notice $nick [Greet] $3 $qt($address($3,2)) has been removed from greet admins!
      }
    }
  }
}
on *:JOIN:#: {
  if ($read(bgreets.txt, s,$address($nick,2))) { halt }
  if (%display. [ $+ [ # ] ] == on) {
    if (%display. [ $+ [ $nick ] ] == on) || (%display. [ $+ [ $nick ] ] == $null) {
      if ($read(greets.txt, s,$address($nick,2))) {
        msg # $+([,$nick,]) $qt($remove($ifmatch, s,$address($nick,2)))
      }
    }
  }
}