Difference between pages "Adventure" and "User:StDoodle/Requests for Deletion"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(interesting example)
 
imported>StDoodle
m
 
Line 1: Line 1:
{{
+
<p>For [[User:fewyn|fewyn]] to reference for page deletions.</p>
#vardefine:name|adventure}}{{
 
#vardefine:return_type|boolean}}{{
 
  
FunctionPage|
+
==Specific Requests & Reasons==
name={{#var:name}}|
+
<p>
function_category=Adventuring|
+
[[(ASHRM) Skills and Effects]]<br />
 +
[[(ASHRM) Datatype Conversions]]<br />
 +
[[(ASHRM) KoLmafia Properties]]<br />
 +
[[(ASHRM) Code Samples]]<br />
 +
[[(ASHRM) Datatype Constants]]<br />
 +
Above 4 pages moved to follow standardization.</p>
 +
<p>
 +
[[Template:Primative]]<br />
 +
This template was a mispeeling & used only as a redirect to properly-spelled version.</p>
 +
<p>
 +
[[test_again]]<br />
 +
[[test_function()]]<br />
 +
The above two pages were created by myself for testing purposes.</p>
 +
<p>
 +
[[Attack alpha]]<br />
 +
[[Available amount alpha]]<br />
 +
[[Ceil alpha]]<br />
 +
[[Main Page alpha]]<br />
 +
[[Numeric modifier alpha]]<br />
 +
[[Outfit alpha]]<br />
 +
[[Random alpha]]<br />
 +
[[Template alpha]]<br />
 +
[[To item alpha]]<br />
 +
[[Visit url alpha]]<br />
 +
The above "alpha" functions were for testing & before (my) philosophy of putting all possible calls to a function on one page, and explaining the differences there (instead of having a page for each fucntion call / parameter set, which seemed to be the original idea; my idea works better with searching).
  
function1={{Function|
+
==General Note==
name={{#var:name}}|
 
aggregate={{#var:aggregate}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
parameter1={{Param|int|adventures}}|
 
parameter2={{Param|location|place}}|
 
}}|
 
  
function2={{Function|
+
<p>All pages that include () at the end, and now have nothing save a redirect to their ()-less version, can be safely deleted.</p>
name={{#var:name}}|
 
aggregate={{#var:aggregate}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
parameter1={{Param|int|adventures}}|
 
parameter2={{Param|location|place}}|
 
parameter3={{Param|string|filter}}|
 
p1desc={{Pspan|int}} is the number of adventures to spend.|
 
p2desc={{Pspan|place}} is the adventuring location.|
 
p3desc={{Pspan|filter}} is the combat action filter. This is the name of a function which modifies the current CCS. The combat filter takes the parameters of a consult script, but returns lines like a CCS, not like a consult script. Essentially this allows the scripter to put a CCS into a script.|
 
}}|
 
 
 
function_description=This function runs the specified number of {{pspan|adventures}} at the given {{pspan|place}}, keeping up your current mood & obeying restore settings.</p>
 
<p>If {{Pspan|filter}} is omitted or assigned an empty string, this function will use your current CCS / battle action.</p>
 
<p>This function does not have to make use of its return value, but if you wish to do so, it will return true if all adventures were used, and false if it is unable to do so for any reason (not enough adventures, location unavailable, etc.).</p>
 
<p>Note that {{Pspan|adventures}} is the number of adventures to spend, and any "free" turns will not count towards this total.</p>
 
<p>Note also that adventure() checks against goals set via [[add_item_condition|add_item_condition()]] or via other methods of specifying goals in KoLmafia.|
 
 
 
code1={{CodeSample|
 
title=Code Sample|
 
description=Adventure 5 times at the Giant's Castle:|
 
code=
 
<syntaxhighlight>
 
adventure(5 , $location[giant's castle]);
 
</syntaxhighlight>}}|
 
 
 
code2={{CodeSample|
 
title=Example of a Combat Filter|
 
description=This uses the combat filter to automatically olfact Goth Giants while adventuring.|
 
code=
 
<syntaxhighlight>
 
 
 
string olfact_goth(int round, string opp, string text) {
 
  if(opp != "Goth Giant")
 
      return get_ccs_action(round);
 
  if(round == 1 && have_effect($effect[On the Trail]) < 1)
 
      return "skill transcendent olfaction"
 
  else
 
      return get_ccs_action(round - 1);
 
}
 
 
 
adventure(5 , $location[giant castle], "olfact_goth");
 
</syntaxhighlight>
 
}}|
 
 
 
code3={{CodeSample|
 
description=Uses a combat filter to ensure that all sewer monsters are being cleeshed while you try to make your way to Hobopolis.|
 
code=
 
<syntaxhighlight>
 
string combat_cleesh(int round, string opp, string text) {
 
  if (opp == $monster[frog].to_string() || opp == $monster[newt].to_string()
 
    || opp == $monster[salamander].to_string()) {
 
      return "attack";
 
  }
 
  return "skill CLEESH";
 
}
 
 
 
adventure(1, $location[a maze of sewer tunnels], "combat_cleesh");
 
</syntaxhighlight>
 
}}|
 
 
 
code4={{CodeSample|
 
description=This makes use of the combat filter to ensure that salve is being used.|
 
code=
 
<syntaxhighlight>
 
// Adds salve to beginning of combat if it doesn't already exist in the CCS.
 
// Otherwise it simply returns the current CCS.
 
string insert_salve(int round, string opp, string text) {
 
  boolean salve = false;
 
  for i from 1 to 30
 
      if(get_ccs_action(round) == "skill saucy salve")
 
        salve = true;
 
  if(salve)
 
      return get_ccs_action(round);
 
  else {
 
      if(round == 1)
 
        return "skill saucy salve";
 
      if(round > 1)
 
        round = round - 1;              // compensate for insertion
 
      return get_ccs_action(round);      // for the rest of the combat, executes your existing ccs
 
  }
 
}
 
 
 
adventure(5 , $location[giant castle], "insert_salve");
 
</syntaxhighlight>
 
}}|
 
 
 
see_also={{SeeAlso|adv1}}|
 
cli_equiv=The CLI command "adv" works similarly.|
 
special=This function will return false if KoLmafia conditions are met before completing the specified number of turns.
 
}}
 

Revision as of 19:15, 2 March 2010

For fewyn to reference for page deletions.

Specific Requests & Reasons

(ASHRM) Skills and Effects
(ASHRM) Datatype Conversions
(ASHRM) KoLmafia Properties
(ASHRM) Code Samples
(ASHRM) Datatype Constants
Above 4 pages moved to follow standardization.

Template:Primative
This template was a mispeeling & used only as a redirect to properly-spelled version.

test_again
test_function()
The above two pages were created by myself for testing purposes.

Attack alpha
Available amount alpha
Ceil alpha
Main Page alpha
Numeric modifier alpha
Outfit alpha
Random alpha
Template alpha
To item alpha
Visit url alpha
The above "alpha" functions were for testing & before (my) philosophy of putting all possible calls to a function on one page, and explaining the differences there (instead of having a page for each fucntion call / parameter set, which seemed to be the original idea; my idea works better with searching).

General Note

All pages that include () at the end, and now have nothing save a redirect to their ()-less version, can be safely deleted.