Pages:
Author

Topic: [Free Script] Untitled Dice - Run your own bitcoin dice site (no server needed) - page 10. (Read 64524 times)

legendary
Activity: 1442
Merit: 1186
After installing this to my domain under the directory /dice it seems to have PERMANENTLY edited my server config.  Even after completely deleting the directory I installed this to it still redirects to moneypot.  I'd like to have my directory back for my own usage, what do I need to do to stop this auto-redirect?

SOLVED, it appears the issue was with my server and not this script. Since there is over 1,000 files it took longer to delete than my FTP manager lead me to believe.  Why does this app have over 1,000 files? Seems like a bit much for a site that just uses moneypot API. API is supposed to make things lightweight...
legendary
Activity: 1442
Merit: 1186
After installing this to my domain under the directory /dice it seems to have PERMANENTLY edited my server config.  Even after completely deleting the directory I installed this to it still redirects to moneypot.  I'd like to have my directory back for my own usage, what do I need to do to stop this auto-redirect?
newbie
Activity: 19
Merit: 0
got it!

I'm publishing it in case anyone is interested:

((winProb * - 100)*-1).toFixed(2).toString()
newbie
Activity: 19
Merit: 0
I'm having some difficulties to get the calculation for the <

 Huh
newbie
Activity: 19
Merit: 0
Hamburger you are right I will be more specific when asking!

