use this script so people can add a description of themselves to your bot, good for chatrooms where people keep trolling and asking what others look like. here is an example of how it works:
.:05:50:32:. -~MichaelA- To set a description, please type !setdesc followed by your description.
.:05:51:08:. (~Michael) !setdesc Tall, skinny, 17, brown hair.
.:05:51:09:. -~MichaelA- Your profile has been set
.:05:51:14:. (~Michael) !desc Michael
.:05:51:15:. (~MichaelA) Description for Michael: Tall, skinny, 17, brown hair.
commands:
!setdesc - set a description for yourself
!desc - view a description of someone
This is my first snippet uploaded, so please comment and tell me what you think :)
-Fixed it as others suggested my moving a bracket-
on *:JOIN:#:{
.timer 1 2 /notice $nick 2To set a description, please type !setdesc followed by your description.
}
ON *:TEXT:!setdesc *:#: {
set $+(%,info,$nick) $2-
notice $nick 2Your profile has been set
}
ON *:TEXT:!desc *:#: {
if ($($+(%,info,$2),2)) {
msg $chan 2Description for $+($2,:) $ifmatch
}
else {
msg $chan 2I have no description set for $2 $+ , if they would like to set one, type it in the room, starting with !setdesc
}
}
it's not working
[14:51] !describe elf-away
[14:51] <sugar^cookie> Description for elf-away: #Auction_Blockops
it shows the channel name?
What can i do to fix it ?
used your last codes Jethro
should be able to put !setdesc in pm and Main...
When people check !describe(nick) shows the room no description.
says saved ...oh, need a !deldesc...HELP !!!! LoL
cupcake, this edit should work both ways:
ON *:TEXT:!desc *:*: {
if ($($+(%,info,$2),2)) {
msg $iif(#,#,$nick) 2Description for $+($2,:) $ifmatch
}
else {
msg $iif(#,#,$nick)2I have no description set for $2 $+ , if they would like to set one, type it in the room, starting with !setdesc
}
}
So should this:
ON *:TEXT:!setdesc *:*: {
set $+(%,info,$nick) $2-
notice $iif(#,#,$nick) 2Your profile has been set
}
@MichaelA you still need to fix ur last else in ur code as others have stated.
you have it as:
ON *:TEXT:!desc *:#: {
if ($($+(%,info,$2),2)) {
msg $chan 2Description for $+($2,:) $ifmatch
}
}
else {
msg $chan 2I have no description set for $2 $+ , if they would like to set one, type it in the room, starting with !setdesc
}
it needs to be:
ON *:TEXT:!desc *:#: {
if ($($+(%,info,$2),2)) {
msg $chan 2Description for $+($2,:) $ifmatch
}
else {
msg $chan 2I have no description set for $2 $+ , if they would like to set one, type it in the room, starting with !setdesc
}
}
if not it wont say the message...
keep at it you will get it down...
thats true too, but this is also the first script i have posted and i dont know that much bout snippets, and what i do know i have learnt from other snippets like fords: translator, imdb and youtube search, urban dictionary and wikipedia snippets :) which are all awesome scripts and i use in my bot xD
lol thank you Napa182, but i was trying to make the script as short as possible, plus i was in a hurry - i was gonna do that later, but i guess you won :D
sasha - the script works like that so i kept it like that. feel free to do what you want to it :P
FordLawnMower - I have been using a couple of your scripts, and i think you are an excellent scripter xD thanks for your comment, i'll add that later on :D
thanks for the comments everyone
You should add a default description to this MichaelA. This way if someone doesn't have a description set it will make them one at random. Like Short, Average, Tall - Fat, athletic, normal, skinny - Beautiful, Good Looking, Average, Ugly, Butt Ugly - Genius, intelligent, average, stupid, dumb as a rock -- etc. This would add a little fun to the script as well as adding motivation to set your description/profile.
If the script set you to A short fat stupid hermaphrodite who loves eating boogers, you would definitely want to take control of your profile.
you should go with hash on this as well add a few checks as well using one on text event....
here it is using hash also added an delete you may want to make it for one channel but w/e
on !*:JOIN:#:{
.timerinfo1 1 2 .notice $nick To set a description, please type !setdesc followed by your description.
.timerinfo2 1 4 .notice $nick To see a description, please type !desc followed by a nick
.timerinfo3 1 6 .notice $nick To delete ur description, please type !deldesc
}
ON $*:TEXT:/^!(\w+)/iS:#: {
if ($regml(1) = setdesc) {
if ($hget(info,$nick)) { .notice $nick You have already added ur info }
else { .hadd -m info $nick $2- | .notice $nick Your profile has been set }
}
if ($regml(1) = desc) {
if ($hget(info,$2)) { .notice $nick Description for $2: $v1 }
else { .msg # I have no description set for $2, if they would like to set one, type it in the room, starting with !setdesc }
}
if ($regml(1) = deldesc) {
if ($hget(info,$nick)) { .hdel info $nick | .notice $nick Your profile has been deleted }
else { .notice $nick Sorry you have no profile to delete. }
}
}
on *:start:{ $infostartup }
on *:connect:{ $infostartup }
on *:exit:{ $infoclose }
on *:disconnect:{ $infoclose }
alias -l infoclose { .hsave info $qt($scriptdirinfo.hsh) }
alias -l infostartup {
if (!$hget(info)) { .hmake info 100 }
elseif ($exists($qt($scriptdirinfo.hsh))) { .hload info $qt($scriptdirinfo.hsh) }
}