// ==UserScript== // @name SpeedCalling for Popmundo // @namespace http://popmundo.psicofrenia.com/ // @description Calls everyone in your contact list // @include http://*.popmundo.com/World/Popmundo.aspx/Character/AddressBook // @include http://*.popmundo.com/World/Popmundo.aspx/Interact/Phone/* // @require https://greasyfork.org/scripts/3355-popmundo-lib/code/popmundo_lib.js?version=10024 // @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js // @grant GM_info // @version 3.2 // @downloadURL https://update.greasyfork.icu/scripts/3357/SpeedCalling%20for%20Popmundo.user.js // @updateURL https://update.greasyfork.icu/scripts/3357/SpeedCalling%20for%20Popmundo.meta.js // ==/UserScript== var gexQuery = jQuery.noConflict(); // ------------------------------------------------------------------------ // ----------- DEFINITIONS AREA var _locVersion_SpeedCalling = '3.1'; // External script with SpeedCalling functions var _jsFile = 'http://resources.psicofrenia.com/popmundo.js'; // Logical variable to detect if the script should use Portuguese or English var _isPortuguese = 0; // Current URL var _urlCurrent = window.location.pathname; // Url to make the calls var _urlToCall = '/World/Popmundo.aspx/Interact/Phone/'; // Url to mark the page as usable by this script var _urlToCall_Token = '#toCall'; var _urlToContact_Token = '#toContact'; // Id of the char logged in var _idMainChar = 0; // Id of the char currently being interacted with var _idCurrentChar = 0; // Id to be used to store values on local storage var _idStorage = '_GEX_MAIN_ID_'; // Array with runtimes values var _valuesRunTime = {}; // Array with stored values var _valuesStorage = {}; // Default value for callings var _valueDefault = 24; // All possible values for calling var _valueCalls = Array(9999,121,24,61,58,26,25,73,74); // ------------------------------------------------------------------------ // ----------- GLOBAL CODE appendJsFile(_jsFile); detectLanguage(); getIdMain(); checkVersion(); if( _urlCurrent.match(/\/World\/Popmundo.aspx\/Character\/AddressBook/g)){ executeOnPage_Book(); } if( _urlCurrent.match(/\/World\/Popmundo.aspx\/Interact\/Phone/g)){ executeOnPage_Contact(); } // ------------------------------------------------------------------------ // ----------- FUNCTIONS AREA //Adds any external JS Script to the Popmundo page function appendJsFile(jsUrl){ var scriptTag = ''; gexQuery(scriptTag).appendTo('head'); } // Detects if Popmundo is being used in one of the Portuguese translations function detectLanguage(){ var langIdentifier = 'notícias'; if (gexQuery('#ctl00_ucMenu_lnkStart').text().toLowerCase() == langIdentifier) _isPortuguese = 1; } //Gets the correct label for the language function getLabel(label){ var translations = new Array(); translations.call_everyone = 'Call everyone#Ligar para todos'; translations.bug_report = 'Report a bug#Reportar um bug'; translations.update = 'Theres a new Version avaiable. Click here to update SpeedCalling.#Há uma nova versão disponível. Clique aqui para atualizá-la.'; translations.i9999 = 'Dont Call#Não telefonar'; translations.i121 = 'Gossip on the phone#Fofocar ao telefone'; translations.i24 = 'Wazzup call#Ligar para papear'; translations.i61 = 'SMS friendly text#Mandar mensagem no celular'; translations.i58 = 'SMS funny pic#Mandar foto engraçada por MMS'; translations.i26 = 'Prank call#Passar trote'; translations.i25 = 'Lover call#Ligar para namorar'; translations.i73 = 'Flirty Phone call#Ligar para flertar'; translations.i74 = 'Flirty SMS#Flertar por SMS'; if(translations[label] == undefined) return 'OOps!!!'; return translations[label].split("#")[_isPortuguese]; } //Gets the ID of the logged char and sets the storage ID function getIdMain(){ _idMainChar = gexQuery('.idHolder').first().html(); _idStorage += _idMainChar; } //Gets the ID of the logged char and sets the storage ID function getIdCurrent(){ _idMainChar = gexQuery('.idHolder').first().html(); } //Returns the button to make the calls function getCallButton(){ var callButton = "