Page 1 of 2
A question for all you scriptwriters

Posted:
Thu Aug 21, 2008 9:06 pm
by Draconian_Intel
Where did you learn to write user scripts? I am an amateur programmer, and it would seem fun to learn how to do this kind of thing. I was just wondering where others learned so that I could try and find a good place to learn. I know a decent amount of C and C++, as well as Visual Basic , and I'm just starting to learn Java (not sure if those will help at all).
Re: A question for all you scriptwriters

Posted:
Fri Aug 22, 2008 12:05 am
by yeti_c
Java will be your main help - as it will teach you syntax (although it's not overtly disimilar to C++(C))...
The other thing Java will give you - if you're using it for an Web application is that you will use Javascript (which is what the scripts are written in) and give you knowledge of (X/D)HTML which is what the scripts do!
The other way of learning - is simply - Doing!!
Take a look at the contents of the scripts (start with a simple one like "Saved Searches") and see if you can see what is happening.
Then try BOB - see if you can think about changing something - i.e. the location of something - or the calculation of something etc...
C.
Re: A question for all you scriptwriters

Posted:
Fri Aug 22, 2008 1:28 pm
by Draconian_Intel
Ok yeti, thanks, I will try that.
Re: A question for all you scriptwriters

Posted:
Sat Aug 23, 2008 7:33 am
by Pedronicus
I've got a question for the script writers.
Do you get paid by Lack for your work?
Re: A question for all you scriptwriters

Posted:
Sat Aug 23, 2008 9:21 am
by lancehoch
I am not a script writer, but no they don't. They do this out of the kindness of their hearts.
Re: A question for all you scriptwriters

Posted:
Sat Aug 23, 2008 11:37 am
by yeti_c
Pedronicus wrote:I've got a question for the script writers.
Do you get paid by Lack for your work?
No - Although - Lack did give me a year for converting Old BOB into AJAX BOB - that was a public offer and I took up the gauntlet!!
C.
Re: A question for all you scriptwriters

Posted:
Tue Aug 26, 2008 8:06 pm
by Draconian_Intel
Ok, so I have learned a fair amount of javascript now, and so I can understand the basic idea of what some of the code means.
Now though, I need some help finding a cheat sheet of sorts, something that tells we what all the javascript keywords are and what they do. For example, it took me something like half an hour to figure out what GetElementByID was.
Another thing that I am curious about is how the javascripts interact with CC. For example: How does the javascript get access to the game log?
I think part of my problems come from a lack of knowledge on how this site works, and my very basic knowledge of HTML, so anyway you can help me with these as well would be appreciated, but especially the first two things.
Re: A question for all you scriptwriters

Posted:
Tue Aug 26, 2008 8:11 pm
by Snorri1234
Well I've been trying to get my scripts into hollywood, but so far noone seems interrested in a movie about a ex-CIA, ex-PETA agent who is down on his luck and has resorted into alcoholism since his wife won't let him see his daughter and he's also an expert martial artist who saw his whole family killed and vowed to fight injustice even when the perpetrators are psychopaths who wear make-up.
It's a hard world out there.
Re: A question for all you scriptwriters

Posted:
Tue Aug 26, 2008 8:19 pm
by Draconian_Intel
I'm not sure if that had anything to do with my topic besides having the word script in it.....
Anyway, the request still stands for someone to fill these needs:
1. I need a way to learn more javascript keywords and their purposes,
2. I need to learn more about how this site works as well as how the javascript can interact with it,
3. and I finally need a way to learn all or most of the HTML I need to write user scripts effectively.
(I have found that it can be useful to reiterate something in different ways to make it clearer).
Re: A question for all you scriptwriters

Posted:
Wed Aug 27, 2008 12:38 am
by lancehoch
Again, not a script writer myself, but I have done coding before. The best way to learn the keywords in a language is to google a tutorial (one of the first links I got was
this). As to how the site works, (I am using firefox, so if you are using IE or something else, this may not work) go to view > page source. This should give you a feel for how the elements of the site are laid out.
Re: A question for all you scriptwriters

Posted:
Wed Aug 27, 2008 12:59 am
by Draconian_Intel
I did use that tutorial, but I missed that section

, thanks for pointing it out.
As for your suggestion on how to learn the site's layout, I followed your advice and found out just how little I really know about website making.

Maybe this will be the drive I need to finally learn it.

Looks like I still have a ways to go before I am able to do much in the way of useful coding. If I have any more questions, I will post them here.
P.S. feel free to respond to any of my old questions if you have a different response.
Re: A question for all you scriptwriters

Posted:
Wed Aug 27, 2008 2:59 am
by yeti_c
OK - here's a few hints for ya.
1) Get Firebug -> Use the inspect tool - it will teach you the site a lot (
https://addons.mozilla.org/en-US/firefox/addon/1843).
2)
http://www.w3schools.com/ - Great resource site.
3) If you find some standard code that you don't understand - throw it into google and see what the search gets you.
C.
Re: A question for all you scriptwriters

Posted:
Wed Aug 27, 2008 3:31 pm
by Draconian_Intel
Ok, I will look into that as well. Thanks to both of you for your ideas.
Re: A question for all you scriptwriters

Posted:
Thu Aug 28, 2008 12:58 am
by yeti_c
Draconian_Intel wrote:Ok, I will look into that as well. Thanks to both of you for your ideas.
Don't look into it - get Firebug... you'll understand what I mean - I can't live without it these days!!!
C.
Re: A question for all you scriptwriters

