<commit_before>var DETECTION_INTERVAL_MS = 750;
var RepeatActionInterval = 90;
var InputInterval = 15;
var DEBUG_MODE = false;

var GAME_MODE = require('./game/Enums.js').GAME_MODE;
var KEYS = require('./game/Enums.js').KEYS;

var fs = require('fs');
var robot = require("robotjs");

var dialog = require('dialog');

var xbox;

try {
	xbox = require('xbox-controller-node');
} catch (e) {
	dialog.warn('Error while connecting to xbox controller driver. Please ensure it is correctly connected and configured.', function(err) {
		var App = require('nw.gui').App;
		App.closeAllWindows();
		App.quit();
	});
}

var Worker = require('workerjs');
var exec = require('child_process').exec;
var fork = require('child_process').fork;

robot.setMouseDelay(0);
robot.setKeyboardDelay(0);

var w = robot.getScreenSize().width;
var h = robot.getScreenSize().height;

var fileResolutionPrefix = w + 'x' + h;

var SCREEN_ASPECT_RATIO = w / h;

console.log('using screen resolution: ' + fileResolutionPrefix);

var halfScreenDiagonal = Math.sqrt(w * w + h * h) / 2;

var BasePosition = {
	x: w / 2,
	y: h * 0.44
};

function SignatureNotFound (filename) {

	if(!DEBUG_MODE) {
		var gui = require('nw.gui');
		
		for(var i in global.__nwWindowsStore) {
			global.__nwWindowsStore[i].hide();
		}
		
		dialog.warn('Signature file ' + filename + ' not found. Could not start the application.', function(err) {
			gui.App.quit();
		});
	}	
	
}

var globalDiffY = (-(h / 1080) + 1) * 100;

function proxyMoveMouse(x, y) {
	robot.moveMouse(x, y - globalDiffY);
}

function IndexOf(o, value) {<commit_msg>Closes the application on unsupported resolutions<commit_after>var DETECTION_INTERVAL_MS = 750;
var RepeatActionInterval = 90;
var InputInterval = 15;
var DEBUG_MODE = false;

var GAME_MODE = require('./game/Enums.js').GAME_MODE;
var KEYS = require('./game/Enums.js').KEYS;

var fs = require('fs');
var robot = require("robotjs");

var dialog = require('dialog');

var xbox;

try {
	xbox = require('xbox-controller-node');
} catch (e) {
	dialog.warn('Error while connecting to xbox controller driver. Please ensure it is correctly connected and configured.', function(err) {
		var App = require('nw.gui').App;
		App.closeAllWindows();
		App.quit();
	});
}

var Worker = require('workerjs');
var exec = require('child_process').exec;
var fork = require('child_process').fork;

robot.setMouseDelay(0);
robot.setKeyboardDelay(0);

var w = robot.getScreenSize().width;
var h = robot.getScreenSize().height;

function SupportedResolution(width, height) {
	this.w = width;
	this.h = height;
}

SupportedResolution.prototype.toString = function() {
	return this.w + "x" + this.h;
};

var SUPPORTED_RESOLUTIONS = [
	new SupportedResolution(1920, 1080),
	new SupportedResolution(1600, 900),
	new SupportedResolution(1366, 768),
];

var ABORTING_APPLICATION = false;

if(!DEBUG_MODE) {

	ABORTING_APPLICATION = (function() {

		var quitGame = true;

		for(var i = 0; i < SUPPORTED_RESOLUTIONS.length && quitGame; i++) {
			var res = SUPPORTED_RESOLUTIONS[i];
			if(w === res.w && h === res.h) {
				quitGame = false;
			}
		}

		if(quitGame) {
			var gui = require('nw.gui');
			
			for(var i in global.__nwWindowsStore) {
				global.__nwWindowsStore[i].hide();
			}
			
			dialog.warn('Unsupported screen resolution. Supported screen resolutions are ' + SUPPORTED_RESOLUTIONS.toString(), function(err) {
				gui.App.quit();
			});
		}
		
		return quitGame;
		
	})();
	
}

var fileResolutionPrefix = w + 'x' + h;

var SCREEN_ASPECT_RATIO = w / h;

console.log('using screen resolution: ' + fileResolutionPrefix);

var halfScreenDiagonal = Math.sqrt(w * w + h * h) / 2;

var BasePosition = {
	x: w / 2,
	y: h * 0.44
};

function SignatureNotFound (filename) {

	if(!DEBUG_MODE && !ABORTING_APPLICATION) {
		var gui = require('nw.gui');
		
		for(var i in global.__nwWindowsStore) {
			global.__nwWindowsStore[i].hide();
		}
		
		dialog.warn('Signature file ' + filename + ' not found. Could not start the application.', function(err) {
			gui.App.quit();
		});
	}	
	
}

var globalDiffY = (-(h / 1080) + 1) * 100;

function proxyMoveMouse(x, y) {
	robot.moveMouse(x, y - globalDiffY);
}

function IndexOf(o, value) {
{'fraction_non_alphanumeric': 0.15145723841376016, 'fraction_numerical': 0.016005733397037744, 'mean_word_length': 4.112332112332112, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3050101', 'n_tokens_mistral': 1635, 'n_tokens_neox': 1453, 'n_words': 354}