8Ball MD5 Hash - Not random

By Mini on Jul 01, 2009

Actually I didn't saw an 8ball script, not based on random numbers, but on a md5 hash calculation, So I made one and posted it here.

It gives the same message on the same question, but changes every 1000 seconds.

(You can replace the messages ofcourse if you'd like)

on *:text:!8ball*:*: { 
 .msg $chan $iif($1,$ball($1-),Gimme a question ^^)
}

alias ball {
  var %q1 $lower($nick), %q2 $lower($1-), %q3 %q1 $+ %q2
  var %h $regsubex($md5(%q3), /[a-zA-Z]/g, $null)
  var %hash $calc( %h + $left($right($ctime,4),1) )
  var %d 1

  while (%d) {

    var %i $len(%hash)
    var %c 0
    var %t 0

    while (%c < %i) {

      var %t $calc( %t + $left(%hash,1) )
      inc %c
      var %hash $right(%hash,-1)
    }
    var %hash %t
    if (%hash < 11) { unset %d }
  }
  var %h $calc( %hash -1)

 return $replace(%h,1,Could be $+ $chr(44) Could be.,2,In your dreams.,3,Not a chance.,4,Absolutely!,5,Could be $+ $chr(44) Could be.,6,In your dreams.,7,Not a chance.,8,Absolutely!,9,Not a chance.,0,Absolutely!)

}

Comments

Sign in to comment.
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.