Conquer Club

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.

Postby edthemaster on Thu Dec 27, 2007 12:39 pm

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
Sergeant 1st Class edthemaster
 
Posts: 111
Joined: Mon Jan 29, 2007 3:07 am

Postby edthemaster on Thu Dec 27, 2007 12:42 pm

see the clickable maps topic for some workarounds in the meantime: http://www.conquerclub.com/forum/viewto ... 847#967847
User avatar
Sergeant 1st Class edthemaster
 
Posts: 111
Joined: Mon Jan 29, 2007 3:07 am

Re: Clock Fix

Postby yowzer14 on Thu Dec 27, 2007 4:59 pm

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);
*******************
Private 1st Class yowzer14
 
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Postby SkyT on Thu Dec 27, 2007 11:58 pm

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
Brigadier SkyT
 
Posts: 194
Joined: Mon Jan 15, 2007 3:31 pm
Location: please view this link

Postby yeti_c on Fri Dec 28, 2007 12:50 pm

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
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Re: Clock Fix

Postby yeti_c on Fri Dec 28, 2007 12:53 pm

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

Re: Clock Fix

Postby yowzer14 on Fri Dec 28, 2007 5:01 pm

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
Private 1st Class yowzer14
 
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Postby SkyT on Fri Dec 28, 2007 5:21 pm

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

Postby Songsting on Sat Dec 29, 2007 1:34 am

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

Postby hecter on Sat Dec 29, 2007 1:38 am

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
User avatar
Private 1st Class hecter
 
Posts: 14632
Joined: Tue Jan 09, 2007 6:27 pm
Location: Tying somebody up on the third floor

Postby Songsting on Sat Dec 29, 2007 1:44 am

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

Postby hecter on Sat Dec 29, 2007 1:49 am

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
Private 1st Class hecter
 
Posts: 14632
Joined: Tue Jan 09, 2007 6:27 pm
Location: Tying somebody up on the third floor

Postby wacicha on Sat Dec 29, 2007 2:08 am

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
User avatar
Major wacicha
 
Posts: 3988
Joined: Fri Jan 27, 2006 6:51 pm

Postby Songsting on Sat Dec 29, 2007 2:21 am

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

Postby lackattack on Sat Dec 29, 2007 9:39 am

I just want to congratulate the BOB hackers for figuring out the cause of the clock bug. That was a real stumper!
User avatar
Corporal 1st Class lackattack
 
Posts: 6097
Joined: Sun Jan 01, 2006 10:34 pm
Location: Montreal, QC

Postby yowzer14 on Sat Dec 29, 2007 2:57 pm

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?
Private 1st Class yowzer14
 
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Postby Songsting on Sat Dec 29, 2007 8:22 pm

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

Postby Coleman on Sun Dec 30, 2007 12:28 am

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
Sergeant Coleman
 
Posts: 5402
Joined: Tue Jan 02, 2007 10:36 pm
Location: Midwest

Postby Aerial Attack on Sun Dec 30, 2007 12:34 am

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
User avatar
Sergeant Aerial Attack
 
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Postby yowzer14 on Sun Dec 30, 2007 10:37 am

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
Private 1st Class yowzer14
 
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Postby RL_Orange on Sun Dec 30, 2007 11:57 am

Dont get an error, but BoB is acting strange on the scotland map.
Image
User avatar
Brigadier RL_Orange
 
Posts: 226
Joined: Mon Jun 26, 2006 2:03 pm
Location: Double Dutch Alley

Postby yowzer14 on Sun Dec 30, 2007 1:44 pm

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.
Private 1st Class yowzer14
 
Posts: 196
Joined: Sun Dec 24, 2006 10:20 pm
Location: Windsor, Ontario, Canada

Postby Optimus Prime on Sun Dec 30, 2007 2:17 pm

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
Cadet Optimus Prime
 
Posts: 9665
Joined: Mon Mar 12, 2007 9:33 pm

Scotland

Postby wombat slayer on Sun Dec 30, 2007 2:19 pm

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
Corporal 1st Class wombat slayer
 
Posts: 3
Joined: Wed Oct 03, 2007 8:16 am

Postby Optimus Prime on Sun Dec 30, 2007 2:22 pm

Disregard that, just found out you already did it. :)
User avatar
Cadet Optimus Prime
 
Posts: 9665
Joined: Mon Mar 12, 2007 9:33 pm

PreviousNext

Return to Tool Archives

Who is online

Users browsing this forum: No registered users