Auto-Greet System v2.0

By Delyrios on May 07, 2007

The script is pretty straight forward. It has an on/off command, as well as a greet modification command, and of course a delete. In order for the on/off to work you need to either set yourself as level 100 for your bot OR make it so that anyone can turn it on or off. Also, all the info saves to two txt files to keep your variables as clean as possible.

To run it, type "^greet on" to set the script as on and then go ahead and make a greet...and when you come back it will display your greet in the following format. Note: this will run in ALL rooms your bot is in.

[Auto-Greet] (persons name) (greet)

Simple List of Commands (try each command by itself for more info):
^greet (on or off) - turns the system on or off.
^addgreet [insert greet here] - creates the greet.
^delgreet - deletes the greet.
^modgreet [new greet here] - allows modification of a greet.
^adddeny [nickname here] - adds deny for a nickname.
^deldeny [nickname here] - deletes deny for a nickname.
^gcount - lists the number of saved greets.

UPDATES:

  • on initial load of script...it checks to make sure the required txt files are created, and prompts you to set a nickname (NOT THE NAME OF THE BOT) as level 100, or owner.

  • Greet Deny. It allows addition and deletion of names to a list which ignores the commands of the person, instead giving them an error message. (this was added to punish people who abuse the script)
on *:LOAD: {
  if (%initial == $null) { /auser 100 $$?="Initial Setup. Type the nickname that is to control this bot feature. (IE: Gravy would control this bot)." | set %initial RUN | halt }
  elseif (%initial == RUN) { halt }
  if ($exists(greet.txt) == $false) { 
    if ($exists(greetg.txt) == $false) {
      if ($exists(greetdeny.txt) == $false) { /write greet.txt | /echo # 12[Auto-Greet] 5Missing file 6"greet.txt"5 was created 3SUCCESSFULLY! | /write greetg.txt | /echo # 12[Auto-Greet] 5Missing file 6"greetg.txt"5 was created 3SUCCESSFULLY! | /write greetdeny.txt | /echo # 12[Auto-Greet] 5Missing file 6"greetdeny.txt"5 was created 3SUCCESSFULLY! }
    }
  }
}

on *:JOIN:#: { set %greetn $read(scripts/text/greet.txt,w,$nick) | set %greetg $read(scripts/text/greetg.txt,s,%greetn)
  if (%greet == on) && ($nick == %greetn) { /msg # 5[Auto-Greet] 4 %greetn 6 %greetg | unset %greetn | unset %greetg | halt }  
  elseif (%greet == on) && ($nick != %greetn) { unset %greetn | unset %greetg | halt }
  elseif (%greet == off) { unset %greetn | unset %greetg | halt }
  halt
}

on 100:TEXT:^greet*:#: {
  if (%greet == off) && ($2 == on) { set %greet on | .msg # 12[Auto-Greet]5 $nick 6has turned my Auto-Greet Systems4 ON6. | halt }
  elseif (%greet == on) && ($2 == on) { .msg # 4ERROR: My Auto-Greet Systems are already set to ON $+ . | halt }
  elseif (%greet == on) && ($2 == off) { set %greet off | .msg # 12[Auto-Greet]5 $nick 6has turned my Auto-Greet Systems4 OFF6. | halt }
  elseif (%greet == off) && ($2 == off) { .msg # 4ERROR: My Auto-Greet Systems are already set to OFF $+ . | halt }
  halt 
}
on 100:TEXT:^adddeny*:#: { set %dnick $2 | set %deny $read(scripts/text/greetdeny.txt,w,%dnick)
  if (%greet == on) && (%deny == %dnick) { .notice $nick 12[Auto-Greet] 4ERROR: %deny is already in the Deny List. | unset %deny | unset %dnick | halt }
  elseif (%greet == on) && (%dnick != deny) { write scripts/text/greetdeny.txt %dnick | .notice $nick 12[Auto-Greet] 5 %dnick was added to the 6Deny List5. | unset %deny | unset %dnick | halt }
  elseif (%greet == off) { .notice $nick 12[Auto-Greet] 4ERROR: My Auto-Greet Systems are currently set to OFF $+ . Turn them on and try again. | unset %deny | unset %dnick | halt }
}

on 100:TEXT:^deldeny*:#: { set %dnick $2 | set %deny $read(scripts/text/greetdeny.txt,s,%dnick)
  if (%greet == on) && (%deny == %dnick) { write -ds %dnick scripts/text/greetdeny.txt | .notice $nick 12[Auto-Greet] 5 %dnick was removed from the 6Deny List5. | unset %deny | unset %dnick | halt }
  elseif (%greet == on) && (%deny != %dnick) { .notice $nick 12[Auto-Greet] 4ERROR: %dnick is not in the Deny List. | unset %deny | unset %dnick | halt }
  elseif (%greet == off) { .notice $nick 12[Auto-Greet] 4ERROR: My Auto-Greet Systems are currently set to OFF $+ . Turn them on and try again. | unset %deny | unset %dnick | halt }
}

on *:TEXT:^delgreet*:#: { set %greetn $read(scripts/text/greet.txt,w,$nick) | set %deny $read(scripts/text/greetdeny.txt,w,$nick)
  if (%greet == on) && (%deny == $nick) { .notice $nick 4ERROR: You are currently listed on the "Deny List". You cannot add/delete/modify a greet because of this. | unset %deny | unset %greetn | halt }  
  elseif (%greet == on) && (%greetn != $nick) && (%deny != $nick) { .notice $nick  4ERROR: You have already removed your personal greet. | unset %deny | unset %greetn | halt }
  elseif (%greet == on) && (%greetn == $nick) && (%deny != $nick) { write -ds $nick scripts/text/greet.txt | write -ds $nick scripts/text/greetg.txt | /notice $nick 5 $nick $+ , you have removed your greet from the archive. | unset %deny | unset %greetn | halt }
  elseif (%greet == off) { .msg # 4ERROR: My Auto-Greet Systems are currently set to OFF $+ . Please ask an admin to turn them on. | unset %deny | halt }
  halt
  )
}
on *:TEXT:^addgreet*:#: { set %greetn $read(scripts/text/greet.txt,w,$nick) | set %deny $read(scripts/text/greetdeny.txt,w,$nick)
  if (%greet == on) && (%deny == $nick) { .notice $nick 4ERROR: You are currently listed on the "Deny List". You cannot add/delete/modify a greet because of this. | unset %deny | unset %greetn | unset greetg | halt }
  elseif (%greet == on) && (%deny != $nick) && ($2 == $null) { .notice $nick 4ERROR: You did not enter a msg to be added for your personal greet. Try again in this format. ^addgreet "Message Here". | unset %deny | unset %greetn | unset greetg  | halt }
  elseif (%greet == on) && (%deny != $nick) &&  ($nick == %greetn) { .notice $nick  4ERROR: You have already set a personal greet. | unset %deny | unset %greetn | halt }
  elseif (%greet == on) && (%deny != $nick) &&  (%greetn == $null) { write scripts/text/greet.txt $nick | write scripts/text/greetg.txt $nick $2- | .notice $nick 5 $nick $+ , you have added the greet, 6" $+ $2- $+ 5", to the archive. | unset %deny | unset %greetn | unset greetg  | halt }
  elseif (%greet == off) { .msg # 4ERROR: My Auto-Greet Systems are currently set to OFF $+ . Please ask an admin to turn them on. | unset %greetn | halt }
  halt
}
on *:TEXT:^modgreet*:#: { set %deny $read(scripts/text/greetdeny.txt,w,$nick) | set %greetn $read(scripts/text/greet.txt,w,$nick) | set %greetg $read(scripts/text/greetg.txt,s,%greetn) 
  if (%greet == on) && (%deny == $nick) { .notice $nick 4ERROR: You are currently listed on the "Deny List". You cannot add/delete/modify a greet because of this. | unset %deny | unset %greetn | halt }
  elseif (%greet == on) && (%deny != $nick) && ($2 == $null) && (%greetn == $nick) { .notice $nick 5[Current Greet] 6" $+ %greetg $+ " 5-- To change it, type ^modgreet <new greet here> | unset %greetn | unset %greetg | halt }
  elseif (%greet == on) && (%deny != $nick) && (%greetn != $nick) { /notice $nick  4ERROR: You have no personal greet to modify. Make one using ^addgreet <message here> | unset %greetn | unset %greetg | halt }
  elseif (%greet == on) && (%deny != $nick) && (%greetn == $nick) { write -ds $nick scripts/text/greet.txt | write -ds $nick scripts/text/greetg.txt | unset %greetn | unset %greetg {
      set %greetn $read(scripts/text/greet.txt,w,$nick) | set %greetg $read(scripts/text/greetg.txt,s,%greetn)
    if (%greet == on) && (%green != $nick) write scripts/text/greet.txt $nick | write scripts/text/greetg.txt $nick $2- | /notice $nick 5 $nick 6, you have modified your greet to the following, " $+ $2- $+ ". | unset %greetn | unset %greetg | halt }
    halt
    ) 
  }
  elseif (%greet == off) { .msg # 4ERROR: My Auto-Greet Systems are currently set to OFF $+ . Please ask an admin to turn them on. | halt }
}
on *:TEXT:^gcount*:#: {
  if (%greet == on) && ($2 == $null) { .msg # 12[Auto-Greet]5 I have6 $lines(scripts/text/greet.txt) 5greets currently saved. | halt }
  elseif (%greet == on) && ($2 != $null) { halt }
  elseif (%greet == off) && ($2 == $null) { .notice $nick 4ERROR: My Auto-Greet Systems are currently set to OFF $+ . Please ask an admin to turn them on. | halt }
  halt
} 

Comments

Sign in to comment.
VolCanO   -  Jun 26, 2016

I just wanted to know how to set my level to 100 or as Owner pff

 Respond  
AHBARAR   -  Jun 03, 2007

Yeah nice Addon man its so good and effective keep the good work >:D

 Respond  
m4g3script   -  Jun 02, 2007

its awesome =p

 Respond  
kerstt   -  May 08, 2007

looks nice

:thumbsup:

 Respond  
BackoffJackson   -  May 07, 2007

Simple in commands, but effective.

 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.