[教學][需測試]一次清掉所有體力的按鈕

Day 1,645, 06:55 Published in Republic of China (Taiwan) Republic of China (Taiwan) by billy3321

把以下程式碼做成按鈕就可以以當前武器一次清掉所有剩餘體力,清完順便幫你回血。然後就停了。
不過如果沒有食物或能量棒,就會停止吃食物。

因為燒的是當前武器,請記得切換到要使用的武器再點喔!

javascript🙁function loop(){var t=Math.round(Math.random()*2000) + 1000;if(parseFloat($j('#current_health').html())!=0){setTimeout(function(){shoot();loop();},t);}else{if(!$j('#DailyConsumtionTrigger').hasClass('disabled')){setTimeout(function(){eatFood();globalSleepTick=globalSleepTimeout;},t);}}})();

如果要糖炮全上,可以用這版:

javascript🙁function loop(){var t=Math.round(Math.random()*2000) + 1000;if(parseFloat($j('#current_health').html())!=0){setTimeout(function(){shoot();loop();},t);}else{if(!$j('#DailyConsumtionTrigger').hasClass('disabled')){setTimeout(function(){eatFood();globalSleepTick=globalSleepTimeout;loop();},t);}}})();

糖炮全上,但是打到51%會暫停:

javascript🙁function loop(){var t=Math.round(Math.random()*2000) + 1000;if(parseFloat($j('#current_health').html())!=0){setTimeout(function(){if($j('#blue_domination').text()

這版要是不能吃食物就會停了:

javascript🙁function loop(){var t=Math.round(Math.random()*2000) + 1000;if(parseFloat($j('#current_health').html())!=0){setTimeout(function(){shoot();loop();},t);}else{if(!$j('#DailyConsumtionTrigger').hasClass('disabled') && !$j('#DailyConsumtionTrigger').hasClass('energy')){setTimeout(function(){eatFood();},t);}}})();

打槍打到不能吃食物(?)

javascript🙁function loop(){var t=Math.round(Math.random()*2000) + 1000;if(parseFloat($j('#current_health').html())!=0){setTimeout(function(){shoot();loop();},t);}else{if(!$j('#DailyConsumtionTrigger').hasClass('disabled') && !$j('#DailyConsumtionTrigger').hasClass('energy')){setTimeout(function(){eatFood();globalSleepTick=globalSleepTimeout;loop();},t);}}})();

做成按鈕的方法請參考:
http://www.erepublik.com/en/article/-1-2038711/1/20

這段程式碼是指定攻擊的間隔時間。如果發生槍打太快或是太慢,可以調整其中的數字。
var t=Math.round(Math.random()*3000) + 1000;
這段是1000微秒+亂數0~3000微秒的時間間隔。

攻擊的過程會出現這個



請大家自行點掉。

一如往常,請大家多多回報問題,謝謝!

附上剛剛夯的抓圖





TaiwanTradeEmpire報業同盟

TTE Weekend   風雨飄搖報   Unlimited Bazooka Works
Angel Meow ~ News Taiwan TIME’s  Sora wo miageru Storia
Hello Tomorrow    Vangola's View Billy's Terminal
3B_Pencil     D觀點     The Real Sound of eROC
Alan's View      Paper Work   Name is not important
頑皮報