mIRC Home    About    Download    Register    News    Help

Print Thread
#141927 14/02/06 04:03 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
I have no clue if this will work,
I just spent too much time with it already...
While doing it I forgot to add brackets...
Will somebody please patch this up...
Code:
on *:TEXT:!blackjack:#:{
  set %blackjacker $nick
  set %card1 $rand(1,13) | set %card2 $rand(1,13)
  .msg $chan %blackjacker drew cards %card1 , %card2 , %card3
  .msg $chan %blackjacker has a card total of $calc( %card1 + %card2 )
  set %card.total $calc( %card1 + %card2 )
  .msg $chan %blackjacker, would you like to hit or stand?
on *:TEXT:hit:#:if ($nick == %blackjacker) set %card3 $rand(1,13)
  .msg $chan %blackjacker hit and got %card3
  .msg $chan %blackjacker has a card total of $calc( %card.total + %card3 )
  set %card.total $calc( %card.total + %card3 )
  if (%card.total > 21) .msg $chan %blackjacker has BUSTED!  game over...
  else .msg chan %blackjacker has a card total of %card.total
  .msg $chan %blackjacker, would you like to hit again or stand? 
on *:TEXT:hit again:#:if ($nick == %blackjacker) set %card4 $rand(1,13)
  .msg $chan %blackjacker hit and got %card4
  .msg $chan %blackjacker has a card total of $calc( %card.total + %card4 )
  set %cardtotal $calc( %card.total + %card4)
  if (%cardtotal > 21) .msg $chan %blackjacker has BUSTED!  game over...
  else .msg chan %blackjacker has a card total of $calc( %card.total + %card3 )
on *:TEXT:stand:#:if ($nick == %blackjacker) .msg $chan %blackjacker has stood..
  .msg $chan Dealer is up..
  set %dealer1 $rand(1,13) | set %dealer2 $rand(1,13)
  .msg $chan Dealer drew cards %dealer1 , %dealer2
  .msg $chan Dealer has a card total of $calc( %dealer1 + %dealer2 )
  set %dealer.total $calc( %dealer1 + %dealer2 )
  if (%dealer.total > 21) .msg $chan Dealer busts, %blackjacker Wins!
  else set %dealer3 $rand(1,13)
  .msg $chan dealer draws %dealer3
  .msg $chan dealer has a card total of $calc( %dealer.total + %dealer3 )
  set %dealer.total $calc( %dealer.total + %dealer3 )
  if (%dealer.total > 21) .msg $chan Dealer busts, %blackjacker Wins!
  else set %dealer4 $rand(1,13)
  .msg $chan dealer draws %dealer4
  .msg $chan dealer has a card total of $calc( %dealer.total + %dealer4 )
  if (%dealer.total > 21) .msg $chan Dealer busts, %blackjacker Wins!
  else set %dealer5 $rand(1,13)
  .msg $chan dealer draws %dealer5
  .msg $chan dealer has a card total of $calc( %dealer.total + %dealer5 )
  if (%dealer.total > 21) .msg $chan Dealer busts, %blackjacker Wins!

And also I would like to make the 11 to apear J(for jack), 12 to be Q, 13 to be K...

Last edited by blk; 14/02/06 04:09 AM.

-blk-
#141928 14/02/06 05:34 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You should really read up on how to use { } brackets, type /help aliases and scroll down to The { } brackets.

#141929 14/02/06 05:39 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
I know how, im just lazy


-blk-
#141930 14/02/06 05:40 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
So you know how to fix your own script but you want us to do it for you?

#141931 14/02/06 05:56 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
exactly :tongue:


-blk-
#141932 14/02/06 05:57 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You've got be kidding me. confused

