  | 
	 
	
	
		Microphallus Newbie
 
  Joined: 31 Dec 2002 Posts: 1 Location: USA
  | 
		
		  
			
			   Posted: Tue Dec 31, 2002 7:55 pm   
  99.9% Working Roulette Script!!! Need Help!   | 
			 
			
				First, I would like to say, this is NOT my script.  It was posted on the mud I play, but it appears to work very well, with a minor problem.  It may be as simple as an invalid character, I am not sure.  I have fixed some things in it, but I am now stuck.  The script was written in 6.16 I'm told, I am using 6.40.   Anyway, Here it goes!
 
 
First make a new class folder called spin.  Make sure it is disabled when connecting to the mud.
 
 
Triggers:
 
 
 
Trigger: (%w) gives you (%d) coin
 
 
Value:
 
thisplayer=%1
 
coinage=%2
 
#if @coinage>100000 {
 
  give @coinage coin @thisplayer
 
  talk @thisplayer Sorry, this casino will not honor a bet that large
 
  } {#if @tableclosed="true" {
 
    give @coinage coin @thisplayer
 
    talk @thisplayer Please wait until the next spinning
 
    } {#if %ismember( @thisplayer, @tableplayer) {
 
      give @coinage coin @thisplayer
 
      talk @thisplayer &P&W@thisplayer&P, you can only bet once per spin
 
      } {
 
      tableplayer=%additem( @thisplayer, @tableplayer)
 
      talk @thisplayer Welcome to the table &P&W@thisplayer!
 
      talk @thisplayer &CTell me which number you would like to bet your &Y@coinage &Ccoins on
 
      tempvar=%concat( @thisplayer, c)
 
      #var @tempvar @coinage
 
 
Trigger: (%w) tells you '(%d)'
 
 
Value:
 
thisplayer=%1
 
select=%2
 
#if @tableclosed="true" {tell @thisplayer sorry, you can't place a bet after the wheel starts to spin}
 
#if %ismember( @thisplayer, @tableplayer) {
 
  tempvar=%concat( @thisplayer, b))
 
  #if %defined( @@tempvar) {reporthand=@@tempvar} {reporthand=0}
 
  #if @reporthand=0 {#if ((@select<8) AND (@select>0)) {
 
      #var @tempvar @select
 
      say &P&W@thisplayer &Phas bet on number &R@select
 
      } {
 
 tell @thisplayer You have to pick a number between 1 and 7
 
      }} {tell @thisplayer You've already picked &P&W@reporthand}
 
  } {
 
 tell @thisplayer You have to give me money before you can pick a number
 
  }
 
 
Alias:  startspin  (this alias does NOT go in the spin class folder)
 
 
Command:
 
#t+ spin
 
tableplayer=""
 
gossip Lets play some Valdor-roulette!! Come to recall for your share of the fun
 
 
Alias: spin
 
 
Command:
 
tableclosed="true"
 
say &PAlright, lets get these wheels going!!
 
emot spins the 3 wheels...
 
spin1=%random( 1, 7)
 
spin2=%random( 1, 7)
 
spin3=%random( 1, 7)
 
#wait 4000
 
say &Pthe first wheel has stopped on... &R@spin1&P!
 
#wait 2000
 
say &Pthe second wheel has stopped on... &R@spin2&P!
 
#wait 2000
 
say &Pthe last wheel has stopped on... &R@spin3&P!
 
say &PWe have &R@spin1 @spin2 @spin3 &Pladies and gentlemen
 
#wait 1000
 
payout
 
 
Alias: payout
 
 
Command:
 
#forall @tableplayer {
 
  thisplayer=%i
 
  match=0
 
  tempvar=%concat( @thisplayer, b)
 
  tempvar2=%concat( @thisplayer, c)
 
  moneylost=@@tempvar2
 
  selection=@@tempvar
 
  #if @selection=0 {
 
    say rofl, &P&W@thisplayer &Cforgot to pick a number, I'll be nice, here's your money back
 
    give @moneylost coin @thisplayer
 
    } {
 
    #if @selection=@spin1 {#math match @match+1} {}
 
    #if @selection=@spin2 {#math match @match+1} {}
 
    #if @selection=@spin3 {#math match @match+1} {}
 
    #if @match=0 {
 
 talk @thisplayer Sorry &P&W@thisplayer, &Cyou didn't match any numbers. Thanks for the @moneylost coins
 
      } {}
 
    #if @match=1 {
 
      talk @thisplayer Nice &P&W@thisplayer&C, a single match, here's your gold
 
      #math coinage @moneylost*2
 
      give @coinage coin @thisplayer
 
      } {}
 
    #if @match=2 {
 
      talk @thisplayer Very nice &P&W@thisplayer&C, a double match, here's your gold
 
      #math coinage @moneylost*5
 
      give @coinage coin @thisplayer
 
      } {}
 
    #if @match=3 {
 
      talk @thisplayer WOW!! &P&W@thisplayer &Cgot a triple match! Here's your gold
 
      #math coinage @moneylost*15
 
      give @coinage coin @thisplayer
 
      } {}
 
    }
 
  #var @tempvar 0
 
  #var @tempvar2 0
 
  tableplayer=%delitem( @thisplayer, @tableplayer)
 
  }
 
tableplayer=""
 
spin1=0
 
spin2=0
 
spin3=0
 
tableclosed="false"
 
say &YThe betting table has been cleared, you may bet again if you wish
 
 
Alias: showhand (in case they forgot what they bet on)
 
 
Value:
 
#forall @tableplayer {thisplayer=%i}
 
tempvar=%concat( @thisplayer, b)
 
selection=@@tempvar
 
say &P&W@thisplayer &Phas placed a bet on &R@selection
 
 
Alias: stopspin
 
 
Command:
 
