Top

8Ball MD5 Hash - Not random


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Jul 01, 2009
Last Updated  Jul 02, 2009
Tags  8ball  calculation  hash  md5 

Introduction

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)

Grab the Code

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

  (0)  RSS

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom