Difference between revisions of "Refresh status"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
(Created page with '{{ #vardefine:name|refresh_status}}{{ #vardefine:return_type|void}}{{ FunctionPage| name={{#var:name}}| function_category=Adventuring| function1={{Function| name={{#var:name}}|…')
 
imported>Bale
(q answered. Added code)
Line 14: Line 14:
 
}}|
 
}}|
  
function_description=Refreshes your character's status in the side pane of the relay browser.|
+
function_description=Refreshes your character's status from the caracter pane. This does not effect the relay browser, only mafia's internal information.|
  
needscode=yes|
+
code1={{CodeSample|
 +
title=Code Samples|
 +
description=Refresh status needs to be used to see if you've gained a new effect.|
 +
code=
 +
<syntaxhighlight>
 +
print("purchasing Ode to Booze from a few buffbots...", "blue");
 +
cli_execute("csend 1 meat to Testudinata");
 +
cli_execute("csend 23 meat to Iocainebot");
 +
int iterations = 0;
 +
while(have_effect($effect[Ode to Booze]) < 1 && iterations < 30) {
 +
  wait(30);
 +
  refresh_status();
 +
  iterations = iterations + 1;
 +
}
 +
if((have_effect($effect[Ode to Booze]) < 1)
 +
  print("failed to get Ode to Booze", "red");
 +
 
 +
</syntaxhighlight>
 +
}}|
  
 
cli_equiv=The CLI command "refresh" with the parameter "status" has the same function.|
 
cli_equiv=The CLI command "refresh" with the parameter "status" has the same function.|
 
}}
 
}}
{{RFI|Either this function isn't working for me, or it doesn't really act on the RB.|Has it been updated to deal with the separate top & side compact modes?}}
 

Revision as of 19:02, 20 March 2010

Function Syntax

void refresh_status()

Refreshes your character's status from the caracter pane. This does not effect the relay browser, only mafia's internal information.

Code Samples

Refresh status needs to be used to see if you've gained a new effect.

print("purchasing Ode to Booze from a few buffbots...", "blue");
cli_execute("csend 1 meat to Testudinata");
cli_execute("csend 23 meat to Iocainebot");
int iterations = 0;
while(have_effect($effect[Ode to Booze]) < 1 && iterations < 30) {
   wait(30);
   refresh_status();
   iterations = iterations + 1;
}
if((have_effect($effect[Ode to Booze]) < 1)
   print("failed to get Ode to Booze", "red");

CLI Equivalent

The CLI command "refresh" with the parameter "status" has the same function.