Difference between pages "Talk:Group string" and "Can faxbot"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Heeheehee
m
 
 
Line 1: Line 1:
(Move from main page)
+
{{
 +
#vardefine:name|can_faxbot}}{{
 +
#vardefine:return_type|boolean}}{{
  
group(0) matches the entire expression. After that, group(n) matches the expression defined by the nth set of parentheses.--[[User:Heeheehee|Heeheehee]] 06:45, 3 March 2010 (UTC)
+
FunctionPage|
 +
name={{#var:name}}|
  
That's the function group(); this page is for group_string(). I know, it's hard to tell 'cause of how wikis handle page names, I'll make that a bit clearer! --[[User:StDoodle|StDoodle]] 15:45, 5 March 2010 (UTC)
+
function1={{Function|
 +
name={{#var:name}}|
 +
return_type={{#var:return_type}}|
 +
parameter1={{Param|monster|mob}}||
 +
p1desc={{Pspan|mob}} is the monster for which to check.|
 +
}}|
  
Perhaps this should be shifted down with the rest of the regex stuff? Even though it doesn't make use of their datatypes, it is a regex function. --[[User:StDoodle|StDoodle (#1059825)]] 06:19, 7 May 2010 (UTC)
+
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>|
  
* That ''is'' weird. It uses regexes, but not matchers. I'm not quite sure what to make of it. Since it doesn't need find or the other requirements that regex functions require it is rather stand alone, unlike those functions so I can see some reason to let it be separate from that bunch. --[[User:Bale|Bale]] 06:42, 7 May 2010 (UTC)
+
code1={{CodeSample|
 +
title=Code Samples|
 +
description=This will acquire a copy of a scary pirate if you can get one.|
 +
code=
 +
<syntaxhighlight>
 +
if( get_property("_photocopyUsed")=="false" && can_faxbot($monster[scary pirate]) )
 +
faxbot($monster[scary pirate]);
 +
</syntaxhighlight>
 +
}}|
 +
see_also={{SeeAlso|faxbot|is_online}}|
 +
}}
 +
==References==
 +
<references/>
  
* I thought some more about the problem and I decided you definitely should not move this to the regex section. I'm going to be saying some things about how regex functions are used and none of that will apply to this function. It will be a glaring exception to several rules. However, on this page you can refer to the [[Regular Expressions]] page for information on creating a regex. --[[User:Bale|Bale]] 08:26, 7 May 2010 (UTC)
+
[[Category:Miscellaneous Functions]]
 
 
 
 
==Category==
 
 
 
Ok, so Heeheehee recently moved group_string() down with the regex functions. This is what I was leaning towards in the first place (see above) but Bale noted that it wouldn't fit with the description for said functions. If this references [[Regular_Expressions#Using Regexes in KoLmafia|Using Regexes in KoLmafia]], I think we'd be better off making a note of group_string() being an exception to the "requires a defined matcher" rule rather than leaving it out of the regex section. Thoughts? --[[User:StDoodle|StDoodle (#1059825)]] 06:54, 5 July 2010 (UTC)
 
: It's easier to locate this way. I mean, who expects group_string() to be up in the unclassified functions, as opposed to those that use regex? --[[User:Heeheehee|Heeheehee]] 17:43, 5 July 2010 (UTC)
 

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