Yet Another Numbers Game

By Flaco22 on Nov 29, 2010

This one is in spanish, my mother language. Paste all in remote and enjoy it.

How it works:

You can gamble on even, odd, or a number between 1 and 10 (included). You get payed 10x your bet if you guess the number, and you get payed x2 if you guess even/odd.

How to run it:

Type !ng <number/impar/par>
Example: !ng 10 50000
Example2: !ng par 50000

Clues:

%ng-max is maxbet
%par is even
%impar is odd

Enjoy and feel free to ask any questions!

on *:text:!ng *:%bot-fun:{
  /set %ng-msg
  if ( ( $$2 !isnum 1-10 ) && ( $$2 != impar ) && ( $$2 != par ) ) {
    /msg %bot-fun Comando equivocado, por favor elija un numero entre 1 y 10, par o impar.
    halt
  }
  if ( $$3 > %ng-max) {
    /msg %bot-fun Disculpa, la apuesta maxima para este juego es de $ %ng-max
    halt
  }
  if ( $$3 < 0 ) {
    /writeini system\ng.ini users $nick $calc( $readini(system\ng.ini, users, $nick ) + $$3 )
    /msg %bot-fun Por tramposo pierdes $$3 Ahora $nick tienes $readini(system\ng.ini, users, $nick )
    halt
  }
  else {
    /writeini system\ng.ini users $nick $calc( $readini(system\ng.ini, users, $nick ) - $$3 )
  }

  set %ng-num $rand(1,10)

  if ( , $+ %ng-num $+ , isin %par ) { /set %ng-msg 0,3 %ng-num - }
  if ( , $+ %ng-num $+ , isin %impar ) { /set %ng-msg 0,4 %ng-num - }

  if ( $$2 == impar ) {
    if ( $calc( %ng-num % 2 ) ) { 
      /ng-msg $nick $calc( $$3 * 2 ) $$3
      halt
    }
    else { 
      /ng-msg $nick 0 $$3
      halt
    }
  }
  if ( $$2 == par ) {
    if ( $calc( %ng-num % 2 ) ) { 
      /ng-msg $nick 0 $$3
      halt
    }
    else { 
      /ng-msg $nick $calc( $$3 * 2 ) $$3
      halt
    }
  }
  if ( $$2 isnum 1-10 ) {
    if ( $$2 == %ng-num ) {
      /ng-msg $nick $calc( $$3 * 10 ) $$3
      halt
    }
    else { 
      /ng-msg $nick 0 $$3
      halt
    }
  }
}

Comments

Sign in to comment.
Flaco22   -  Nov 30, 2010

Add this to your aliases:

/ng-msg {
/writeini system\ng.ini users $$1 $calc( $readini(system\ng.ini, users, $$1 ) + $$2 )
/set %ng-msg $addtok(%ng-msg,Has apostado $ $$3 y has ganado $ $$2 || $$1 tienes $readini(system\ng.ini, users, $$1 ) ||,0)
/msg %bot-fun %ng-msg
}

 Respond  
Dark|   -  Nov 29, 2010

Hmmm, Cool

 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.