Difference between pages "Money Making Game" and "Talk:Use familiar"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>StDoodle
m
 
imported>Heeheehee
m
 
Line 1: Line 1:
{{Flink|int|mmg_bet_amount|int}}
+
This always seems to return false for me, can anyone confirm?<br />
{{Flink|string|mmg_bet_owner|int}}
+
--[[User:Slyz|Slyz]] 20:56, 9 April 2010 (UTC)
{{Flink|int|mmg_bet_owner_id|int}}
+
 
{{Flink|string|mmg_bet_taker}}
+
 
{{Flink|string|mmg_bet_taker_id}}
+
: > ash use_familiar($familiar[sandworm])
{{Flink|int|mmg_bet_winnings}}
+
 
{{Flink|int|mmg_make_bet|int|boolean}}
+
: Putting Mexicana the Hovering Sombrero back into terrarium...<br />
{{Flink|int [int]|mmg_my_bets}}
+
: Taking Hecho en Mexico the Baby Sandworm out of terrarium...<br />
{{Flink|int [int]|mmg_offered_bets}}
+
: Returned: true<br />
{{Flink|boolean|mmg_retract_bet|int}}
+
I assume that the ash command should be enough to check return value; correct me if I'm wrong. --[[User:Heeheehee|Heeheehee]] 21:03, 9 April 2010 (UTC)
{{Flink|void|mmg_search|int|int}}
+
 
{{Flink|int|mmg_take_bet|int|boolean}}
+
I'll have to recheck after RO, but here is what I was getting (doing things slightly differently):
{{Flink|void|mmg_visit}}
+
 
