DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • April 19, 2019, 01:17:25 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Blackjack  (Read 7423 times)
0 Members and 1 Guest are viewing this topic.
lonnyl
Guest
« on: June 02, 2004, 06:20:53 AM »

Ok... I've had this for a while... saw that someone wanted it so I thought I would comment it up and zip it up for the world to use.   The instructions are in the php file and the images go in the images folder... have fun with it and let me know what you think.

This one gave me a headache at the time of making it, but it seems to work really well.

http://www.pqcomp.com/modules/mydownloads/visit.php?cid=4&lid=71

I do ask that you leave my link in this file as this mod took a great many hours and edits to create.
« Last Edit: January 30, 2005, 06:28:24 AM by lonnyl » Logged
thegleek
Guest
« Reply #1 on: June 02, 2004, 07:23:46 AM »

OMG! thank you!!!! i will install this asap and check it out to the max!

stay tuned...
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #2 on: June 02, 2004, 08:47:59 AM »

I've already installed on my local server (implementing it at the old man in Dark Horse Tavern) and it works fine. The only thing that looks strange to me is that some some sequences of cards repeat frequently. An example:
King Diamonds - 3 Diamonds
If I call a card it always come out Ace of Hearts, and the table has always 5 Diamonds - 4 Diamonds and the third card is Queen of Hearts.

I'll try again and I'll let you know if it will repeats again.

BTW ... Chapeau !! (french expression to show you all my admiration for this superb script)

Rgds Excalibur

*** EDIT ***
Another sequence that comes out frequently is:
(my cards) Queen Hearts - 10 Clubs
(deck) Queen Diamonds - 7 Hearts - Jack Spades
« Last Edit: June 02, 2004, 08:57:38 AM by Excalibur » Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Voratus
Guest
« Reply #3 on: June 02, 2004, 09:07:48 AM »

Probably the common sequences is just the lack of variety in LotGD (computer's?) random numbers.
The same reason you can go for days without facing Lonestrider, then in one day you will face him three times.
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #4 on: June 02, 2004, 09:25:12 AM »

The problem is located in the shuffle function on line 114 of blackjack.php

I've replaced it with this code (taken from PHP Planet Mirror)
Code:
srand ((double) microtime() * 10000000);
for ($i=0;$i<sizeof($cards);$i++) {
       $from=rand(0,sizeof($cards)-1);
       $old=$cards[$i];
       $cards[$i]=$cards[$from];
       $cards[$from]=$old;
}    

Now it works well, each time it takes out different cards Cheesy
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #5 on: June 02, 2004, 10:05:59 AM »

Another bug  Wink
Let's say I have 900 gold in hand and I bet 500 to play. I lose my hand, so I left 400 gold in hand. If I choose "Bet again 500 gold" it let me play again, while it should tell me "You don't have enough money to play". More then that, it let me play again even if I lose going negative (-100) on gold  Grin

I don't have time ATM to add a check to it, so if anyone else want to do it ...  Grin
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #6 on: June 02, 2004, 11:53:23 AM »

Very cool, lonny, thanks!

I don't know why, but Robert and I both had to add  $mybet=$HTTP_POST_VARS[mybet]; right after line 41 if ($HTTP_GET_VARS[op]=="mybet"){ otherwise $mybet was not getting set.
Logged

Play the latest beta version here on DragonPrime
lonnyl
Guest
« Reply #7 on: June 02, 2004, 11:53:51 AM »

uploaded new version with excaliburs fix and the fix for continuing betting when not enough gold.....  Shocked

and again the link

http://www.pqcomp.com/modules/mydownloads/visit.php?cid=4&lid=71

-edit-
added talisman's line just because some may need it and it won't break anything.
« Last Edit: January 30, 2005, 06:28:53 AM by lonnyl » Logged
dvd871
Guest
« Reply #8 on: June 19, 2004, 09:26:42 PM »

Here's a set of cards with numbers added that have been optimized.  They are about half the size of the originals which will save on the bandwidth.

http://dragonprime.cawsquad.net/users/dvd871/cards.zip
Logged
theKlaus
Member
Militia
**
Offline Offline

Posts: 35



View Profile WWW
« Reply #9 on: June 21, 2004, 01:59:13 AM »

 Smiley
great AddOn.
running it on my server in a german translated version.
My users love it!

Klaus
Logged
Interloper
Guest
« Reply #10 on: June 30, 2004, 06:50:43 PM »

Excellent modification. I'm addicted!  Cheesy

However I am getting an error on the page in IE, that looks like this:

'document.getElementByld(...)' is null or not an object

Supposedly the error is on line 94, but I checked the code and the only thing on that line is:

"8ofhearts",

If anyone has any ideas what could cause it I'd like to know.

 Smiley
« Last Edit: June 30, 2004, 06:52:31 PM by Interloper » Logged
dvd871
Guest
« Reply #11 on: June 30, 2004, 07:57:36 PM »

Well, I'm using the mod and have IE 6 and it runs with no problems at all.    Haven't had any player report any problem either.
Logged
Interloper
Guest
« Reply #12 on: June 30, 2004, 08:22:20 PM »

Oh well, it doesn't seem to be affecting the game at all, so it's just a minor annoyance I suppose.

 Cheesy
« Last Edit: June 30, 2004, 08:27:13 PM by Interloper » Logged
Floris
Guest
« Reply #13 on: September 19, 2004, 12:51:27 PM »

Hi,

Can someone give me a hand ?

I have put all the image files in the image directory.. and put the .php file in the main directory..
In IMG I added the script..

But what's next ?
Where can I find the game ?
And if I want it to be seen in the Inn.... whitch links must I alter ?

Thanx,
Newby Floris.....
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5483



View Profile WWW
« Reply #14 on: September 19, 2004, 01:09:16 PM »

You'll need to read the instructions contained in the php file re casino.php, etc.  Then you need to add an addnav line whereever you want the game to appear.  
Logged

Play the latest beta version here on DragonPrime
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
99 Guests, 1 User
Smirnov
Home Forums News Downloads Login Register Advanced Search