Difference between pages "Insert" and "Can faxbot"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
m
 
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|insert}}{{
+
#vardefine:name|can_faxbot}}{{
#vardefine:return_type|buffer}}{{
+
#vardefine:return_type|boolean}}{{
  
 
FunctionPage|
 
FunctionPage|
Line 8: Line 8:
 
function1={{Function|
 
function1={{Function|
 
name={{#var:name}}|
 
name={{#var:name}}|
aggregate={{#var:aggregate}}|
 
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
+
parameter1={{Param|monster|mob}}||
parameter1={{Param|buffer|original}}|
+
p1desc={{Pspan|mob}} is the monster for which to check.|
parameter2={{Param|int|strStart}}|
 
parameter3={{Param|string|stuff}}|
 
p1desc={{Pspan|original}} is the buffer to modify|
 
p2desc={{Pspan|strStart}} marks where to insert the string|
 
p3desc={{Pspan|stuff}} is the string to insert|
 
 
}}|
 
}}|
  
function_description=Returns the buffer {{pspan|original}} with the string {{pspan|stuff}} inserted at {{pspan|strStart}}.|
+
function_description=Checks to see if {{Pspan|mob}} can be faxed by any of the faxbots known to KoLmafia. This does not check if the faxbot(s) are online.<ref>https://sourceforge.net/p/kolmafia/code/20614/tree/src/net/sourceforge/kolmafia/textui/RuntimeLibrary.java#l4753</ref>|
  
 
code1={{CodeSample|
 
code1={{CodeSample|
title=Code Sample|
+
title=Code Samples|
description=Inserts a "Refresh page" link to the Pyramid inside KoL's default border.|
+
description=This will acquire a copy of a scary pirate if you can get one.|
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
buffer results;
+
if( get_property("_photocopyUsed")=="false" && can_faxbot($monster[scary pirate]) )
results.append(visit_url());
+
faxbot($monster[scary pirate]);
 
 
int strEnd = results.index_of("height=137 border=0>");
 
if(strEnd > 0) {
 
  results.insert(strEnd + 20,"<br /><div align='center' class='tiny'><a href='pyramid.php'>Refresh page</a></div>");
 
}
 
results.write();
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 
}}|
 
}}|
 
+
see_also={{SeeAlso|faxbot|is_online}}|
see_also={{SeeAlso|delete}}|
 
 
}}
 
}}
 +
==References==
 +
<references/>
  
[[Category:String Handling Routines]]
+
[[Category:Miscellaneous Functions]]

Latest revision as of 23:53, 24 January 2021

Function Syntax

boolean can_faxbot(monster mob )

  • mob is the monster for which to check.

Checks to see if mob can be faxed by any of the faxbots known to KoLmafia. This does not check if the faxbot(s) are online.[1]

Code Samples

This will acquire a copy of a scary pirate if you can get one.

if( get_property("_photocopyUsed")=="false" && can_faxbot($monster[scary pirate]) )
 faxbot($monster[scary pirate]);

See Also

faxbot() | is_online()


References