no, this one isn't bob's fault--it's my clickable maps script. i'm getting pretty close to finishing the next version which will no longer have this bug. sorry again to all who have lost games because of thislord voldemort wrote:im not sure if this is ajax bob or not.
but when im playing speed games and im typing in game chat everytime i type the letter e iit comes up with the warning to end attack etc. is this supposed to happen. cause hell annoying, it cost poo the game
AJAX BOB 4.7.1 Development/Discussion (don't post bugs here)
Moderator: Tech Team
Forum rules
Please read the Community Guidelines before posting.
Please read the Community Guidelines before posting.
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
- edthemaster
- Posts: 111
- Joined: Mon Jan 29, 2007 3:07 am
- Contact:
see the clickable maps topic for some workarounds in the meantime: http://www.conquerclub.com/forum/viewto ... 847#967847
Re: Clock Fix
Here's my version of a clock fix. Let me know if this works for all...
Code: Select all
In function countDown()
Replace
*******************
clock.innerHTML = hours1+'hrs '+minutes1+'min '+seconds1+'sec';
*******************
with
*******************
if( hours1 < 10)
{
clock.innerHTML = '0'+hours1+'hrs ';
}
else
{
clock.innerHTML = hours1+'hrs ';
}
if( minutes1 < 10)
{
clock.innerHTML = clock.innerHTML+'0'+minutes1+'min ';
}
else
{
clock.innerHTML = clock.innerHTML+minutes1+'min ';
}
if( seconds1 < 10)
{
clock.innerHTML = clock.innerHTML+'0'+seconds1+'sec';
}
else
{
clock.innerHTML = clock.innerHTML+seconds1+'sec';
}
*******************
in the // ---- Start Clock ----
Replace (all parseInt(time[x]) with parseInt(time[x],10))
*******************
// ---- Start Clock ----
tmp = rightside.innerHTML.indexOf(timeLocStr);//to make sure there is a clock.
if( tmp > -1 ){
timeLoc = tmp + timeLocStr.length ;
tmp = rightside.innerHTML;
timeStr = tmp.substring(timeLoc,timeLoc + timeWIDTH);
time = timeStr.split(/hrs\n|min\n|sec\n/);
var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var day = ' @ ';
var ampm = ' ';
minutes = (minutes + parseInt(time[1]));
if (minutes >= 60) {
hours = hours + 1;
minutes = minutes - 60;
}
if (time[0][0] == '0')
{
time[0] = time[0][1];
}
hours = (hours + parseInt(time[0]));
if (hours >= 24)
{
day = "tomorrow @ ";
hours = hours - 24
}
if (OPTIONS['24hourClockFormat']=="am/pm") {
ampm = " am";
if (hours >= 12)
{
ampm = " pm";
hours = hours - 12;
}
if (hours == 0) hours = 12;
}
else
{
if (hours < 10)
{
hours = "0" + hours;
}
}
if (minutes < 10)
minutes = "0" + minutes;
if (OPTIONS['24hourClockFormat']!="Off") {
clock = day + "<b>" + hours + ":" + minutes + ampm + " " + "</b>"
}
else
{
clock = ""
}
hours1 = parseInt(time[0]);
minutes1 = parseInt(time[1]);
seconds1 = parseInt(time[2]);
clockInterval = window.setInterval(countDown,1000);
}
*******************
with
*******************
// ---- Start Clock ----
tmp = rightside.innerHTML.indexOf(timeLocStr);//to make sure there is a clock.
if( tmp > -1 ){
timeLoc = tmp + timeLocStr.length ;
tmp = rightside.innerHTML;
timeStr = tmp.substring(timeLoc,timeLoc + timeWIDTH);
time = timeStr.split(/hrs\n|min\n|sec\n/);
var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var day = ' @ ';
var ampm = ' ';
minutes = (minutes + parseInt(time[1],10));
if (minutes >= 60) {
hours = hours + 1;
minutes = minutes - 60;
}
if (time[0][0] == '0')
{
time[0] = time[0][1];
}
hours = (hours + parseInt(time[0],10));
if (hours >= 24)
{
day = "tomorrow @ ";
hours = hours - 24
}
if (OPTIONS['24hourClockFormat']=="am/pm") {
ampm = " am";
if (hours >= 12)
{
ampm = " pm";
hours = hours - 12;
}
if (hours == 0) hours = 12;
}
else
{
if (hours < 10)
{
hours = "0" + hours;
}
}
if (minutes < 10)
minutes = "0" + minutes;
if (OPTIONS['24hourClockFormat']!="Off") {
clock = day + "<b>" + hours + ":" + minutes + ampm + " " + "</b>"
}
else
{
clock = ""
}
hours1 = parseInt(time[0],10);
minutes1 = parseInt(time[1],10);
seconds1 = parseInt(time[2],10);
clockInterval = window.setInterval(countDown,1000);
}
*******************
In the function reinitClock()
Replace
*******************
hours1 = parseInt(time[0]);
minutes1 = parseInt(time[1]);
seconds1 = parseInt(time[2]);
*******************
with
*******************
hours1 = parseInt(time[0],10);
minutes1 = parseInt(time[1],10);
seconds1 = parseInt(time[2],10);
*******************
Don't forget that this is JavaScript... a whole different beast to Java... Java is what I usually program in - the syntax is simlar... but JS is harder and easier in equal measures...SkyT wrote:yeti you are a god, i just took a java class last semester and loved it, then i saw yeti's source code for bob, i am totally worshipping him now.
The main thing you need to know about JS - variables ('var' s) are not typed - until you use them - then of course you can change them too...
i.e.
var a = 1;
a = a+1;
and
var a = "1";
a = a+1;
Will do 2 different things completely...
C.
PS Answers on a postcard to the above if you fancy a challenge!!

Highest score : 2297
Re: Clock Fix
This bit might be the bit I'm looking for (for the leading 0's problem) too!!yowzer14 wrote:Code: Select all
hours1 = parseInt(time[0],10); minutes1 = parseInt(time[1],10); seconds1 = parseInt(time[2],10);
I'll take a look at both suggestions next week - and implement them when I have time!!
Cheers for both of your help.
C.
PS Here's the explanation...
parseInt(string, radix)
If the radix parameter is omitted, JavaScript assumes the following:
If the string begins with "0x", the radix is 16 (hexadecimal)
If the string begins with "0", the radix is 8 (octal). This feature is deprecated
If the string begins with any other value, the radix is 10 (decimal)
----
So I assmume that the code is thinking that it is parsing an octal number...
Thus 08, 09 are above 7 (The limit of Octal) and returning a 0.
C.

