Blank lines count, comments don't. It would make no sense to include comments in the line count because they're there as user documentation, not for the function of the script itself. Whether it be scripting or proper programming commenting is essential, it makes no sense to limit comments because you want to stay within the line count.
New to scripting? Procedures & Functions for Beginners
Do you use your computer at night? Just get f.lux
a custom TPA/ATPA find function is sth like this roughly:
Simba Code:UndorakObjectFinder (Color, Tol: integer, Hue, sat : Extended, Mouseovertext: array of string): boolean
var
x, y:integer;
TPA: TPointArray
begin
FindcolorsSpiralTolerance( x, y, TPA, color, tol, (2, hue, sat);
TPA.cluster(10);
{etc etc, you are supposed to do this :),
here you add move mouse functions and
whatever you want to do, so when you call
it in the script you just have to do:
UndorakObjectfinder(color,tol, hue,sat, ['banker']);
instead of doing the same thing on each process you search for a color}
end;
this is a very rough example, since i made it fast and didnt even check it, its just so you get the idea.. You can look at other people's scripts to learn about custom ATPA/TPA functions!
@The Mayor; when you say ATPA/TPA function, it means it can be etiher ATPA or TPA? since i made only TPA function to save lines, it works the same though
Last edited by Incurable; 11-07-2014 at 12:11 AM.
New to scripting? Procedures & Functions for Beginners
Do you use your computer at night? Just get f.lux
There's three ways of doing it:
- Setting a rule that the script must be no more than 250 lines after being formatted with the Parser extension so that no one has any advantages or disadvantages based on preferred formatting style (suggested but shot down)
- Having each contestant count the number of comment lines that they have and giving them the benefit of the doubt
- Running each script through a program that removes comment lines but doesn't modify formatting, something that many people here could whip up in 15 minutes
Or if absolutely necessary, Mayor counts each individual comment line and subtracts it from the total lines in order to see whether the script passes 250 lines or not. It's really not that hard, it takes about a minute to count the amount of comment lines in a 250 line script. Judging the scripts is going to take time, so what's another total of ~30 minutes to confirm line counts? ;/
As for the line cap, I was skeptical about 250 lines at first, but I've grown to like it. It's a good number, and 300 lines would be giving just a little bit too much imo now that I've seen what can be done in 250.
Last edited by Incurable; 11-07-2014 at 12:23 AM.
New to scripting? Procedures & Functions for Beginners
Do you use your computer at night? Just get f.lux
Anyone else amazed at what can be written in 250 lines? I didn't even think there would be room for a progress report at the end
Comments are a part of documentation, most methods should be commented so that someone reading it can understand at a glance what, how, and why it does what it does; that's just a basic part of programming.
Instead of doing this:
Simba Code:{ ============================================================================ )
Procedure: GaussWait
Description: Waits a period of time normally distributed in the given range
Credit: Incurable, original idea (with better code) by Slacky
( ============================================================================ }
procedure GaussWait(min, max: integer);
begin
wait(gaussRangeInt(min, max));
end;
... I've had to do this this:
Simba Code:procedure GaussWait(min, max: integer); // Waits a period of time normally distributed in the given range
begin
wait(gaussRangeInt(min, max));
end;
The first is better formatted, gives credit where it's due, and is easier for another script writer to read without having to scroll past 80 characters to the right. The second is done purely for the sake of saving lines because "comments count".
New to scripting? Procedures & Functions for Beginners
Do you use your computer at night? Just get f.lux
It depends what the situation is. You might not need to split the TPA.
Yes comments are an essential part of documentation, but you’re not writing an include! Having a 20 line comment header for something that is self-explanatory is ridiculous.
Simba Code:{------------------------------------------------------------------------------)
@@@@ Function: findBanker: boolean
@@@@ Description: Looks for the banker // // Oh really! I would have never guessed!
@@@@ Made by: The Mayor // Oh you did? I would have never guessed!
(------------------------------------------------------------------------------}
function findBanker(): boolean;
var
t: TTimeMarker; // t is a TTimeMarker // Oh it is! I would have never guessed!
begin
end; // this is an 'end' // sadfaice
You don’t need explain what srl-6 functions do, as those are already documented. You only need to explain something that is ambiguous to the reader, and even then, the comment don’t have to take up any lines.
Simba Code:mouseBox(intToBox(100, 150, 100, 150), MOUSE_RIGHT); // right clicking the top/left area of xx interface
How many lines did that comment take up? Zero, zilch, zip, nada, none
Exactly
I've received about 10 entries so far, and even I'm amazed at what has been squeezed in 250 lines
@Lama @arclight @Nathgunner888 @Dr Clemsip @Soviet Union @o0Matthius0o @Incurable @Blytez @undorak7 @uhit @Gunner @Cyanempire @Spaceblow @cosmasjdz @pipos1 @sparkyownage @sipfer3 @Annonymus @tealc @aran armath @Wooty @Torol @keff @Trollcrank @akarigar
Friendly reminder: 3 days until due date!
Ignore this mention if you have already sent me your script! Last chance to hit it out this weekend!
My new comp is coming on monday. So no chance for me to make a script by then
I used GaussWait as an example, and I have no idea where you're pulling the rest of that condescending nonsense from.
But whatever, I'm not going to continue, it's clear that we disagree and there's no point arguing about it. I'll still be submitting a script and I look forward to seeing what everyone else has produced.
New to scripting? Procedures & Functions for Beginners
Do you use your computer at night? Just get f.lux
So nice to see so many people are actually submitting scripts! You guys are awesome!
All those people still unsure about the line limit
You guys realize that just removing random line feeds does make your script elligble to enter, but will imidiatly get you at the bottom of the rankings because you gave an hard to read script with bad standards.
Working on: Tithe Farmer
I believe the biggest "pain" for the line limit is that the only guideline is "Have some good standards and also legible code and also less than 251 lines" which is extremely subjective. Perhaps everyone should learn how Mayor codes because that way he'll like their standards more, or perhaps they should use the Parser extension, or perhaps they should follow a tutorial on proper standards.
The problem with those options is that they would all be different line amounts. Maybe Mayor likes to have spacing in his functions (I do in between "segments" of a function), which makes it more lines than a tutorial might require. The parser extension adds new lines in "else" statements, which is a waste of space, but it also makes the script very hard to follow (IMO) because of the lack of spacing anywhere through the functions.
The point is that the people I've talked to are trying to squeeze as many features into the script as possible to get the upper hand in the competition, and having things as subjective as "I'm going to rate you based on how I like your standards" is creating extreme difficulties in how this happens. ie "Well if I use the parser and then make all the else statements on the same lines, it makes the script illegible to Garrett but it will let me add in the playerform, hopefully Mayor reads better than Garrett does".
That doesn't even touch on my other huge problem with the competition ('You will be ranked higher if I think that you aren't as good at scripting') but I could write a whole essay on how terribly that will work out. It's nice in theory but again, implimenting an idea like that adds extreme subjectivity to it that only serves to frustrate the competitors.
Edit:
Since this sounds like I'm complaining I offer a solution to each problem.
1) Require that all scripts are formatted using the parser (except make all else statements on the same line because it doesn't make sense the way parser does it).
2) Mark the scripts based on quality and performance, preferably marked by someone who doesn't even know what script is written by who.
Last edited by 3Garrett3; 11-07-2014 at 04:18 PM.
Sorry for short reply, gtg.
A signature competition is subjective. A scripting competition is only a bit subjective. Scripting standards are well defined:
http://www.kaitnieks.com/scar/scriptingsta/
Imagine a small poem competition. The limit is half an A4 paper, of course, using Arial 5pt will give you plenty of room to write tons of stuff. But you will most likely lose the competition: it is not readable, it doesn't look nice and above all it is not short and powerfull like the other entries.
Working on: Tithe Farmer
The only thing I'm saying is that if scripting standards are well defined, it should be an explicit requirement that all scripts meet the scripting standards and they should be judged based on how well they meet the official standards. Being a casual bystander through this thread has given me the feel of very vague requirements in standards, which is causing undue stress among the competitors who are trying to maximize line usage without losing points in other areas. The whole point of the competition is to get non-members to script, which will only serve to help the community. Causing any stress over areas which could be more clearly defined is doing a disservice to the competition.
Don't worry too mush about them comments! There are much more important aspects (this isn't a commenting competition).
Yes, very pleased!
No worries, maybe next time!
This competition was designed to give new users the opportunity and motivation to code. For a large portion of the entrants, this will be the first script they have ever written.
The unspecific ‘laid back’ guidelines are proposed the way they are to foster creativity, independence, and more importantly, problem solving. I’m not going to propose outrageous ‘Olympic standards’ to people that are learning. If there were 5 different criteria for writing a comment, another 3 for where to place the ‘else’ in a conditional statement, another 2 for ‘spaces between lines’ do you think this ‘wall of rules’ would encourage someone who has never scripted before to enter this competition?
If there was no line limit, how many entries would I receive? If the criteria was too strict, how many entries would I receive? If I didn't weight it against current ability (thus not giving everybody an equal opportunity) how many entries would I receive? If you are questioning my ability to mark these appropriately, I have marked thousands of examinations in my time.
This is turning out to be the most successful competition ever to occur here at the Forums. While you are entitled to your opinion, you could have sent it to me via PM. All it’s done is cast a bad light on something which was so positive. You really should think before unleashing your undue criticism.
Best of luck to everyone participating. Unfortunately I had to bail out :\
Previously known as; Annonymus.
i'll probably be sending my script today.... its an amazing quantity of exactly 250 lines
There are currently 1 users browsing this thread. (0 members and 1 guests)