xNeox Posted September 6, 2010 Share Posted September 6, 2010 I am making a mmorpg, and am addind a auto attack button that i want to attack 15 times at 1.75 second intervals then stop, i already have it set up to when you click auto attack it waits the 1.75 second but it doesnt click the next button here is the code function fightDisable() { $('#Fight').attr("disabled","disabled"); $('#Fight').blur(); $("#Fight").val("-=Wait=-"); $('#Fight').oneTime(1750, function() { $('#Fight').removeAttr("disabled"); $("#Fight").val("Fight again!"); }); Link to comment https://forums.phpfreaks.com/topic/212632-javascript-for-loop-to-click-2-buttons/ Share on other sites More sharing options...
Adam Posted September 6, 2010 Share Posted September 6, 2010 That function simply disables a button, changes the value, then reverts it back after 1.75 seconds (just 'oneTime'). Do you want it to do that 15 times? :s Link to comment https://forums.phpfreaks.com/topic/212632-javascript-for-loop-to-click-2-buttons/#findComment-1107853 Share on other sites More sharing options...
xNeox Posted September 6, 2010 Author Share Posted September 6, 2010 There is a attack button and a fight again button, once you click the attack button i want it to wait 1.75 second then click the fight again button and i want it to do that 15 times, i hope that makes more sense, thanks for the help. Link to comment https://forums.phpfreaks.com/topic/212632-javascript-for-loop-to-click-2-buttons/#findComment-1107960 Share on other sites More sharing options...
xNeox Posted September 6, 2010 Author Share Posted September 6, 2010 Or if anyone has a completely different code that will do want i need it to that would be great too. Link to comment https://forums.phpfreaks.com/topic/212632-javascript-for-loop-to-click-2-buttons/#findComment-1108035 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.