Bitcoin Forum
May 11, 2024, 12:59:42 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: « 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »  All
  Print  
Author Topic: Double Trouble (Instant/Automatic) w/ Partial Refunds! [12hr rounds]  (Read 30256 times)
NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:06:03 AM
 #21

Yeah, my most recent bug was found when a new game starts.
It's suppose to send everyone who didn't get doubled their money back, but their was a flaw.

I think what I'm going to do is:
((Amount in Pot)/(Total Amount Unpaid))/(Total # of Unpiad)

I'm still working out the rest of this (such as the weight[amount] per person).

1715389182
Hero Member
*
Offline Offline

Posts: 1715389182

View Profile Personal Message (Offline)

Ignore
1715389182
Reply with quote  #2

1715389182
Report to moderator
1715389182
Hero Member
*
Offline Offline

Posts: 1715389182

View Profile Personal Message (Offline)

Ignore
1715389182
Reply with quote  #2

1715389182
Report to moderator
1715389182
Hero Member
*
Offline Offline

Posts: 1715389182

View Profile Personal Message (Offline)

Ignore
1715389182
Reply with quote  #2

1715389182
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715389182
Hero Member
*
Offline Offline

Posts: 1715389182

View Profile Personal Message (Offline)

Ignore
1715389182
Reply with quote  #2

1715389182
Report to moderator
1715389182
Hero Member
*
Offline Offline

Posts: 1715389182

View Profile Personal Message (Offline)

Ignore
1715389182
Reply with quote  #2

1715389182
Report to moderator
lemonginger
Full Member
***
Offline Offline

Activity: 210
Merit: 100


firstbits: 121vnq


View Profile
June 18, 2011, 01:08:05 AM
 #22

what happened to the refund?

(for those of you that don't realize it, there can be no refund in a game like this unless OP wants to pay out of their own pocket. By it's nature the "last entry" gets eaten up paying out the entries before it.)
NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:15:09 AM
 #23

what happened to the refund?

(for those of you that don't realize it, there can be no refund in a game like this unless OP wants to pay out of their own pocket. By it's nature the "last entry" gets eaten up paying out the entries before it.)
If you haven't read my post right above yours I am trying to work out a way to at least give Some of the money back.

I'm thinking about taking the pot at the end of the game, finding out what percent of the money goes to who and I take a 2% fee from each person.
(Math is still a work-in-progress).


Well there ya go, paid out that quick.  I think I will play again with winnings.  Thanks OP.  btw when does this game end?
Roughly midnight, then the game restarts.

NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:24:09 AM
 #24

Well there ya go, paid out that quick.  I think I will play again with winnings.  Thanks OP.  btw when does this game end?
Roughly midnight, then the game restarts.

What time zone are you in?  Just trying to calculate time left.
It's actually the servers timezone.
I'll add it on the front page (how much time is left before game restarts).

lemonginger
Full Member
***
Offline Offline

Activity: 210
Merit: 100


firstbits: 121vnq


View Profile
June 18, 2011, 01:24:24 AM
 #25

If you haven't read my post right above yours I am trying to work out a way to at least give Some of the money back.

I'm thinking about taking the pot at the end of the game, finding out what percent of the money goes to who and I take a 2% fee from each person.
(Math is still a work-in-progress).

Fair enough.

Though you should at least work it out in a basic spreadsheet and see that depending on how the betting goes, people could be getting back very small fractions of what they put in.

Also there should be a countdown clock until reset.
lemonginger
Full Member
***
Offline Offline

Activity: 210
Merit: 100


firstbits: 121vnq


View Profile
June 18, 2011, 01:25:09 AM
 #26

wow I love it when a feature gets added seconds /before/ I post Smiley
WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile WWW
June 18, 2011, 01:33:38 AM
 #27

Whats up, looks nice and clean. Got my shiny 2 btc dished out automatically
NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:35:22 AM
 #28

I'm going to stop working on the countdown timer until midnight but that's when the game resets. In other words, that's how long I have to perfect the refund code.
AHH! lol

Whats up, looks nice and clean. Got my shiny 2 btc dished out automatically
Hey Cheesy
I told you this game would be a hit.
Kind of surprised that I didn't think about the refund properly.

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile WWW
June 18, 2011, 01:49:30 AM
 #29

It was pretty late dude, and the concept was new. Hey but the program is pretty smooth:)
Are you doing a smaller time frame for the reset, or what ended up happening with that. I was thinking a big time frame was counter-productive.
NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 01:54:52 AM
 #30

It was pretty late dude, and the concept was new. Hey but the program is pretty smooth:)
Are you doing a smaller time frame for the reset, or what ended up happening with that. I was thinking a big time frame was counter-productive.
I ended up going with the game resetting at midnight.
Currently working on the math to split the current bank between users who haven't gotten paid (when the game resets).
The problem I am having is the weight each user has on the bank as to make the split fair.

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile WWW
June 18, 2011, 02:02:45 AM
 #31

