AllInOne Game(s)

By Purcell on Dec 20, 2008

I maked a AllInOne Snippet.

I Hope u like it!

For the Commands: .commands

Credits:
Made by: Purcell
Special Thanks to: [DX] For help with the Slto Machine!

Thanks

on *:load:{
  .write AllInOne.txt 0
}

on *:connect:{ 
  var %x 1 
  var %y $read(AllInOne.txt,0) 
  while %x <= %y { 
    hload -si $gettok($read(AllInOne.txt,%x),1,32) AllInOne.ini $gettok($read(AllInOne.txt,%x),1,32) 
    inc %x 
  } 
} 

on *:text:.register*:#AllInOne:{
  if !$2 || $2 !isalnum || $3 !isalnum {
    .notice $nick 14 Say: 4 .register $nick
  }
  if $gettok($read(AllInOne.txt,w,$2),2,32) !== $null {
    .msg # 4 That name has been taken!
    halt
  }
  else { 
    hmake $nick
    hadd $nick name $2
    hadd $nick cash 750
    hsave -i $nick AllInOne.ini $hget($nick,name)
    write -l1 AllInOne.txt $calc($read(AllInOne.txt,-1) + 1)
    write AllInOne.txt $nick $2
    .msg # 14 Welcome to AllInOne, 4 $2 $+($chr(40),$nick,$chr(41))
    .msg # 14 Created by 4 Purcell!
    stats
  }
}

on *:text:.mug:#AllInOne:{
  if !$hget($nick) {
    .notice $nick 14 Say: 4 .register $nick
    halt
  }
  else {
    if !$hfind($nick,mugging) {
      var %x $rand(100,300)
      var %cash $calc($hget($nick,cash) + %x)
      hadd $nick cash %cash
      hadd -z $nick mugging 60
      .msg # 14 Yea! 4 $hget($nick,name) 14 has 4 $+($chr(36),$bytes(%x,b),.) 14 stolen! 
      .notice $nick 14 Total Cash: 4 $+($chr(36),$bytes($hget($nick,cash),b))
    }
    else {
      .notice $nick 5 Waiting Time:
      .notice $nick 14 Mugging: 5 $+($duration($hget($nick,mugging),3),.) | halt
    }
  }
}

on *:TEXT:.slot*:#AllInOne:{
  if !$hget($nick) {
    .notice $nick 14 Say: 4 .register $nick | halt
  }
  if ($1- == .slot) { /notice $nick 14 Say: 4 .slot 5 <money>
  }
  else {
    if $2 isnum {
      if $hget($nick,cash) >= $2 {
        hadd $nick cash $calc($hget($nick,cash) - $2)
        var %1 = $rand(1,9)
        var %2 = $rand(1,9)
        var %3 = $rand(1,9)
        msg $chan 1,14 $getSign(%1) -- $getSign(%2) -- $getSign(%3)
        if (%1 == %2) && (%1 == %3) { /msg $chan 4 $nick 14 has won 5 $calc($2 * 5)) | hadd $nick cash $calc($hget($nick,cash) + ($2 * 5)) 
          if (%1 == %2) || (%2 == %3) { /msg $chan 4 $nick 14 has won 5 $calc($2 * 3)) | hadd $nick cash $calc($hget($nick,cash) + ($2 * 3))
          }
        }
      }    
    }
  }  
}

alias -l getSign {
  if ($1 == 1) { return apple }
  if ($1 == 2) { return banana }
  if ($1 == 3) { return cherie }
  if ($1 == 4) { return coin }
  if ($1 == 5) { return circle }
  if ($1 == 6) { return triangle }
  if ($1 == 7) { return 1 }
  if ($1 == 8) { return 2 }
  if ($1 == 9) { return 3 }
} }

on *:text:.stats:#AllInOne:{
  if !$hget($nick) {
    .notice $nick 14 Say: 4 .register $nick
    halt
  }
  else {
    stats
  }
}

