Re: Stasis & Combat Control & access to HTML output
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751]
There is nothing stopping anyone from writing their own wrapper functions. What you've requested is that KoLmafia have wrappers built-in, rather than having to write your own. There is a fundamental difference. One, you customize it to suit your needs, and in the other, I customize it to balance everyone else's needs.[/quote]
My original statement of "why did you write any ASH functions" and most of my worry comes down to this. If KoLmafia has wrappers built in, then everybody can use the same API, can share scripts, and can know that the API will continue to work in the future (or, will only have to be fixed in one place.) If they write wrappers, then everybody has their own (possibly broken) wrappers and everybody has to fix their scripts if anything ever changes. It's all about abstraction. I just fundamentally don't like the idea of raw URLs in a script. Maybe nobody else is bothered by this concept and I should just shut up.
I hope you don't think it's a question of laziness or of not wanting to write it myself. I'll probably write my own KoLmafia functions to do this on my local branch if you're not going to, but that doesn't help anybody else. Like most folks, I prefer features to be rolled back into the main line.
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751](snip chatbot workaround)[/quote]
That makes a lot of sense to do it that way and is a good idea of getting around that issue.
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751]
However, I decided to spend more than a couple minutes dismissing everything, giving different reasons wherever applicable. And in doing so, now I get guilt-tripped by being told "you truly must enjoy rejecting things".[/quote]
I'm honestly really sorry if you felt guilt tripped by what I said. I was more miffed by the presentation and delivery than by the content. I have no problem with "I don't like this because of reason X." It's the bold, red, "so, rejected" bit with terse responses that comes off a mite strong.
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751]You didn't do anything to help me understand why you wanted what you wanted. Why should I implement anything?[/quote]
Maybe I just assumed too much, but I thought it would be extremely clear from context why those would be useful, especially following the stasis script, which used most of those functions.
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751]Okay, look at those eight functions and then ask yourself why you want the success value to be (a) returned and then (b) cached for later use.[/quote]
(b) isn't really an issue for me. It's really (a) that's important.
I figured in the boolean return value could be used more for an immediately handled try/catch idiom in the cases that it can action could fail. For example, you could try to use an item, but say you really didn't have it (because of a bug in your script or somesuch). Instead of continuing to attack with the bogus item, you could catch that case and attack with your weapon instead. Maybe your script miscalculated the MP usage for a particular skill and thinks you can use it. Maybe your script thinks you have a skill that you don't (or that you can use a skill in combat that you can't.) Those are just a few failure cases off the top of my head. I just tend towards the "if it can fail, you need a method of informing somebody about that failure" attitude. I hope that explains it a little more clearly.
I would have no problem with a round counting function or a last_action_failed() function instead. I'm really just concerned with knowing if those actions failed.
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751]Then, ask yourself, "Okay, if I can micro-manage success of item and skill usage, will I do anything different in my scripts?"[/quote]
Yes. If I'm fighting a monster that blocks skills and I use a delevelling skill or item, it's pretty critical that I find out if it worked or not so I know if it's weak enough to start attacking. Granted, there are only two cases where that's an issue, but it can be important.
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751]Correct. What thread were you in? Access to internal data.[/quote]
...which is why you were having a discussion about stasis and functions that visit arbitrary urls.
[quote author=holatuwol link=topic=350.msg1915#msg1915 date=1155582751]Internal functions allow pass by reference; you've seen that with the file_to_map functions.[/quote]
Ah, true enough. My mind was still in script land and not in internal-function land.
And as for the lastround_mpchange() and lastround_hpchange(), you make a great point. From the point of view of writing a script, you only really care about the absolutes which you can get from the status update. And, if somebody really wanted relative values, they could calculate that themselves from round to round.
Finally, I'm sorry the scripting isn't interesting to you. It's probably pretty obvious that I'm a diamond sort of player with a thing for scripting and optimization (and pickles!)