#t- spin
 
gossip I am sorry, but Lycilium's Valdor-roulette table is now closed due to lack of funds, interest,
 
 abuse, or he has other pressing needs he must attend to. Thank you and please come again.
 
say feel free to tip the dealer any amount you wish
 
 
 
 
This is what the mud output will look like to an extent.
 
 
I am not currently connected to the mud I play, technical difficulties (clicked wrong button on zone alarm, don't want to shut it off yet)
 
 
  
 
startspin
 
gossip Lets play some Valdor-roulette!! Come to recall for your share of the fun
 
Graco gives you 50 coins
 
talk Graco Welcome to the table &P&WGraco!
 
talk Graco &CTell me which number you would like to bet your &Y50 &Ccoins on
 
Graco tells you '5'
 
say &P&WGraco &Phas bet on number &R5
 
say &P&WGraco &Phas placed a bet on &R0
 
say &PAlright, lets get these wheels going!!
 
emot spins the 3 wheels...
 
say &Pthe first wheel has stopped on... &R4&P!
 
say &Pthe second wheel has stopped on... &R1&P!
 
say &Pthe last wheel has stopped on... &R6&P!
 
say &PWe have &R4 1 6 &Pladies and gentlemen
 
say rofl, &P&WGraco &Cforgot to pick a number, I'll be nice, here's your money back
 
give 50 coin Graco
 
say &YThe betting table has been cleared, you may bet again if you wish
 
gossip I am sorry, but Lycilium's Valdor-roulette table is now closed due to lack of funds, interest,
 
abuse, or he has other pressing needs he must attend to. Thank you and please come again.
 
say feel free to tip the dealer any amount you wish
 
 
 
 
If you notice, after the 'Graco tells you '7'' and I type showhand, it shows he has bet on 0, it's not taking his bet, and I cannot figure out why.  Also, after it is over, whether the number he picked won or not, it says he forgot to pick a number and gives him his money back (which it should if they forget).  Any help would be appreciated. | 
			 
		  | 
	 
	
	  | 
		  
		 | 
	 
	
		  | 
	 
	
		Kjata GURU
  
  Joined: 10 Oct 2000 Posts: 4379 Location: USA
  | 
		
		  
			
			   Posted: Tue Dec 31, 2002 8:18 pm      | 
			 
			
				Try changing this line and other lines similar to this one (with a double @):
 
selection=@@tempvar
 
 
to this format:
 
selection=@{@tempvar}
 
 
Kjata | 
			 
		  | 
	 
	
	  | 
		  
		 | 
	 
	
		  | 
	 
	
		Evangelist Adept
 
  Joined: 10 Oct 2000 Posts: 224 Location: USA
  | 
		
		  
			
			   Posted: Tue Dec 31, 2002 8:51 pm      | 
			 
			
				That did not work either :(  I am pretty sure the problem is in the trigger where the person tells me what number they want to pick (shown below).   Any other possible suggestions? 
 
 
 
thisplayer=%1
 
select=%2
 
#if @tableclosed="true" {tell @thisplayer sorry, you can't place a bet after the wheel starts to spin}
 
{#if %ismember(@thisplayer,@tableplayer) {tempvar=%concat(@thisplayer,b)
 
  tempvar=%concat( @thisplayer, b))
 
  #if %defined(@@tempvar) {reporthand=@@tempvar} {reporthand=0}
 
#if @reporthand=0 {#if ((@select<8) AND (@select>0)) {#var @tempvar @select
 
say &P&W@thisplayer &Phas bet on number &R@select} {tell @thisplayer You have to pick a number between
 
 1 and 7}} {tell @thisplayer You've already picked &P&W@reporthand}} {tell @thisplayer You have to give
 
 me money before you can pick a number}}
 
 
 
 
Evangelist/Pernius
 
telnet://phidar.com:9000 | 
			 
		  | 
	 
	
	  | 
		  
		 | 
	 
	
		  | 
	 
	
		Evangelist Adept
 
  Joined: 10 Oct 2000 Posts: 224 Location: USA
  | 
		
		  
			
			   Posted: Tue Dec 31, 2002 8:55 pm      | 
			 
			
				Didn't mean to reply in two different names, forgot it had one logged in automatically, they are both me.
 
 
Evangelist/Pernius
 
telnet://phidar.com:9000 | 
			 
		  | 
	 
	
	  | 
		  
		 | 
	 
	
		  | 
	 
	
		Kjata GURU
  
  Joined: 10 Oct 2000 Posts: 4379 Location: USA
  | 
		
		  
			
			   Posted: Tue Dec 31, 2002 9:06 pm      | 
			 
			
				Two changes:
 
tempvar=%concat( @thisplayer, b))
 
 
has an extra parenthesis. It should be:
 
tempvar=%concat( @thisplayer, b)
 
 
Also:
 
#if %defined(@@tempvar) {reporthand=@@tempvar} {reporthand=0}
 
 
should be:
 
#if %defined(@tempvar) {reporthand=@@tempvar} {reporthand=0}
 
 
Kjata | 
			 
		  | 
	 
	
	  | 
		  
		 | 
	 
	
		  | 
	 
	
		Evangelist Adept
 
  Joined: 10 Oct 2000 Posts: 224 Location: USA
  | 
		
		  
			
			   Posted: Tue Dec 31, 2002 9:46 pm      | 
			 
			
				Thank you, I figured it out.  Had a variable not working as well which I fixed.  Thanks EMMENSELY(sp?) for your help Kj
 
 
Evangelist/Pernius
 
telnet://phidar.com:9000 | 
			 
		  | 
	 
	
	  | 
		  
		 | 
	 
	
		  | 
	 
	
		| 
		
		 | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
  | 
   
 
 |