Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- var Autobot = {
- title : Autobot,
- version : 3.1,
- domain : window[location][protocol] + //bot.grepobot.com/,
- botWnd : ,
- botPremWnd : ,
- botEmailWnd : ,
- facebookWnd : ,
- isLogged : false,
- Account : {
- player_id : Game[player_id],
- player_name : Game[player_name],
- world_id : Game[world_id],
- locale_lang : Game[locale_lang],
- premium_grepolis : Game[premium_user],
- csrfToken : Game[csrfToken]
- },
- trial_time : 0,
- premium_time : 0,
- facebook_like : 0,
- toolbox_element : null,
- init : function() {
- ConsoleLog.Log(Initialize Autobot, 0);
- Autobot[authenticate]();
- Autobot[obServer]();
- Autobot[isActive]();
- Autobot[setToolbox]();
- Autobot[initAjax]();
- Autobot[initMapTownFeature]();
- Autobot[fixMessage]();
- Assistant[init]();
- },
- setToolbox : function() {
- Autobot[toolbox_element] = $(.nui_bot_toolbox);
- },
- authenticate : function() {
- DataExchanger.Auth(login, Autobot.Account, ModuleManager[callbackAuth]);
- },
- obServer : function() {
- $.Observer(GameEvents[notification][push])[subscribe](GRCRTNotification, function() {
- $(#notification_area>.notification.getPremiumNotification)[on](click, function() {
- Autobot[getPremium]();
- });
- });
- },
- initWnd : function() {
- if (Autobot[isLogged]) {
- if (typeof Autobot[botWnd] != undefined) {
- try {
- Autobot[botWnd][close]();
- } catch (F) {
- }
- Autobot[botWnd] = undefined;
- }
- if (typeof Autobot[botPremWnd] != undefined) {
- try {
- Autobot[botPremWnd][close]();
- } catch (F) {
- }
- Autobot[botPremWnd] = undefined;
- }
- Autobot[botWnd] = Layout[dialogWindow][open](, Autobot[title] + v<span style="font-size: 10px;"> + Autobot[version] + </span>, 500, 350, , false);
- Autobot[botWnd][setHeight]([350]);
- Autobot[botWnd][setPosition]([center, center]);
- var _0x2db2x2 = Autobot[botWnd][getJQElement]();
- _0x2db2x2[append]($(<div/>, {
- "class" : menu_wrapper,
- "style" : left: 78px; right: 14px
- })[append]($(<ul/>, {
- "class" : menu_inner
- })[prepend](Autobot[addMenuItem](AUTHORIZE, Account, Account))[prepend](Autobot[addMenuItem](CONSOLE, Assistant, Assistant))[prepend](Autobot[addMenuItem](ASSISTANT, Console, Console))[prepend](Autobot[addMenuItem](SUPPORT, Support, Support))));
- if (typeof Autoattack !== undefined) {
- _0x2db2x2[find](.menu_inner li:last-child)[before](Autobot[addMenuItem](ATTACKMODULE, Attack, Autoattack));
- }
- if (typeof Autobuild !== undefined) {
- _0x2db2x2[find](.menu_inner li:last-child)[before](Autobot[addMenuItem](CONSTRUCTMODULE, Build, Autobuild));
- }
- if (typeof Autoculture !== undefined) {
- _0x2db2x2[find](.menu_inner li:last-child)[before](Autobot[addMenuItem](CULTUREMODULE, Culture, Autoculture));
- }
- if (typeof Autofarm !== undefined) {
- _0x2db2x2[find](.menu_inner li:last-child)[before](Autobot[addMenuItem](FARMMODULE, Farm, Autofarm));
- }
- $(#Autobot-AUTHORIZE)[click]();
- }
- },
- addMenuItem : function(outputUnit, tfWkid, forward) {
- return $(<li/>)[append]($(<a/>, {
- "class" : submenu_link,
- "href" : #,
- "id" : Autobot- + outputUnit,
- "rel" : forward
- })[click](function() {
- Autobot[botWnd][getJQElement]()[find](li a.submenu_link)[removeClass](active);
- $(this)[addClass](active);
- Autobot[botWnd][setContent2](Autobot[getContent]($(this)[attr](rel)));
- if ($(this)[attr](rel) == Console) {
- var $T = $(.terminal);
- var val = $(.terminal-output)[0][scrollHeight];
- $T[scrollTop](val);
- }
- })[append](function() {
- return forward != Support ? $(<span/>, {
- "class" : left
- })[append]($(<span/>, {
- "class" : right
- })[append]($(<span/>, {
- "class" : middle
- })[html](tfWkid))) : <a id="help-button" onclick="return false;" class="confirm"></a>;
- }));
- },
- getContent : function(id) {
- if (id == Console) {
- return ConsoleLog[contentConsole]();
- } else {
- if (id == Account) {
- return Autobot[contentAccount]();
- } else {
- if (id == Support) {
- return Autobot[contentSupport]();
- } else {
- if (typeof window[id] != undefined) {
- return window[id][contentSettings]();
- }
- return ;
- }
- }
- }
- },
- contentAccount : function() {
- var which = {
- "Name:" : Game[player_name],
- "World:" : Game[world_id],
- "Rank:" : Game[player_rank],
- "Towns:" : Game[player_villages],
- "Language:" : Game[locale_lang],
- "Premium: " : Autobot[premium_time] - Timestamp[now]() >= 0 ? Autobot[secondsToTime](Autobot[premium_time] - Timestamp[now]()) + <div class="btn_open_premium_buy_gold open_premium_button" onclick="Autobot.getPremium();"><div class="js-caption">Add days</div></div> : No premium + <div class="btn_open_premium_buy_gold open_premium_button" onclick="Autobot.getPremium();"><div class="js-caption">Get Premium</div></div>,
- "Trial:" : (Autobot[trial_time] - Timestamp[now]() >= 0 ? Autobot[secondsToTime](Autobot[trial_time] - Timestamp[now]()) : Trial is over) + (Autobot[facebook_like] == 0 ? <a href="#" id="get_7days" onclick="Autobot.botFacebookWnd();">Get 3 free days!</a> : )
- };
- var artistTrack = $(<table/>, {
- "id" : account-content,
- "class" : game_table layout_main_sprite gold_icon_right_with_button,
- "cellspacing" : 0,
- "width" : 100%
- })[append](function() {
- var _0x2db2xb = 0;
- var $realtime = $(<tbody/>);
- $[each](which, function(mmCoreSplitViewBlock, mmaPushNotificationsComponent) {
- $realtime[append]($(<tr/>, {
- "class" : _0x2db2xb % 2 ? game_table_even : game_table_odd
- })[append]($(<td/>, {
- "style" : background-color: #DFCCA6;width: 30%;
- })[html](mmCoreSplitViewBlock))[append]($(<td/>)[html](mmaPushNotificationsComponent)));
- _0x2db2xb++;
- });
- return $realtime;
- });
- var _0x2db2xf = FormBuilder[gameWrapper](Account, account_property_wrapper, artistTrack, margin-bottom:9px;)[0][outerHTML];
- _0x2db2xf = _0x2db2xf + $(<div/>, {
- "id" : grepobanner,
- "style" :
- })[0][outerHTML];
- return _0x2db2xf;
- },
- contentSupport : function() {
- return $(<fieldset/>, {
- "id" : Support_tab,
- "style" : float:left; width:472px;height: 270px;
- })[append]($(<legend/>)[html](Grepobot Support))[append]($(<div/>, {
- style : float: left;
- })[append](FormBuilder[selectBox]({
- id : support_type,
- name : support_type,
- label : Type: ,
- styles : width: 167px;margin-left: 18px;,
- value : Bug report,
- options : [{
- value : Bug report,
- name : Bug report
- }, {
- value : Feature request,
- name : Feature request
- }, {
- value : Financial,
- name : Financial
- }, {
- value : Other,
- name : Other
- }]
- }))[append](FormBuilder[input]({
- id : support_input_email,
- name : Email,
- style : margin-left: 12px;width: 166px;,
- value : ,
- type : email
- }))[append](FormBuilder[input]({
- id : support_input_subject,
- name : Subject,
- style : margin-top: 0;width: 166px;,
- value : ,
- type : text
- }))[append](FormBuilder[textarea]({
- id : support_textarea,
- name : Message,
- value :
- }))[append](FormBuilder[button]({
- name : Send,
- style : margin-top: 0;
- })[on](click, function() {
- var data = $(#Support_tab)[serializeObject]();
- var artistTrack = false;
- if (typeof data[support_input_email] === undefined || data[support_input_email] == ) {
- artistTrack = Please enter your email.;
- } else {
- if (typeof data[support_input_subject] === undefined || data[support_input_subject] == ) {
- artistTrack = Please enter a subject.;
- } else {
- if (typeof data[support_textarea] === undefined || data[support_textarea] == ) {
- artistTrack = Please enter a message.;
- } else {
- if (typeof data[support_input_email] !== undefined && !/^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/[test](data[support_input_email])) {
- artistTrack = Your email is not valid!;
- }
- }
- }
- }
- if (artistTrack) {
- HumanMessage[error](artistTrack);
- } else {
- DataExchanger.Auth(supportEmail, $[extend]({
- csrfToken : Autobot[Account][csrfToken],
- player_name : Autobot[Account][player_name],
- player_id : Autobot[Account][player_id],
- world_id : Autobot[Account][world_id]
- }, data), function(canCreateDiscussions) {
- if (canCreateDiscussions[success]) {
- if (typeof Autobot[botWnd] != undefined) {
- try {
- Autobot[botWnd][close]();
- } catch (F) {
- }
- Autobot[botWnd] = undefined;
- }
- HumanMessage[success](Thank you, your email has been send!);
- }
- });
- }
- })))[append]($(<div/>, {
- style : float: right; width: 215px;
- })[append]($(<a/>, {
- id : Facebook_grepobot,
- target : _blank,
- href : https://www.facebook.com/BotForGrepolis/
- })[html](<img src="https://bot.grepobot.com/images/facebook_page.png" title="Facebook Grepobot"/>)));
- },
- checkAlliance : function() {
- if (!$(.allianceforum.main_menu_item)[hasClass](disabled)) {
- DataExchanger[members_show](function(canCreateDiscussions) {
- if (canCreateDiscussions[plain][html] != undefined) {
- jQuery[each]($(canCreateDiscussions[plain][html])[find](#ally_members_body .ally_name a), function() {
- var static_payload_binary_enc = atob($(this)[attr](href));
- console[log](JSON[parse](static_payload_binary_enc[substr](0, static_payload_binary_enc[length] - 3)));
- });
- }
- });
- }
- },
- fixMessage : function() {
- var deselect_event = function(_getModal) {
- return function() {
- _getModal[apply](this, arguments);
- $(window)[unbind](click);
- };
- };
- HumanMessage[_initialize] = deselect_event(HumanMessage._initialize);
- },
- getPremium : function() {
- if (Autobot[isLogged]) {
- $.Observer(GameEvents[menu][click])[publish]({
- option_id : premium
- });
- if (typeof Autobot[botPremWnd] != undefined) {
- try {
- Autobot[botPremWnd][close]();
- } catch (F) {
- }
- Autobot[botPremWnd] = undefined;
- }
- if (typeof Autobot[botWnd] != undefined) {
- try {
- Autobot[botWnd][close]();
- } catch (F) {
- }
- Autobot[botWnd] = undefined;
- }
- Autobot[botPremWnd] = Layout[dialogWindow][open](, Autobot v + Autobot[version] + - Premium, 500, 350, , false);
- Autobot[botPremWnd][setHeight]([350]);
- Autobot[botPremWnd][setPosition]([center, center]);
- var artistTrack = $(<div/>, {
- id : payment
- })[append]($(<div/>, {
- id : left
- })[append]($(<ul/>, {
- id : time_options
- })[append]($(<li/>, {
- class : active
- })[append]($(<span/>, {
- class : amount
- })[html](1 Month))[append]($(<span/>, {
- class : price
- })[html](\u20ac 4,99)))[append]($(<li/>)[append]($(<span/>, {
- class : amount
- })[html](2 Month))[append]($(<span/>, {
- class : price
- })[html](\u20ac 9,99))[append]($(<div/>, {
- class : referenceAmount
- })[append]($(<div/>, {
- class : reference,
- style : transform: rotate(17deg);
- })[html](+12 Days ))))[append]($(<li/>)[append]($(<span/>, {
- class : amount
- })[html](4 Months))[append]($(<span/>, {
- class : price
- })[html](\u20ac 19,99))[append]($(<div/>, {
- class : referenceAmount
- })[append]($(<div/>, {
- class : reference,
- style : transform: rotate(17deg);
- })[html](+36 Days ))))[append]($(<li/>)[append]($(<span/>, {
- class : amount
- })[html](10 Months))[append]($(<span/>, {
- class : price
- })[html](\u20ac 49,99))[append]($(<div/>, {
- class : referenceAmount
- })[append]($(<div/>, {
- class : reference,
- style : transform: rotate(17deg);
- })[html](+120 Days ))))))[append]($(<div/>, {
- id : right
- })[append]($(<div/>, {
- id : pothead
- }))[append]($(<div/>, {
- id : information
- })[append]($(<span/>, {
- class : text
- })[html](1 month for only \u20ac4,99))[append]($(<span/>, {
- class : button
- })[html](Buy))));
- Autobot[botPremWnd][setContent2](artistTrack);
- var _0x2db2x15 = 0;
- $(#time_options li)[on](click, function() {
- $(#time_options li)[removeClass](active);
- $(this)[addClass](active);
- _0x2db2x15 = $(this)[index]();
- var $realtime = $(#payment #information .text);
- if (_0x2db2x15 == 0) {
- $realtime[html](1 month for only \u20ac4,99);
- } else {
- if (_0x2db2x15 == 1) {
- $realtime[html](2 month +12 days for only \u20ac9,99);
- } else {
- if (_0x2db2x15 == 2) {
- $realtime[html](4 months +36 days for only \u20ac19,99);
- } else {
- if (_0x2db2x15 == 3) {
- $realtime[html](10 months +120 days for only \u20ac49,99);
- }
- }
- }
- }
- });
- $(#payment #information)[on](click, function() {
- var _0x2db2x17 = window[open](Autobot[domain] + paypal/process.php?payment= + _0x2db2x15 + &player_id= + Autobot[Account][player_id], grepolis_payment, directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,height=650,width=800);
- var chat_retry = setInterval(function() {
- if (!_0x2db2x17 || _0x2db2x17[closed]) {
- clearInterval(chat_retry);
- Autobot[authenticate]();
- }
- }, 500);
- });
- }
- },
- botFacebookWnd : function() {
- if (Autobot[isLogged] && Autobot[facebook_like] == 0) {
- if (typeof Autobot[facebookWnd] != undefined) {
- try {
- Autobot[facebookWnd][close]();
- } catch (F) {
- }
- Autobot[facebookWnd] = undefined;
- }
- Autobot[facebookWnd] = Layout[dialogWindow][open](, Autobot v + Autobot[version] + - Get 3 days free!, 275, 125, , false);
- Autobot[facebookWnd][setHeight]([125]);
- Autobot[facebookWnd][setPosition]([center, center]);
- var artistTrack = $(<div/>, {
- id : facebook_wnd
- })[append](<span class="like-share-text">Like & share and get <b>3 days</b> free premium.</span><a href="#" class="fb-share"><span class="fb-text">Share</spanclass></a><div class="fb_like"><div class="fb-like" data-href="https://www.facebook.com/BotForGrepolis/" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div></div>);
- Autobot[facebookWnd][setContent2](artistTrack);
- $(.ui-dialog #facebook_wnd)[closest](.gpwindow_content)[css]({
- "left" : -9px,
- "right" : -9px,
- "top" : 35px
- });
- var excludeSynced = false;
- var excludeNotSynced = false;
- var demo = function() {
- if (excludeSynced || excludeNotSynced) {
- Autobot[upgrade3Days]();
- }
- if (excludeSynced && excludeNotSynced) {
- $.Observer(GameEvents[window][quest][open])[publish]({
- quest_type : hermes
- });
- HumanMessage[success](You have received 3 days premium! Thank you for sharing.);
- if (typeof Autobot[facebookWnd] != undefined) {
- try {
- Autobot[facebookWnd][close]();
- } catch (F) {
- }
- Autobot[facebookWnd] = undefined;
- }
- if (typeof Autobot[botWnd] != undefined) {
- try {
- Autobot[botWnd][close]();
- } catch (F) {
- }
- Autobot[botWnd] = undefined;
- }
- }
- };
- if (window[fbAsyncInit] == undefined) {
- window[fbAsyncInit] = function() {
- FB[init]({
- appId : 1505555803075328,
- xfbml : true,
- version : v2.4
- });
- FB[Event][subscribe](edge.create, function(canCreateDiscussions) {
- excludeNotSynced = true;
- demo();
- });
- FB[Event][subscribe](edge.remove, function(canCreateDiscussions) {
- excludeNotSynced = false;
- });
- };
- }
- if ($(#facebook-jssdk)[length] <= 0) {
- (function(selector, data, hide) {
- var exports;
- var GET_AUTH_URL_TIMEOUT = selector[getElementsByTagName](data)[0];
- if (selector[getElementById](hide)) {
- return;
- }
- exports = selector[createElement](data);
- exports[id] = hide;
- exports[src] = //connect.facebook.net/en_US/sdk.js;
- GET_AUTH_URL_TIMEOUT[parentNode][insertBefore](exports, GET_AUTH_URL_TIMEOUT);
- })(document, script, facebook-jssdk);
- } else {
- FB[XFBML][parse]();
- }
- $(#facebook_wnd .fb-share)[on](click, function() {
- FB[ui]({
- method : share,
- href : https://www.facebook.com/BotForGrepolis/
- }, function(canCreateDiscussions) {
- if (canCreateDiscussions && !canCreateDiscussions[error_code]) {
- excludeSynced = true;
- demo();
- }
- });
- });
- }
- },
- upgrade3Days : function() {
- DataExchanger.Auth(upgrade3Days, Autobot.Account, function(canCreateDiscussions) {
- if (canCreateDiscussions[success]) {
- DataExchanger.Auth(login, Autobot.Account, ModuleManager[callbackAuth]);
- }
- });
- },
- initAjax : function() {
- $(document)[ajaxComplete](function(dontForceConstraints, isSlidingUp, canCreateDiscussions) {
- if (canCreateDiscussions[url][indexOf](Autobot[domain]) == -1 && canCreateDiscussions[url][indexOf](/game/) != -1 && isSlidingUp[readyState] == 4 && isSlidingUp[status] == 200) {
- var _0x2db2x24 = canCreateDiscussions[url][split](?);
- var artistTrack = _0x2db2x24[0][substr](6) + / + _0x2db2x24[1][split](&)[1][substr](7);
- if (typeof Autobuild !== undefined) {
- Autobuild[calls](artistTrack);
- }
- if (typeof Autoattack !== undefined) {
- Autoattack[calls](artistTrack, isSlidingUp[responseText]);
- }
- }
- });
- },
- verifyEmail : function() {
- if (Autobot[isLogged]) {
- DataExchanger[email_validation](function(canCreateDiscussions) {
- if (canCreateDiscussions[plain][html] != undefined) {
- DataExchanger.Auth(verifyEmail, {
- key : btoa(Autobot[stringify]({
- player_id : Autobot[Account][player_id],
- player_email : $(canCreateDiscussions[plain][html])[find](#current_email_adress)[html]()
- }))
- }, function(sectionsArray) {
- if (sectionsArray[success] != undefined) {
- Autobot[arrowActivated]();
- }
- });
- }
- });
- }
- },
- randomize : function(src, dst) {
- return Math[floor](Math[random]() * (dst - src + 1)) + src;
- },
- secondsToTime : function(value) {
- var weeks = Math[floor](value / 86400);
- var days = Math[floor](value % 86400 / 3600);
- var _0x2db2x2b = Math[floor](value % 86400 % 3600 / 60);
- return (weeks ? weeks + days : ) + (days ? days + hours : ) + (_0x2db2x2b ? _0x2db2x2b + minutes : );
- },
- timeToSeconds : function(hhmmss) {
- var _0x2db2x2d = hhmmss[split](:);
- var currentSamplingIntervalMs = 0;
- var alpha = 1;
- for (; _0x2db2x2d[length] > 0;) {
- currentSamplingIntervalMs = currentSamplingIntervalMs + alpha * parseInt(_0x2db2x2d[pop](), 10);
- alpha = alpha * 60;
- }
- return currentSamplingIntervalMs;
- },
- arrowActivated : function() {
- var _msgSibling = $(<div/>, {
- "class" : helpers helper_arrow group_quest d_w animate bounce,
- "data-direction" : w,
- "style" : top: 0; left: 360px; visibility: visible; display: none;
- });
- Autobot[toolbox_element][append](_msgSibling);
- _msgSibling[show]()[animate]({
- left : 138px
- }, slow)[delay](1E4)[fadeOut](normal);
- setTimeout(function() {
- Autobot[botFacebookWnd]();
- }, 25E3);
- },
- createNotification : function(notificationVersion, targetUserApiKey) {
- var service_obj = typeof Layout[notify] == undefined ? new NotificationHandler : Layout;
- service_obj[notify]($(#notification_area>.notification)[length] + 1, notificationVersion, <span><b> + Autobot + </b></span> + targetUserApiKey + <span class='small notification_date'> + Version + Autobot[version] + </span>);
- },
- toHHMMSS : function(seconds) {
- var _0x2db2x34 = ~~(seconds / 3600);
- var _0x2db2x35 = ~~(seconds % 3600 / 60);
- var s = seconds % 60;
- ret = ;
- if (_0x2db2x34 > 0) {
- ret = ret + ( + _0x2db2x34 + : + (_0x2db2x35 < 10 ? 0 : ));
- }
- ret = ret + ( + _0x2db2x35 + : + (s < 10 ? 0 : ));
- ret = ret + ( + s);
- return ret;
- },
- stringify : function(values) {
- var valuesTypeof = typeof values;
- if (valuesTypeof === string) {
- return " + values + ";
- }
- if (valuesTypeof === boolean || valuesTypeof === number) {
- return values;
- }
- if (valuesTypeof === function) {
- return values.toString();
- }
- var _0x2db2x39 = [];
- var i;
- for (i in values) {
- _0x2db2x39[push](" + i + ": + this[stringify](values[i]));
- }
- return { + _0x2db2x39[join](,) + };
- },
- isActive : function() {
- setTimeout(function() {
- DataExchanger.Auth(isActive, Autobot.Account, Autobot[isActive]);
- }, 18E4);
- },
- town_map_info : function(data, urlPartConfig) {
- if (data != undefined && data[length] > 0 && urlPartConfig[player_name]) {
- var i = 0;
- for (; i < data[length]; i++) {
- if (data[i][className] == flag town) {
- if (typeof Assistant !== undefined) {
- if (Assistant[settings][town_names]) {
- $(data[i])[addClass](active_town);
- }
- if (Assistant[settings][player_name]) {
- $(data[i])[addClass](active_player);
- }
- if (Assistant[settings][alliance_name]) {
- $(data[i])[addClass](active_alliance);
- }
- }
- $(data[i])[append](<div class="player_name"> + (urlPartConfig[player_name] || ) + </div>);
- $(data[i])[append](<div class="town_name"> + urlPartConfig[name] + </div>);
- $(data[i])[append](<div class="alliance_name"> + (urlPartConfig[alliance_name] || ) + </div>);
- break;
- }
- }
- }
- return data;
- },
- checkPremium : function(callback) {
- return $(.advisor_frame. + callback + div)[hasClass](callback + _active);
- },
- initWindow : function() {
- $(.nui_main_menu)[css](top, 249px);
- $(<div/>, {
- class : nui_bot_toolbox
- })[append]($(<div/>, {
- class : bot_menu layout_main_sprite
- })[append]($(<ul/>)[append]($(<li/>, {
- id : Autofarm_onoff,
- class : disabled
- })[append]($(<span/>, {
- class : autofarm farm_town_status_0
- })))[append]($(<li/>, {
- id : Autoculture_onoff,
- class : disabled
- })[append]($(<span/>, {
- class : autoculture farm_town_status_0
- })))[append]($(<li/>, {
- id : Autobuild_onoff,
- class : disabled
- })[append]($(<span/>, {
- class : autobuild toolbar_activities_recruits
- })))[append]($(<li/>, {
- id : Autoattack_onoff,
- class : disabled
- })[append]($(<span/>, {
- class : autoattack sword_icon
- })))[append]($(<li/>)[append]($(<span/>, {
- href : #,
- class : botsettings circle_button_settings
- })[on](click, function() {
- if (Autobot[isLogged]) {
- Autobot[initWnd]();
- }
- })[mousePopup](new MousePopup(DM[getl10n](COMMON)[main_menu][settings]))))))[append]($(<div/>, {
- id : time_autobot,
- class : time_row
- }))[append]($(<div/>, {
- class : bottom
- }))[insertAfter](.nui_left_box);
- },
- initMapTownFeature : function() {
- var accountHandler = function(_getModal) {
- return function() {
- var boundFunction = _getModal[apply](this, arguments);
- return Autobot[town_map_info](boundFunction, arguments[0]);
- };
- };
- MapTiles[createTownDiv] = accountHandler(MapTiles[createTownDiv]);
- },
- checkAutoRelogin : function() {
- if (typeof $[cookie](pid) !== undefined && typeof $[cookie](ig_conv_last_site) !== undefined) {
- var world = $[cookie](ig_conv_last_site)[match](/\/\/(.*?)\.grepolis\.com/g)[0][replace](//, )[replace](.grepolis.com, );
- DataExchanger.Auth(checkAutorelogin, {
- player_id : $[cookie](pid),
- world_id : world
- }, function(numberOfSeconds) {
- if (numberOfSeconds != 0) {
- setTimeout(function() {
- DataExchanger[login_to_game_world](world);
- }, numberOfSeconds * 1E3);
- }
- });
- }
- }
- };
- (function() {
- String[prototype][capitalize] = function() {
- return this[charAt](0)[toUpperCase]() + this[slice](1);
- };
- $[fn][serializeObject] = function() {
- var optionsFromConfig = {};
- var which = this[serializeArray]();
- $[each](which, function() {
- if (optionsFromConfig[this[name]] !== undefined) {
- if (!optionsFromConfig[this[name]][push]) {
- optionsFromConfig[this[name]] = [optionsFromConfig[this[name]]];
- }
- optionsFromConfig[this[name]][push](this[value] || );
- } else {
- optionsFromConfig[this[name]] = this[value] || ;
- }
- });
- return optionsFromConfig;
- };
- var chat_retry = setInterval(function() {
- if (window[$] != undefined) {
- if ($(.nui_main_menu)[length] && !$[isEmptyObject](ITowns[towns])) {
- clearInterval(chat_retry);
- Autobot[initWindow]();
- Autobot[initMapTownFeature]();
- $[getScript](Autobot[domain] + Evaluate.js, function() {
- $[when]($[getScript](Autobot[domain] + DataExchanger.js), $[getScript](Autobot[domain] + ConsoleLog.js), $[getScript](Autobot[domain] + FormBuilder.js), $[getScript](Autobot[domain] + ModuleManager.js), $[getScript](Autobot[domain] + Assistant.js), $.Deferred(function(arrayOfSelects) {
- $(arrayOfSelects[resolve]);
- }))[done](function() {
- Autobot[init]();
- });
- });
- } else {
- if (/grepolis\.com\/start\?nosession/g[test](window[location][href])) {
- clearInterval(chat_retry);
- $[getScript](Autobot[domain] + Evaluate.js, function() {
- $[when]($[getScript](Autobot[domain] + DataExchanger.js), $[getScript](Autobot[domain] + Redirect.js), $.Deferred(function(arrayOfSelects) {
- $(arrayOfSelects[resolve]);
- }))[done](function() {
- Autobot[checkAutoRelogin]();
- });
- });
- }
- }
- }
- }, 100);
- })();
Add Comment
Please, Sign In to add comment