Highest score : 2297
Re: Clock Fix
I've been running it for a few days and runs fine on my end.yeti_c wrote:This bit might be the bit I'm looking for (for the leading 0's problem) too!!yowzer14 wrote:Code: Select all
hours1 = parseInt(time[0],10); minutes1 = parseInt(time[1],10); seconds1 = parseInt(time[2],10);
I'll take a look at both suggestions next week - and implement them when I have time!!
Hopefully it'll help clear up that clock issue.
yowzer14
oh ic, i never learned about "function"s, maybe the stuff i learned are just basics. is JS just a variation of java or do they have a lot of differences?yeti_c wrote:Don't forget that this is JavaScript... a whole different beast to Java... Java is what I usually program in - the syntax is simlar... but JS is harder and easier in equal measures...SkyT wrote:yeti you are a god, i just took a java class last semester and loved it, then i saw yeti's source code for bob, i am totally worshipping him now.
The main thing you need to know about JS - variables ('var' s) are not typed - until you use them - then of course you can change them too...
i.e.
var a = 1;
a = a+1;
and
var a = "1";
a = a+1;
Will do 2 different things completely...
C.
PS Answers on a postcard to the above if you fancy a challenge!!
and postcard? what do you mean, if u want a game, sure lets set up one. if you have a partner or a team we can do doubles or triples, if not 1v1 is fine too
I have tried to find the answer in this thread, but I feel so dumb amongst all the programming talk...
I'd like to install the script, and went to the page at
http://userscripts.org/scripts/show/13076
When I click on the "Install this script" button, I get a lot of text code, but nothing to download. Do I have to copy/paste the code somewhere. Ummm...help? I have a win xp computer if it makes any difference....
Thanks very much in advance for any help anyone can shed.
I'd like to install the script, and went to the page at
http://userscripts.org/scripts/show/13076
When I click on the "Install this script" button, I get a lot of text code, but nothing to download. Do I have to copy/paste the code somewhere. Ummm...help? I have a win xp computer if it makes any difference....
Thanks very much in advance for any help anyone can shed.
- hecter
- Posts: 14632
- Joined: Tue Jan 09, 2007 6:27 pm
- Gender: Female
- Location: Tying somebody up on the third floor
- Contact:
You didn't download greasemonkey and/or you're not using Firefox.Songsting wrote:I have tried to find the answer in this thread, but I feel so dumb amongst all the programming talk...
I'd like to install the script, and went to the page at
http://userscripts.org/scripts/show/13076
When I click on the "Install this script" button, I get a lot of text code, but nothing to download. Do I have to copy/paste the code somewhere. Ummm...help? I have a win xp computer if it makes any difference....
Thanks very much in advance for any help anyone can shed.
First, make sure you're running Firefox, downloadable via this link:
http://www.mozilla.com/en-US/firefox/
Then, after it's up and running, download greasemonkey:
https://addons.mozilla.org/en-US/firefox/addon/748
Just click the big green button
After that's all down, THEN, and only then, can you download BOB.
Yeti, I think you should include the above information in the first post. Not everybody knows this stuff y'know...
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.


- hecter
- Posts: 14632
- Joined: Tue Jan 09, 2007 6:27 pm
- Gender: Female
- Location: Tying somebody up on the third floor
- Contact:
No problemSongsting wrote:Hecter, thanks VERY much. I had firefox, but had never even heard of greasemonkey. I just set it all up after your wonderfully simple instructions, and I looked at a game; it's like a whole new world has suddenly opened up to me. Many many thanks!
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.


- lackattack
- Posts: 6097
- Joined: Sun Jan 01, 2006 10:34 pm
- Location: Montreal, QC
- Aerial Attack
- Posts: 1132
- Joined: Mon Jun 04, 2007 7:59 pm
- Location: Generation One: The Clan
Anyone getting this error with the Scotland map?
Code: Select all
Error: c has no properties
Source File: file:///C:/Documents%20and%20Settings/garyh/Application%20Data/Mozilla/Firefox/Profiles/407xoggh.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js
Line: 3542
- Optimus Prime
- Posts: 9665
- Joined: Mon Mar 12, 2007 9:33 pm
- Gender: Male
Hey there yeti,
I just noticed something in one of my Quadruples games. In all of my other team games I can hover over the "Team 1" tag and see where the armies for my entire team are using the map inspect. This doesn't seem to work at the moment for the Quads games. Any chance you can throw that in with your next update? I'm going to guess it should be too difficult of a fix.
Regards, Optimus Prime
I just noticed something in one of my Quadruples games. In all of my other team games I can hover over the "Team 1" tag and see where the armies for my entire team are using the map inspect. This doesn't seem to work at the moment for the Quads games. Any chance you can throw that in with your next update? I'm going to guess it should be too difficult of a fix.
Regards, Optimus Prime
- wombat slayer
- Posts: 3
- Joined: Wed Oct 03, 2007 8:16 am
Scotland
I am also having troubles with BoB on the Scotland map. I usually have to switch over to IE to make my moves.
- Optimus Prime
- Posts: 9665
- Joined: Mon Mar 12, 2007 9:33 pm
- Gender: Male



