Author

Topic: [ANN] www.BitGrenade.net Hot Potato Chain Game (MNC/LTC) (Read 1637 times)

full member
Activity: 134
Merit: 100
I'm not too worried he just stole his from BitPotatoe and a question on stackoverflow.  I made some "tweaks".
hero member
Activity: 504
Merit: 500
Tsk tsk  Undecided

You should have at least mixed up the values of the items to make it not look so obvious Tongue
hero member
Activity: 1036
Merit: 504
Becoming legend, but I took merit to the knee :(
REPLY TO MY PM
full member
Activity: 179
Merit: 100
You have BLATENTLY stolen our javascript.

bitgrenade :

Code:
$(document).ready(function() {
  
  
function toHMS(seconds)
{
seconds = seconds-1;
if(seconds > 0)
{
var h = Math.floor(seconds / 3600);
var m = Math.floor(seconds % 3600 / 60);
var s = Math.floor(seconds % 3600 % 60);
var result = (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":" + (s  < 10 ? "0" + s : s);
return result;
}
}
function updateTimers()
{
$(".timer").each(function() {
if(!isNaN($(this).html()))
{
seconds = $(this).html();
}
else
{
var hms = $(this).html();
var a = hms.split(":");
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
}

if(seconds > 0)
{
$(this).html(toHMS(seconds));
}
else
{
$(this).html("N/A");
//pollGrenades();
}
});
}
$(".timer").each(function()
{
$(this).html(toHMS($(this).html()));
});

$(".grenade_button").live("click",function() {
var str = $(this).attr("id");
var id = str.match(/[0-9]+/g);

var address = $("#address").val();
var nick = $("#nick").val();
var url = $("#url").val();

$.ajax({
url: "./",
type: "POST",
async: false,
data: "action=buy.grenade&grenade_id="+id+"&address="+address+"&nick="+nick+"&url="+url,
success: function(data) {
if (data.error == 1) {
display_notify(data.title,data.msg,0);
} else {
$("#deposit_fields").html(data.msg);
pollGrenades();
}
}
});


});

var pollingGrenades = false;

function pollGrenades() {

if (! pollingGrenades) {

pollingGrenades = true;

$.ajax({
url: "./",
type: "POST",
async: false,
data: "action=get.grenades&coin_id="+1,
success: function(data) {
$("#grenade_wrapper").html(data.grenades);
}
});

pollingGrenades = false;
}
}

setInterval(updateTimers, 1000);
setInterval(pollGrenades, 30000);
updateTimers();

$("#coin_display").val(1);

$("#coin_display").change(function() {
$("form#coin_select_form").submit();
});

$("#faq_link").click(function() {
$("#faq").modal({
overlayClose:true,
opacity:65,
overlayCss: {backgroundColor:"#000"}
});
});


      
  });

CoinBomb.com
Code:
function toHMS(seconds)
{
seconds = seconds-1;
if(seconds > 0)
{
var h = Math.floor(seconds / 3600);
var m = Math.floor(seconds % 3600 / 60);
var s = Math.floor(seconds % 3600 % 60);
var result = (h < 10 ? "0" + h : h) + ":" + (m < 10 ? "0" + m : m) + ":" + (s  < 10 ? "0" + s : s);
return result;
}
}

function updateTimers()
{
$('.timer').each(function() {
if(!isNaN($(this).html()))
{
seconds = $(this).html();
}
else
{
var hms = $(this).html();
var a = hms.split(':');
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
}

if(seconds > 0)
{
$(this).html(toHMS(seconds));
}
else
{
pollBombs('BTC');
}
});
}

var pollRunning = false;
function pollBombs()
{
if(!pollRunning)
{
pollRunning = true;
$.ajax({
url: "poll.php",
type: "POST",
data: {currencyName : currencyName},
dataType: "html"
})
.done(function(msg)
{
var $msg = $(msg);

$msg.find('.timer').each(function()
{
$(this).html(toHMS($(this).html()));
});
$('#bombWrapper').html($msg);
resizeContainer();
}
)
.always(function()
{
window.pollRunning = false
}
);
}
}
full member
Activity: 134
Merit: 100
Announcing the launch of www.bitgrenade.net

Your classic hot potato chain game supporting both LTC and MNC for the moment.  Will most likely add BTC and any other ALT by popular demand.

Come check us out!
Jump to: