Cool Points

By Jeuz on Nov 29, 2005

Something i decided to make after seeing ppl talk about cool points.
This takes your text and scans to see if any of your words match: coolwords(+20 cool points)/gaywords(-20 cool points).
plus..
It is also possible to increase/decrease ppls cool points by using !cool nickname add/minus number or /cool nickname add/minus number.
You can also add/remove coolwords/gaywords by right clicking on a channel and you can turn on/off in menubar...
This is my 1st time using hash tables...
So if there is any bugs or anything you think could be done better please comment and explain why so i can learn more
thanks.
P.S credit to yoinx for helping me get to grips with hash tables

menu menubar {
  - 
  $+(Cool Points Is,$chr(58),$chr(32),$group(#coolpoints).status)
  .$iif($group(#coolpoints).status == on,Turn off,Turn on):$iif($group(#coolpoints).status == on, .disable #coolpoints,.enable #coolpoints) 
  -
}
menu channel {
  -
  Cool Points
  .Gay Words
  ..Add Gay Word:hadd -m coolpoints GAYWORDS $addtok($hget(coolpoints,gaywords),$$?="Add Gay Word(s)",32)
  ..Remove Gay Word:hdel -m coolpoints GAYWORDS $remtok($hget(coolpoints,gaywords),$$?="Add Gay Word(s)",1,32)
  ..-
  ..Show Current Gay Words: echo -a 14Current 4Gay Words14 Are: $+(4,,$hget(coolpoints,gaywords))
  .Cool Words
  ..Add Cool Word:hadd -m coolpoints COOLWORDS $addtok($hget(coolpoints,coolwords),$$?="Add Cool Word(s)",32)
  ..Remove Cool Word:hdel -m coolpoints COOLWORDS $remtok($hget(coolpoints,coolwords),$$?="Add Cool Word(s)",1,32)
  ..-
  ..Show Current Cool Words: echo -a 14Current 4Cool Words14 Are: $+(4,,$hget(coolpoints,coolwords))
  -
}
on *:start: {
  if ($exists(coolpoints.hsh) == $true) {
    echo -a 4C14ool 4P14oints Created By 4Jeuz
    echo -a 14Type 4/chelp14 For Help 
    echo -a 14Get Users To Type 4!chelp14 For Help
    echo -a 14Right Click On 4Channel14 To Add And Remove 4Gay words14/4Cool Words
    echo -a 14Any Problems Contact Me At:12 Pete@Jeuz.org
    enable #coolpoints
    hmake -m coolpoints
    hload coolpoints coolpoints.hsh 
  }
  elseif ($exists(coolpoints.hsh) == $false) {
    echo -a 4C14ool 4P14oints Created By 4Jeuz
    echo -a 14Type 4/chelp14 For Help 
    echo -a 14Get Users To Type 4!chelp14 For Help
    echo -a 14Right Click On 4Channel14 To Add And Remove 4Gay words14/4Cool Words
    echo -a 14Any Problems Contact Me At:12 Pete@Jeuz.org
    enable #coolpoints 
    hmake -m coolpoints
    hadd coolpoints GAYWORDS nigger bitch whore cunt fag  
    hadd coolpoints COOLWORDS hi love ilu mIRC hawkee 
  }
}
on *:unload: {
  hsave -o coolpoints coolpoints.hsh
  hfree coolpoints
}
on *:exit: {
  hsave -o coolpoints coolpoints.hsh
  hfree coolpoints
} 
#coolpoints on
on *:text:*:#: {
  tokenize 32 $strip($1-,burc) 
  if (!$hget(coolpoints,$nick)) {
    hadd -m coolpoints $nick 100 
  }
  elseif ($1 == !chelp) {
    .notice $nick 14Type 4!cool <14nickname4>14 To View Nicknames Cool Points
    .notice $nick 14Type 4!cool <14nickname4> <14Add4> <14number4> 14To Give Nickname Number Of Cool Points
    .notice $nick 14Type 4!cool <14nickname4> <14Minus4> <14number4> 14To Deduct Nickname Number Of Cool Points
  }  
  elseif ($1 != !cool) {
    var %x = 1
    while (%x <= $0) {
      if ($istok($hget(coolpoints,gaywords),$($+($,%x),2),32)) {
        hdec -m coolpoints $nick 20
      }
      elseif ($istok($hget(coolpoints,coolwords),$($+($,%x),2),32)) {
        hinc -m coolpoints $nick 20
      }
      inc %x
    }
  }
  elseif ($1 == !cool) && (!$2) {
    msg # 4INVALID PARAMETERS PLEASE STATE A NICKNAME
  }
  elseif ($1 == !cool)  && ($hget(coolpoints,$2)) && (!$3) {
    msg # $+(4,$2) 14has $+(4,0,$hget(coolpoints,$2)) 4C14ool 4P14oints
  }
  elseif ($1 == !cool) && (!$hget(coolpoints,$2)) && (!$3) {
    msg # $+(4,$2) 14is not on my 4C14ool 4P14oints list
  }
  elseif ($1 == !cool) && ($3) && (!$4) {
    msg # 4INVALID PARAMETERS PLEASE STATE AN AMOUNT
  }
  elseif ($1 == !cool) && ($2 == $nick) {
    msg # 4YOU CANNOT ALTER YOUR OWN COOL POINTS!!
  }
  elseif ($1 == !cool) && ($3 == add) && ($4 isnum) {
    hinc -m coolpoints $2 $4
    msg # $+(4,$nick) 14gave4 $2 $4 14coolpoints
  }
  elseif ($1 == !cool) &&  ($3 == minus) && ($4 isnum) {
    hdec -m coolpoints $2 $4
    msg # $+(4,$nick) 14removed4 $4 14coolpoints from4 $2
  }
}
on *:input:*: {
  tokenize 32 $strip($1-,burc)  
  if ($1 != !cool) {
    var %x = 1
    while (%x <= $0) {
      if ($istok($hget(coolpoints,gaywords),$($+($,%x),2),32)) {
        hdec -m coolpoints $me 20
      }
      elseif ($istok($hget(coolpoints,coolwords),$($+($,%x),2),32)) {
        hinc -m coolpoints $me 20
      }
      inc %x
    }
  }
}

alias cool {
  if (!$1) {
    echo -a 4INVALID PARAMETERS PLEASE STATE A NICKNAME
  }
  elseif ($hget(coolpoints,$1)) && (!$2) {
    msg # $+(4,$1) 14has $+(4,,$hget(coolpoints,$1)) 4C14ool 4P14oints
  }
  elseif (!$hget(coolpoints,$1)) && (!$2) {
    echo -a $+(4,$1) 14is not on my 4C14ool 4P14oints list
  }
  elseif ($2) && (!$3) {
    echo -a 4INVALID PARAMETERS PLEASE STATE AN AMOUNT
  }
  elseif ($1 == $me) {
    echo -a 4YOU CANNOT ALTER YOUR OWN COOL POINTS!!
  }
  elseif ($2 == add) && ($3 isnum) {
    hinc -m coolpoints $1 $3
    msg # $+(4,$me) 14gave4 $1 $3 14coolpoints
  }
  elseif ($2 == minus) && ($3 isnum) {
    hdec -m coolpoints $1 $3
    msg # $+(4,$me) 14removed4 $3 14coolpoints from4 $1
  }
}
alias chelp {
  echo -a 14Type 4/cool <14nickname4>14 To View Nicknames Cool Points
  echo -a 14Type 4/cool <14nickname4> <14Add4> <14number4> 14To Give Nickname Number Of Cool Points
  echo -a 14Type 4/cool <14nickname4> <14Minus4> <14number4> 14To Deduct Nickname Number Of Cool Points
}

Comments

Sign in to comment.
thomgarcia   -  Sep 30, 2007

WOW !! Thats good, but how about if i want every time i type the gaypoints and coolpoints it will decrease 10 points.. sample i have 100 coolpoints , then when i type 1 word in the coolpoints it becomes 90 points.. Please tell me the code.

 Respond  
BrainBryce   -  Apr 14, 2007

Yeh same

 Respond  
globus   -  Feb 27, 2006

its only showing cool point
but not gay points

 Respond  
Jeuz   -  Nov 29, 2005

yeah it is basically useless i just wanted something to learn hash tables with..

 Respond  
`Kazuma   -  Nov 29, 2005

Kinda useless but still good.

 Respond  
Jeuz   -  Nov 29, 2005

fixed hload errors

 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.