Posted:
Thu Aug 28, 2008 12:54 pm
by Draconian_Intel
Well, I got it, but I'm not sure what I'm looking at. I am trying to learn more HTML/CSS/anything website related right now, which is giving me a better understanding of the information presented by Firebug, but its still Greek to me.
I have learned a lot by trying to become a scriptwriter, but I have also learned that I don't nearly enough.
Re: A question for all you scriptwriters

Posted:
Fri Aug 29, 2008 1:37 pm
by yeti_c
Use the inspect tool...
And look in the console - you will see that the HTML tags become like a tree structure - this is how you can navigate around the page element by element.
C.
Re: A question for all you scriptwriters

Posted:
Fri Aug 29, 2008 3:26 pm
by Draconian_Intel
Wow, this is a nice tool. I'm learning a lot. I notice that most of the time, the inspect tool highlights the stuff on the page in light blue, but sometimes it does other colors as well. Is there a color-code? Actually, is there a good tutorial or something that will help me learn how to use this better? I did google it, but I didn't see a lot that gave this kind of info.
Re: A question for all you scriptwriters

Posted:
Sat Aug 30, 2008 4:48 pm
by Draconian_Intel
I can understand how Saved Searches works!

I doubt that I could write anything that complex right now, but it gives me new encouragement that I will eventually. Hopefully there will still be a user script worth writing then.
Re: A question for all you scriptwriters

Posted:
Sat Aug 30, 2008 5:14 pm
by chipv
Draconian_Intel wrote:I can understand how Saved Searches works!

I doubt that I could write anything that complex right now, but it gives me new encouragement that I will eventually. Hopefully there will still be a user script worth writing then.
Outstanding! Saved Searches isn't actually as easy at it might sound on the face of it, so I think you've done really well.
Re: A question for all you scriptwriters

Posted:
Sat Aug 30, 2008 5:36 pm
by Scott-Land
I have a question as well- is there anyway to copy the terr's on the map to paste in team chat?
Re: A question for all you scriptwriters

Posted:
Sat Aug 30, 2008 5:47 pm
by chipv
Scott-Land wrote:I have a question as well- is there anyway to copy the terr's on the map to paste in team chat?
You could use the map .xml , would that be good enough? Or do yo need army counts in which case use BOB Text Map
What exactly do you need to paste?
Re: A question for all you scriptwriters

Posted:
Sun Aug 31, 2008 9:02 am
by Scott-Land
chipv wrote:Scott-Land wrote:I have a question as well- is there anyway to copy the terr's on the map to paste in team chat?
You could use the map .xml , would that be good enough? Or do yo need army counts in which case use BOB Text Map
What exactly do you need to paste?
With all the new maps, it'd be nice to be able to copy the name of the territory from the map itself and paste it in team chat. Right now I cant highlight the terr's names to do it- complicated names on the newer maps in like Ussr and Iceland. I'm not sure how else to explain it.
Also another question about your Map Ranks- no way to configure how many kills a players made ( not Unique defeats) ?
Re: A question for all you scriptwriters

Posted:
Sun Aug 31, 2008 9:15 am
by chipv
Scott-Land wrote:chipv wrote:Scott-Land wrote:I have a question as well- is there anyway to copy the terr's on the map to paste in team chat?
You could use the map .xml , would that be good enough? Or do yo need army counts in which case use BOB Text Map
What exactly do you need to paste?
With all the new maps, it'd be nice to be able to copy the name of the territory from the map itself and paste it in team chat. Right now I cant highlight the terr's names to do it- complicated names on the newer maps in like Ussr and Iceland. I'm not sure how else to explain it.
Also another question about your Map Ranks- no way to configure how many kills a players made ( not Unique defeats) ?
If it's only the name you want to paste just copy the name from the Text Map in BOB. (BOB menu on the game page -> View Options -> Text Map Standard or Extended)
Map Rank does actually already store non-unique kills for the kill ratio.
Kill ratio = kills/ kills + losses so
kills = (kill ratio x losses) / (1 - kill ratio)
So this is a rough number because kill ratio is rounded, but an accurate number would not be a problem since map rank already stores the value of the number of kills.
Re: A question for all you scriptwriters

Posted:
Sun Aug 31, 2008 9:21 am
by Scott-Land
chipv wrote:Scott-Land wrote:chipv wrote:Scott-Land wrote:I have a question as well- is there anyway to copy the terr's on the map to paste in team chat?
You could use the map .xml , would that be good enough? Or do yo need army counts in which case use BOB Text Map
What exactly do you need to paste?
With all the new maps, it'd be nice to be able to copy the name of the territory from the map itself and paste it in team chat. Right now I cant highlight the terr's names to do it- complicated names on the newer maps in like Ussr and Iceland. I'm not sure how else to explain it.
Also another question about your Map Ranks- no way to configure how many kills a players made ( not Unique defeats) ?
If it's only the name you want to paste just copy the name from the Text Map in BOB. (BOB menu on the game page -> View Options -> Text Map Standard or Extended)
Map Rank does actually already store non-unique kills for the kill ratio.
Kill ratio = kills/ kills + losses so
kills = (kill ratio x losses) / (1 - kill ratio)
So this is a rough number because kill ratio is rounded, but an accurate number would not be a problem since map rank already stores the value of the number of kills.
As usual Chip, timely and helpful. Thanks.

Re: A question for all you scriptwriters

Posted:
Sun Aug 31, 2008 5:01 pm
by Draconian_Intel
So, I have managed to understand a couple of scripts (Saved Searches and Games Filter to be exact), so I'm thinking of trying my hand at writing one (points history to be exact). I figure it will at least show me how much more I need to learn. So, my first two of many questions to come is this: is there a way to get all the game numbers a person has ever played in? Also, is there a way to access the game log without opening the game in a separate window?
I wish I could understand map rank, because I'm pretty sure all the answers I need are in there, but oh well.
