Description Script

By MichaelA on Apr 07, 2010

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

Comments

Sign in to comment.
cupcake   -  Dec 10, 2010

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

 Respond  
cupcake   -  Nov 17, 2010

Tested Jethro_ everything works great. Thank you, i need alot of help learning mirc :(

 Respond  
Jethro   -  Nov 17, 2010

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 
}
 Respond  
cupcake   -  Nov 17, 2010

One thing had someone asked if you could place description in pm and when they type desc shows in main ?

 Respond  
MichaelA   -  Apr 10, 2010

thanks :) i have been working on a new one, but i will fix this one up soon :D

 Respond  
napa182   -  Apr 09, 2010

@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...

 Respond  
MichaelA   -  Apr 09, 2010

thanks :)

 Respond  
Jethro   -  Apr 09, 2010

MichaelA, keep up the good work. I know what's like to be new myself. I've been there once upon a time.

 Respond  
MichaelA   -  Apr 08, 2010

thanks :D

 Respond  
FordLawnmower   -  Apr 08, 2010

Thanks MichaelA. I think you are doing fine for your first snippet. You made a working snippet that does exactly what you intended it to do.

 Respond  
MichaelA   -  Apr 08, 2010

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

 Respond  
Jethro   -  Apr 08, 2010

:P you have a point, ford. But roughly speaking, using hash tables is more, say, productive and efficient performance wise.

 Respond  
FordLawnmower   -  Apr 08, 2010

Laughing @ Jethro_'s "family-oriented" comment.
Why would that effect how this script works in a channel.
This script will work just fine for a small community of Satanists too :P

 Respond  
MichaelA   -  Apr 07, 2010

i know :) i designed it to be used on small channels, but i was planning on improving it

 Respond  
Jethro   -  Apr 07, 2010

Your current script is fine if you have a couple of private, family-oriented channels, where you only allow a certain amount of friends and folks to join on a regular basis; and the population doesn't increase. But if you have a big, busy channel, that will be a different story.

 Respond  
MichaelA   -  Apr 07, 2010

lmao fine :P change it if you want, i will in time, but this one has been working for me very well

 Respond  
Jethro   -  Apr 07, 2010

Um huh hash tables are ideal for his script indeed.

 Respond  
napa182   -  Apr 07, 2010

@MichaelA the only thing is if you are going to use a var for this an you end up having a ton of people adding profiles you will fill up ur var list. Also making the script as short as possible kinda makes the script lose its efficiency. ie: no checks no way to delete an so on..

 Respond  
Jethro   -  Apr 07, 2010

Short codes don't always mean better. At least not for the idea and purpose of your script. Your script is recommended to incorporate hash tables to be efficient.

 Respond  
MichaelA   -  Apr 07, 2010

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

 Respond  
Jethro   -  Apr 07, 2010

Nicely done, napa182.

 Respond  
FordLawnmower   -  Apr 07, 2010

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.

 Respond  
napa182   -  Apr 07, 2010

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) } 
}
 Respond  
Sasha   -  Apr 07, 2010

You need to delete one closing bracket above the "Else"..

 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.