Gambling

smoochy boys on tour

Geordiehc

Mad Dog Geo
VIP
Jul 4, 2007
2,827
49
195
Redditch, UK
Is there much call for gambling scripts? I've nearly finished programming a full set including Dice, Horse Racing and Hi-Lo, not exactly rocket science but i had fun programming them and if enough people want them i'll make a post with the scripts on.
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,184
30
2,788
540
im interested in gambling npcs. iv always wanted them, but never really known how to do em well. post post post.
 

Tai

HEAD CAPTAIN
Staff member
Administrator
May 11, 2003
14,330
2
2,716
515
United Kingdom
mmm like final fantasy type crap?

never found that remotely interesting tbh
 

Geordiehc

Mad Dog Geo
VIP
Jul 4, 2007
2,827
49
195
Redditch, UK
i cant put the script in text on here coz its got amx amount of chars allowed so any ideas of how i can upload them please :)
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,184
30
2,788
540
zip/rar the txt files. or just upload the txt file.
 

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
is it your job apple to post a stupid comment to every post when you have no abilities of scripting yourself? :)

geo, load it into a text document and upload it to a free webhost.. if its under 1K then i believe you can do it as a forum attachment or contact me in PM :) i have plenty of webhosts available for you to use.
 

Geordiehc

Mad Dog Geo
VIP
Jul 4, 2007
2,827
49
195
Redditch, UK
Nice 1, its not that i dont know how to coz i could have zipped it and uploaded to filefront or summik lol just the fact is a flick of a file and hardly worth zipping and uploading lol, thanks for the offers guys but i'm having major problems on the Dice game were it is really just doing things that i cant see why its happening, but by then i will have remembered my pass for my webspace and i'll load it up there
 

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
I have working Gambler scripts on Sting..

And there are a few others I made for Xtreme

Dice (Gamble various things on the roll of 4 Dice)
Hi-Lo
Scratch Card
Greed
Roullette
BlackJack
Rock/Paper/Scissors
A few others I can't remember lol, if you want a hand with any, just shout up..
 

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
I won't give any script away, I will however help anyone make a script.

Giving away scripts helps no-one, especially the person who receives it. You learn nothing, working (like Geo is) to make a script and learning the way its done is beneficial to everyone, as is soon makes another person who can script.

What I did with BlackJack.. was..

Text File with 52 Cards in it.. like so

[Cards]
1=AC
2=2C
3=3C
4=4C...
11=JC
12=QC
13=KC
14=AD
15=2D

etc..

You get the jist.., then in the same file, I created a list of Card Values..

[Values]
1=1
2=2
3=3
4=4...
11=10
12=10
13=10
14=1
15=2

etc..

So.. in the text file, I had 52 numbers for Cards under [Cards] and 52 numbers for the values of those Cards under [Values]

Then I simply load up a card using..

Movr D0 51
Inc D0 1
LoadValue A1 [QuestDiary/Gamblers/CardVariables.txt] [Cards] %D0
LoadValue D1 [QuestDiary/Gamblers/CardVariables.txt] [Values] %D0

Now, I have a Card Stored in A1 and the Value of that Card in D1

Movr D0 51
Inc D0 1
LoadValue A9 [QuestDiary/Gamblers/CardVariables.txt] [Cards] %D0
LoadValue D9 [QuestDiary/Gamblers/CardVariables.txt] [Values] %D0
Inc D1 %D9
AddStr A1 " - "
AddStr A1 %A9

Now I have 2 Cards Stored...

A1 Contains the Cards i.e. "QD - A1"
D1 Contains the Values i.e. "11"

(Players Cards Sorted)

Do the same for A2 and D2 for the Dealer

Now you have 2 sets of cards, one for you and one for the Dealer..

Now, its time to do some Math..

#IF
Equal D1 11
!Equal D2 11
#ACT
Inc D1 10
Break
#SAY
You have BlackJack.. \
You Win...\

#IF
!Equal D1 11
Equal D2 11
#ACT
Inc D2 10
Break
#SAY
Dealer has BlackJack.. \
You Lost...\

#IF
Equal D1 11
Equal D2 11
#ACT
Inc D1 10
Inc D2 10
Break
#SAY
You Both Have BlackJack.. \
Push....\

#IF
#ACT
Goto @Loop

[@Loop]
<DRAW>
<STAND>

[@Draw]
#IF
#ACT
Add Another Card to the Variables D1 and A1

#IF
ELarge D1 22
#ACT
Break
#SAY
You have over 21!!! You Lost!!\

#IF
#ACT
Goto @Loop

[@Stand]
Show Players Cards and Value..
Goto @DealerLoop

[@DealerLoop]
#IF
ESmall D2 16
#ACT
Add Another Card to the Variables D1 and A1

#IF
ELarge D2 22
#ACT
Break
#SAY
Dealer has over 21!!! You Win!!\

#IF
ELarge D2 17
#ACT
Goto @CheckWinner
Break

#IF
#ACT
Goto @DealerLoop

[@CheckWinner]
#IF
Equal D1 %D2
#ACT
Break
#SAY
Push..

#IF
Large D1 %D2
#ACT
Break
#SAY
You Win

#IF
Large D2 %D1
#ACT
Break
#SAY
You Lose


Now.. You just need to change that lot into Mir Language, and add in the option of if either player gets an 11 they can count it as 1 or 11 and away you go..

P.S. You can use SQL instead of a text file if you want..

Any Q's?