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)
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.
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
}