SRL Archive - Other Scripts

Fruit Machine


Rich

2008-11-02 11:17:04

First off, I'll start by giving credits:
- Coo Too: For making a fruit machine and giving me the idea to make it better
His thread: http://www.villavu.com/forum/showthread.php?t=25558

Anyway, this is a fruit machine script which I made, I only got the idea from Coo Too. This one has more features, which are:
- Fully animated
- AutoSpin or not
- You can set the amount of spins
- Score recorder

ADDED FEATURES - V 1.5
- Carry on - run until you run out of points
- You can choose whether you want it animated
- You can choose whether you need the points shown to you

Just download it an see, and tell me what you think of it!

Version 1.5 is out! Download it now!

Thanks!

nhstarter10

2008-11-02 11:49:11

[debug]You started off with £10.
You ended up with £64.
That's a profit of £54!
Thanks for playing my fruit machine! I hope you liked it!
Successfully executed[/debug]

Cool lol… I should gamble more :D

Rich

2008-11-02 11:51:36

So you like the script then? Any improvements that could be made?

mixster

2008-11-02 13:00:13

Overall a nice little script.
You could shorten it a lot by putting the different types (ie big X, little x's) into 2 (or a 2d) TStringArray, then randomly use them instead of making it write out a random chunk for each section and instead the randomly chosen chunks. You can then adjust wins or losses by seeing if they match.
An example of this could be through:

var
line: TStringArray;
outcome: array[0..2] of Integer;
begin
line := ['X', 'O', 'S'];
outcome[0] := Random(3);
outcome[1] := Random(3);
outcome[2] := Random(3);
Writeln('You rolled ' + line[outcome[0]] + ' - ' + line[outcome[1]] + ' - ' + line[outcome[2]] + '!');
if(outcome[0] = outcome[1]) and (outcome[1] = outcome[2]) then
Writeln('You matched 3!')
else if (outcome[0] = outcome[1]) or (outcome[1] = outcome[2]) or (outcome[0] = outcome[2]) then
Writeln('You matched 2!')
else
Writeln('Sorry, you didn''t match any');
end.

You can try by separating that all to add it in instead of your current system. To make it work with 2 string arrays, you just have 1 for top, 1 for bottom and call them separately in the WriteLn's :)

Dan Cardin

2008-11-02 13:18:40

this would be a lot nicer inside a form

but nice job nonetheless

Rich

2008-11-04 16:37:42

Version 1.5 is released! Get it now! New features to make it even better!


@Dan Cardin: What would you like inside a form? Just the constants, or the machine? If the machine, how would I animate it?

Dan Cardin

2008-11-04 18:13:30

the machine itself, if nothing else you could have an image for the machine, 3 for the lever (or 1 if you're going to rotate it), then 1 for each of the fruits and a few maybe for when its spinning. Once you have the images it would just be a matter of making a loop to put them in the right place an to display the right ones when they get picked.

That would get you the basics.

Tootoot222

2008-11-07 07:31:24

lolz, there's one certain line that you can change to always get jackpot…

You started off with £15.
You ended up with £240.
That's a profit of £225!
Thanks for playing my fruit machine! I hope you like it!

and that was after only 15 rolls… :garfield:

Rich

2008-11-07 10:45:03

With all scripts like this, there are ways to do that, but that's not the spirit of playing scripts like this :P