#141933 14/02/06 06:05 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
Code:
on *:TEXT:!blackjack:#:{
  set %blackjacker $nick
  set %card1 $rand(1,13) 
  set %card2 $rand(1,13)
  .msg $chan %blackjacker drew cards %card1 , %card2 , %card3
  .msg $chan %blackjacker has a card total of $calc(%card1 + %card2)
  set %card.total $calc(%card1 + %card2)
  .msg $chan %blackjacker, would you like to hit or stand?
}
on *:TEXT:hit:#:{
  if ($nick == %blackjacker) {
    set %card3 $rand(1,13)
    .msg $chan %blackjacker hit and got %card3
    .msg $chan %blackjacker has a card total of $calc(%card.total + %card3)
    set %card.total $calc(%card.total + %card3)
  }  
  if (%card.total > 21) {
    .msg $chan %blackjacker has BUSTED!  game over...
  }  
  else {
    .msg chan %blackjacker has a card total of %card.total
    .msg $chan %blackjacker, would you like to hit again or stand? 
  }
}
on *:TEXT:hit again:#:{
  if ($nick == %blackjacker) {
    set %card4 $rand(1,13)
    .msg $chan %blackjacker hit and got %card4
    .msg $chan %blackjacker has a card total of $calc(%card.total + %card4)
    set %cardtotal $calc( %card.total + %card4)
  }  
  if (%cardtotal > 21) {
    .msg $chan %blackjacker has BUSTED!  game over...
  }
  else {
    .msg chan %blackjacker has a card total of $calc( %card.total + %card3 )
  }
}
on *:TEXT:stand:#:{
  if ($nick == %blackjacker) {
    .msg $chan %blackjacker has stood..
    .msg $chan Dealer is up..
    set %dealer1 $rand(1,13) | set %dealer2 $rand(1,13)
    .msg $chan Dealer drew cards %dealer1 , %dealer2
    .msg $chan Dealer has a card total of $calc( %dealer1 + %dealer2 )
    set %dealer.total $calc( %dealer1 + %dealer2 )
  }
  if (%dealer.total > 21) {
    .msg $chan Dealer busts, %blackjacker Wins!
  }
  else {
    set %dealer3 $rand(1,13)
    .msg $chan dealer draws %dealer3
    .msg $chan dealer has a card total of $calc( %dealer.total + %dealer3 )
    set %dealer.total $calc( %dealer.total + %dealer3 )
  }
  if (%dealer.total > 21) {
    .msg $chan Dealer busts, %blackjacker Wins!
  }
  else {
    set %dealer4 $rand(1,13)
    .msg $chan dealer draws %dealer4
    .msg $chan dealer has a card total of $calc( %dealer.total + %dealer4 )
  }
  if (%dealer.total > 21) {
    .msg $chan Dealer busts, %blackjacker Wins!
  }
  else {
    set %dealer5 $rand(1,13)
    .msg $chan dealer draws %dealer5
    .msg $chan dealer has a card total of $calc( %dealer.total + %dealer5 )
  }
  if (%dealer.total > 21) {
    .msg $chan Dealer busts, %blackjacker Wins!
  }
}

at a glance i dont think it will work brackets or no brackets
just a hunch

#141934 14/02/06 09:48 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
Thanks grin ..
even though my script has a handfull of flaws...

I didn't do that bad... lol

Can anybody help me fix it? :tongue:


-blk-
#141935 14/02/06 09:53 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
Nevermind, scratch this, ill just use another blackjack script..
I just wanted to take a stab at it..


-blk-
#141936 14/02/06 09:54 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
If anybody wants to fix it, i dont care...
Thanks for helpin though grin


-blk-
#141937 14/02/06 09:56 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Just FYI, you can edit your posts on these forums 2 hours after making them so you don't need to make 3 consecutive posts in a few minutes.

#141938 14/02/06 09:58 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
I know that, maybe I just didn't want to :tongue:


-blk-
#141939 14/02/06 11:30 PM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
mouthy aint he

#141940 15/02/06 05:11 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
im writting a script to play monopoly in a channel, i was wondering if someone can fix it up for me and make the rest of the bits that i have missed.

heres the code
Code:
on *:TEXT:!monopoly:#:{
  msg # you are added to the game $nick
}


:-)


*** warning for any one to lame to realise i was being sarcastic ***

#141941 15/02/06 06:04 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Code:
on *:TEXT:!play:#:{
  msg $nick Your game is now being auto-played by $me
  msg $nick .
  msg $nick ..
  msg $nick ...
  if ($r(0,1)) msg $nick CONGRATULATIONS, YOU WON THE GAME!! :D
  else msg $nick Sorry, you lost the game. :'(
}


-genius_at_work

#141942 15/02/06 07:10 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
mahahahahahahahahaha smile


Link Copied to Clipboard