· 6 years ago · Feb 25, 2020, 09:04 PM
1// ==UserScript==
2// @name Omerta Beyond (edit)
3// @namespace http://tampermonkey.net/
4// @version 12
5// @description try to take over the world!
6// @author void
7// @include *
8// @grant unsafeWindow
9// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
10// @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js
11// @require https://openuserjs.org/src/libs/sizzle/GM_config.js
12// @require https://cdnjs.cloudflare.com/ajax/libs/howler/2.0.4/howler.min.js
13// @require https://raw.githubusercontent.com/AdminAnticaptcha/anticaptcha-nodejs/master/anticaptcha.js
14// @grant unsafeWindow
15// @grant GM_getValue
16// @grant GM_setValue
17// @grant GM_log
18// @grant GM_xmlhttpRequest
19// @grant GM.xmlHttpRequest
20// @connect budgetsms.net
21// @connect 2captcha.com
22// @connect anti-captcha.com
23// @connect pastebin.com
24// @connect self
25// @connect *
26// ==/UserScript==
27//SETTINGS MENU ---- INIT
28var apiFields = {
29 'captcha_api_key': {
30 'label': 'Insert your deacaptcher API key', // Appears next to field
31 'section': ['CAPTCHA Options'], // Appears above the field
32 'type': 'text', // Makes this setting a text field
33 'title': 'Your deacaptcher api key here', // Add a tooltip (hover over text)
34 'default': '' // Default value if user doesn't change it
35 },
36 'proxy_use': {
37 'label': 'Use proxy for captcha ?', // Appears next to field
38 'section': ['Proxy Options'], // Appears above the field
39 'type': 'checkbox', // Makes this setting a text input
40 'title': 'Use proxy for captcha ?', // Add a tooltip (hover over text)
41 'default': false // Default value if user doesn't change it
42 },
43 'proxy_ip': {
44 'label': 'Insert proxy IP (use 0 for your IP)', // Appears next to field
45 'type': 'text', // Makes this setting a text field
46 'title': 'Insert proxy IP (use 0 for your IP)', // Add a tooltip (hover over text)
47 'default': '0' // Default value if user doesn't change it
48 },
49 'proxy_port': {
50 'label': 'Insert proxy port', // Appears next to field
51 'type': 'text', // Makes this setting a text field
52 'title': 'Insert proxy port', // Add a tooltip (hover over text)
53 'default': '' // Default value if user doesn't change it
54 },
55 'proxy_login': {
56 'label': 'Insert proxy login', // Appears next to field
57 'type': 'text', // Makes this setting a text field
58 'title': 'Insert proxy login', // Add a tooltip (hover over text)
59 'default': '' // Default value if user doesn't change it
60 },
61 'proxy_pw': {
62 'label': 'Insert proxy password', // Appears next to field
63 'type': 'text', // Makes this setting a text field
64 'title': 'Insert proxy password', // Add a tooltip (hover over text)
65 'default': '' // Default value if user doesn't change it
66 },
67 'sms_username': {
68 'label': 'Insert your budgetSMS Username - Create free test account they give 60cents !', // Appears next to field
69 'section': ['SMS Options'], // Appears above the field
70 'type': 'text', // Makes this setting a text field
71 'title': 'Your budgetSMS username here', // Add a tooltip (hover over text)
72 'default': '' // Default value if user doesn't change it
73 },
74 'sms_userid': {
75 'label': 'Insert your budgetSMS userID', // Appears next to field
76 'type': 'text', // Makes this setting a text field
77 'title': 'Your budgetSMS userID here', // Add a tooltip (hover over text)
78 'default': '' // Default value if user doesn't change it
79 },
80 'sms_api_key': {
81 'label': 'Insert your budgetSMS HANDLE key', // Appears next to field
82 'type': 'text', // Makes this setting a text field
83 'title': 'Your budgetSMS HANDLE key here', // Add a tooltip (hover over text)
84 'default': '' // Default value if user doesn't change it
85 },
86 'sms_number': {
87 'label': 'Insert your number here! (format: Countrycode+number Ex: 351958845699)', // Appears next to field
88 'type': 'text', // Makes this setting a text field
89 'title': 'Inser your number here!', // Add a tooltip (hover over text)
90 'default': '' // Default value if user doesn't change it
91 }
92};
93var setFields = {
94 'crimes_carros': {
95 'label': 'Enable Crimes and Cars', // Appears next to field
96 'section': ['Ranking Options'], // Appears above the field
97 'type': 'checkbox', // Makes this setting a text input
98 'default': false // Default value if user doesn't change it
99 },
100 'booze_narcs': {
101 'label': 'Enable Booze & Narcs Mode', // Appears next to field
102 'type': 'radio', // Makes this setting a series of radio elements
103 'options': ['Money', 'RP', 'BOOST', 'Disable'], // Possible choices
104 'default': 'Disable' // Default value if user doesn't change it
105 },
106 'scratch': {
107 'label': 'Enable Scratcher', // Appears next to field
108 'section': ['Scratcher Options'], // Appears above the field
109 'type': 'checkbox', // Makes this setting a text input
110 'default': false // Default value if user doesn't change it
111 },
112 'scratch_on_cooldown': {
113 'label': 'Enable Scratcher while on cooldown for other crimes !', // Appears next to field
114 'type': 'checkbox', // Makes this setting a text input
115 'default': false // Default value if user doesn't change it
116 },
117 'min_sc': {
118 'label': 'Min Money on pocket to scratch', // Appears next to field
119 'type': 'int', // Makes this setting a text input
120 'min': 0, // Optional lower range limit
121 'max': 9999999, // Optional upper range limit
122 'default': 500000 // Default value if user doesn't change it
123 },
124 'send_message_scratch': {
125 'label': 'Send message if out of Scratch Money ?', // Appears next to field
126 'type': 'checkbox', // Makes this setting a text input
127 'default': false // Default value if user doesn't change it
128 },
129 'bo': {
130 'label': 'Enable Bust-Outs', // Appears next to field
131 'section': ['Bust-Outs Options'], // Appears above the field
132 'type': 'checkbox', // Makes this setting a text input
133 'default': false // Default value if user doesn't change it
134 },
135 'bo_on_cooldown': {
136 'label': 'Enable Bust-Outs while on cooldown for other crimes!', // Appears next to field
137 'type': 'checkbox', // Makes this setting a text input
138 'default': false // Default value if user doesn't change it
139 },
140 'bo_cooldown_time': {
141 'label': 'Timeout when jail is empty!', // Appears next to field
142 'type': 'int', // Makes this setting a text input
143 'min': 0, // Optional lower range limit
144 'max': 9999999, // Optional upper range limit
145 'default': 10 // Default value if user doesn't change it
146 },
147 'fianca': {
148 'label': 'Pay Out of jail ?', // Appears next to field
149 'section': ['Jail Options'], // Appears above the field
150 'type': 'checkbox', // Makes this setting a text input
151 'default': false // Default value if user doesn't change it
152 },
153 'min_bo': {
154 'label': 'Min Money on pocket to pay out of jail', // Appears next to field
155 'type': 'int', // Makes this setting a text input
156 'min': 0, // Optional lower range limit
157 'max': 9999999, // Optional upper range limit
158 'default': 50000 // Default value if user doesn't change it
159 },
160 'warning_captcha': {
161 'label': 'Only warn when captcha appears? IMPORTANT! IF SELECTED CAPTCHA WONT BE DONE AUTOMATICALLY', // Appears next to field
162 'section': ['Captcha Options'], // Appears above the field
163 'type': 'checkbox', // Makes this setting a text input
164 'default': false // Default value if user doesn't change it
165 },
166 'warning_captcha_sound': {
167 'label': 'Play sound when warning captcha ?', // Appears next to field
168 'type': 'checkbox', // Makes this setting a text input
169 'default': false // Default value if user doesn't change it
170 },
171 'check_message': {
172 'label': 'Check for being shoot while online?', // Appears next to field
173 'section': ['SMS / Misc Options'], // Appears above the field
174 'type': 'checkbox', // Makes this setting a text input
175 'default': false // Default value if user doesn't change it
176 },
177 'do_races': {
178 'label': 'Do races?', // Appears next to field
179 'section': ['Group Crimes / Races Options'], // Appears above the field
180 'type': 'checkbox', // Makes this setting a text input
181 'default': false // Default value if user doesn't change it
182 },
183 'race_friend': {
184 'label': 'Friend to invite for race', // Appears next to field
185 'type': 'text', // Makes this setting a text field
186 'title': 'Type your racer friend ingame', // Add a tooltip (hover over text)
187 'default': '' // Default value if user doesn't change it
188 },
189 'race_ask_chat': {
190 'label': 'Ask for race on chat? (This will take priority over inviting a friend!)', // Appears next to field
191 'type': 'checkbox', // Makes this setting a text input
192 'default': false // Default value if user doesn't change it
193 },
194 'race_msg': {
195 'label': 'Message to send asking race', // Appears next to field
196 'type': 'text', // Makes this setting a text field
197 'title': 'Message to send asking race', // Add a tooltip (hover over text)
198 'default': '' // Default value if user doesn't change it
199 },
200 'do_heists': {
201 'label': 'Do Heists?', // Appears next to field
202 'type': 'checkbox', // Makes this setting a text input
203 'default': false // Default value if user doesn't change it
204 },
205 'heists_friend': {
206 'label': 'Friend to invite for heist', // Appears next to field
207 'type': 'text', // Makes this setting a text field
208 'title': 'Type your heist friend ingame', // Add a tooltip (hover over text)
209 'default': '' // Default value if user doesn't change it
210 },
211 'heists_ask_chat': {
212 'label': 'Ask for heist on chat? (This will take priority over inviting a friend! so only select if you really want!)', // Appears next to field
213 'type': 'checkbox', // Makes this setting a text input
214 'default': false // Default value if user doesn't change it
215 },
216 'heist_msg': {
217 'label': 'Message to send asking heist', // Appears next to field
218 'type': 'text', // Makes this setting a text field
219 'title': 'Message to send asking heist', // Add a tooltip (hover over text)
220 'default': '' // Default value if user doesn't change it
221 },
222 'do_raids': {
223 'label': 'Do Raids?', // Appears next to field
224 'type': 'checkbox', // Makes this setting a text input
225 'default': false // Default value if user doesn't change it
226 },
227 'raids_friend': {
228 'label': 'Friend to invite for raid', // Appears next to field
229 'type': 'text', // Makes this setting a text field
230 'title': 'Type your raid friend ingame', // Add a tooltip (hover over text)
231 'default': '' // Default value if user doesn't change it
232 },
233 'raids_ask_chat': {
234 'label': 'Ask for Raids on chat? (This will take priority over inviting a friend! so only select if you really want!)', // Appears next to field
235 'type': 'checkbox', // Makes this setting a text input
236 'default': false // Default value if user doesn't change it
237 },
238 'raids_msg': {
239 'label': 'Message to send asking raid', // Appears next to field
240 'type': 'text', // Makes this setting a text field
241 'title': 'Message to send asking raid', // Add a tooltip (hover over text)
242 'default': '' // Default value if user doesn't change it
243 },
244 'do_ocs': {
245 'label': 'Do Organised Crimes?', // Appears next to field
246 'type': 'checkbox', // Makes this setting a text input
247 'default': false // Default value if user doesn't change it
248 },
249 'ocs_ask_chat': {
250 'label': 'Ask for Organised Crimes on chat?', // Appears next to field
251 'type': 'checkbox', // Makes this setting a text input
252 'default': false // Default value if user doesn't change it
253 },
254 'ocs_msg': {
255 'label': 'Message to send asking oc', // Appears next to field
256 'type': 'text', // Makes this setting a text field
257 'title': 'Message to send asking oc', // Add a tooltip (hover over text)
258 'default': '' // Default value if user doesn't change it
259 },
260 'GC_city': {
261 'label': 'Choose which city (or all) to do Group Crimes !', // Appears next to field
262 'type': 'select', // Makes this setting a text input
263 'options': ['Any', 'Detroit', 'Chicago', 'Palermo', 'New York', 'Las Vegas', 'Philadelphia', 'Baltimore', 'Corleone'],
264 },
265 'milestone_check': {
266 'label': 'Check for milestones and accept them ?)', // Appears next to field
267 'section': ['Milestones Options'], // Appears above the field
268 'type': 'checkbox', // Makes this setting a text input
269 'default': false // Default value if user doesn't change it
270 },
271 'milestone_send_sms': {
272 'label': 'Send sms when milestone redeemed ? (Need sms credentials!)', // Appears next to field
273 'type': 'checkbox', // Makes this setting a text input
274 'default': false // Default value if user doesn't change it
275 }
276};
277
278function whatV(hostname) {
279 hostname = hostname || window.location.hostname;
280 if (/(.*).omerta.land$/.test(hostname)) {
281 return 'dev';
282 }
283 switch (hostname) {
284 case 'www.omerta3.com':
285 case 'omerta3.com':
286 case 'www.barafranca.com':
287 case 'barafranca.com':
288 case 'www.barafranca.us':
289 case 'barafranca.us':
290 return 'com';
291 case 'omerta.dm':
292 case 'www.omerta.dm':
293 return 'dm';
294 case 'www.barafranca.nl':
295 case 'barafranca.nl':
296 return 'nl';
297 case 'www.omerta.com.tr':
298 case 'omerta.com.tr':
299 return 'tr';
300 case 'omerta.pt':
301 case 'www.omerta.pt':
302 return 'pt';
303 default:
304 return undefined;
305 }
306}
307var version = whatV();
308console.log("Version: " + version);
309var infoPage = (version == 'dm') ? '/?module=UserInformation' : '/information.php';
310if (version != undefined) {
311 GM_config.init({
312 'id': version, // The id used for this instance of GM_config
313 'title': 'Configuration for version: ' + version,
314 'fields': setFields, // Fields object
315 'events': // Callback functions object
316 {
317 'save': function() {
318 onSave();
319 }
320 }
321 });
322 var gmAPI = new GM_configStruct({
323 'id': 'APIoptions', // The id used for this instance of GM_config
324 'title': 'Configuration of Captcha/SMS API',
325 'fields': apiFields, // Fields object
326 'events': // Callback functions object
327 {
328 'save': function() {
329 onSaveAPI();
330 }
331 }
332 });
333} else {
334 console.log("Version is undefined - Not loading GM");
335}
336// TIMEOUTS
337var infoTimeOut, scratch10, scratchGo, dAsync, gApiTO, doCaptchaTO, captchaErroTO1, captchaErroTO2, doCrimeTO, doCarTO, doBN1, doBN2, doBN3, loopTO3, loopTO2, loopTO4;
338// CONFIG VARS
339var doingCaptcha = false;
340// First Time Check
341var lcArrayStorage = ["Enable", "heistChatMsg", "heistWaitTime", "raceChatMsg", "raceWaitTime", "raidChatMsg", "raidWaitTime", "ocWaitTime", "ocChatMsg"];
342lcArrayStorage.forEach(function(elem) {
343 if (localStorage.getItem(elem) === null) {
344 console.log(elem + ' = Null'); // first time runner
345 localStorage.setItem(elem, 0);
346 }
347});
348
349
350// Help Stacks
351var ranks = ['Empty-suit', 'Delivery Boy', 'Delivery Girl', 'Picciotto', 'Shoplifter', 'Pickpocket', 'Thief', 'Associate', 'Mobster', 'Soldier', 'Swindler', 'Assassin', 'Local Chief', 'Chief', 'Bruglione', 'Capodecina', 'Godfather', 'First Lady'];
352var cities = ['Detroit', 'Chicago', 'Palermo', 'New York', 'Las Vegas', 'Philadelphia', 'Baltimore', 'Corleone'];
353var maxBooze = [1, 2, 2, 5, 7, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 70, 70];
354var maxNarcs = [0, 0, 0, 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 20, 20, 20];
355var boozenames = ['NO BOOZE', 'Wine', 'Beer', 'Rum', 'Cognac', 'Whiskey', 'Amaretto', 'Port'];
356var narcnames = ['NO NARCS', 'Morphine', 'Marijuana', 'Glue', 'Heroin', 'Opium', 'Cocaine', 'Tabacco'];
357var prevPrices = [];
358
359//CONTROL VARS
360var action;
361var SmuggleDone = false;
362var CanTravel = true;
363//Actualizar na hora as settings
364function onSave() {
365 console.log('Settings saved');
366 Enable = localStorage.getItem("Enable");
367 booze_narcs = GM_config.get('booze_narcs');
368 crimes_carros = GM_config.get('crimes_carros');
369 scratch = GM_config.get('scratch');
370 scratch_on_cooldown = GM_config.get('scratch_on_cooldown');
371 min_sc = GM_config.get('min_sc');
372 bos = GM_config.get('bo');
373 bo_on_cooldown = GM_config.get('bo_on_cooldown');
374 bo_cooldown_time = GM_config.get('bo_cooldown_time');
375 pagar_fianca = GM_config.get('fianca');
376 min_fianca = GM_config.get('min_bo');
377 do_races = GM_config.get('do_races');
378 do_heists = GM_config.get('do_heists');
379 do_raids = GM_config.get('do_raids');
380 heists_chat = GM_config.get('heists_ask_chat');
381 heists_friend = GM_config.get('heists_friend');
382 race_friend = GM_config.get('race_friend');
383 race_chat = GM_config.get('race_ask_chat');
384 raids_chat = GM_config.get('raids_ask_chat');
385 raids_friend = GM_config.get('raids_friend');
386 do_ocs = GM_config.get('do_ocs');
387 ocs_chat = GM_config.get('ocs_ask_chat');
388 GC_city = GM_config.get('GC_city');
389 race_msg = GM_config.get('race_msg');
390 heist_msg = GM_config.get('heist_msg');
391 raids_msg = GM_config.get('raids_msg');
392 ocs_msg = GM_config.get('ocs_msg');
393 send_message_scratch = GM_config.get('send_message_scratch');
394 warning_captcha = GM_config.get('warning_captcha');
395 warning_captcha_sound = GM_config.get('warning_captcha_sound');
396 milestone_check = GM_config.get('milestone_check');
397 milestone_send_sms = GM_config.get('milestone_send_sms');
398 $('#GODbody').html('Enable:<font style="float:right;"><b>' + Enable + '</b></font><br />Car/Crimes:<font style="float:right;"><b>' + crimes_carros + '</b></font><br />Booze/Narcs:<font style="float:right;"><b>' + booze_narcs + '</b></font><br />Scratch:<font style="float:right;"><b>' + scratch + '</b></font><br />BustOuts:<font style="float:right;"><b>' + bos);
399}
400
401function onSaveAPI() {
402 console.log('API Settings saved');
403 captcha_api_key = gmAPI.get('captcha_api_key');
404 proxy_use = gmAPI.get('proxy_use');
405 proxy_login = gmAPI.get('proxy_login');
406 proxy_pw = gmAPI.get('proxy_pw');
407 proxy_ip = gmAPI.get('proxy_ip');
408 proxy_port = gmAPI.get('proxy_port');
409 sms_api_key = gmAPI.get('sms_api_key');
410 sms_username = gmAPI.get('sms_username');
411 sms_userid = gmAPI.get('sms_userid');
412 sms_number = gmAPI.get('sms_number');
413}
414if (version != undefined) {
415 onSave();
416 onSaveAPI();
417} else {
418 console.log("Version Undefined - GM not loaded!");
419}
420// HORA
421function getOmertaTime() {
422 if (typeof unsafeWindow.omerta.server.clock !== 'undefined') {
423 return unsafeWindow.omerta.server.clock.getTime();
424 }
425 if (typeof unsafeWindow.omerta.Clock !== 'undefined') {
426 return unsafeWindow.omerta.Clock.getTime();
427 }
428 return Date.now();
429}
430//Send notifications
431function notifyGOD(title, text, tag, URLicon) {
432 var notification = new Notification(title, {
433 dir: 'auto',
434 body: text,
435 icon: URLicon,
436 tag: tag
437 });
438 notification.onclick = function() {
439 parent.focus();
440 notification.close();
441 };
442 setTimeout(notification.close.bind(notification), 6800);
443}
444
445function playSound() {
446 var sound = new Howl({
447 src: ['https://d1oi19aitxwcck.cloudfront.net' + '/sounds/beep.mp3']
448 });
449 sound.play();
450}
451//Funcao get pageurl
452function getUrl() {
453 return (pageUrl = "https://" + (location.host) + "/");
454}
455//Funcao clearTimeouts
456function clearTO(id) {
457 if (typeof id !== 'undefined') {
458 clearTimeout(id);
459 }
460}
461//Função detectar pagina
462function on_page(str) {
463 if (window.location.hash.indexOf(str) != -1) {
464 return true;
465 }
466 return false;
467}
468
469function check_title(title) {
470 var pTitle = omerta.GUI.container.title();
471 if (pTitle.indexOf(title) !== -1) {
472 return true;
473 } else {
474 return false;
475 }
476}
477//Função nr random entre (min) (max)
478function rnd(min, max) {
479 return Math.floor(Math.random() * (max - min + 1) + min);
480}
481
482function array_sum(array) {
483 return array.reduce(function(a, b) {
484 return (a + b);
485 });
486}
487// LOGOUT
488function logout() {
489 window.location = '/logout.php';
490}
491
492// Func detectar captcha
493function deCaptcha() {
494 if ((document.documentElement.textContent || document.documentElement.innerText).indexOf('Security Check') > -1 && warning_captcha === true) {
495 console.log('Got Captcha - Sending warn notification! - check if done in 7 seconds');
496 doingCaptcha = true;
497 notifyGOD('Got Captcha', 'Have captcha on ' + version + ' !', 'captcha', 'https://www.google.com/recaptcha/intro/images/hero-recaptcha-invisible.gif');
498 if (warning_captcha_sound === true) {
499 playSound();
500 }
501 warnCaptcha = setTimeout(loop, 7000);
502 } else if ((document.documentElement.textContent || document.documentElement.innerText).indexOf('Security Check') > -1) {
503 console.log("Temos Captcha");
504 if (doingCaptcha === false) {
505 console.log("Doing Captcha");
506 doingCaptcha = true;
507 var anticaptcha = new Anticaptcha(captcha_api_key);
508 anticaptcha.setWebsiteURL(window.location.href);
509 anticaptcha.setWebsiteKey("6Ldvw_4SAAAAALAn52hITD-mzh10oyGaef6-A3bf");
510
511 //proxy access parameters
512 anticaptcha.setProxyType("http");
513 if (proxy_ip === '0') {
514 anticaptcha.setProxyAddress(myip);
515 } else {
516 anticaptcha.setProxyAddress(proxy_ip);
517 }
518 anticaptcha.setProxyPort(proxy_port);
519 anticaptcha.setProxyLogin(proxy_login);
520 anticaptcha.setProxyPassword(proxy_pw);
521
522 anticaptcha.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36");
523
524 //Do Captcha
525 anticaptcha.createTask(function(err, taskId) {
526 if (err) {
527 doCaptchaTO4 = setTimeout(function() {
528 console.error(err);
529 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
530 location.reload();
531 return;
532 },5000);
533 }
534
535 console.log("taskId: " + taskId);
536
537 anticaptcha.getTaskSolution(taskId, function(err, taskSolution) {
538 if (err) {
539 doCaptchaTO3 = setTimeout(function() {
540 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
541 location.reload();
542 return;
543 },5000);
544 }
545 console.log("taskSolution: " + taskSolution);
546
547 $(".g-recaptcha-response").innerHTML = taskSolution;
548 //$('span#recaptcha-anchor').click();
549 omerta.services.security.check(taskSolution);
550 doCaptchaTO = setTimeout(function() {
551 doingCaptcha = false;
552 loop();
553 }, 3000);
554
555 });
556 });
557 } else {
558 console.log("Temos captcha - Ja estamos a fazer!");
559 }
560 } else {
561 doingCaptcha = false;
562 return false;
563 }
564}
565//Reload DIV quando fica stuck em mensagens de merda !
566function clks() {
567 var page = window.location.hash.substring(1);
568 $('#game_container').load(page);
569}
570function gotClicks(){
571 if ($('#game_container:contains("You reached your click limit.")').length) { // CLICKS WAIT 10 SECS AND RELOAD DIV
572 console.log("Clicks - 10secs tentar de novo");
573 gotclicksTO1 = setTimeout(function() {
574 clks();
575 loop();
576 }, 10000);
577 return true;
578 }
579 else{
580 return false;
581 }
582}
583function startStop() {
584 var Enable = localStorage.getItem('Enable');
585 if (Enable != "true") {
586 localStorage.setItem('Enable', "true");
587 onSave();
588 Enable = localStorage.getItem('Enable');
589 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
590 loop();
591 } else if (Enable === "true") {
592 clearTO(infoTimeOut);
593 clearTO(scratch10);
594 clearTO(scratchGo);
595 clearTO(loopTO3);
596 clearTO(loopTO2);
597 clearTO(loopTO4);
598 localStorage.setItem('Enable', "false");
599 onSave();
600 Enable = localStorage.getItem('Enable');
601 loop();
602 }
603}
604
605function start() {
606 var Enable = localStorage.getItem('Enable');
607 localStorage.setItem('Enable', "true");
608 onSave();
609 Enable = localStorage.getItem('Enable');
610 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
611 loop();
612}
613
614function stop() {
615 clearTO(infoTimeOut);
616 clearTO(scratch10);
617 clearTO(scratchGo);
618 clearTO(loopTO3);
619 clearTO(loopTO2);
620 clearTO(loopTO4);
621 localStorage.setItem('Enable', "false");
622 onSave();
623 Enable = localStorage.getItem('Enable');
624 loop();
625}
626
627function chkMessage() {
628 var check_message = GM_config.get('check_message');
629 if (check_message === true) {
630 msgSI = setInterval(function() {
631 console.log('Checking if got shoot!');
632 var serviceData = unsafeWindow.omerta.services.account.data;
633 var lastShootID = localStorage.getItem('lastShootID');
634 if (serviceData.messages.inbox.length > 0) {
635 var totalMessages = 0;
636 $.each(serviceData.messages.inbox, function(i, val) {
637 var id = parseInt(val.id, 10);
638 msgText = serviceData.messages.inbox[i].msg;
639 msgTitle = /*'New message from ' + serviceData.messages.inbox[i].frm + ': ' +*/ serviceData.messages.inbox[i].sbj;
640 console.log(msgTitle);
641 console.log(msgText);
642 if (lastShootID != id && (msgTitle == "You've been shot!" || msgTitle == "Foste atacado!")) {
643 GM_xmlhttpRequest({
644 method: "GET",
645 url: "http://api.budgetsms.net/sendsms/?username=" + sms_username + "&userid=" + sms_userid + "&handle=" + sms_api_key + "&msg=" + msgText + "&from=GODSCRIPT&to=" + sms_number,
646 onload: function(response) {
647 console.log(response.responseText);
648 }
649 });
650 localStorage.setItem('lastShootID', id);
651 }
652 totalMessages += 1;
653 });
654 }
655 }, 30000);
656 }
657}
658
659// NEW priceS
660function newPrices() {
661 setTimeout(function() {
662 console.log("BN Price Fetcher ON!");
663 $.get('//' + document.location.hostname + '/BeO/webroot/index.php?module=API&action=smuggling_prices', function(dom) {
664 function getPrice(drug, city) {
665 return dom.getElementsByTagName(drug)[city].textContent;
666 }
667
668 function refreshMarquee(h, m) {
669 h = (m >= 31 ? h + 1 : h);
670 m = (m >= 31 ? 1 : 31);
671 var marQd = new Date();
672 marQd.setHours(h);
673 marQd.setMinutes(m);
674 marQd.setSeconds(0);
675 marQd.setMilliseconds(0);
676 return (marQd.getTime() - getOmertaTime());
677 }
678
679 var p = [];
680 var q = [];
681 var pricesChanged = false;
682
683 for (var i = 0; i <= 7; i++) {
684 p[i] = getPrice('cocaine', i);
685 q[i] = p[i];
686 if ((prevPrices === undefined || prevPrices[i] === undefined) || prevPrices[i] != p[i]) {
687 pricesChanged = true;
688 }
689 }
690
691 if (pricesChanged) {
692 prevPrices = JSON.parse(JSON.stringify(q));
693 } else {
694 console.log("Waiting new prices!");
695 setTimeout(newPrices, 30000);
696 return;
697 }
698
699 // NEW PRICES
700 highPriceNarcs = 0;
701 lowPriceNarcs = 99999;
702 highPriceBooze = 0;
703 lowPriceBooze = 99999;
704 highCity = -1;
705 lowCity = -1;
706
707 /*var possessions = unsafeWindow.omerta.modules.UserInformation.data.possessions;
708 if (possessions) {
709 $.each(possessions, function(i) {
710 if (possessions[i].type == 'plane') {
711 ride = possessions[i].name_owned;
712 }
713 });
714 }
715 var rides = ['none', 'geen', 'Fokker DR-1', 'Havilland DH 82A', 'Fleet 7', 'Douglas DC-3'];
716 for (var plane = 0, i = 0; i <= 5; i++) {
717 if (rides[i] == ride) {
718 plane = i;
719 break;
720 }
721 }*/
722
723 for (i = 0; i <= 7; i++) {
724 var tempPriceNarc = parseInt(dom.getElementsByTagName('cocaine')[i].textContent, 10);
725 var tempPriceBooze = parseInt(dom.getElementsByTagName('rum')[i].textContent, 10);
726 //if( plane != 0 && (i != 2 || i != 7 )){
727 //high
728 highPriceNarcs = Math.max(highPriceNarcs, tempPriceNarc);
729 if (highPriceNarcs == tempPriceNarc) {
730 highCity = i;
731 highPriceBooze = tempPriceBooze;
732 }
733 //low
734 lowPriceNarcs = Math.min(lowPriceNarcs, tempPriceNarc);
735 if (lowPriceNarcs == tempPriceNarc) {
736 lowCity = i;
737 lowPriceBooze = tempPriceBooze;
738 }
739 //}
740 }
741 console.log("High City is: " + cities[highCity] + " - Coke: " + highPriceNarcs + " - Rum: " + highPriceBooze);
742 console.log("Low City is: " + cities[lowCity] + " - Coke: " + lowPriceNarcs + " - Rum: " + lowPriceBooze);
743
744 //SET FOR NEXT 30MINS !
745 setTimeout(newPrices, refreshMarquee(new Date().getHours(), new Date().getMinutes()));
746 });
747 });
748}
749function travel(id, callback) {
750 unsafeWindow.omerta.GUI.container.loadPage('/?module=Travel&action=FetchInfo&CityId=' + id);
751 travelGOTO = setTimeout(function() {
752 if ($('#game_container:contains("You will be able to travel again")').length) { // We cant travel!
753 CanTravel = false;
754 callback();
755 } else {
756 travelTO = setTimeout(function() {
757 $('input[type=submit]').removeAttr("data-confirm");
758 $('input[type=submit]').focus().click();
759 canTravel = false;
760 travelTO1 = setTimeout(function() {
761 callback();
762 }, 2000);
763 }, 2000);
764 }
765 }, 2000);
766}
767//Press Funcs
768function pressSCRT() {
769 if ($('#game_container:contains("You can buy")').length) {
770 if ($('input[name="codescratch"]').length) { // focus on unclaimed prices
771 $('input[type="submit"]:eq(1)').focus().click(); // clikar unclaimed prizes
772 } else { // focus on scratch
773 $('input[name="scratch"]').focus().click();
774 }
775 } else if ($('#game_container:contains("Congratulations!")').length) { // won something
776 $('input[name="scratch"]').focus().click();
777 } else if ($('#game_container:contains("Sorry mate")').length) { // no prize
778 $('input[name="scratch"]').focus().click();
779 } else if ($('#game_container:contains("Start scratching")').length) { // Pagina inicio
780 if ($('input[name="Check"]').length) {
781 $('input[name="Check"]').focus().click();
782 } else {
783 $('input[type="submit"]').focus().click();
784 }
785 } else if ($('#game_container:contains("here to try again")').length) {
786 console.log("Demos reload ou click com captcha! SHIT");
787 if ((document.documentElement.textContent || document.documentElement.innerText).indexOf('Security Check') > -1) {
788 console.log("Ainda tem captcha");
789 return;
790 } else {
791 console.log("Shit page - go to scratch again !");
792 unsafeWindow.omerta.GUI.container.loadPage('/scratch.php');
793 }
794 } else if ($('#game_container:contains("You tramp! Trying to steal our scratch cards!")').length) { // no money go logout
795 console.log("Tamos sem $, dammm :( - Fazer logout");
796 if (send_message_scratch === true) {
797 GM_xmlhttpRequest({
798 method: "GET",
799 url: "http://api.budgetsms.net/sendsms/?username=" + sms_username + "&userid=" + sms_userid + "&handle=" + sms_api_key + "&msg=Out_of_scratch_money&from=GODSCRIPT&to=" + sms_number,
800 onload: function(response) {
801 console.log(response.responseText);
802 }
803 });
804 }
805 logout();
806 }
807}
808//JAIL
809function inJail() {
810 var pocketMoney = omerta.services.account.data.money;
811 if ($('#game_container:contains("You are in jail for the next")').length) {
812 console.log("preso");
813 if ($('#game_container:contains("Try to bust yourself out.")').length) {
814 console.log("tirar-me da prisa");
815 $('input[type=submit]:eq(1)').focus().click();
816 } else if (pagar_fianca === true && pocketMoney > min_fianca) {
817 console.log("pagar fiança");
818 $('input[name="buymeout"]').focus().click();
819 clks();
820 return false;
821 } else if ($('#game_container:contains("Now")').length) {
822 console.log("Nao pagar fiança. tempo acabou");
823 clks();
824 return false;
825 } else {
826 return true;
827 }
828 } else {
829 return false;
830 }
831}
832//BOBOS - money left
833function bobos() {
834 var pocketMoney = omerta.services.account.data.money;
835 if (deCaptcha() === false) {
836 if ($('#game_container:contains("GO FOR IT")').length) {
837 console.log("do bo");
838 $('input[type="submit"]').focus().click();
839 } else if ($('#game_container:contains("You are in jail for the next")').length) {
840 console.log("preso");
841 if ($('#game_container:contains("Try to bust yourself out.")').length) {
842 console.log("tirar-me da prisa");
843 $('input[type=submit]:eq(1)').focus().click();
844 } else if (pagar_fianca === true && pocketMoney > min_fianca) {
845 console.log("pagar fiança");
846 $('input[name="buymeout"]').focus().click();
847 } else if ($('#game_container:contains("Now")').length) {
848 console.log("Nao pagar fiança. tempo acabou");
849 clks();
850 }
851 } else if ($('#game_container:contains("You have been released from jail")').length) {
852 console.log("Deram bo ou pagaram fiança");
853 clks();
854 } else if ($('#game_container:contains("You bought yourself out")').length) {
855 console.log("falhei tirarme 3x paguei fiança");
856 clks();
857 }
858 }
859}
860//-------------------------------------------------------------------------
861// ------------------------ Funções de ranking ----------------------------
862function crimeAtpt() {
863 unsafeWindow.omerta.GUI.container.loadPage('/?module=Crimes');
864 if (deCaptcha() === false) {
865 doCrimeTO = setTimeout(function() {
866 console.log('Doing Crime!');
867 $("#crime-chance5").click();
868 doCrimeTO2 = setTimeout(loop, 1250);
869 }, 1000);
870 }
871}
872
873function carN() {
874 unsafeWindow.omerta.GUI.container.loadPage('/?module=Cars');
875 if (deCaptcha() === false) {
876 doCarTO = setTimeout(function() {
877 var bestChance = 0;
878 var choice = 3;
879 $('#nick-car-choices .head h4').each(function(i) {
880 if (parseInt($(this).text().replace('%', ''), 10) > bestChance) {
881 bestChance = parseInt($(this).text().replace('%', ''), 10);
882 choice = i;
883 }
884 });
885 $('#nick-car-choices .popup-place-wrapper:eq(' + choice + ')').addClass('active');
886 $('#nick-car-choices button:eq(' + choice + ')').focus().click();
887 console.log('Doing Car Nick! Option: ' + choice + " With Chance of: " + bestChance);
888 doCarTO2 = setTimeout(loop, 1250);
889 }, 1000);
890 }
891}
892
893function bnRP() { // TO MAKE IT BETTER !
894 if (Enable == "true") {
895 if (!on_page('/smuggling.php')) {
896 unsafeWindow.omerta.GUI.container.loadPage('/smuggling.php');
897 }
898 doRP0 = setTimeout(function() {
899 if (check_title("Smuggling") === true) {
900 if (deCaptcha() === false) {
901 if (inJail() === false ) {
902 if (!gotClicks()){
903 doRP1 = setTimeout(function() {
904 //Check if lackeys on
905 if ($('#game_container').html().match('/orourke.jpg') !== null || $('#game_container').html().match('/freekowski.jpg') !== null) {
906 console.log("BN Lackeys on!");
907 GM_config.set('booze_narcs', "Disabled");
908 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
909 loop();
910 }
911 console.log('Doing RP Booze/Narc Buy!');
912 var MyCity = unsafeWindow.omerta.character.game.city();
913 for (i = 0; i < 8; i++) {
914 if (MyCity == cities[i]) {
915 MyCity = i;
916 break;
917 }
918 }
919 //Check what we carry!
920 var inputs = $('input');
921 var bn_xp = '.smuggling-header';
922 if( $(bn_xp).html() != undefined ){
923 var bn_text = $(bn_xp).html().split('|');
924 }
925 else{
926 console.log("cant get bn_xp - try again");
927 bnRPTO01 = setTimeout(function() {
928 bnRP();
929 }, 2000);
930 }
931
932 var cash = parseInt(bn_text[0].replace(/[^0-9.]/g, ''), 10);
933 var booze = parseInt(bn_text[1].replace(/[^0-9.]/g, ''), 10); // max amount user can carry
934 var narcs = parseInt(bn_text[2].replace(/[^0-9.]/g, ''), 10);
935
936 var b_amount = [0, 0, 0, 0, 0, 0];
937 var n_amount = [0, 0, 0, 0, 0, 0];
938
939 var xpb = 'table.thinline > tbody > tr:eq(';
940 var xpn = 'table.thinline:eq(1) > tbody > tr:eq(';
941
942 for (var i = 0; i <= 13; i++) {
943 if (i < 7) { // booze
944 var x = i + 3;
945 b_amount[i] = parseInt($(xpb + x + ') > td:eq(2)').html(), 10);
946 }
947
948 if (i > 6) {
949 var x = i - 4;
950 n_amount[(i - 7)] = parseInt($(xpn + x + ') > td:eq(2)').html(), 10); // define how much of this item is being carried
951 }
952
953 }
954 var totalB = array_sum(b_amount);
955 var totalN = array_sum(n_amount);
956 var missingB = booze - totalB;
957 var missingN = narcs - totalN;
958
959 //Need to sell whatever i'm holding!
960 if (parseInt(totalB, 10) !== 0 || parseInt(totalN, 10) !== 0) {
961 var sorts = ['wine', 'cognac', 'whiskey', 'amaretto', 'beer', 'port', 'rum', 'morphine', 'heroin', 'opium', 'cocaine', 'marihuana', 'tabacco', 'glue'];
962 for (i = 0; i <= 13; i++) {
963 var box = $('input[name="' + sorts[i] + '"]');
964 if (i < 7) {
965 box.val(b_amount[i]);
966 } else {
967 box.val(n_amount[i - 7]);
968 }
969 }
970 $('input[name="typebooze"]:eq(0)').prop('checked', true); // sell
971 $('input[name="typedrugs"]:eq(0)').prop('checked', true); // sell
972 var rpTO1 = setTimeout(function() {
973 $('input[type=submit]').focus().click();
974 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
975 loop();
976 }, 2000);
977 } else if ($('.smuggling-table-info:eq(0)').text().match(/NOW|booze is(\s+)$/m) || $('.smuggling-table-info:eq(1)').text().match(/NOW|narcotics is(\s+)$/m)) { // have BN to buy for RP !
978 if ($('.smuggling-table-info:eq(0)').text().match(/NOW|booze is(\s+)$/m)) // booze RP
979 {
980 $('input[name="beer"]').val(booze);
981 $('input[name="typebooze"]:eq(1)').prop('checked', true); // buy
982 }
983 if ($('.smuggling-table-info:eq(1)').text().match(/NOW|narcotics is(\s+)$/m)) // narcs RP
984 {
985 $('input[name="glue"]').val(narcs);
986 $('input[name="typedrugs"]:eq(1)').prop('checked', true); // buy
987 }
988 var rpTO2 = setTimeout(function() {
989 $('input[type=submit]').focus().click();
990 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
991 loop();
992 }, 2000);
993 } else { // Means we have no RP to gain!
994 rpTO3 = setTimeout(function() {
995 if (deCaptcha() === false) {
996 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
997 loop();
998 }
999 }, 2000);
1000 }
1001 }, 2000);
1002 }
1003 }else if (inJail() === true){
1004 var bnRPTO02 = setTimeout(function(){
1005 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1006 loop();
1007 },5000);
1008 }
1009 }
1010 } else {
1011 clks();
1012 bnRP();
1013 }
1014 }, 2000);
1015 }
1016}
1017
1018function BoozeNarcRun() {
1019 if (Enable == "true") {
1020 if (!on_page('/smuggling.php')) {
1021 unsafeWindow.omerta.GUI.container.loadPage('/smuggling.php');
1022 }
1023 doSmug1 = setTimeout(function() {
1024 if (check_title("Smuggling") === true) {
1025 if (deCaptcha() === false) {
1026 if (inJail() === false) {
1027 doSmug2 = setTimeout(function() {
1028 //Check if lackeys on
1029 if ($('#game_container').html().match('/orourke.jpg') !== null || $('#game_container').html().match('/freekowski.jpg') !== null) {
1030 console.log("BN Lackeys on!");
1031 GM_config.set('booze_narcs', "Disabled");
1032 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1033 loop();
1034 }
1035 SmuggleDone = false;
1036 console.log('Doing booze or narc money run!');
1037 var MyCity = unsafeWindow.omerta.character.game.city();
1038 for (i = 0; i < 8; i++) {
1039 if (MyCity == cities[i]) {
1040 MyCity = i;
1041 break;
1042 }
1043 }
1044
1045 //Check what we carry!
1046 var inputs = $('input');
1047 var bn_xp = '.smuggling-header';
1048 var bn_text = $(bn_xp).html().split('|');
1049
1050 var cash = parseInt(bn_text[0].replace(/[^0-9.]/g, ''), 10);
1051 var booze = parseInt(bn_text[1].replace(/[^0-9.]/g, ''), 10); // max amount user can carry
1052 var narcs = parseInt(bn_text[2].replace(/[^0-9.]/g, ''), 10);
1053 var b_amount = [0, 0, 0, 0, 0, 0];
1054 var n_amount = [0, 0, 0, 0, 0, 0];
1055
1056 var xpb = 'table.thinline > tbody > tr:eq(';
1057 var xpn = 'table.thinline:eq(1) > tbody > tr:eq(';
1058
1059 for (var i = 0; i <= 13; i++) {
1060 if (i < 7) { // booze
1061 var x = i + 3;
1062 b_amount[i] = parseInt($(xpb + x + ') > td:eq(2)').html(), 10);
1063 }
1064
1065 if (i > 6) {
1066 var x = i - 4;
1067 n_amount[(i - 7)] = parseInt($(xpn + x + ') > td:eq(2)').html(), 10); // define how much of this item is being carried
1068 }
1069
1070 }
1071 var totalB = array_sum(b_amount);
1072 var totalN = array_sum(n_amount);
1073 var missingB = booze - totalB;
1074 var missingN = narcs - totalN;
1075
1076 console.log("I'm in city: " + cities[MyCity] + " | Booze: " + totalB + " Narcs: " + totalN);
1077
1078 if (parseInt(missingB, 10) === parseInt(booze, 10) || parseInt(missingN, 10) === parseInt(narcs, 10)) { //I'm EMPTY
1079 if (parseInt(MyCity, 10) === parseInt(lowCity, 10)) { //We are in low city, go buy
1080 console.log("Buying in " + cities[MyCity]);
1081 if (missingB === booze) {
1082 $('input[name="rum"]').val(booze);
1083 }
1084 if (missingN === narcs) {
1085 $('input[name="cocaine"]').val(narcs);
1086 }
1087 $('input[name="typebooze"]:eq(1)').prop('checked', true); // buy
1088 $('input[name="typedrugs"]:eq(1)').prop('checked', true); // buy
1089 var bnTO1 = setTimeout(function() {
1090 $('input[type=submit]').focus().click();
1091 BoozeNarcRun();
1092 }, 2000);
1093 } else if (parseInt(MyCity, 10) === parseInt(highCity, 10) && CanTravel === false && missingB === booze && missingN === narcs) { // We are in high city without BN and cant travel to buy! DONE!
1094 console.log("We are in high city without BN, cant travel. We are done!");
1095 SmuggleDone = true;
1096 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1097 loop();
1098 } else if (CanTravel === true) { // need to travel
1099 console.log("We need to buy, traveling to " + cities[lowCity]);
1100 travel(lowCity, BoozeNarcRun);
1101 }
1102 }
1103 if (missingB === 0 || missingN === 0) { // I'm full
1104 if (parseInt(MyCity, 10) === parseInt(highCity, 10)) { // Need to sell
1105 console.log("Selling in " + cities[MyCity]);
1106 var sorts = ['wine', 'cognac', 'whiskey', 'amaretto', 'beer', 'port', 'rum', 'morphine', 'heroin', 'opium', 'cocaine', 'marihuana', 'tabacco', 'glue'];
1107 for (i = 0; i <= 13; i++) {
1108 var box = $('input[name="' + sorts[i] + '"]');
1109 if (i < 7) {
1110 box.val(b_amount[i]);
1111 } else {
1112 box.val(n_amount[i - 7]);
1113 }
1114 }
1115 $('input[name="typebooze"]:eq(0)').prop('checked', true); // sell
1116 $('input[name="typedrugs"]:eq(0)').prop('checked', true); // sell
1117 var bnTO2 = setTimeout(function() {
1118 $('input[type=submit]').focus().click();
1119 BoozeNarcRun();
1120 }, 2000);
1121 } else if (parseInt(MyCity, 10) === parseInt(lowCity, 10) && CanTravel === false && missingB === 0 && missingN === 0) { // We are in low city with BN and we cant travel to sell ! DONE
1122 console.log("We are in low city with BN and cant travel, we already bought!");
1123 SmuggleDone = true;
1124 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1125 loop();
1126 } else if (CanTravel === true) { // need to travel to high city
1127 console.log("We need to sell, traveling to " + cities[highCity]);
1128 travel(highCity, BoozeNarcRun);
1129 }
1130 }
1131 if ((missingB < booze && missingB != 0) || (missingN < narcs && missingN != 0)) { // Good heist or incomplete amounts. just sell all and rebuy !
1132 console.log("Good heist or incomplete amounts. just sell all and rebuy !");
1133 var sorts = ['wine', 'cognac', 'whiskey', 'amaretto', 'beer', 'port', 'rum', 'morphine', 'heroin', 'opium', 'cocaine', 'marihuana', 'tabacco', 'glue'];
1134 for (i = 0; i <= 13; i++) {
1135 var box = $('input[name="' + sorts[i] + '"]');
1136 if (i < 7) {
1137 box.val(b_amount[i]);
1138 } else {
1139 box.val(n_amount[i - 7]);
1140 }
1141 }
1142 $('input[name="typebooze"]:eq(0)').prop('checked', true); // sell
1143 $('input[name="typedrugs"]:eq(0)').prop('checked', true); // sell
1144 var bnTO1 = setTimeout(function() {
1145 $('input[type=submit]').focus().click();
1146 BoozeNarcRun();
1147 }, 2000);
1148 }
1149 if (CanTravel === false && (MyCity != highCity && MyCity != lowCity)) { // We cant travel and our city is good for nothing
1150 console.log("We cant travel and our city is good for nothing");
1151 SmuggleDone = true;
1152 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1153 loop();
1154 }
1155 }, 2000);
1156 }
1157 }
1158 } else {
1159 clks();
1160 BoozeNarcRun();
1161 }
1162 }, 2000);
1163 }
1164}
1165
1166function bnBOOST() { //TO MAKE NEW !
1167 if (deCaptcha() === false) {
1168 unsafeWindow.omerta.GUI.container.loadPage('/smuggling.php');
1169 console.log('Doing booze or narc non stop!!!');
1170 doBN1 = setTimeout(function() {
1171 $("#brc1").prop("checked", true);
1172 }, 2000);
1173 doBN2 = setTimeout(function() {
1174 if (inJail() === false) {
1175 $('input[type=submit]').focus().click();
1176 }
1177 }, 4000);
1178 doBN3 = setTimeout(function() {
1179 loop();
1180 }, 6000);
1181 }
1182}
1183
1184function doRace() {
1185 unsafeWindow.omerta.GUI.container.loadPage('/races.php');
1186 if (deCaptcha() === false) {
1187 console.log('Race page');
1188 raceTO1 = setTimeout(function() {
1189 $('div[style="display: none;"]').remove();
1190 if ($('#game_container:contains("You reached your click limit.")').length) { // CLICKS WAIT 10 SECS AND RELOAD DIV
1191 console.log("Clicks - 10secs tentar de novo");
1192 loopTO1 = setTimeout(function() {
1193 unsafeWindow.omerta.GUI.container.loadPage('/races.php');
1194 loop();
1195 }, 10000);
1196 } else if ($('#game_container:contains("You can start a race with your car against someone else here!")').length && race_chat === true) { // Not invited for race! - Ask for race in chat mode
1197 if (parseInt(localStorage.getItem("raceChatMsg")) + (30 * 1) < Math.round(new Date().getTime() / 1000)) {
1198 if ($('#omerta_sidepanel_toggle').attr('class') == 'open') {
1199 omerta_sidepanel_toggle.click();
1200 console.log('chat open');
1201 }
1202 console.log('asking for race in chat');
1203 $.post(getUrl() + "?module=Chat&action=send", {
1204 room: "omerta.orgcrime",
1205 message: race_msg
1206 });
1207 localStorage.setItem("raceChatMsg", Math.round(new Date().getTime() / 1000)); // Set time of last Message
1208 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1209 } else {
1210 console.log("Race message sent less than 30secs ago");
1211 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1212 }
1213 raceTO2 = setTimeout(function() {
1214 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1215 loop();
1216 }, 2500);
1217 } else if ( $('#game_container:contains("You can start a race with your car against someone else here!")').length && race_friend !== "" ) { // Not invited for race! - Invite friend mode
1218 console.log('Will invite for race');
1219 //$('input[name="option"][value="3"]').prop('checked', true);
1220 //$("select[name=num_racers] option[value=2]").prop('selected', true);
1221 //$('select:eq(1)>option:eq(1)').prop('selected', true);
1222 raceTO3 = setTimeout(function() {
1223 $('input[type="submit"]').focus().click();
1224 raceTO4 = setTimeout(function() {
1225 console.log('Inviting: ' + race_friend + ' for race');
1226 $('input[type=text]').val(race_friend);
1227 raceTO5 = setTimeout(function() {
1228 $('input[type=submit]:eq(0)').focus().click();
1229 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 10));
1230 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1231 loop();
1232 }, 1000);
1233 }, 2000);
1234 }, 2000);
1235 } else if ($('#game_container:contains("Your race invitations")').length) { // Invited for race just accept!
1236 console.log('Have invites for race!');
1237 $("a:contains('Accept')")[0].click();
1238 console.log('Accepted first race');
1239 raceTO6 = setTimeout(function() {
1240 if ($('#game_container:contains("Car: ")').length) { // Select car for race
1241 //$('select>option:eq(1)').prop('selected', true); // random car
1242 console.log('Selected random car');
1243 $('input[type="submit"]').focus().click();
1244 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1245 raceTO13 = setTimeout(function() {
1246 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1247 loop();
1248 }, 2500);
1249 }
1250 }, 2000);
1251 } else if ( $('#game_container:contains("Car: ")').length && !$('#game_container:contains("You can start a race")').length) { // Select car for race
1252 //$('select>option:eq(1)').prop('selected', true); // random car
1253 console.log('Selected random car');
1254 $('input[type="submit"]').focus().click();
1255 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1256 raceTO13 = setTimeout(function() {
1257 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1258 loop();
1259 }, 2500);
1260 } else if ($('#game_container:contains("Invited")').length) {
1261 console.log('Friend invited - lets wait 10seconds');
1262 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1263 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1264 raceTO7 = setTimeout(function() {
1265 loop();
1266 }, 2500);
1267 } else if ($('#game_container:contains("Please fill in the names")').length) {
1268 console.log('Inviting: ' + race_friend + ' for race');
1269 $('input[type=text]').val(race_friend);
1270 raceTO5 = setTimeout(function() {
1271 $('input[type=submit]:eq(0)').focus().click();
1272 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 10));
1273 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1274 loop();
1275 }, 1000);
1276 } else if ($('#game_container:contains("Accepted")').length) {
1277 console.log('Accepted lets go');
1278 $('input[type="submit"]').focus().click();
1279 raceTO8 = setTimeout(function() {
1280 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1281 loop();
1282 }, 2000);
1283 } else if ($('#game_container:contains("All racers are ready for the race")').length) {
1284 console.log('Race done - Lets get info');
1285 $('input[type=submit]:eq(0)').focus().click();
1286 raceTO9 = setTimeout(function() {
1287 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1288 loop();
1289 }, 2000);
1290 } else if ($('#game_container:contains("still tired from your last race")').length) {
1291 console.log('Race done - Lets get info');
1292 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1293 raceTO10 = setTimeout(function() {
1294 loop();
1295 }, 2000);
1296 } else if ($('#game_container:contains("ready for the race")').length) {
1297 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 30));
1298 console.log('Ready for race - Dont need to check much - 30 sec');
1299 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1300 raceTO11 = setTimeout(function() {
1301 loop();
1302 }, 2500);
1303 } else {
1304 localStorage.setItem("raceWaitTime", (Math.round(new Date().getTime() / 1000) + 10));
1305 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1306 raceTO12 = setTimeout(function() {
1307 console.log('Race Page : Nothing / 10 Seconds time out');
1308 loop();
1309 }, 2000);
1310 }
1311 }, 2500);
1312 }
1313}
1314
1315function doHeist() {
1316 unsafeWindow.omerta.GUI.container.loadPage('/?module=Heist&action=');
1317 if (deCaptcha() === false) {
1318 console.log('Heist page');
1319 heistTO1 = setTimeout(function() {
1320 if ($('#game_container:contains("You reached your click limit.")').length) { // CLICKS WAIT 10 SECS AND RELOAD DIV
1321 console.log("Clicks - 10secs tentar de novo");
1322 loopTO1 = setTimeout(function() {
1323 unsafeWindow.omerta.GUI.container.loadPage('/?module=Heist&action=');
1324 loop();
1325 }, 10000);
1326 } else if ($('#game_container:contains("Desperate for some cash")').length && heists_friend !== "") { // Do Heist with Friend!
1327 heistTO2 = setTimeout(function() {
1328 console.log("Inviting " + heists_friend + " to Heist!");
1329 $('input[name=driver]').val(heists_friend);
1330 heistInviteTO = setTimeout(function() {
1331 $('input[type=submit]:eq(0)').focus().click();
1332 heistInviteTO2 = setTimeout(function() {
1333 if ($('#game_container:contains("Your buddy is still tired from his last heist")').length) // partner HOT try again in 30secs
1334 {
1335 console.log("Partner is hot for heist !");
1336 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 60));
1337 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1338 heistTO6 = setTimeout(function() {
1339 loop();
1340 }, 2000);
1341 } else {
1342 loop();
1343 }
1344 }, 2000);
1345 }, 1500);
1346 }, 3000);
1347 } else if ($('#game_container:contains("Invite is sent to your buddy, if he accepts you guys are ready to roll!")').length || $('#game_container:contains("Wanna kick him out for his lazy behaviour?")').length) {
1348 console.log('Heist not accepted yet - wait 10seconds');
1349 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 10));
1350 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1351 heistTO3 = setTimeout(function() {
1352 loop();
1353 }, 2000);
1354 } else if ($('#game_container:contains("Your buddy is still tired from his last heist")').length) // partner HOT try again in 30secs
1355 {
1356 console.log("Partner is hot for heist !");
1357 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 60));
1358 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1359 heistTO6 = setTimeout(function() {
1360 loop();
1361 }, 2000);
1362 } else if ($('#game_container:contains("Desperate for some cash")').length && heists_chat === true) { // Do Heist on Chat!
1363 if (parseInt(localStorage.getItem("heistChatMsg")) + (60 * 1) < Math.round(new Date().getTime() / 1000)) {
1364 if ($('#omerta_sidepanel_toggle').attr('class') == 'open') {
1365 omerta_sidepanel_toggle.click();
1366 }
1367 console.log('asking for heist in chat');
1368 $.post(getUrl() + "?module=Chat&action=send", {
1369 room: "omerta.orgcrime",
1370 message: heist_msg
1371 });
1372 localStorage.setItem("heistChatMsg", Math.round(new Date().getTime() / 1000)); // Set time of last Message
1373 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1374 } else {
1375 console.log("Heist Message sent less than 1minute ago!");
1376 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1377 }
1378 heistTO4 = setTimeout(function() {
1379 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1380 loop();
1381 }, 2500);
1382 } else if ($('#game_container:contains("wait for your leader to give the green signal")').length) {
1383 console.log('Accepted heist - Waiting for leader - Checking if done in 1min');
1384 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 60));
1385 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1386 heistTO5 = setTimeout(function() {
1387 loop();
1388 }, 3000);
1389 } else if ($('#game_container:contains("Take some rest and hit the road again")').length) {
1390 console.log('Heist done - Lets get info');
1391 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1392 heistTO6 = setTimeout(function() {
1393 loop();
1394 }, 2000);
1395 } else if ($('#game_container:contains("Fill in the ID of your car below and hit Ready!")').length) { // NEED TO PUT CAR
1396 console.log('Accepted heist - Gotta put car');
1397 heistTO7 = setTimeout(function() {
1398 $('input[type=submit]').focus().click();
1399 heistTO8 = setTimeout(function() {
1400 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1401 loop();
1402 }, 4000);
1403 }, 2000);
1404 } else if ($('#game_container:contains("Your partner in crime")').length) { // Partner accepted heist. GOGO !
1405 console.log('Partner accepted heist! ');
1406 heistT13 = setTimeout(function() {
1407 console.log('Heist GO!');
1408 $('input[type=submit]').focus().click();
1409 heistTO15 = setTimeout(function() {
1410 console.log('Sending heist money!');
1411 $('input[type=submit]').focus().click();
1412 }, 2000);
1413 heistTO14 = setTimeout(function() {
1414 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1415 loop();
1416 }, 5000);
1417 }, 2000);
1418 } else if (heists_friend === "" && heists_chat === false) { //Only waiting for invites
1419 heistTO9 = setTimeout(function() {
1420 if ($('#game_container:contains("You have been invited to a heist")').length) { // Got invite
1421 console.log('Got invite');
1422 $("a:contains('Accept')")[0].click();
1423 heistTO10 = setTimeout(function() {
1424 $('input[type=submit]').focus().click();
1425 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 15));
1426 heistTO16 = setTimeout(function() {
1427 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1428 loop();
1429 }, 2000);
1430 }, 1500);
1431 } else if ($('#game_container:contains("Desperate for some cash")').length) { // dont have invite - waiting 30seconds
1432 console.log('Dont have invite - Checking again in 15 seconds');
1433 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 15));
1434 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1435 heistTO11 = setTimeout(function() {
1436 loop();
1437 }, 3000);
1438 } else {
1439 console.log('Waiting for Heist invite but did shit!');
1440 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 15));
1441 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1442 heistTO13 = setTimeout(function() {
1443 loop();
1444 }, 3000);
1445 }
1446 }, 3000);
1447 } else {
1448 localStorage.setItem("heistWaitTime", (Math.round(new Date().getTime() / 1000) + 15));
1449 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1450 heistTO12 = setTimeout(function() {
1451 console.log('Heist Page : Nothing / 15 Seconds time out');
1452 loop();
1453 }, 2000);
1454 }
1455 }, 2500);
1456 }
1457}
1458
1459function doRaid() {
1460 unsafeWindow.omerta.GUI.container.loadPage('/?module=Spots&action=');
1461 if (deCaptcha() === false) {
1462 var raidID;
1463 console.log('Raid page');
1464 raidTO1 = setTimeout(function() {
1465 if ($('#game_container:contains("You reached your click limit.")').length) { // CLICKS WAIT 10 SECS AND RELOAD DIV
1466 console.log("Clicks - 10secs tentar de novo");
1467 loopTO1 = setTimeout(function() {
1468 unsafeWindow.omerta.GUI.container.loadPage('/?module=Spots&action=');
1469 loop();
1470 }, 10000);
1471 } else if ($('#game_container:contains("Start raiding")').length && raids_friend !== "") { // Do Raid with Friend!
1472 raidTO2 = setTimeout(function() {
1473 $('table.thinline:eq(1) button').each(function() {
1474 if ($(this).text() === "Go" && !$(this).is(":disabled")) {
1475 raidID = $(this).attr('data-raidid');
1476 console.log(raidID);
1477 return false;
1478 }
1479 });
1480 console.log("Inviting " + raids_friend + " to Raid on Spot " + raidID + " !");
1481 $.post(getUrl() + "?module=Spots&action=start_raid", {
1482 spotId: raidID,
1483 bullets: "0",
1484 driver: raids_friend
1485 });
1486 doRaid();
1487 }, 3000);
1488 } else if ($('#game_container:contains("Start raiding")').length && raids_chat === true) { // Do Raid on Chat!
1489 if (parseInt(localStorage.getItem("raidChatMsg")) + (60 * 1) < Math.round(new Date().getTime() / 1000)) {
1490 if ($('#omerta_sidepanel_toggle').attr('class') == 'open') {
1491 omerta_sidepanel_toggle.click();
1492 console.log('chat open');
1493 }
1494 console.log('asking for raid in chat');
1495 $.post(getUrl() + "?module=Chat&action=send", {
1496 room: "omerta.orgcrime",
1497 message: raids_msg
1498 });
1499 localStorage.setItem("raidChatMsg", Math.round(new Date().getTime() / 1000)); // Set time of last Message
1500 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1501 } else {
1502 console.log("Raid Message sent less than 1minute ago!");
1503 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1504 }
1505 heistTO4 = setTimeout(function() {
1506 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1507 loop();
1508 }, 2500);
1509 } else if ($('#game_container:contains("Start raiding")').length && raids_friend === "" && raids_chat === false) { // Waiting for friend to invite !
1510 console.log("Partner didnt invite yet - wait 15 seconds!");
1511 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 15));
1512 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1513 raidTO03 = setTimeout(function() {
1514 loop();
1515 }, 2000);
1516 } else if ($('#game_container:contains("Your driver hasnt accepted the invitation yet, be patient.")').length) // Waiting to put car before go !
1517 {
1518 console.log("Partner didnt put car for raid yet !");
1519 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 10));
1520 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1521 raidTO03 = setTimeout(function() {
1522 loop();
1523 }, 2000);
1524 } else if ($('#game_container:contains("Your Driver has accepted the invited")').length) // GOGOGO!
1525 {
1526 console.log("Go Raid !");
1527 raidTO04 = setTimeout(function() {
1528 $('a:contains("Start/Update Raid")').click();
1529 raidTO041 = setTimeout(function() {
1530 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1531 raidTO042 = setTimeout(function() {
1532 loop();
1533 }, 2000);
1534 }, 2000);
1535 }, 2000);
1536 } else if ($('#game_container:contains("Accept Invite")').length) //Need to accept invite
1537 {
1538 console.log("Have invite for raid lets accept !");
1539 raidTO04 = setTimeout(function() {
1540 $('a:contains("Accept Invite")').click();
1541 raidTO042 = setTimeout(function() {
1542 loop();
1543 }, 2000);
1544 }, 2000);
1545 } else if ($('#game_container:contains("The raid failed")').length) // Failed - Its done
1546 {
1547 console.log("Raid done!");
1548 raidTO05 = setTimeout(function() {
1549 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1550 raidTO051 = setTimeout(function() {
1551 loop();
1552 }, 2000);
1553 }, 2000);
1554 } else if ($('#game_container:contains("You have now joined this raid, make sure you stay in this city while your leader gets ready to start.")').length) //Accepted waiting start
1555 {
1556 console.log("Accepted Waiting start");
1557 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 25));
1558 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1559 raidTO042 = setTimeout(function() {
1560 loop();
1561 }, 2000);
1562 } else if ($('#game_container:contains("You have accepted this raid invite, and are waiting on the raid leader to start.")').length) //Accepted waiting start
1563 {
1564 console.log("Accepted Waiting start");
1565 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 25));
1566 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1567 raidTO042 = setTimeout(function() {
1568 loop();
1569 }, 2000);
1570 } else if ($('#game_container:contains("LEM")').length) //ERRO NA RAID
1571 {
1572 console.log("LEM ERROR");
1573 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 25));
1574 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1575 raidTO042 = setTimeout(function() {
1576 loop();
1577 }, 2000);
1578 } else {
1579 localStorage.setItem("raidWaitTime", (Math.round(new Date().getTime() / 1000) + 15));
1580 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1581 raidTO6 = setTimeout(function() {
1582 console.log('Raid Page : Nothing / 15 Seconds time out');
1583 loop();
1584 }, 2000);
1585 }
1586 }, 2500);
1587 }
1588}
1589
1590function doOC() {
1591 unsafeWindow.omerta.GUI.container.loadPage('/orgcrime2.php');
1592 if (deCaptcha() === false) {
1593 console.log('OC page');
1594 ocTO1 = setTimeout(function() {
1595 if ($('#game_container:contains("You reached your click limit.")').length) { // CLICKS WAIT 10 SECS AND RELOAD DIV
1596 console.log("Clicks - 10secs tentar de novo");
1597 ocTO1 = setTimeout(function() {
1598 unsafeWindow.omerta.GUI.container.loadPage('/orgcrime2.php');
1599 loop();
1600 }, 10000);
1601 } else if ($('#game_container:contains("Start an Organised Crime")').length && ocs_chat === true) {
1602 if (parseInt(localStorage.getItem("ocChatMsg")) + (rnd(120, 240) * 1) < Math.round(new Date().getTime() / 1000)) {
1603 if ($('#omerta_sidepanel_toggle').attr('class') == 'open') {
1604 omerta_sidepanel_toggle.click();
1605 }
1606 console.log('asking for oc in chat');
1607 $.post(getUrl() + "?module=Chat&action=send", {
1608 room: "omerta.orgcrime",
1609 message: ocs_msg
1610 });
1611 localStorage.setItem("ocChatMsg", Math.round(new Date().getTime() / 1000)); // Set time of last Message
1612 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1613 } else {
1614 console.log("OC Message sent less than 2 minutes ago!");
1615 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1616 }
1617 ocTO4 = setTimeout(function() {
1618 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1619 loop();
1620 }, 2500);
1621 } else if ($('#game_container:contains("Start an Organised Crime")').length) {
1622 console.log("Still waiting for oc invite!");
1623 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 12));
1624 ocTO4 = setTimeout(function() {
1625 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1626 loop();
1627 }, 2500);
1628 } else if ($('#game_container:contains("Do you really want to be a part of the Organised Crime")').length) {
1629 console.log("Got invited for oc!");
1630 unsafeWindow.omerta.GUI.container.loadPage('/orgcrime2.php?takepart=yes');
1631 ocTO5 = setTimeout(function() {
1632 // WE
1633 $('input[name="bulletz"]').val('100');
1634 $('select[name="guns"]').val('2');
1635 // EE
1636 $('input:radio[name="exploz"]').prop('checked', true);
1637 // GO
1638 $('input[type=submit]').focus().click();
1639 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 10));
1640 ocTO6 = setTimeout(function() {
1641 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1642 loop();
1643 }, 2000);
1644 }, 2000);
1645 } else if ($('#game_container:contains("Put in")').length) {
1646 console.log("Already in for oc gotta accept!");
1647 ocTO5 = setTimeout(function() {
1648 // WE
1649 $('input[name="bulletz"]').val('100');
1650 $('select[name="guns"]').val('2');
1651 // EE
1652 $('input:radio[name="exploz"]').prop('checked', true);
1653 // GO
1654 $('input[type=submit]').focus().click();
1655 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 10));
1656 ocTO6 = setTimeout(function() {
1657 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1658 loop();
1659 }, 2000);
1660 }, 2000);
1661 } else if ($('#game_container:contains("You are now ready for the job")').length) {
1662 console.log("Already in for oc, checking for completion!");
1663 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 25));
1664 ocTO6 = setTimeout(function() {
1665 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1666 loop();
1667 }, 1000);
1668 } else if ($('#game_container:contains("You are still hot from your last Organised Crime")').length) {
1669 console.log("Oc DONE!");
1670 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 25));
1671 ocTO6 = setTimeout(function() {
1672 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1673 loop();
1674 }, 1000);
1675 } else if ($('#game_container:contains("loose your stuff!")').length) {
1676 console.log("Already in for oc, checking for completion 2!");
1677 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 25));
1678 ocTO6 = setTimeout(function() {
1679 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1680 loop();
1681 }, 1000);
1682 } else {
1683 localStorage.setItem("ocWaitTime", (Math.round(new Date().getTime() / 1000) + 15));
1684 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1685 ocTO6 = setTimeout(function() {
1686 console.log('OC PAGE : Nothing / 15 Seconds time out');
1687 loop();
1688 }, 2000);
1689 }
1690 }, 2500);
1691 }
1692}
1693//------Milestone Checker-----------//
1694function mileChecker() {
1695 if (deCaptcha() === false) {
1696 console.log("Milestones to redeem!");
1697 unsafeWindow.omerta.GUI.container.loadPage('/?module=Milestone');
1698 mileTO1 = setTimeout(function() {
1699 if ($('.box-buttons:contains("COLLECT")').length) {
1700 var mileType = ("Redeeming Milestone of: " + $('.box-buttons:contains("COLLECT")').parents(".box-inner").find("h2").text() + " !");
1701 console.log(mileType);
1702 var mile = $('.box-buttons:contains("COLLECT"):eq(0)').children().attr('href');
1703 $.post((pageUrl = "https://" + (location.host)) + mile);
1704 if (milestone_send_sms === true) {
1705 GM_xmlhttpRequest({
1706 method: "GET",
1707 url: "http://api.budgetsms.net/sendsms/?username=" + sms_username + "&userid=" + sms_userid + "&handle=" + sms_api_key + "&msg=" + mileType + "&from=GODSCRIPT&to=" + sms_number,
1708 onload: function(response) {
1709 console.log(response.responseText);
1710 }
1711 });
1712 }
1713 mileTO2 = setTimeout(function() {
1714 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1715 loop();
1716 }, 2500);
1717 } else {
1718 console.log("No Milestone to redeem!");
1719 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1720 mileTO3 = setTimeout(function() {
1721 loop();
1722 }, 3500);
1723 }
1724 }, 5000);
1725 }
1726}
1727//----------------------------MENU------------------------------
1728function menu() {
1729 var STtop = 225;
1730 var STleft = 300;
1731 if ($('#GODMenu').length === 0) {
1732 $('#wrapper').append(
1733 $('<div>').addClass('gdlay').attr({
1734 id: 'GODMenu'
1735 }).css({
1736 top: STtop,
1737 left: STleft
1738 }).append(
1739 $('<div>').attr({
1740 id: 'GODhead'
1741 }).append(
1742 $('<center>').text('God Menu').css({
1743 fontWeight: 'bold'
1744 })
1745 ).click(function() {
1746 $('#GODMenu').draggable();
1747 }),
1748 $('<hr>').css({
1749 color: 'gray'
1750 }),
1751 $('<div>').attr({
1752 id: 'GODdiv'
1753 }).append(
1754 $('<div>').attr({
1755 id: 'GODbody'
1756 }).html('Enable:<font style="float:right;"><b>' + Enable + '</b></font><br />Car/Crimes:<font style="float:right;"><b>' + crimes_carros + '</b></font><br />Booze/Narcs:<font style="float:right;"><b>' + booze_narcs + '</b></font><br />Scratch:<font style="float:right;"><b>' + scratch + '</b></font><br />BustOuts:<font style="float:right;"><b>' + bos),
1757 $('<hr>').css({
1758 color: 'gray'
1759 }),
1760 $('<div>').attr({
1761 id: 'GODconfig'
1762 }).addClass('reset').text('Configuration').click(function() {
1763 GM_config.open();
1764 }),
1765 $('<div>').attr({
1766 id: 'GODconfigAPI'
1767 }).addClass('reset').text('API/Keys Configuration').click(function() {
1768 gmAPI.open();
1769 }),
1770 $('<hr>').css({
1771 color: 'gray'
1772 }),
1773 $('<div>').attr({
1774 id: 'GODhideshow'
1775 }).addClass('reset').text('Hide/Show Menu').click(function() {
1776 $("#GODdiv").toggle();
1777 $("#GODhideshow2").toggle();
1778 }),
1779 $('<hr>').css({
1780 color: 'gray'
1781 }),
1782 $('<div>').attr({
1783 id: 'GODstartstop'
1784 }).addClass('reset').text('Start/Stop').click(function() {
1785 startStop();
1786 })
1787 ),
1788 $('<div>').attr({
1789 id: 'GODhideshow2'
1790 }).addClass('reset').text('Hide/Show Menu').css({
1791 display: "none"
1792 }).click(function() {
1793 $("#GODhideshow2").toggle();
1794 $("#GODdiv").toggle();
1795 })
1796 )
1797 );
1798 }
1799 $('#GODMenu').mouseup(function() {
1800 var divOffset = $('#GODMenu').offset();
1801 var left = divOffset.left;
1802 var top = divOffset.top;
1803 STleft = left;
1804 STtop = top;
1805 });
1806}
1807//--------------------------------------------------------------
1808//----------------------------MAIN LOOPER-----------------------
1809//--------------------------------------------------------------
1810
1811var css = "@charset 'UTF-8'; .gdlay {color: #FFFFFF;box-shadow: 2px 2px 2px 2px #1B1B1B;background-image: -moz-linear-gradient(center top, #3F505F, #1B1B1B);background-image: -webkit-linear-gradient(center top ,#3F505F, #1B1B1B);background-image: -o-linear-gradient(top, #3F505F, #1B1B1B);background: linear-gradient(to bottom, #3F505F, #1B1B1B);opacity: 0.90;border-radius: 5px;}.gdlay {position: fixed;width: 135px;border: 2px double gray;padding: 5px;} .reset { border: 2px solid #BEBEBE; } .reset:hover { border: 2px solid #960011; cursor: pointer; } .reset, .reset:hover { padding: 2px; border-radius: 7px; text-align: center; }";
1812$('head').append('<style type="text/css">' + css + '</style>');
1813var myip;
1814$(document).ready(function() {
1815 $.getJSON("https://jsonip.com/?callback=", function(data) {
1816 console.log(data.ip);
1817 myip = data.ip;
1818 });
1819 menuTO = setTimeout(function() {
1820 if (version != undefined) {
1821 console.log('Menu | Message Checker | Price Checker - launcher');
1822 menu();
1823 chkMessage();
1824 newPrices();
1825 }
1826 }, 2000);
1827});
1828$(document).ready(function() {
1829 window.loop = function() {
1830 if (version != undefined) {
1831 if (Enable === "true") {
1832 if (deCaptcha() === false) {
1833 if (gotClicks()) { // CLICKS WAIT 10 SECS AND RELOAD DIV
1834
1835 } else if ($('body:contains("milestones to redeem")').length && milestone_check === true) { //Have Milestones!
1836 loopMILE01 = setTimeout(function() {
1837 mileChecker();
1838 }, rnd(1500, 2500));
1839 } else if ((on_page('/jail.php') || on_page('jail.php')) && (bos === true || bo_on_cooldown === true)) { // For busting !
1840 console.log("Jail page detected");
1841 if ($('#game_container:contains("GO FOR IT")').length) {
1842 console.log('Pagina BO');
1843 if ($('tr[bgcolor]').length >= 1) {
1844 loopTO2 = setTimeout(function() {
1845 bobos();
1846 loop();
1847 }, rnd(300, 675));
1848 } else {
1849 console.log('Prisao vazia, timeout de ' + bo_cooldown_time + 's');
1850 loopTO3 = setTimeout(function() {
1851 unsafeWindow.omerta.GUI.container.loadPage('/jail.php');
1852 loop();
1853 }, (bo_cooldown_time * 1000));
1854 }
1855 } else {
1856 console.log('Jail mas não pode BO | preso ou pior!');
1857 loopTO4 = setTimeout(function() {
1858 bobos();
1859 loop();
1860 }, rnd(300, 675));
1861 }
1862 } else if (inJail() === true) { // IF we get here means no busting !
1863 console.log('Loop - In Jail');
1864 loopTO5 = setTimeout(function() {
1865 loop();
1866 }, 5000);
1867 } else if (on_page('/?module=Heist&action=') || on_page('?module=Heist&action=')) { // HEIST PAGE
1868 console.log('Heist page - 7sec CD');
1869 loopTO6 = setTimeout(function() {
1870 doHeist();
1871 }, rnd(5000, 10000));
1872 } else if (on_page('?module=Spots&action=')) { // RAID PAGE
1873 console.log('Raid page - 7sec CD');
1874 loopTO7 = setTimeout(function() {
1875 doRaid();
1876 }, rnd(5000, 10000));
1877 } else if (on_page('/?module=Crimes')) {
1878 console.log('Crime page - loop');
1879 if (crimes_carros === true) {
1880 loopTO8 = setTimeout(function() {
1881 if ($('#game_container:contains("WELL DONE!")').length) {
1882 var profit = $('#game_container').text().trim();
1883 if (profit.match(/\$ ([,\d]+)/) !== null) {
1884 var plimplim = parseInt(profit.match(/\$ ([,\d]+)/)[1].replace(',', ''), 10);
1885 console.log('Crime with sucess! We Stole: ' + plimplim + "$");
1886 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1887 loop();
1888 }
1889 } else if ($('#game_container:contains("ATTEMPT FAILED!")').length) {
1890 console.log('Crime Failed!');
1891 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1892 loop();
1893 } else if ($('#game_container:contains("Too tired")').length) {
1894 console.log('Crime already Done!');
1895 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1896 loop();
1897 } else if (on_page('/?module=Crimes')) {
1898 crimeAtpt();
1899 } else {
1900 loopTO9 = setTimeout(function() {
1901 loop();
1902 }, 2000);
1903 }
1904 }, 1000);
1905 }
1906 } else if (on_page('/?module=Cars')) {
1907 console.log('Car page - loop');
1908 if (crimes_carros === true) {
1909 loopTO8 = setTimeout(function() {
1910 if ($('#game_container:contains("WELL DONE!")').length) {
1911 var profit = $('#game_container').text().trim();
1912 if (profit.match(/\$ ([,\d]+)/) !== null) {
1913 var popoplim = parseInt(profit.match(/\$ ([,\d]+)/)[1].replace(',', ''), 10);
1914 }
1915 console.log('Car Nick with success ! Car Value: ' + popoplim + "$");
1916 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1917 loop();
1918 } else if ($('#game_container:contains("ATTEMPT FAILED!")').length) {
1919 console.log('Car Nick Failed!');
1920 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1921 loop();
1922 } else if ($('#game_container:contains("Too tired")').length) {
1923 console.log('Car Nick Already Done!');
1924 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1925 loop();
1926 } else if (on_page('/?module=Cars')) {
1927 carN();
1928 } else {
1929 loopTO9 = setTimeout(function() {
1930 loop();
1931 }, 2000);
1932 }
1933 }, 1000);
1934 }
1935 } else if (on_page('/races.php') || on_page('/races.php') || on_page('/#races.php') || on_page('#races.php')) {
1936 doRace();
1937 } else if (on_page('/scratch.php') || on_page('scratch.php')) {
1938 console.log("Scratch page detected");
1939 if (scratch === true || scratch_on_cooldown === true) {
1940 var pocketMoney = omerta.services.account.data.money;
1941 if (pocketMoney < min_sc) // We are out of money
1942 {
1943 console.log("Money on pocket is below specified Money to scratch!");
1944 GM_config.set('scratch', false);
1945 GM_config.set('scratch_on_cooldown', false);
1946 onSave();
1947 if (send_message_scratch === true) {
1948 GM_xmlhttpRequest({
1949 method: "GET",
1950 url: "http://api.budgetsms.net/sendsms/?username=" + sms_username + "&userid=" + sms_userid + "&handle=" + sms_api_key + "&msg=Out_of_scratch_money&from=GODSCRIPT&to=" + sms_number,
1951 onload: function(response) {
1952 console.log(response.responseText);
1953 }
1954 });
1955 }
1956 if (crimes_carros === true || booze_narcs != 'Disabled' || do_races === true || do_heists === true || do_raids === true) {
1957 console.log("Have other actions to do - Go back to info!");
1958 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
1959 scratchSMS = setTimeout(function() {
1960 loop();
1961 }, 2000);
1962 } else {
1963 console.log("Doing nothing else - Logout!");
1964 logout();
1965 }
1966 } else if ($('#game_container:contains("Sorry, but 10 per minute is enough.")').length) {
1967 console.log('10 por minuto - 10seg cooldown');
1968 scratch10 = setTimeout(function() {
1969 unsafeWindow.omerta.GUI.container.loadPage('/scratch.php');
1970 loop();
1971 }, 10000);
1972 } else {
1973 scratchGo = setTimeout(function() {
1974 pressSCRT();
1975 loop();
1976 }, rnd(1000, 1550));
1977 }
1978 }
1979 } else if (on_page('/smuggling.php') || on_page('smuggling.php')) {
1980 console.log("BN page! - loop");
1981 if (booze_narcs == 'RP') {
1982 loopTO10 = setTimeout(function() {
1983 bnRP();
1984 }, rnd(2000, 3000));
1985 } else if (booze_narcs == 'Money') {
1986 loopTO10 = setTimeout(function() {
1987 BoozeNarcRun();
1988 }, rnd(1000, 2000));
1989 } else if (booze_narcs == 'BOOST') {
1990 loopTO10 = setTimeout(function() {
1991 bnBOOST();
1992 }, rnd(2000, 3000));
1993 }
1994 }else if (on_page('/orgcrime2.php') ){
1995 console.log('Doing oc!');
1996 var doingOC = setTimeout(function(){
1997 doOC();
1998 },2500);
1999 } else if (on_page(infoPage)) {
2000 console.log("Info Page");
2001 var rankGD = omerta.services.account.data.rankname;
2002 var rankNum = 0;
2003 for (var i = 0; i <= 17; i++) {
2004 if (ranks[i] == rankGD) {
2005 rankNum = i;
2006 break;
2007 }
2008 }
2009 console.log("My rank is:" + rankGD + rankNum + " !");
2010 timerTimeOut = setTimeout(function() {
2011 //-------TIMERS-----------------------------------------------------
2012 if (crimes_carros === true || booze_narcs != 'Disable' || do_races === true || do_heists === true || do_raids === true) {
2013 var timeWait = 99999999; // DEFAULT
2014 if (crimes_carros === true) {
2015 if (version == 'dm') {
2016 var t1 = (parseInt($('.action-wrapper:eq(0) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2017 var t2 = (parseInt($('.action-wrapper:eq(1) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2018 } else {
2019 var t1 = (parseInt($('.thinline:eq(1)>tbody>tr:eq(1) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2020 var t2 = (parseInt($('.thinline:eq(1)>tbody>tr:eq(2) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2021 }
2022 if (isNaN(t1) || t1 < 0) {
2023 t1 = 0;
2024 }
2025 if (isNaN(t2) || t2 < 0) {
2026 t2 = 0;
2027 }
2028 localStorage.setItem('Crime Time',parseInt(t1/1000));
2029 localStorage.setItem('Car Time',parseInt(t2/1000));
2030 timeWait = Math.min(t1, t2);
2031 console.log('Next Crime in:' + t1 / 1000);
2032 console.log('Next Car Attempt in:' + t2 / 1000);
2033 }
2034 if (booze_narcs == "Money") {
2035 if (rankNum == 0) {
2036 console.log("I'm empty-suit i cant do BN!");
2037 t4 = 300000;
2038 } else if (version == 'dm') {
2039 var t4 = (parseInt($('.action-wrapper:eq(2) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2040 } else {
2041 var t4 = (parseInt($('.thinline:eq(1)>tbody>tr:eq(6) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2042 }
2043 if (isNaN(t4) || t4 < 0) {
2044 t4 = 0;
2045 CanTravel = true;
2046 } else {
2047 CanTravel = false;
2048 }
2049 if (SmuggleDone === false) {
2050 t4 = 0;
2051 }
2052 localStorage.setItem('Booze Narc Time',parseInt(t4/1000));
2053 timeWait = Math.min(timeWait, t4);
2054 console.log('Next BN Money (Flight) in:' + t4 / 1000);
2055 } else if (booze_narcs == 'RP') {
2056 if (rankNum == 0) {
2057 console.log("I'm empty-suit i cant do BN!");
2058 t4 = 300000;
2059 } else if (version == 'dm') {
2060 var booze = (parseInt($('.action-wrapper:eq(3) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2061 var narcs = (parseInt($('.action-wrapper:eq(4) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2062 if (rankNum <= 2) {
2063 console.log('Im just Delivery Boy/Girl, cant do narcs !');
2064 var t4 = booze;
2065 } else {
2066 var t4 = Math.min(booze, narcs);
2067 }
2068 } else {
2069 var booze = (parseInt($('.thinline:eq(1)>tbody>tr:eq(12) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2070 var narcs = (parseInt($('.thinline:eq(1)>tbody>tr:eq(13) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2071 if (rankNum <= 2) {
2072 console.log('Im just Delivery Boy/Girl, cant do narcs !');
2073 var t4 = booze;
2074 } else {
2075 var t4 = Math.min(booze, narcs);
2076 }
2077 }
2078 if (isNaN(t4) || t4 < 0) {
2079 t4 = 0;
2080 }
2081 localStorage.setItem('Booze Narc Time',parseInt(t4/1000));
2082 timeWait = Math.min(timeWait, t4);
2083 console.log('Next BN in:' + t4 / 1000);
2084 } else if (booze_narcs == 'BOOST') {
2085 var t4 = 3000;
2086 localStorage.setItem('Booze Narc Time',parseInt(t4/1000));
2087 timeWait = Math.min(timeWait, t4);
2088 console.log('Doing BN Boost!');
2089 }
2090 if (do_races === true && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2091 if (Math.round(new Date().getTime() / 1000) > localStorage.getItem("raceWaitTime")) {
2092 if (version == 'dm') {
2093 var t5 = (parseInt($('.action-wrapper:eq(12) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2094 } else {
2095 var t5 = (parseInt($('.thinline:eq(1)>tbody>tr:eq(9) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2096 }
2097 if (isNaN(t5) || t5 < 0) {
2098 t5 = 0;
2099 }
2100 localStorage.setItem('Race Time',parseInt(t5/1000));
2101 timeWait = Math.min(timeWait, t5);
2102 console.log('Next Race in:' + t5 / 1000);
2103 } else {
2104 var t5 = (parseInt(localStorage.getItem("raceWaitTime"), 10) - Math.round(new Date().getTime() / 1000)) * 1000;
2105 if (isNaN(t5)) {
2106 console.log("t5 is NaN");
2107 t5 = 0;
2108 }
2109 localStorage.setItem('Race Time',parseInt(t5/1000));
2110 timeWait = Math.min(timeWait, t5);
2111 console.log("Race checks on Cooldown for: " + t5 / 1000 + " !");
2112 }
2113 }
2114 if (do_heists === true && (rankNum > 3) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2115 if (Math.round(new Date().getTime() / 1000) > localStorage.getItem("heistWaitTime")) {
2116 if (version == 'dm') {
2117 var t6 = (parseInt($('.action-wrapper:eq(6) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2118 } else {
2119 var t6 = (parseInt($('.thinline:eq(1)>tbody>tr:eq(3) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2120 }
2121 if (isNaN(t6) || t6 < 0) {
2122 t6 = 0;
2123 }
2124 localStorage.setItem('Heist Time',parseInt(t6/1000));
2125 timeWait = Math.min(timeWait, t6);
2126 console.log('Next Heist in:' + t6 / 1000);
2127 } else {
2128 var t6 = (parseInt(localStorage.getItem("heistWaitTime"), 10) - Math.round(new Date().getTime() / 1000)) * 1000;
2129 if (isNaN(t6)) {
2130 console.log("t6 is Nan!");
2131 t6 = 0;
2132 }
2133 localStorage.setItem('Heist Time',parseInt(t6/1000));
2134 timeWait = Math.min(timeWait, t6);
2135 console.log("Heist checks on Cooldown for: " + t6 / 1000 + " !");
2136 }
2137 }
2138 if (do_raids === true && (rankNum > 8) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2139 if (Math.round(new Date().getTime() / 1000) > localStorage.getItem("raidWaitTime")) {
2140 if (version == 'dm') {
2141 var t7 = (parseInt($('.action-wrapper:eq(8) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2142 } else {
2143 var t7 = (parseInt($('.thinline:eq(1)>tbody>tr:eq(11) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2144 }
2145 if (isNaN(t7) || t7 < 0) {
2146 t7 = 0;
2147 }
2148 localStorage.setItem('Raid Time',parseInt(t7/1000));
2149 timeWait = Math.min(timeWait, t7);
2150 console.log('Next Raid in:' + t7 / 1000);
2151 } else {
2152 var t7 = (parseInt(localStorage.getItem("raidWaitTime"), 10) - Math.round(new Date().getTime() / 1000)) * 1000;
2153 if (isNaN(t7)) {
2154 console.log("t7 is Nan!");
2155 t7 = 0;
2156 }
2157 localStorage.setItem('Raid Time',parseInt(t7/1000));
2158 timeWait = Math.min(timeWait, t7);
2159 console.log("Raid checks on Cooldown for: " + t7 / 1000 + " !");
2160 }
2161 }
2162 if (do_ocs === true && (rankNum > 5) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2163 if (Math.round(new Date().getTime() / 1000) > localStorage.getItem("ocWaitTime")) {
2164 if (version == 'dm') {
2165 var t8 = (parseInt($('.action-wrapper:eq(7) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2166 } else {
2167 var t8 = (parseInt($('.thinline:eq(1)>tbody>tr:eq(4) [data-time-end]').attr('data-time-end'), 10) - parseInt(omerta.Clock.getTime(), 10) / 1000) * 1000;
2168 }
2169 if (isNaN(t8) || t8 < 0) {
2170 t8 = 0;
2171 }
2172 localStorage.setItem('OC Time',parseInt(t8/1000));
2173 timeWait = Math.min(timeWait, t8);
2174 console.log('Next OC in:' + t8 / 1000);
2175 } else {
2176 var t8 = (parseInt(localStorage.getItem("ocWaitTime"), 10) - Math.round(new Date().getTime() / 1000)) * 1000;
2177 if (isNaN(t8)) {
2178 console.log("t8 (oc) is Nan!");
2179 t8 = 0;
2180 }
2181 localStorage.setItem('OC Time',parseInt(t8/1000));
2182 timeWait = Math.min(timeWait, t8);
2183 console.log("OC checks on Cooldown for: " + t8 / 1000 + " !");
2184 }
2185 }
2186 timeWait = timeWait + rnd(850, 1500);
2187 if (isNaN(timeWait)) {
2188 console.log('TimeWait is NaN!');
2189 timeWait = rnd(5000, 10000);
2190 }
2191 localStorage.setItem('TimeWait', parseInt(timeWait/1000) );
2192 console.log('Next action in: ' + timeWait / 1000 + ' seconds');
2193 //------------------------------------------------------------------
2194 infoTimeOut = setTimeout(function() {
2195 if (version == 'dm') {
2196 if (doingCaptcha === false) {
2197 clearTO(scratch10);
2198 clearTO(scratchGo);
2199 if (!on_page(infoPage)) {
2200 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
2201 }
2202 if (isNaN(parseInt($('.action-wrapper:eq(3) [data-time-end]').attr('data-time-end'), 10)) || (isNaN(parseInt($('.action-wrapper:eq(4) [data-time-end]').attr('data-time-end'), 10)) && rankNum > 2)) {
2203 var goBN = 1;
2204 } else {
2205 var goBN = 0;
2206 }
2207 if (isNaN(parseInt($('.action-wrapper:eq(0) [data-time-end]').attr('data-time-end'), 10)) && crimes_carros === true) {
2208 crimeAtpt();
2209 } else if (isNaN(parseInt($('.action-wrapper:eq(1) [data-time-end]').attr('data-time-end'), 10)) && crimes_carros === true) {
2210 carN();
2211 } else if (isNaN(parseInt($('.action-wrapper:eq(2) [data-time-end]').attr('data-time-end'), 10)) && booze_narcs == 'Money' && rankNum > 0) {
2212 BoozeNarcRun();
2213 } else if (booze_narcs == 'RP' && (rankNum > 0) && goBN == 1) {
2214 bnRP();
2215 } else if (isNaN(parseInt($('.action-wrapper:eq(12) [data-time-end]').attr('data-time-end'), 10)) && do_races === true && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2216 doRace();
2217 } else if (isNaN(parseInt($('.action-wrapper:eq(6) [data-time-end]').attr('data-time-end'), 10)) && do_heists === true && (rankNum > 3) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2218 console.log("Gona do heist!");
2219 doHeist();
2220 } else if (isNaN(parseInt($('.action-wrapper:eq(8) [data-time-end]').attr('data-time-end'), 10)) && do_raids === true && (rankNum > 8) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2221 doRaid();
2222 } else if (isNaN(parseInt($('.action-wrapper:eq(7) [data-time-end]').attr('data-time-end'), 10)) && do_ocs === true && (rankNum > 5) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2223 doOC();
2224 } else if (booze_narcs == 'BOOST') {
2225 unsafeWindow.omerta.GUI.container.loadPage('/smuggling.php');
2226 bnBOOST();
2227 } else {
2228 loop();
2229 }
2230 } else {
2231 console.log("Temos rank a fazer mas há captcha acabar! Tentar de novo em 5s");
2232 setTimeout(loop, 5000);
2233 }
2234 } else {
2235 if (doingCaptcha === false) {
2236 clearTO(scratch10);
2237 clearTO(scratchGo);
2238 unsafeWindow.omerta.GUI.container.loadPage(infoPage);
2239 if ($('.thinline:eq(1)>tbody>tr:eq(12)>td:eq(1)').text() == "Now" || ($('.thinline:eq(1)>tbody>tr:eq(13)>td:eq(1)').text() == "Now" && rankNum > 2)) {
2240 var goBN = 1;
2241 } else {
2242 var goBN = 0;
2243 }
2244 if ($('.thinline:eq(1)>tbody>tr:eq(1)>td:eq(1)').text() == "Now" && crimes_carros === true) {
2245 crimeAtpt();
2246 } else if ($('.thinline:eq(1)>tbody>tr:eq(2)>td:eq(1)').text() == "Now" && crimes_carros === true) {
2247 carN();
2248 } else if (($('.thinline:eq(1)>tbody>tr:eq(6)>td:eq(1)').text() == "Now" || SmuggleDone === false) && booze_narcs == 'Money' && rankNum > 0) {
2249 BoozeNarcRun();
2250 } else if (booze_narcs == 'RP' && (rankNum > 0) && goBN == 1) {
2251 bnRP();
2252 } else if ($('.thinline:eq(1)>tbody>tr:eq(9)>td:eq(1)').text() == "Now" && do_races === true && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2253 doRace();
2254 } else if ($('.thinline:eq(1)>tbody>tr:eq(3)>td:eq(1)').text() == "Now" && do_heists === true && (rankNum > 3) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2255 doHeist();
2256 } else if ($('.thinline:eq(1)>tbody>tr:eq(11)>td:eq(1)').text() == "Now" && do_raids === true && (rankNum > 8) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2257 doRaid();
2258 } else if ($('.thinline:eq(1)>tbody>tr:eq(4)>td:eq(1)').text() == "Now" && do_ocs === true && (rankNum > 5) && (omerta.services.account.data.city.name == GC_city || GC_city == 'Any')) {
2259 doOC();
2260 } else if (booze_narcs == 'BOOST') {
2261 unsafeWindow.omerta.GUI.container.loadPage('/smuggling.php');
2262 bnBOOST();
2263 } else {
2264 loop();
2265 }
2266 } else {
2267 console.log("Temos rank a fazer mas há captcha acabar! Tentar de novo em 5s");
2268 setTimeout(loop, 5000);
2269 }
2270 }
2271 }, timeWait);
2272 if (scratch_on_cooldown === true && timeWait > 30000) {
2273 console.log('No action for 30seconds - Go Scratch !');
2274 unsafeWindow.omerta.GUI.container.loadPage('/scratch.php');
2275 loopTO7 = setTimeout(function() {
2276 loop();
2277 }, 2500);
2278 } else if (bo_on_cooldown === true && timeWait > 30000) {
2279 console.log('No action for 30seconds - Go Bust !');
2280 unsafeWindow.omerta.GUI.container.loadPage('/jail.php');
2281 loopTO7 = setTimeout(function() {
2282 loop();
2283 }, 2500);
2284 }
2285 } else if (scratch === true) { //Only scratching!
2286 console.log("Only Scratch");
2287 unsafeWindow.omerta.GUI.container.loadPage('/scratch.php');
2288 loopTO7 = setTimeout(function() {
2289 loop();
2290 }, 2500);
2291 } else if (bos === true) // Only Bo's
2292 {
2293 console.log('Only BustOut');
2294 unsafeWindow.omerta.GUI.container.loadPage('/jail.php');
2295 loopTO7 = setTimeout(function() {
2296 loop();
2297 }, 2500);
2298 } else {
2299 console.log('Nothing to check for!');
2300 stop();
2301 }
2302 }, 1500);
2303 } else {
2304 console.log("Espera de pagina para funcionar");
2305 loopTO11 = setTimeout(function() {
2306 loop();
2307 }, 5000);
2308 }
2309 }
2310 }
2311 }
2312 };
2313 loop();
2314});