Moderators: Tech Team, Global Moderators
AAFitz wrote:lackattack wrote:Here's a tip for anyone trying to fix BOB. There is an function I put in called handleResponse() that runs each time an AJAX response comes in. Perhaps the GM script could re-define that function to call gm_ConquerClubGame() at the end?
tell you what.......you install this crap for me on my computer, and ill make your moves in your game so you can win one
this would have been so much funnier if it wasnt for that "neverland game we played"
Ishiro wrote:Not yet, because parts of it don't work well at all. The map doesn't update when you do things... have to fix that first.
// ==UserScript==
// @name Conquer Club - Ajax BOB
// @namespace http://www.itj.com.br/
// @description Ajax BOB
// @include http://*conquerclub.com*
// ==/UserScript==
// Starting
var TimeStr = document.getElementById('clock').innerHTML;
var TargetTime = TimeStr.split(/hrs\n|min\n|sec/);
var CurrHour = parseInt(TargetTime[0]);
var CurrMinute = parseInt(TargetTime[1]);
var CurrSecond = parseInt(TargetTime[2]);
ClockInterval = window.setInterval(ClockTimer, 2000);
// Running clock
function ClockTimer()
{
--CurrSecond;
if (CurrSecond < 0)
{
--CurrMinute;
if (CurrMinute < 0)
{
--CurrHour;
if (CurrHour < 0)
{
CurrHour = 0;
}
CurrMinute = 59;
}
CurrSecond = 59;
}
snextTurn = ' @ ';
CurrDate = new Date();
nextTurn = (CurrHour * 60) + CurrMinute + (CurrDate.getHours() * 60) + CurrDate.getMinutes();
if (nextTurn > 1440)
{
nextTurn -= 1440;
snextTurn = ' tomorrow @ ';
}
StrClock = document.getElementById('clock');
StrClock.innerHTML = zslash(CurrHour, 2) + 'hrs ' + zslash(CurrMinute, 2) + 'min ' + zslash(CurrSecond, 2) + 'sec' + snextTurn + '<b>' + zslash(parseInt(nextTurn / 60), 2) + ':' + zslash(nextTurn - parseInt(parseInt(nextTurn / 60) * 60), 2) + '</b />';
}
// Ajax Code
var bob_gameLog = unsafeWindow.gameLog;
var bob_gameChat = unsafeWindow.gameChat;
var bob_handleResponse = unsafeWindow.handleResponse;
unsafeWindow.handleResponse = function() {
if (typeof(unsafeWindow.request.responseText) != "undefined")
{
var bob_response = unsafeWindow.request.responseText.split("&");
if (bob_response.length > 2)
{
if (bob_response[2] != "")
{
TargetTime = bob_response[2].split(/hrs|min|sec/);
CurrHour = parseInt(TargetTime[0]);
CurrMinute = parseInt(TargetTime[1]);
CurrSecond = parseInt(TargetTime[2]);
}
var CurrDate = new Date();
bob_gameChat.innerHTML += '<b>' + zslash(CurrDate.getHours(), 2) + ':' + zslash(CurrDate.getMinutes(), 2) + ':' + zslash(CurrDate.getSeconds(), 2) + '</b /> Ajax Test - I am a response!<br />';
}
} else {
var CurrDate = new Date();
bob_gameChat.innerHTML += '<b>' + zslash(CurrDate.getHours(), 2) + ':' + zslash(CurrDate.getMinutes(), 2) + ':' + zslash(CurrDate.getSeconds(), 2) + '</b /> Ajax Test - I am not!<br />';
}
return bob_handleResponse();
}
// Counters, Map inspect...
// Common Functions
function zslash(svalue, iwidth)
{
var szero = String(svalue);
var ch = szero.substr(0,1);
while (ch == ' ')
{
szero = szero.substr(1, szero.length);
ch = szero.substr(0,1);
}
ch = szero.substr(szero.length - 1, szero.length);
while (ch == ' ')
{
szero = szero.substr(0, szero.length - 1);
ch = szero.substr(szero.length - 1, szero.length);
}
for (var i=0; i < (iwidth - szero.length); i++)
{
szero = '0' + szero;
}
return szero;
}

lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX
* Main contributor(s) will get 12 months, secondary contributors according to their contribution
** Colourblind feature is now core, no need to replace that

lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX
* Main contributor(s) will get 12 months, secondary contributors according to their contribution
** Colourblind feature is now core, no need to replace that


lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX
* Main contributor(s) will get 12 months, secondary contributors according to their contribution
** Colourblind feature is now core, no need to replace that

Users browsing this forum: No registered users and 1 guest