Thats a toughy. Its different for each person.



Leftover pot
*
(
User_X's Unpaid Deposit Amount
divided by
Total amount of deposits of unpaid users
)

Then your fee
I dont know how to apply that to code

NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:07:42 AM
 #32

Okay, I believe I have it down (took me a while lol)...
Maybe I can get the communities input before I put it in place? I want to make sure this is fair for everyone.
Code:
usr[1] = 1
usr[2]= 1.5
brank= 1.7

count($Id) =2

$share_math = ( how_much_you_put_in * bank )  /  #ofPlayers_UnPaid ;

$share[1] =   ( 1 * 1.7 )  /  2 ;
$share[1]=  0.85;
$amount2send = $share[1] - ($share[1]/200); //2% gameover fee
$amount2send = 0.84575;
send(user,amount2send);

$share[2] =   ( 1 .5 * 1.7 )  /  2 ;
$share[2]=  1.275;
$amount2send = $share[2] - ($share[2]/200); //2% gameover fee
$amount2send = 1.268625;
send(user,amount2send);

Mind the $ and non $ switching. I do that when I code in notepad -> calculator before I move it into notepad++ xD

NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:16:24 AM
 #33

so what time zone are your servers in?  ie, how long till midnight?
Quote from: 'front page'
Current TIME: 10:15:51 PM
Cheesy 1hr and 45min left

NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:24:39 AM
 #34

Nice same as me.  So will you immediately post a new btc address at midnight for tomorrows game?
I don't use a specific BTC address for payments (well I do, hrm...maybe I should post it?).
It uses the SCI from mybitcoins.com (btw, if you use mybitcoins.com you can get free transactions instead of paying the program fee of 0.0005BTC. As the host, I still take the 1% and 2% fees).

The database goes through, splits the earnings (look a few post up about the math of that), deletes the database, and re-creates it.

[Edit]: The code is now in-place for refunds:
Code:
	//get total amount the unpaid users have put in
$total = 0;
foreach($Id as $user)
{
$total = $Amount[$user] + $total; //they have in pot togeder
}

//spin for each user
foreach($Id as $userz)
{
$share[$userz] =  ( $Amount[$userz] * $total )/count($Id);
$amount2send[$userz] = $share[$userz] - ($share[$userz]/200); //take 2% for end of game fee ;D
mbc_spend($Address[$userz],$amount2send[$userz],"[BitDouble]: {End-of-Day} Refund!","");

//1 night, we need to logg this
$fh = fopen(--onebaddasshiddenfile--, 'a');
fwrite($fh, "[sending]: ".$amount2send[$userz]."\n");
fwrite($fh, "[Shares]: ".$share[$userz]."\n");
fwrite($fh, "[Account]: ".$Address[$userz]."\n\n");
fclose($fh);
}
This is the exact code I am using to split the shares.
If ANYONE sees anything wrong, please let me know!
ps, I am logging what get's shared for 1 night to make sure it goes smoothly. If not, having this log will allow me to see what went wrong.

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile WWW
June 18, 2011, 02:33:20 AM
 #35

Let me be the first to suggest running this one until 2moro nite...lol. Didnt know what time it was where you are.
NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:34:40 AM
 #36

Let me be the first to suggest running this one until 2moro nite...lol. Didnt know what time it was where you are.
So, instead of resetting each night...wait two nights?

WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile WWW
June 18, 2011, 02:41:36 AM
 #37

 :-\yeah.?.?
Just this time because we didnt know what time it is. I dont really care that much but if other people feel the same way maybe.

Edit* Why'd my nervous/uneasy face come out like that??haha
NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 02:43:43 AM
Last edit: June 18, 2011, 02:58:51 AM by NothinG
 #38

Okay, I see.
I'll leave the first night (tonight) alone.
I'll have it setup so from tomorrow it will reset each midnight (clock is still going to be at the top).

[Edit]:
I added some code to the front page to:
1) Refresh every 30 seconds.
2) After it refreshes the first time you will notice ?pot_only is appended to the link. This will change the title to show how big the pot currently is. Saving you time from having to go back to the page and refreshing it every so often.

Hope everyone likes the updates. Cheesy


WiseOldOwl
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile WWW
June 18, 2011, 03:05:26 AM
 #39

Nice!!
Thanks for letting it ride.
NothinG (OP)
Hero Member
*****
Offline Offline

Activity: 560
Merit: 500



View Profile
June 18, 2011, 03:28:01 AM
 #40

Nice!!
Thanks for letting it ride.

No problem. Smiley

Pages: « 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!