AJAX BOB 4.7.1 Development/Discussion (don't post bugs here)

Archival storage to keep things organized and uncluttered. Can't find what you need? Search for old topics here.

Moderator: Tech Team

Forum rules
Please read the Community Guidelines before posting.
Locked
User avatar
edthemaster
Posts: 111
Joined: Mon Jan 29, 2007 3:07 am
Contact:

Post by edthemaster »

lord 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


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 this
User avatar
edthemaster
Posts: 111
Joined: Mon Jan 29, 2007 3:07 am
Contact:

Post by edthemaster »

see the clickable maps topic for some workarounds in the meantime: http://www.conquerclub.com/forum/viewto ... 847#967847
yowzer14
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Re: Clock Fix

Post by yowzer14 »

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);
*******************
User avatar
SkyT
Posts: 194
Joined: Mon Jan 15, 2007 3:31 pm
Location: please view this link
Contact:

Post by SkyT »

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.
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post by yeti_c »

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.


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...

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!!
Image
Highest score : 2297
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Re: Clock Fix

Post by yeti_c »

yowzer14 wrote:

Code: Select all

        hours1 = parseInt(time[0],10);
          minutes1 = parseInt(time[1],10);
        seconds1 = parseInt(time[2],10);



This bit might be the bit I'm looking for (for the leading 0's problem) too!!

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.
Image
Highest score : 2297
yowzer14
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Re: Clock Fix

Post by yowzer14 »

yeti_c wrote:
yowzer14 wrote:

Code: Select all

        hours1 = parseInt(time[0],10);
          minutes1 = parseInt(time[1],10);
        seconds1 = parseInt(time[2],10);



This bit might be the bit I'm looking for (for the leading 0's problem) too!!

I'll take a look at both suggestions next week - and implement them when I have time!!



I've been running it for a few days and runs fine on my end.

Hopefully it'll help clear up that clock issue.

yowzer14
User avatar
SkyT
Posts: 194
Joined: Mon Jan 15, 2007 3:31 pm
Location: please view this link
Contact:

Post by SkyT »

yeti_c wrote:
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.


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...

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!!


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?

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
Songsting
Posts: 26
Joined: Thu Mar 01, 2007 6:25 am

Post by Songsting »

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.
User avatar
hecter
Posts: 14632
Joined: Tue Jan 09, 2007 6:27 pm
Gender: Female
Location: Tying somebody up on the third floor
Contact:

Post by hecter »

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.

You didn't download greasemonkey and/or you're not using Firefox.

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 :D

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.
Image
Songsting
Posts: 26
Joined: Thu Mar 01, 2007 6:25 am

Post by Songsting »

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!
User avatar
hecter
Posts: 14632
Joined: Tue Jan 09, 2007 6:27 pm
Gender: Female
Location: Tying somebody up on the third floor
Contact:

Post by hecter »

Songsting 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!

No problem :D Play around with the settings to get what you want, and be careful with it on Conquerman, it runs really really slow on it. I like to turn it off when entering a conquerman game (look at the bottom right of your Firefox window. See that little monkey? Click him to make him grey and frowning, now greasemonkey is off. Click him again to turn him back on).
In heaven... Everything is fine, in heaven... Everything is fine, in heaven... Everything is fine... You got your things, and I've got mine.
Image
User avatar
wacicha
Posts: 3988
Joined: Fri Jan 27, 2006 6:51 pm
Gender: Male
Contact:

Post by wacicha »

good job Hector. You are helping a lot of people with your explicit explanations and you seem to always be there for them, thanks
Image
Songsting
Posts: 26
Joined: Thu Mar 01, 2007 6:25 am

Post by Songsting »

Can I just also ask: when I make a decision to put armies somewhere or whatever, I now get a dialogue box that says "Conquerclub says are you sure you want to do that?" or similar message. How do I turn that off?
User avatar
lackattack
Posts: 6097
Joined: Sun Jan 01, 2006 10:34 pm
Location: Montreal, QC

Post by lackattack »

I just want to congratulate the BOB hackers for figuring out the cause of the clock bug. That was a real stumper!
yowzer14
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Post by yowzer14 »

lackattack wrote:I just want to congratulate the BOB hackers for figuring out the cause of the clock bug. That was a real stumper!


Can't say I found it for sure...haven't heard if anyone else testing the fix has it working for them...anyone put my temp fix in and has the clock bug fixed?
Songsting
Posts: 26
Joined: Thu Mar 01, 2007 6:25 am

Post by Songsting »

yeti_c wrote:On the left hand side there is the "BOB menu"...

Toggle some of the "confirm" options to how you want them...

C.


Wonderful. Thanks.
User avatar
Coleman
Posts: 5402
Joined: Tue Jan 02, 2007 10:36 pm
Gender: Male
Location: Midwest

Post by Coleman »

You really need to change how decay and auto deploy is added into the total armies section.

I'd like a number you get to deploy as it is now and the autodeploy/decay number in [] next to it.
Warning: You may be reading a really old topic.
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

And of course - he needs to change the missed turns multiplier to show armies deployed before and after attacking. Lots of changes for yeti_c and the BOB crew to digest.
Image
My Conquer Club Scripts | Bests: 2133, #205
yowzer14
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Post by yowzer14 »

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
User avatar
RL_Orange
Posts: 226
Joined: Mon Jun 26, 2006 2:03 pm
Gender: Male
Location: Double Dutch Alley

Post by RL_Orange »

Dont get an error, but BoB is acting strange on the scotland map.
Image
yowzer14
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Post by yowzer14 »

RL_Orange wrote:Dont get an error, but BoB is acting strange on the scotland map.


If you check the <T>ools/Error <C>onsole from Firefox next time you play a Scotland map, you'll see the errors there.
User avatar
Optimus Prime
Posts: 9665
Joined: Mon Mar 12, 2007 9:33 pm
Gender: Male

Post by Optimus Prime »

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
User avatar
wombat slayer
Posts: 3
Joined: Wed Oct 03, 2007 8:16 am

Scotland

Post by wombat slayer »

I am also having troubles with BoB on the Scotland map. I usually have to switch over to IE to make my moves.
User avatar
Optimus Prime
Posts: 9665
Joined: Mon Mar 12, 2007 9:33 pm
Gender: Male

Post by Optimus Prime »

Disregard that, just found out you already did it. :)
Locked

Return to “Tool Archives”