Im having a problem with the below script. Everytime I call it with an alias, it returns the same amount of health and mana, even after a battle when my health has changed. Can anyone help me with this problem on updating my stats? Thanks.
////////////////////////////////////////////////////
var line, total_lines;
total_lines = world.GetLinesInBufferCount ();
//Determines health!
function GetHealthandMana(){
stats = world.GetLineInfo (total_lines, 1);
actualHealth = stats.slice(0,3);
tempstring = stats.slice(6,13);
actualMana = tempstring.slice(0,3);
}
//puts everything together
function Main(){
//start by checking health and mana
GetHealthandMana();
world.note (actualHealth + " " + actualMana);
if(actualHealth != 888){
world.send (sleep);
world.DoAfter +24 (wake);
world.DoAfter +6 (stand);
}else{
world.send ("laugh");
}
}
////////////////////////////////////////////////////
var line, total_lines;
total_lines = world.GetLinesInBufferCount ();
//Determines health!
function GetHealthandMana(){
stats = world.GetLineInfo (total_lines, 1);
actualHealth = stats.slice(0,3);
tempstring = stats.slice(6,13);
actualMana = tempstring.slice(0,3);
}
//puts everything together
function Main(){
//start by checking health and mana
GetHealthandMana();
world.note (actualHealth + " " + actualMana);
if(actualHealth != 888){
world.send (sleep);
world.DoAfter +24 (wake);
world.DoAfter +6 (stand);
}else{
world.send ("laugh");
}
}