alias stats {
  .notice $nick 4 [ 14 Cash: 4 $+($chr(36),$bytes($hget($nick,cash),b),])
} }

on *:TEXT:.NumberGame*:#allinone:{ inc %scriptcount |
  if ($1- == .NumberGame) { /notice $nick 14 Say: 4 .NumberGame 5 <Number> <Bet>
  }
  else {
    if !$hget($nick) {
      .notice $nick 14 Say: 4 .register $nick
      halt
    }
    else {
      if (($2 > 0) && ($2 <= 10)) {
        /set %number [ $+ [ $chan ] ] $rand(1,10)
        if $hget($nick,cash) >= $3 {
          hadd $nick cash $calc($hget($nick,cash) - $3)
          if ($2 == %number [ $+ [ $chan ] ]) { 
            var %cash $calc($3 * 7)
            hadd $nick cash $calc($hget($nick,cash) + %cash)
            /msg # 14 The number was 5 $2 $+ . 4 $nick 14 has won: 4 $ $+ %cash | unset %number [ $+ [ $chan ] ]
          }
          else {
            if ($2 < %number [ $+ [ $chan ] ]) || ($2 > %number [ $+ [ $chan ] ]) {
            /msg # 4 $nick, 14 The number was 5 %number#AllInOne  $+ . 4 You Lose! | unset %number [ $+ [ $chan ] ] }
          }
          else { /notice $nick 14 You don't got: 5 $ $+ $3 !
          }
        }
      }
    } 
  }  
}

on *:TEXT:.roulette*:#AllInOne:{
  if ($1- == .roulette) { /notice $nick 14 Say: 4 .roulette <Number> <Bet> | halt
  }
  else {
    if !$hget($nick) {
      .notice $nick 14 Say: 4 .register $nick
      halt
    }
    else {
      if (($2 > 0) && ($2 <= 35)) {
        /set %roulette [ $+ [ $chan ] ] $rand(1,36)
        if $hget($nick,cash) >= $3 {
          hadd $nick cash $calc($hget($nick,cash) - $3)
          if ($2 == %roulette [ $+ [ $chan ] ]) { 
            var %cashe $calc($3 * 35)
            hadd $nick cash $calc($hget($nick,cash) + %cashe)
            /msg # 14 The number was 5 $2 $+ . 4 $nick 14 has won: 4 $ $+ %cashe 14 | unset %roulette [ $+ [ $chan ] ]
          } 
          else {
            if ($2 < %roulette [ $+ [ $chan ] ]) || ($2 > %roulette [ $+ [ $chan ] ]) {
            /notice $nick 14 The number was 5 %roulette#AllInOne  $+ . 4 You Lose! | unset %roulette [ $+ [ $chan ] ] }
          }
          else { /notice $nick 14 You don't got: 5 $ $+ $3 !
          }
        }
      }
    }
  }
}

on *:TEXT:.help:#AllInOne:{
  /notice $nick 14 Say: 4 .help 5 NumberGame 14 or 4 .help 5 Roulette
} }

on *:TEXT:.help NumberGame:#AllInOne:{
  /notice $nick 5,5....................1,5NumberGame5,5....................
  /notice $nick 14 - You choose a number of 1 to 10. Then you an amount. If you have guessed the good number, recover you uses itself 7x. Differently is you yourself money lost.
  /notice $nick 14 Say: 4 .NumberGame 5 <number> <Bet>
} }

on *:TEXT:.help Roulette:#AllInOne:{
  /notice $nick 5,5....................1,5Roulette5,5....................
  /notice $nick 14 - You choose a number of 1 to 35.
  /notice $nick 14 Say: 4 .roulette 5 <Number> <Bet>
} }

on *:TEXT:.commands:#AllInOne:{
  /notice $nick 5 .Help
  /notice $nick 5 .Mug
  /notice $nick 5 .Stats
} }

Comments

Sign in to comment.
Purcell   -  Dec 21, 2008

I let it so ;)

Players can change it too.

 Respond  
