Skip to content

Instantly share code, notes, and snippets.

@billy3321
Created May 19, 2012 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billy3321/2731689 to your computer and use it in GitHub Desktop.
Save billy3321/2731689 to your computer and use it in GitHub Desktop.
eat food after restore health
javascript:healthCounterResetCallback=function(hours,mins,secs){if(hours == 0 && mins == 0 && secs == 0){i=$j('#DailyConsumtionTrigger');$j(".resetFoodContainer").hide();$j("#foodText").show();i.removeClass('reset');if(typeof(battleFX) != 'undefined'){var h=$j('#heal_btn');h.removeClass('health_kit_btn');h.addClass('food_btn');}var val=parseFloat($j('#current_health').html());if(val<100){i.removeClass('disabled');}if(reset_has_food == 0){i.removeClass('disabled');i.addClass('buy');$j("#foodText").html(textForBuy);}var t=food_remaining + 100;if(t >= reset_health_to_recover){food_remaining=reset_health_to_recover;$j("#foodResetHoursContainer").css('display','none');} else{food_remaining=t;var a=new ERPK.countDown({display: $j("#foodResetHours"),startTime: "01:00:00",stopTime: "00:00:00",onExpire: healthCounterResetCallback});$j("#foodResetHoursContainer").css('display','block');}$j('.tooltip_health_limit').html(food_remaining + " / " + reset_health_to_recover);if(val<100){eatFood();}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment