0

This bookmarklet to Auto-claim zynga.com rewards does nothing when I click it but works properly for the creator of it. I don't know enough to be able to figure out why it does not work for me. The creator uses firefox, and I have tried it in both firefox and chrome and it does nothing at all. I have tried to update both browsers and all addons but nothing has worked. If you could please look the code over and see if there is anything that would cause a problem, thanks.

var classesPublic='zui_list_itemsContainer zui_zdc_gameboard_rts_rtsList_itemsContainer zui_zdc_gameboard_rts_rtsPublicList_itemsContainer';var classesNeighbors='zui_list_itemsContainer zui_zdc_gameboard_rts_rtsList_itemsContainer zui_zdc_gameboard_rts_rtsNeighborList_itemsContainer';var classesButtons='zui zui_button zui_enabled zui_button_enabled zui_zdc zui_button_zdc zui_zdc_enabled zui_button_zdc_enabled zui_button_tiny zui_button_white';var unclaimedRewardsNeighbors,unclaimedRewardsPublic;var unclaimedNeighborsInit=unclaimedPublicInit=true;function collectRewardsNeighbors(){for(unclaimedIndex=0;unclaimedIndex=1){if(unclaimedNeighborsInit){unclaimedNeighborsInit=false;collectRewardsNeighbors();}else{setTimeout('collectRewardsNeighbors()',1000);}}},false);var parentUnclaimedPublic=document.getElementsByClassName(classesPublic)[0];parentUnclaimedPublic.addEventListener('DOMSubtreeModified',function(){unclaimedRewardsPublic=parentUnclaimedPublic.getElementsByClassName(classesButtons);if(unclaimedRewardsPublic.length>=1){if(unclaimedPublicInit){unclaimedPublicInit=false;collectRewardsPublic();}else{setTimeout('collectRewardsPublic()',1000);}}},false);
  • Check the console for any errors. – sachleen Sep 08 '12 at 21:56
  • in the web console i get the following error: [15:33:47.039] SyntaxError: missing ) after argument list – user1657329 Sep 08 '12 at 22:34
  • `for(unclaimedIndex=0;unclaimedIndex=1)` is not correct syntax or logic. I don't know what its supposed to be doing there. – sachleen Sep 08 '12 at 22:41
  • also if I put it in scratchpad it gives the error: Exception: missing ; after for-loop condition – user1657329 Sep 08 '12 at 22:42
  • It turned out the problem was the syntax errors, netbean helped narrow down where the error was. Thanks for your help sachleen. It won't let me answer my own question, but this is solved for anyone looking here. – user1657329 Sep 09 '12 at 00:53

1 Answers1

1

for(unclaimedIndex=0;unclaimedIndex=1) is not correct syntax or logic. That's probably your error.

Tips:

Use a tool like JS Beautifier to turn that single line of JS into properly formatted, easy to read code.

I use JS Bin to check for warnings and syntax errors.

sachleen
  • 30,730
  • 8
  • 78
  • 73