pwnisher3   -  Dec 21, 2008

i did try it when i removed it all

 Respond  
Purcell   -  Dec 21, 2008

Try it then, here it wont work!

 Respond  
pwnisher3   -  Dec 21, 2008

lol i'm 15. and the # stands for all channels instead of just one. so does $chan.

 Respond  
Purcell   -  Dec 21, 2008

pwnisher3, U need a channel there, so it don't works.

I know my english suckx! I'm only 13 years old, and I'm trying to make snippets. And set them in English.

Thanks

 Respond  
pwnisher3   -  Dec 20, 2008

ok try this.

on *:load:{
  .write AllInOne.txt 0
}

on *:connect:{ 
  var %x 1 
  var %y $read(AllInOne.txt,0) 
  while %x <= %y { 
    hload -si $gettok($read(AllInOne.txt,%x),1,32) AllInOne.ini $gettok($read(AllInOne.txt,%x),1,32) 
    inc %x 
  } 
} 

on *:text:.register*:#:{
  if !$2 || $2 !isalnum || $3 !isalnum {
    .notice $nick 14 Say: 4 .register $nick
  }
  if $gettok($read(AllInOne.txt,w,$2),2,32) !== $null {
    .msg # 4 That name has been taken!
    halt
  }
  else { 
    hmake $nick
    hadd $nick name $2
    hadd $nick cash 750
    hsave -i $nick AllInOne.ini $hget($nick,name)
    write -l1 AllInOne.txt $calc($read(AllInOne.txt,-1) + 1)
    write AllInOne.txt $nick $2
    .msg # 14 Welcome to  $+ $chan $+ , 4 $2 $+($chr(40),$nick,$chr(41))
    .msg # 14 Created by 4 Purcell!
    stats
  }
}

on *:text:.mug:#:{
  if !$hget($nick) {
    .notice $nick 14 Say: 4 .register $nick
    halt
  }
  else {
    if !$hfind($nick,mugging) {
      var %x $rand(100,300)
      var %cash $calc($hget($nick,cash) + %x)
      hadd $nick cash %cash
      hadd -z $nick mugging 60
      .msg # 14 Yea! 4 $hget($nick,name) 14 has 4 $+($chr(36),$bytes(%x,b),.) 14 stolen! 
      .notice $nick 14 Total Cash: 4 $+($chr(36),$bytes($hget($nick,cash),b))
    }
    else {
      .notice $nick 5 Waiting Time:
      .notice $nick 14 Mugging: 5 $+($duration($hget($nick,mugging),3),.) | halt
    }
  }
}

on *:TEXT:.slot*:#:{
  if !$hget($nick) {
    .notice $nick 14 Say: 4 .register $nick | halt
  }
  if ($1- == .slot) { notice $nick 14 Say: 4 .slot 5 <money>
  }
  else {
    if $2 isnum {
      if $hget($nick,cash) >= $2 {
        hadd $nick cash $calc($hget($nick,cash) - $2)
        var %1 = $rand(1,9)
        var %2 = $rand(1,9)
        var %3 = $rand(1,9)
        msg $chan 1,14 $getSign(%1) -- $getSign(%2) -- $getSign(%3)
        if (%1 == %2) && (%1 == %3) { msg $chan 4 $nick 14 has won 5 $calc($2 * 5)) | hadd $nick cash $calc($hget($nick,cash) + ($2 * 5)) 
          if (%1 == %2) || (%2 == %3) { msg $chan 4 $nick 14 has won 5 $calc($2 * 3)) | hadd $nick cash $calc($hget($nick,cash) + ($2 * 3))
          }
        }
      }    
    }
  }  
}

alias -l getSign {
  if ($1 == 1) { return apple }
  if ($1 == 2) { return banana }
  if ($1 == 3) { return cherie }
  if ($1 == 4) { return coin }
  if ($1 == 5) { return circle }
  if ($1 == 6) { return triangle }
  if ($1 == 7) { return 1 }
  if ($1 == 8) { return 2 }
  if ($1 == 9) { return 3 }
} }

