HI Guys,
Not brilliant at coding in Lua, though I am looking to expand my skills.
As such, I would like to offer a free service where I will try and help you/create scripts for you that you find useful but don't know how to complete yourself.
I have a pretty solid background in Achaea - mostly combat oriented - so if there was something you wanted, let me know and I'll try and make it for you (I may already have it, too)!
No promises that it will be better than anything you can create yourself, but I think this could be mutually beneficial - I learn more, you get your scripts.
I'll work on a first-come-first-serve basis, and will be honest if I think I can or can't do something that you request.
Thanks,
Telinus.
1
Comments
Results of disembowel testing | Knight limb counter | GMCP AB files
EDIT: http://forums.achaea.com/discussion/5939/need-some-help-getting-started-with-mudlet#latest
This post has some great links to exactly what I was asking for!
The major issues I see with code by other Achaeans are inconsistent - or just plain non-existent - indentation and other whitespace making it almost impossible to determine what code goes with which conditions, is part of a function, etc., large nested if statements (made worse by the previous point - tables are your friend, there's no need to be scared of them!), and inappropriate use of data types (in particular using 1 and 0 rather than true and false).
Results of disembowel testing | Knight limb counter | GMCP AB files
Honestly the things I saw of yours wasn't "bad" they just hurt to look at. Like your massive index of tables:
Travesty! Looking through your limb counter you had up, I see so much stuff that could easily be condensed
This is really just a way for me to work on other projects as I find it difficult to think up things I would actually need/utilise personally in Achaea.
Comments in code would hopefully explain what each part is trying to achieve, and make it easy to edit/tear apart.
[At work I am presently trying to rewrite a VB program that interacts with SAP/Sql and has no comments or information on what each sub/function does - they also have names like function1 and label1]
Just be glad I used "conf" rather than "configuration" for the table that contains the configuration options for my limb counter!
In all seriousness, namespacing is important (in my opinion), as is using meaningful variable names (though sometimes I'm guilty of using less than optimal names because I've already used the ideal name for something else in the script). I'd rather have slightly longer references because my code is properly namespaced and the variable names have meaning than risk potential conflicts with other pieces of code because a variable name gets reused; besides, I type reasonably fast and I usually store the value from a long reference in a local variable if it's going to be used more than once, so it's not a huge issue when writing the code (and I wouldn't ever consider it an issue when reading code, personally, but that's definitely a matter of taste - possibly it's more of an issue if you don't have much screen space?).
Since I've brought up meaningful variable names, I just remembered another thing people have a strong tendency to do - and it's likely because a lot of tutorials do the same thing - is use meaningless names when iterating over a table with the pairs/ipairs functions. Using for i, v in ipairs(t) and for k, v in pairs(t) isn't great. Sure, i means index, k means key and v means value.
But what is the key? The name of a person? The name of a class? A bodypart? Something else?
What is the value? An entire object? A percentage? The name of a room?
Results of disembowel testing | Knight limb counter | GMCP AB files
Results of disembowel testing | Knight limb counter | GMCP AB files
For the 'specialised' stuff I make for people, or give out, I'll actually give it meaningful names / comments to ensure people don't have to come to me to ask what it's doing.
And like I said, the deep namespacing in itself isn't bad. To me it just looks irksome to read, I'd rather split it into separate lists than have it like table1.table2.table3.table4.table5[setting] - personal preference, really, nothing wrong with doing it that way.
Rude.
Svof
Mudlet Discord join up
I've never worked with SAP tables before, there are a LOT of tables.. there's also a lot of crap naming conventions in the VB script, as well as in the stored procedures that are being used to then write into SAP.
It's good fun. I've started just going through and adding comments to the code with what I think they do.
It made me sad
Whether or not a table would be suitable to replace an if chain depends on what exactly your nested if statements are doing, but I've seen quite a lot of code where people will have a long chain of if statements to check the value of variable X and set the value of variable Y accordingly (e.g. mapping an affliction to what curse to use). That's an obvious case where a dictionary lookup would be better, and - excluding the code to define the dictionary (one of the two types of table) - it takes that entire if chain and replaces it with a single line of code.
Results of disembowel testing | Knight limb counter | GMCP AB files
Also for converting venoms to their respective affliction, on weapon hits:
both functions are reused in a few different scenarios, too, so it's extra nice. getLockAff is used for my prompt tags for example, to determine what the 'final' aff whatever class I'm playing needs, in order for a true lock to be registered.
I try to think ahead a lot, to see if functions I write can serve multiple purposes. Saved me quite a lot of time and headaches.
But.. it did do the job.
@Telinus Back to the original point though, I've always wanted something that would identify who was online (from qwho) on a city bounty list. Even if it just put an (x) next to their name or something, I think that'd be cool. Like check qwho, check city bounty list, boom if something matches it let's you know. Something to think about until you get higher priority requests.
First number is the number of the bounty, so I could do city bounty claim 243 to claim Halos's without having to sift through the board to find it.
http://forums.achaea.com/discussion/5960/city-bounty-list#latest