1

What's happening is the queue is getting what the value is at the time the queue gets to that function and not the value when the queue was set in the first place. How do I fix this?

    ms = false;
    for(var x in Apps['f-game'].m['gD']['game_data']['lr']['sk']) {
        if(Apps['f-game'].m['gD']['game_data']['lr']['sk'][x] == 1) {
            Apps['f-game'].m['aQ'].queue(function () {
                Apps['f-game'].wGBF(x);

                if(!mS) {
                    Apps['f-game'].m['aQ'].delay(200);
                    Apps['f-game'].m['aQ'].queue(function () {
                        Apps['f-game'].wGBP(x, 5);
                    });
                }
                Apps['f-game'].m['aQ'].delay(500);
            });

        }
    }

Examples Apps['f-game'].m['gD']['game_data']['lr']['sk'] = {1:1,54:1,115894:1}

The entire file will call Apps['f-game'].wGBP(x, 5); and x will be 115894 every time.

Case
  • 4,244
  • 5
  • 35
  • 53

1 Answers1

1

Try 'cheating' by using let varName = data to force a local scope.

Billy
  • 886
  • 8
  • 18