Advertisement
Guest User

Untitled

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