RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

FS Slot Machine (Miner Madness)

CEO

Sorceror
After looking at the code, I'm guessing they are forging packets to fool the server into thinking a button is pressed that was already removed by the gump but is still processable in the code.

Taking a look at the repetitive code in OnResponse:

Code:
        		if ( info.ButtonID == 1 )
         		{
				if ( m_c1 == 0 )
				{
					from.SendMessage( "You found coal!" );
					from.SendMessage( "You may now close this menu out to contiune playing." );
					from.SendGump( new MinerBonusGump( m_Stone, true, true, true, true, true, true, true, true, true, m_c1, m_c2, m_c3, m_c4, m_c5, m_c6, m_c7, m_c8, m_c9 ) );
				}
				else
				{
					m_Stone.Won += m_c1;
					from.SendMessage( "You have won {0}, Pick another spot to mine.", m_c1 );
					from.SendGump( new MinerBonusGump( m_Stone, true, m_b2, m_b3, m_b4, m_b5, m_b6, m_b7, m_b8, m_b9, m_c1, m_c2, m_c3, m_c4, m_c5, m_c6, m_c7, m_c8, m_c9 ) );
					m_Stone.LastPay += m_c1;
					m_Stone.TotalCollected -= m_c1;
				}
                           }

You can prevent this from happening by setting the payout of the selected to button to 0 after it's paid, so if they try to forge a button it'll basically think you've pressed a coal button and exit out. Personally, I'd do more then that and log the attempt somewhere so you can deal with your exploiter later. :mad:

So change all those sections of code to something like this:

Code:
        		if ( info.ButtonID == 1 )
         		{
				if ( m_c1 == 0 )
				{
					from.SendMessage( "You found coal!" );
					from.SendMessage( "You may now close this menu out to contiune playing." );
					from.SendGump( new MinerBonusGump( m_Stone, true, true, true, true, true, true, true, true, true, m_c1, m_c2, m_c3, m_c4, m_c5, m_c6, m_c7, m_c8, m_c9 ) );
				}
				else
				{
					m_Stone.Won += m_c1;
                                        m_Stone.LastPay += m_c1;
                                        m_Stone.TotalCollected -= m_c1;
					from.SendMessage( "You have won {0}, Pick another spot to mine.", m_c1 );
                                        m_c1 = 0;
					from.SendGump( new MinerBonusGump( m_Stone, true, m_b2, m_b3, m_b4, m_b5, m_b6, m_b7, m_b8, m_b9, m_c1, m_c2, m_c3, m_c4, m_c5, m_c6, m_c7, m_c8, m_c9 ) );

				}
			}

However, with no offense to the author, this slot machine is basically a gold farm machine. In writing my own slots, I started with this one and one of the first things I did was incorporate the ability to "model" a machine using actual statistical formulas and then followup by simulating a huge number of spins (millions) and then compare that with the statisitcal odds to verify the machine performs as desired. This machine's profile is this:

/*
Profiling: Theme:MinerMadness Payout Table:Loose

Distribution Tables:

2,3,4,5,8,11,15,18
2,3,4,5,8,11,15,18
2,3,4,5,8,11,15,18

Individual jackpot odds:
0. 02*02*02:08/287496=0.00003*10000.00000=0.27826 cumulative odds:0.27826
1. 03*03*03:27/287496=0.00009*5000.00000=0.46957 cumulative odds:0.74784
2. 04*04*04:64/287496=0.00022*1000.00000=0.22261 cumulative odds:0.97045
3. 05*05*05:125/287496=0.00043*500.00000=0.21739 cumulative odds:1.18784
4. 08*08*08:512/287496=0.00178*10.00000=0.01781 cumulative odds:1.20565
5. 11*11*11:1331/287496=0.00463*5.00000=0.02315 cumulative odds:1.22880
6. 15*15*15:3375/287496=0.01174*3.00000=0.03522 cumulative odds:1.26402
7. 18*18*18:5832/287496=0.02029*2.00000=0.04057 cumulative odds:1.30459

Any 3: (14*14*14/287496)=.00954-.00078=.00877*25=.21913

Scatter2: (8*8*58+8*58*8+58*8*8)/287496*0.500=0.01937
Scatter1: (8*58*58+58*8*58+58*58*8)/287496=0.28082*0.330=0.09267

Statistical payout odds for this slot machine is : 163.57615%

@ 10 million spins: Low: 163.42% High: 178.21% Actual: 167.16%

*/