on *:text:.stats:#:{
  if !$hget($nick) {
    .notice $nick 14 Say: 4 .register $nick
    halt
  }
  else {
    stats
  }
}

alias stats {
  .notice $nick 4 [ 14 Cash: 4 $+($chr(36),$bytes($hget($nick,cash),b),])
} }

on *:TEXT:.NumberGame*:#:{ inc %scriptcount |
  if ($1- == .NumberGame) { notice $nick 14 Say: 4 .NumberGame 5 <Number> <Bet>
  }
  else {
    if !$hget($nick) {
      .notice $nick 14 Say: 4 .register $nick
      halt
    }
    else {
      if (($2 > 0) && ($2 <= 10)) {
        set %number [ $+ [ $chan ] ] $rand(1,10)
        if $hget($nick,cash) >= $3 {
          hadd $nick cash $calc($hget($nick,cash) - $3)
          if ($2 == %number [ $+ [ $chan ] ]) { 
            var %cash $calc($3 * 7)
            hadd $nick cash $calc($hget($nick,cash) + %cash)
            msg # 14 The number was 5 $2 $+ . 4 $nick 14 has won: 4 $ $+ %cash | unset %number [ $+ [ $chan ] ]
          }
          else {
            if ($2 < %number [ $+ [ $chan ] ]) || ($2 > %number [ $+ [ $chan ] ]) {
            msg # 4 $nick, 14 The number was 5 %number#  $+ . 4 You Lose! | unset %number [ $+ [ $chan ] ] }
          }
          else { notice $nick 14 You don't got: 5 $ $+ $3 !
          }
        }
      }
    } 
  }  
}

on *:TEXT:.roulette*:#:{
  if ($1- == .roulette) { notice $nick 14 Say: 4 .roulette <Number> <Bet> | halt
  }
  else {
    if !$hget($nick) {
      .notice $nick 14 Say: 4 .register $nick
      halt
    }
    else {
      if (($2 > 0) && ($2 <= 35)) {
        set %roulette [ $+ [ $chan ] ] $rand(1,36)
        if $hget($nick,cash) >= $3 {
          hadd $nick cash $calc($hget($nick,cash) - $3)
          if ($2 == %roulette [ $+ [ $chan ] ]) { 
            var %cashe $calc($3 * 35)
            hadd $nick cash $calc($hget($nick,cash) + %cashe)
            msg # 14 The number was 5 $2 $+ . 4 $nick 14 has won: 4 $ $+ %cashe 14 | unset %roulette [ $+ [ $chan ] ]
          } 
          else {
            if ($2 < %roulette [ $+ [ $chan ] ]) || ($2 > %roulette [ $+ [ $chan ] ]) {
            notice $nick 14 The number was 5 %roulette#  $+ . 4 You Lose! | unset %roulette [ $+ [ $chan ] ] }
          }
          else { notice $nick 14 You don't got: 5 $ $+ $3 !
          }
        }
      }
    }
  }
}

on *:TEXT:.help:#:{
  notice $nick 14 Say: 4 .help 5 NumberGame 14 or 4 .help 5 Roulette
} }

on *:TEXT:.help NumberGame:#:{
  notice $nick 5,5....................1,5NumberGame5,5....................
  notice $nick 14 - You choose a number of 1 to 10. Then you an amount. If you have guessed the good number, recover you uses itself 7x. Differently is you yourself money lost.
  notice $nick 14 Say: 4 .NumberGame 5 <number> <Bet>
} }

on *:TEXT:.help Roulette:#:{
  notice $nick 5,5....................1,5Roulette5,5....................
  notice $nick 14 - You choose a number of 1 to 35.
  notice $nick 14 Say: 4 .roulette 5 <Number> <Bet>
} }

on *:TEXT:.commands:#:{
  notice $nick 5 .Help
  notice $nick 5 .Mug
  notice $nick 5 .Stats
} }
 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.