User:PhilmASTErpLus: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>PhilmASTErpLus
No edit summary
imported>PhilmASTErpLus
→‎ASH Quirks and Hacks: Added information about the fairy gravy boat that I learned through the painful way.
 
(6 intermediate revisions by 2 users not shown)
Line 3: Line 3:
--[[User:PhilmASTErpLus|PhilmASTErpLus]] 02:36, 21 June 2010 (UTC)
--[[User:PhilmASTErpLus|PhilmASTErpLus]] 02:36, 21 June 2010 (UTC)


== Moving [[Datatype Constants]] to [[Data Types]] ==


"Datatype constants" are literals that begin with a dollar sign($), such as <code>$item[]</code>, <code>$effect[]</code>, etc. Types of data, such as <code>boolean</code> and <code>int</code>, are called [http://en.wikipedia.org/wiki/Data_type Data Types].
"Datatype constants" are literals that begin with a dollar sign($), such as <code>$item[]</code>, <code>$effect[]</code>, etc. Types of data, such as <code>boolean</code> and <code>int</code>, are called [http://en.wikipedia.org/wiki/Data_type Data Types].
Line 8: Line 9:
That is true, and deserves fixing; but please don't do so in a way that breaks a massive amount of links, ktx. --[[User:StDoodle|StDoodle (#1059825)]] 04:18, 21 June 2010 (UTC)
That is true, and deserves fixing; but please don't do so in a way that breaks a massive amount of links, ktx. --[[User:StDoodle|StDoodle (#1059825)]] 04:18, 21 June 2010 (UTC)


Heh, that's okay (re: discussion on []Datatype Constants]). For most pages it isn't a huge issue, but that one... it requires fixing in quite a few places, some of which unfortunately won't be automatically be fixed by redirects during a page move (this seems to happen when some of the links are from templates, which this page has a massive number of). For reference, this wiki has problems with both the "design by committee" philosophy & the "legacy problems" philosophy. Originally, the stuff here was simply copy & pasted from an guide that had been hosted elsewhere, which itself was about 2/3 original material and 1/3 copied from Hola's old reference material. That led to the problem of pages having inappropriate names, as by the time the issue was given thought, they were deeply ingrained in the wiki structure. Then there's the "committee" issue, which resulted in some over-elaborate templates. For the most part, the last issue doesn't present any issues with searching and display, but does up the learning curve for "proper" page editing in some places (mostly on the function pages). In the end, I'm glad to have another person interested in helping; but please, before making any massive-scale (many pages) edits, or moving pages, a discussion would be appreciated. As you now know, there are "methods in the madness" for some of this stuff... ;)  Also, if you want to help with getting [[Datatype Constants]] corrected, I'd be happy to jot down some notes on what needs to be done in the next day or so. --[[User:StDoodle|StDoodle (#1059825)]] 15:51, 21 June 2010 (UTC)
Heh, that's okay (re: discussion on Datatype Constants). For most pages it isn't a huge issue, but that one... it requires fixing in quite a few places, some of which unfortunately won't be automatically be fixed by redirects during a page move (this seems to happen when some of the links are from templates, which this page has a massive number of). For reference, this wiki has problems with both the "design by committee" philosophy & the "legacy problems" philosophy. Originally, the stuff here was simply copy & pasted from an guide that had been hosted elsewhere, which itself was about 2/3 original material and 1/3 copied from Hola's old reference material. That led to the problem of pages having inappropriate names, as by the time the issue was given thought, they were deeply ingrained in the wiki structure. Then there's the "committee" issue, which resulted in some over-elaborate templates. For the most part, the last issue doesn't present any issues with searching and display, but does up the learning curve for "proper" page editing in some places (mostly on the function pages). In the end, I'm glad to have another person interested in helping; but please, before making any massive-scale (many pages) edits, or moving pages, a discussion would be appreciated. As you now know, there are "methods in the madness" for some of this stuff... ;)  Also, if you want to help with getting Datatype Constants corrected, I'd be happy to jot down some notes on what needs to be done in the next day or so. --[[User:StDoodle|StDoodle (#1059825)]] 15:51, 21 June 2010 (UTC)


P.S. User pages such as this are the perfect places for sandboxing & discussion; you can even make sub-pages in your own wiki-space by linking to them from here, with a "/" as the first character of the page name. Since user pages are outside of the normal search parameters, feel free to use them however you wish.
P.S. User pages such as this are the perfect places for sandboxing & discussion; you can even make sub-pages in your own wiki-space by linking to them from here, with a "/" as the first character of the page name. Since user pages are outside of the normal search parameters, feel free to use them however you wish.


== To-Do ==
== Works ==
 
*Add information on directly accessing kolmafia data files--equipment.txt, pulverize.txt, etc. => see {{f|file_to_map}}
*Report & document ASH quirks
**{{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.
**{{f|file_to_map}} ignores lines beginning with a sharp character (<code>#</code>), or any line that does not have a tab character in it.
**Clarify call-by-value and call-by-reference, somewhere...
*item_search.ash
**Add searching for outfit parts, iotms, semi-rares, etc.
**Fix <code>is_display()</code> issue ([http://kolmafia.us/showthread.php?4535#post32209 request])
**Add <code>search_custom()</code> ([http://kolmafia.us/showthread.php?4535#post32209 request])
 
=== Done ===
 
*Add information on directly accessing kolmafia data files--equipment.txt, pulverize.txt, etc.
*[[Image:item_category.png|150px]] would go nicely in the pages for [[Item Management]]-related functions.
*[[Image:item_category.png|150px]] would go nicely in the pages for [[Item Management]]-related functions.
*To anyone who cares: the image above was created in Microsoft PowerPoint. You can get it [http://sites.google.com/site/philmasterplus/files/kolmafia_wiki.ppt here].
*To anyone who cares: the image above was created in Microsoft PowerPoint. You can get it [http://sites.google.com/site/philmasterplus/files/kolmafia_wiki.ppt here].
== ASH Quirks and Hacks ==
*{{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".
*Technically NOT ASH-related, but KoLmafia has difficulty understanding haiku combat. In particular, as of r8611, it cannot detect acquisition of {{kolwiki|fairy gravy boat}}s from the {{kolwiki|Gravy Fairy Wing}} adventure. Therefore you must NOT use a goal and auto-adventure to get one. Let the adventurer beware!

Latest revision as of 12:35, 13 September 2010

I'm using this page as my own personal sandbox :) Please contribute your comments, opinions, and ideas in the talk page.

--PhilmASTErpLus 02:36, 21 June 2010 (UTC)

Moving Datatype Constants to Data Types

"Datatype constants" are literals that begin with a dollar sign($), such as $item[], $effect[], etc. Types of data, such as boolean and int, are called Data Types.

That is true, and deserves fixing; but please don't do so in a way that breaks a massive amount of links, ktx. --StDoodle (#1059825) 04:18, 21 June 2010 (UTC)

Heh, that's okay (re: discussion on Datatype Constants). For most pages it isn't a huge issue, but that one... it requires fixing in quite a few places, some of which unfortunately won't be automatically be fixed by redirects during a page move (this seems to happen when some of the links are from templates, which this page has a massive number of). For reference, this wiki has problems with both the "design by committee" philosophy & the "legacy problems" philosophy. Originally, the stuff here was simply copy & pasted from an guide that had been hosted elsewhere, which itself was about 2/3 original material and 1/3 copied from Hola's old reference material. That led to the problem of pages having inappropriate names, as by the time the issue was given thought, they were deeply ingrained in the wiki structure. Then there's the "committee" issue, which resulted in some over-elaborate templates. For the most part, the last issue doesn't present any issues with searching and display, but does up the learning curve for "proper" page editing in some places (mostly on the function pages). In the end, I'm glad to have another person interested in helping; but please, before making any massive-scale (many pages) edits, or moving pages, a discussion would be appreciated. As you now know, there are "methods in the madness" for some of this stuff... ;) Also, if you want to help with getting Datatype Constants corrected, I'd be happy to jot down some notes on what needs to be done in the next day or so. --StDoodle (#1059825) 15:51, 21 June 2010 (UTC)

P.S. User pages such as this are the perfect places for sandboxing & discussion; you can even make sub-pages in your own wiki-space by linking to them from here, with a "/" as the first character of the page name. Since user pages are outside of the normal search parameters, feel free to use them however you wish.

Works

  • Add information on directly accessing kolmafia data files--equipment.txt, pulverize.txt, etc. => see file_to_map()
  • would go nicely in the pages for Item Management-related functions.
  • To anyone who cares: the image above was created in Microsoft PowerPoint. You can get it here.

ASH Quirks and Hacks

  • 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".

  • Technically NOT ASH-related, but KoLmafia has difficulty understanding haiku combat. In particular, as of r8611, it cannot detect acquisition of fairy gravy boats from the Gravy Fairy Wing adventure. Therefore you must NOT use a goal and auto-adventure to get one. Let the adventurer beware!