SRL / SRL-5

SRL 5
https://villavu.com
GNU General Public License v3.0
32 stars 34 forks source link

GetWildernessLevel #99

Closed litoris closed 12 years ago

litoris commented 12 years ago

http://villavu.com/forum/showthread.php?p=1116265#post1116265

riwu commented 12 years ago

Good job. Maybe evaluate the param -50? I know it's good for readability but will be very slightly less efficient for Simba to do an additional subtraction.

Also why not default it to 0? Some people may use it to do some math where outcome is directly tied to an arithmetic operation of the result. -1 is conventionally used when a function 'technically failed' (an error) to retrieve a result but in this case it's simply that we are not in the wilderness.

cohenadair commented 12 years ago

What's the point of the -50? If it's for the navigation tool bar, it's automatically removed from the client in Simba.

ghost commented 12 years ago

What about function GetWildernessLevel(var Lv : Integer) : Boolean instead?

litoris commented 12 years ago

@riwu it returns -1 because it doesn't necessarily mean you are out of the wildy if the number can't be read, could be just that the OCR failed.

@Coh3n it's there because i got the coordinates manually, I can't remove it myself so can you do it please? You just need to do simple algebra. (Though it will work the way it stands too)

@Zyt3x that would be harder to use if you just want to know the wildy level, it's very easy for a user to make such a boolean function from this, but it's hard the other way around.

ghost commented 12 years ago

No, you don't understand; returning False would mean error, -1 would be out of wilderness. This solution copes with the problem riwu adressed. This way one can easily create a function WildyLevel : Integer that does what this function currently does, but also adds extra functionality for more advanced programs. On Oct 24, 2012 3:39 PM, "litoris" notifications@github.com wrote:

@riwu https://github.com/riwu it returns -1 because it doesn't necessarily mean you are out of the wildy if the number can't be read, could be just that the OCR failed.

@Coh3n https://github.com/Coh3n it's there because i got the coordinates manually, removing it now.

@Zyt3x https://github.com/Zyt3x that would be harder to use if you just want to know the wildy level, it's very easy for a user to make such a boolean function from this, but it's hard the other way around.

— Reply to this email directly or view it on GitHubhttps://github.com/SRL/SRL-5/pull/99#issuecomment-9739516.

litoris commented 12 years ago

Ooh I see, but then I'd need another piece of code to check whether the wildy symbol is even there, right?

cohenadair commented 12 years ago

I think so, yes.

litoris commented 12 years ago

Closing this, I'll make a new version the way Zyt3x suggested after the weekend.