Welcome!
This topic will be the home to the "League of Scripters" unofficial competition & league, where every week I'll be putting up a problem, which is open for anyone to try and solve!
The emphasis on the problems is not to give hard tasks, but tasks that have plenty of room for improving their speed. As all skilled scripters will know, Scar's main flaw is in its slow pace, so being able to take a slow function and speeding it up a lot is a vital ability for kick ass scripts.
Points will be awarded for the first submissions and for the fastest scripts. As I am unsure of how many people will enter, I can't give exact numbers, but probably the points will be distributed for the first half of entries and for the fastest third of entries, with the fastest script getting a bit more points than the first entry.
Everyone is open to submit a script to solve the problem and you are allowed 2 submissions, with the first being completely ignored if you send in a second. 3rd submissions onwards will not be counted, so don't be too rash in deciding to submit. If a script doesn't work, then it can't get any points, but Scar version based changes will be corrected as needed.
All entries are to be PM'd to me. Unless stated, you are fine with me publishing your script for each other to learn from. If you disagree, please say so in the PM, however you must then consent to me being able to send it to an independent judge in case anyone thinks I'm being biased or if I am unable to judge for whatever reason.
Plugins are not allowed at all. However, you may rely on external sauces as long as they accessible from within Scar - this is as much about ingenuity as it is about scripting ability. Likewise, all scripts must be Scar scripts and be in the form of a function. I'll be using Scar 3.15b to run the speed tests. If you feel that my times differ from yours, bear in mind I probably have a much worse computer. Likewise, if you feel that my Scar version may affect the times, do say and I'll run re-tests through a newer version, but I don't see any future problems that would be affected by changes in Scar version.
It will hopefully run a while and at the moment there are no prizes, but there is a possibility for prizes in the future.
Any questions, ask else try to leave the topic spam free - no need to tell me you are planning to participate as I'll get the idea when you send in a submission :)
League table:
Nielsie = 18 + 5; 23
Raymond = 12;
Cardin = 10;
Bullzeye = 10;
Killerdou = 10;
DansTheMan = 8;
Senrath = 6;
RM = 6;
Markus = 4;
Toot = 2;
Widget = 2;
ToF = 1;
Nadeem = 0;
Problem 5
Your problem, whether or not you choose to accept it, is two fold this week. These are not tiered tasks - you may enter one and one only. The points awarded will depend on how many people submit for the same problem - the more that enter the same, the more points awarded for the winner.
The problems will be classed as problem A and problem B.
Problem A
A most unfortunate problem has arisen - RS has updated and no longer uses the same font even in the same piece of uptext! All that you know is that they use some what consistent colours much like they do now, but they differ enough from char to char that someone will have to make a whole new approach to text finding to do this! Luckily, someone has, but they are ahving trouble getting the input to use and this is where you come in!
Problem A requires an algorithm that takes in a bitmap of the top left quarter or so of the main screen and returns a TPA of all points where there is text. It is to be believed that no other text apart from the uptext is present, however similar colours may also be there, so the more accurate the better. Likewise, it shouldn't be restricted to just one uptext colour as we all know that the colours differ for different things ie main bit that is in white, a little yellow bit to show the default NPC action then another little white bit for how many other options there are. For testing, it should be able to work with the current RS uptext. This function should therefore have a layout similar to:
SCAR Code:function mixsters_UptextFilterer(bitmap: Integer): TPointArray;
Problem B
Ok, so the scene continues from Problem A - RS has updated and uptext has been ruined. However, some intelligent individual notices that all the characters can successfully be converted to a consistent font. How to do this? Why, it's "easy" - the chars have a border colour that goes all the way around them and if he grabs this border and passes it through his own complex function, he can generate a TPA outline of the character that is consistent to a font. However, to match it against a font, he need an ingenious way to turn the TPA border into a solidly filled TPA.
This is where you come in. You must create an algorithm that takes in a TPA of a single character's outline. You must then fill in the TPA so that a TPA of the character is returned with a solid fill. Be careful though, some tricky characters like 'H' or 'O' don't have a completely solid fill - they too much be returned correctly. As far as this problem goes, you can use a TPA generated from an item's border for testing or draw your own shapes and use them. For presentation, the function should resemble:
But processing as a procedure with input as a var is also fine.SCAR Code:function mixsters_TPAFiller(input: TPointArray): TPointArray;
The deadline will be in one week, but if there is a general mood of it being a bit pressurising, I will be fine with extending it.
On another note, I think this will be the last of this season. Unless someone else wants to run it for a month or so, I think I will put it away and focus on the Jr comp as well as refining my current layout and organisation for this competition so that it can make a come back and hopefully run a lot smoother and generate a real buzz :)
Problem 4 results
1 entry.
nielsie95 was the only entrant and I am quite sure it runs (had to get someone else to test though since Scar was being silly). Congratulations to nielsie! 5 points awarded, though I really could of and should of given more, but then he would get too far in front :) Script can be found here.
Problem 3 winning script by nielsie can still be found here.