I gave a value of 2500 to the bonus round which is very conservative as you can easily win 50k+ on some rounds. A payout of 163% means that over a sufficiently large amount of spins for every 1gp put in 1.6gp will be returned, obviously not something desirable for any slot machine! You can modify the payout table by taking some of the numbers off the higher values and distributing them lower, but without the ability to model the machine you won't easily be able to tell if your changes were successful and with only one table to work with (real machines have a table for each reel) moving one value to another can have a huge adverse impact. :(
 

Pyro-Tech

Knight
I think it would be nice to have a decent slot machine that does more than just become a gold farm....a whole casino pack with the theme of "legit" gambling would be great....meaning, allow the possibility to get some money back and have fun, mabey a couple of millionares won (since it does happen from odd time to odd time), but not become where every player with 15k can spend it all and get triple the profits (whein i tested this, i went in with 10k and quit playing after winning back 196k....that's quite a bit)
 

CEO

Sorceror
Polter said:
OMFG here is "little" bug :-DDD http://www.ihme.org/~polter/luck.JPG
this script SUCK :D

That bug has already been mentioned above. it's always good to peruse the thread of any program you plan to install on your shard to see if there are problems. The first fix I gave was crude, it actually can be done easier by surrounding all the pay line stuff with something like:
Code:
                    if (!m_b1)
                    {
                        m_Stone.Won += m_c1;
                        from.SendMessage("You have won {0}, Pick another spot to mine.", m_c1);
                        from.SendGump(new MinerBonusGump(m_Stone, true, m_b2, m_b3, m_b4, m_b5, m_b6, m_b7, m_b8, m_b9, m_c1, m_c2, m_c3, m_c4, m_c5, m_c6, m_c7, m_c8, m_c9));
                        m_Stone.LastPay += m_c1;
                        m_Stone.TotalNetProfit -= m_c1;
                    }
And then it'll ignore attempts to simulate a button already pressed through Razor or something else. Regardless, even with that fix and as I said earlier, this script is pretty much a gold farm anyways as proven by the statistical table above.
 

Pyro-Tech

Knight
CEO said:
That bug has already been mentioned above. it's always good to peruse the thread of any program you plan to install on your shard to see if there are problems. The first fix I gave was crude, it actually can be done easier by surrounding all the pay line stuff with something like:
Code:
                    if (!m_b1)
                    {
                        m_Stone.Won += m_c1;
                        from.SendMessage("You have won {0}, Pick another spot to mine.", m_c1);
                        from.SendGump(new MinerBonusGump(m_Stone, true, m_b2, m_b3, m_b4, m_b5, m_b6, m_b7, m_b8, m_b9, m_c1, m_c2, m_c3, m_c4, m_c5, m_c6, m_c7, m_c8, m_c9));
                        m_Stone.LastPay += m_c1;
                        m_Stone.TotalNetProfit -= m_c1;
                    }
And then it'll ignore attempts to simulate a button already pressed through Razor or something else. Regardless, even with that fix and as I said earlier, this script is pretty much a gold farm anyways as proven by the statistical table above.

that's why it would be awesome if another set of slot machine's came around ;) hehe, just messing ceo

i did have to quit using these due to the fact that players got WAY too rich off of this
 

joshw

Sorceror
Ok well i fixed the gump being open when not near machine and the stone need to be within one tile of it and if walk away from machine and try to use any of the gumps to play it will close the gump and state that you are too far from machine to continue playing it and also sets it back to inuse = false

**NOTE** wish you could allow winrar file types to be uploaded since some of us don't use winzip hehe

just save as .cs files since in text format
 

Attachments

  • MinerBonusGump.txt
    13.9 KB · Views: 14
  • MinerMadessSlotGump.txt
    3.7 KB · Views: 17
  • MinerPayTableGump.txt
    2.5 KB · Views: 15
  • MinerSlotStone.txt
    12.5 KB · Views: 20
Here is Joshw's modified MinerBonusGump.cs with the fix CEO replied with.
 

Attachments

  • MinerBonusGump.cs.txt
    14.1 KB · Views: 20
Top