I would like to show both but I think I will be able (I'll try!) to implement it with your explanation.

Thank you very very very much, I was struggling my small mind with this all day!!

Thanks again!!!
full member
Activity: 241
Merit: 107

I don't want to change the Chance, I want to add the target number.

Example for Multiplier x4, the Chance would be 24.75% and the Target would be > 75.24

I would like to show the target before Rolling the dice.

How can I implement this? I'm a bit lost here...

It is very important to explain exactly what you want. Do not expect people who are willing to take time to help you to just know what you are actually want.

If you want to display "Target" instead of "Chance"

Find the following code in app.js

Code:

    return el.div(
      {},
      el.span(
        {className: 'lead', style: { fontWeight: 'bold' }},
        'Chance: '
      ),
      innerNode
    );


Code:

    return el.div(
      {},
      el.span(
        {className: 'lead', style: { fontWeight: 'bold' }},
        'Target: '
      ),
      innerNode
    );


Then change the code to inverse the calculation

Find the following code in app.js

Code:
    // Just show '--' if chance can't be calculated
    var innerNode;
    if (isError) {
      innerNode = el.span(
        {className: 'lead'},
        ' --'
      );
    } else {
      innerNode = el.span(
        {className: 'lead'},
        ' ' + (winProb * 100).toFixed(2).toString() + '%'
      );
    }

change it to

Code:
    // Just show '--' if chance can't be calculated
    var innerNode;
    if (isError) {
      innerNode = el.span(
        {className: 'lead'},
        ' --'
      );
    } else {
      innerNode = el.span(
        {className: 'lead'},
        '  > ' + ((winProb * -100) + 100 ).toFixed(2).toString() + '%'
      );
    }

You site will display;

Target: > 75.24%

as simple as that!

Enjoy.
newbie
Activity: 19
Merit: 0
No one can help me here??

 Huh

If you want to change the "Chance:", find in the app.js the following line of code

Code:
  multiplier: {
    str: '2.00',
    num: 2.00,
    error: undefined
  },

Set multiplier anything between 1 and 10 - just note the profit drop if the Chance increase an it will increase if the Chance decrease.







I don't want to change the Chance, I want to add the target number.

Example for Multiplier x4, the Chance would be 24.75% and the Target would be > 75.24

I would like to show the target before Rolling the dice.

How can I implement this? I'm a bit lost here...
full member
Activity: 241
Merit: 107
No one can help me here??

 Huh

If you want to change the "Chance:", find in the app.js the following line of code

Code:
  multiplier: {
    str: '2.00',
    num: 2.00,
    error: undefined
  },

Set multiplier anything between 1 and 10 - just note the profit drop if the Chance increase an it will increase if the Chance decrease.




newbie
Activity: 19
Merit: 0
No one can help me here??

 Huh
newbie
Activity: 19
Merit: 0
Hi!!

I have a couple doubts, please it would be great if someone could HELP me!!!


- Where do I configure the Hedge and so??

- And why do the Domain appears like unverified??

- How can I add the TARGET (Under 50.5 or Over whatever) to the script?? (This is a important missing thing!)

Thanks in advance!!
legendary
Activity: 3570
Merit: 1959

I know it's just comments in the code.. I'm noob, but not that big Cheesy

BTW: I removed the ! and it's working! Thanks! Smiley

No problem, and btw, I didn't mean to imply you were a noob, I just thought it was odd that you only included the comments and not the code.

Glad you got it working. Always hated Javascript myself, it can really be messy sometimes! Wink
newbie
Activity: 19
Merit: 0
I miss the TARGET to roll over or under...

Anyone can help me a bit to add this to the script?
newbie
Activity: 28
Merit: 0
I'm trying to get up my first website with this script, but I don't have SSL and it always redirects to https://.. I found this
Code:
// - Set this to true if you want users that come to http:// to be redirected
  //   to https://
But what do I have to set to true? There's nothing like this..

Those are comments in the code. There should be some code right underneath, like (This is just a guess)

$HTTPS == "true"

(Or something along those lines).  Good luck! Wink


Sorry, I didn't realize the source was on the OP.

This is javascript, so it's different:

Here is the default code, which is causing your redirects to https://
Code:
force_https_redirect: !isRunningLocally()

Since I'm not a Javascript person, I can only guess that removing the ! in front of that function call above will reverse the effect of what is there now - Here is the function it calls if it helps -

Code:
// :: Bool
function isRunningLocally() {
  return /^localhost/.test(window.location.host);
}

Edit - Or, you could try just replacing !isRunningLocally() with either :

true

or

"true"

and see if that fixes it.  Good luck! Smiley

I know it's just comments in the code.. I'm noob, but not that big Cheesy

BTW: I removed the ! and it's working! Thanks! Smiley
legendary
Activity: 3570
Merit: 1959
I'm trying to get up my first website with this script, but I don't have SSL and it always redirects to https://.. I found this
Code:
// - Set this to true if you want users that come to http:// to be redirected
  //   to https://
But what do I have to set to true? There's nothing like this..

Those are comments in the code. There should be some code right underneath, like (This is just a guess)

$HTTPS == "true"

(Or something along those lines).  Good luck! Wink


Sorry, I didn't realize the source was on the OP.

This is javascript, so it's different:

Here is the default code, which is causing your redirects to https://
Code:
force_https_redirect: !isRunningLocally()

Since I'm not a Javascript person, I can only guess that removing the ! in front of that function call above will reverse the effect of what is there now - Here is the function it calls if it helps -

Code:
// :: Bool
function isRunningLocally() {
  return /^localhost/.test(window.location.host);
}

Edit - Or, you could try just replacing !isRunningLocally() with either :

true

or

"true"

and see if that fixes it.  Good luck! Smiley
newbie
Activity: 28
Merit: 0
I'm trying to get up my first website with this script, but I don't have SSL and it always redirects to https://.. I found this
Code:
// - Set this to true if you want users that come to http:// to be redirected
  //   to https://
But what do I have to set to true? There's nothing like this..
newbie
Activity: 19
Merit: 0
Hi!

I've installed in https://meherdice.com and it looks great!

Where do I configure the Hedge and so??

and why do the App appears like unverified??

Thanks!
legendary
Activity: 1442
Merit: 1186
Do I have to have SSL in order for this to work? I tried forking it to my site and the layout popped up for a second and then firefox said "this site is not trusted blah blah blah" since I don't have SSL. I added an exception and then I get a 404 error :/  My uri redirect I put it regular HTTP instead of HTTPS but it auto-redirects to HTTPS.

fix the app.js entry for that lol
I did change the redirect uri in the app.js but it still forces it over to https after loading causing a 404 error.

I take it that you have set redirect uri to => redirect_uri: 'http://www.your-domain.................',

Find these lines in app.js
Code:
  // - Set this to true if you want users that come to http:// to be redirected
  //   to https://
  force_https_redirect: !isRunningLocally()

Change it to

Code:
  // - Set this to true if you want users that come to http:// to be redirected
  //   to https://
  //force_https_redirect: !isRunningLocally()

Thanks Hamburger that was it!
Mega facepalm! How did I not see that? The dev even commented it out! Sometimes the things hardest to find are right in front of my face. LOL
All is working well now that I commented out the force_https_redirect    thanks!
full member
Activity: 241
Merit: 107
Do I have to have SSL in order for this to work? I tried forking it to my site and the layout popped up for a second and then firefox said "this site is not trusted blah blah blah" since I don't have SSL. I added an exception and then I get a 404 error :/  My uri redirect I put it regular HTTP instead of HTTPS but it auto-redirects to HTTPS.

fix the app.js entry for that lol
I did change the redirect uri in the app.js but it still forces it over to https after loading causing a 404 error.

I take it that you have set redirect uri to => redirect_uri: 'http://www.your-domain.................',

Find these lines in app.js
Code:
  // - Set this to true if you want users that come to http:// to be redirected
  //   to https://
  force_https_redirect: !isRunningLocally()

Change it to

Code:
  // - Set this to true if you want users that come to http:// to be redirected
  //   to https://
  //force_https_redirect: !isRunningLocally()
legendary
Activity: 1442
Merit: 1186
Do I have to have SSL in order for this to work? I tried forking it to my site and the layout popped up for a second and then firefox said "this site is not trusted blah blah blah" since I don't have SSL. I added an exception and then I get a 404 error :/  My uri redirect I put it regular HTTP instead of HTTPS but it auto-redirects to HTTPS.

fix the app.js entry for that lol
I did change the redirect uri in the app.js but it still forces it over to https after loading causing a 404 error.
legendary
Activity: 1246
Merit: 1000
!!! RiSe aBovE ThE StoRm !!!
@OP, thanks a lot for this, thanks for letting people like us to be able to manage their own dice sites, if I need your help setting this up even after all the instructions here, will you guide me through???
Pages:
Jump to: