Difference between pages "Counters" and "Talk:Tips, Tricks and Workarounds"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(CLI command)
 
imported>StDoodle
 
Line 1: Line 1:
{{DISPLAYTITLE:counters (CLI)}}
+
__TOC__
  
This is a CLI command for displaying or modifying KoLmafia's counters. Without any parameters it will display all current counters.
+
== Discussion Recap ==
  
The possible parameters are:
+
=== Discussion from [[Talk:Storage amount]] ===
* '''clear''': This will remove all current counters.
 
* '''add''' condition: This will add a counter. If the condition is an item, it will set the necessary quantity to this many more than you currently have. This also has the additional parameters: number [title img]
 
** '''number''' the is the number of turns until the counter expires
 
** '''title''' is an optional parameter to name the counter. If no name is given, then the counter will be named "manual"
 
** '''img''' is an optional image for the counter. You can use any of the images in KoL's \itemimages directory. If no image is chosen, then mafia will use watch.gif for the counter.
 
  
Example: to add a fortune cookie counter to expire in 88 turns, use this command:
+
Can anyone else verify, before I edit it in, that this function doesn't work on free pulls? --[[User:StDoodle|StDoodle (#1059825)]] 11:45, 21 September 2010 (UTC)
:<code> counters add 88 cookie fortune.gif</code>
 
  
 +
Verified. I believe that this was reported as a bug once. (Back when we had that awesome bug tracker.) However this behavior was clarified to be working as intended and hence, not a bug. The fact that an itemd doesn't require a pulls means that it is supposed to be treated differently. Use {{f|available_amount}} minus {{f|item_amount}} to verify presence of free pulls in Hangks. Then get them into inventory with {{f|retrieve_item}} instead of with {{f|take_storage}}. You're right that info should probably be on all relevant pages.  --[[User:Bale|Bale]] 05:17, 22 September 2010 (UTC)
  
[[Category:CLI Commands]]
+
Perhaps we should start a special "caveats" page, and link to subheadings on it, for such info; it seems a bit much may be required to explain the situation to include it on every page. It would also be a good place to put info on things like Between Battle Scripts and adventure count in automation, etc. Thoughts? --[[User:StDoodle|StDoodle (#1059825)]] 15:10, 22 September 2010 (UTC)
 +
 
 +
I favor a caveats page. Or perhaps we could call it Tricks & Tips. We should add [[User:PhilmASTErpLus#ASH_Quirks_and_Hacks|THIS]] there also. --[[User:Bale|Bale]] 22:22, 22 September 2010 (UTC)
 +
 
 +
Tips, Tricks and Workarounds* sounds good to me. I agree that those items philmaterplus points out should go there. Also, we should clean up the FAQ to only include one example of non-aborting booleans, and move the full list to this new page, I think (with a link of course). Perhaps this would even be a good page to put a dedicated file link to the syntax highlighting scheme for Notepadd++ (I favor having it on the wiki, so when it's updated with new ash functions, it's... you know, updated). I'll come up with other ideas, too, and leave them on the talk page when it's there. --[[User:StDoodle|StDoodle (#1059825)]] 17:04, 23 September 2010 (UTC)
 +
 
 +
*Actually it doesn't sound perfect, which is why I'm not making it yet... hrmph.
 +
 
 +
Moving Discussion to [[Talk: Tips, Tricks and Workarounds]]. Since there may be a bit of discussion about the page before it gets created properly. We can always move the talk page if we change our minds about what it should be called. --[[User:Bale|Bale]] 21:18, 23 September 2010 (UTC)
 +
 
 +
 
 +
=== Quirks & Hacks from [[User:PhilmASTErpLus|PhilmASTErpLus]] ===
 +
 
 +
*{{f|print}} displays a blank line when given a string starting with a slash (<code>/</code>). To prevent this, the text color must be explicitly given. Easy to bypass, but weird.
 +
*"Anonymous" closures: ASH does not seem to accept anonymous closures by default.
 +
{{CodeSample|code=<syntaxhighlight>
 +
int var1;
 +
/* Do stuff */
 +
{
 +
    int var1;
 +
    call_some_function();
 +
    /* Do other stuff */
 +
}
 +
</syntaxhighlight>}}
 +
However, you can use a workaround with a if-clause.
 +
{{CodeSample|code=<syntaxhighlight>
 +
int var1;
 +
/* Do stuff */
 +
if (true)
 +
{
 +
    int var1;
 +
    /* Do other stuff */
 +
}
 +
</syntaxhighlight>}}
 +
As for where stuff like this could be used...I'm using it for initializing ASH scripts without creating any unnecessary functions or variables in the "namespace".
 +
 
 +
 
 +
== New Discussion ==
 +
 
 +
Ugh, sorry. Can't think of the best way to fix that ATM, it was half a joke. (Note to self; don't edit wiki drunk.) --[[User:StDoodle|StDoodle (#1059825)]] 06:32, 24 September 2010 (UTC)

Revision as of 06:32, 24 September 2010

Discussion Recap

Discussion from Talk:Storage amount

Can anyone else verify, before I edit it in, that this function doesn't work on free pulls? --StDoodle (#1059825) 11:45, 21 September 2010 (UTC)

Verified. I believe that this was reported as a bug once. (Back when we had that awesome bug tracker.) However this behavior was clarified to be working as intended and hence, not a bug. The fact that an itemd doesn't require a pulls means that it is supposed to be treated differently. Use available_amount() minus item_amount() to verify presence of free pulls in Hangks. Then get them into inventory with retrieve_item() instead of with take_storage(). You're right that info should probably be on all relevant pages. --Bale 05:17, 22 September 2010 (UTC)

Perhaps we should start a special "caveats" page, and link to subheadings on it, for such info; it seems a bit much may be required to explain the situation to include it on every page. It would also be a good place to put info on things like Between Battle Scripts and adventure count in automation, etc. Thoughts? --StDoodle (#1059825) 15:10, 22 September 2010 (UTC)

I favor a caveats page. Or perhaps we could call it Tricks & Tips. We should add THIS there also. --Bale 22:22, 22 September 2010 (UTC)

Tips, Tricks and Workarounds* sounds good to me. I agree that those items philmaterplus points out should go there. Also, we should clean up the FAQ to only include one example of non-aborting booleans, and move the full list to this new page, I think (with a link of course). Perhaps this would even be a good page to put a dedicated file link to the syntax highlighting scheme for Notepadd++ (I favor having it on the wiki, so when it's updated with new ash functions, it's... you know, updated). I'll come up with other ideas, too, and leave them on the talk page when it's there. --StDoodle (#1059825) 17:04, 23 September 2010 (UTC)

  • Actually it doesn't sound perfect, which is why I'm not making it yet... hrmph.

Moving Discussion to Talk: Tips, Tricks and Workarounds. Since there may be a bit of discussion about the page before it gets created properly. We can always move the talk page if we change our minds about what it should be called. --Bale 21:18, 23 September 2010 (UTC)


Quirks & Hacks from PhilmASTErpLus

  • print() displays a blank line when given a string starting with a slash (/). To prevent this, the text color must be explicitly given. Easy to bypass, but weird.
  • "Anonymous" closures: ASH does not seem to accept anonymous closures by default.
int var1;
/* Do stuff */
{
    int var1;
    call_some_function();
    /* Do other stuff */
}

However, you can use a workaround with a if-clause.

int var1;
/* Do stuff */
if (true)
{
    int var1;
    /* Do other stuff */
}

As for where stuff like this could be used...I'm using it for initializing ASH scripts without creating any unnecessary functions or variables in the "namespace".


New Discussion

Ugh, sorry. Can't think of the best way to fix that ATM, it was half a joke. (Note to self; don't edit wiki drunk.) --StDoodle (#1059825) 06:32, 24 September 2010 (UTC)