{{Flink|int|mmg_wait_event|int}}
+
: > ash print( use_familiar($familiar[slimeling]) )
{{RFI|Help me obi-wan Veracity, you're my only hope.|Seriously, does anyone else know how all of these work?}}
+
 
 +
: Putting Dusty the Baby Sandworm back into terrarium...<br />
 +
: Taking Yuk the Slimeling out of terrarium...<br />
 +
: false<br />
 +
: Returned: void<br />
 +
--[[User:Slyz|Slyz]] 03:33, 10 April 2010 (UTC)
 +
 
 +
 
 +
Huh. Using that method, I get:
 +
: > ash print( use_familiar($familiar[sombrero]) )
 +
 
 +
: Putting Hecho en Mexico the Baby Sandworm back into terrarium...<br />
 +
: Taking Mexicana the Hovering Sombrero out of terrarium...<br />
 +
: true<br />
 +
: Returned: void
 +
--[[User:Heeheehee|Heeheehee]] 07:51, 10 April 2010 (UTC)
 +
 
 +
I'm also seeing expected behavior; true most of the time, false if I try a familiar I don't have.
 +
--[[User:StDoodle|StDoodle (#1059825)]] 14:52, 10 April 2010 (UTC)
 +
 
 +
 
 +
I find the syntax as described on this page confusing. With other functions I do not have to specify the datatype, for example:<br/>
 +
outfit($string[Backup]);<br/>
 +
outfit("Backup");<br/>
 +
both work identically. However, use_familiar("hobo");<br/>
 +
returns the error "Function 'use_familiar( string )' undefined..."<br/>
 +
This just happened to be the first function I looked up on this wiki, and if the discussion with examples had not been here, I don't think I would have worked it out at all.--[[User:RogerMexico|RogerMexico]] 12:04, 25 September 2010 (UTC)
 +
 
 +
By default, supplying something inside of quotes is considered of the "string" datatype. So, $string[hello] is the same as "hello". However, use_familiar() needs the familiar datatype. You can't just supply a string (ie "hobo"); you need to supply a familiar. Since datatypes like familiar, element, etc. aren't "normal" datatypes used in programming, we have to use an explicit datatype constant call (the dollar-sign thing) or a function that converts from a string to that datatype. --[[User:StDoodle|StDoodle (#1059825)]] 18:42, 25 September 2010 (UTC)
 +
 
 +
I've done some further reading on this wiki (which is absolutely superb documentation by the way) and came to understand ''why'' it is that way. But for non-programmers like myself who are looking for a quick answer, I think an example on the page would help. I'll try adding one, hope I don't screw it up :) Oh, and is there a page that discusses syntax in general? The whole reason I went and looked at the outfit() function was to try and understand the syntax of the function (specifically, why is the word familiar inside the parentheses there?).The datatype page was helpful, I think something like that on syntax would be nice. --[[User:RogerMexico|RogerMexico]] 13:26, 26 September 2010 (UTC)
 +
 
 +
: The word "familiar" inside the parentheses indicates the type of argument that this function accepts. An additional note: the functions for [[Datatype Conversions]] might help.
 +
: Also, [[ASH For Beginners|this page]] might be what you're looking for; I dunno. --[[User:Heeheehee|Heeheehee]] 22:10, 26 September 2010 (UTC)

Latest revision as of 22:10, 26 September 2010

This always seems to return false for me, can anyone confirm?
--Slyz 20:56, 9 April 2010 (UTC)


> ash use_familiar($familiar[sandworm])
Putting Mexicana the Hovering Sombrero back into terrarium...
Taking Hecho en Mexico the Baby Sandworm out of terrarium...
Returned: true

I assume that the ash command should be enough to check return value; correct me if I'm wrong. --Heeheehee 21:03, 9 April 2010 (UTC)

I'll have to recheck after RO, but here is what I was getting (doing things slightly differently):

> ash print( use_familiar($familiar[slimeling]) )
Putting Dusty the Baby Sandworm back into terrarium...
Taking Yuk the Slimeling out of terrarium...
false
Returned: void

--Slyz 03:33, 10 April 2010 (UTC)


Huh. Using that method, I get:

> ash print( use_familiar($familiar[sombrero]) )
Putting Hecho en Mexico the Baby Sandworm back into terrarium...
Taking Mexicana the Hovering Sombrero out of terrarium...
true
Returned: void

--Heeheehee 07:51, 10 April 2010 (UTC)

I'm also seeing expected behavior; true most of the time, false if I try a familiar I don't have. --StDoodle (#1059825) 14:52, 10 April 2010 (UTC)


I find the syntax as described on this page confusing. With other functions I do not have to specify the datatype, for example:
outfit($string[Backup]);
outfit("Backup");
both work identically. However, use_familiar("hobo");
returns the error "Function 'use_familiar( string )' undefined..."
This just happened to be the first function I looked up on this wiki, and if the discussion with examples had not been here, I don't think I would have worked it out at all.--RogerMexico 12:04, 25 September 2010 (UTC)

By default, supplying something inside of quotes is considered of the "string" datatype. So, $string[hello] is the same as "hello". However, use_familiar() needs the familiar datatype. You can't just supply a string (ie "hobo"); you need to supply a familiar. Since datatypes like familiar, element, etc. aren't "normal" datatypes used in programming, we have to use an explicit datatype constant call (the dollar-sign thing) or a function that converts from a string to that datatype. --StDoodle (#1059825) 18:42, 25 September 2010 (UTC)

I've done some further reading on this wiki (which is absolutely superb documentation by the way) and came to understand why it is that way. But for non-programmers like myself who are looking for a quick answer, I think an example on the page would help. I'll try adding one, hope I don't screw it up :) Oh, and is there a page that discusses syntax in general? The whole reason I went and looked at the outfit() function was to try and understand the syntax of the function (specifically, why is the word familiar inside the parentheses there?).The datatype page was helpful, I think something like that on syntax would be nice. --RogerMexico 13:26, 26 September 2010 (UTC)

The word "familiar" inside the parentheses indicates the type of argument that this function accepts. An additional note: the functions for Datatype Conversions might help.
Also, this page might be what you're looking for; I dunno. --Heeheehee 22:10, 26 September 2010 (UTC)