Can anyone tell me why this wont work.
?? It recognizes that i have vials, but wont actually use them.
////////////////////////////////////
// Auto-Energy standalone version //
////////////////////////////////////
////////////////////////////////////
//
// This script will automatically
// use Crystal Energy Vials or
// Energy Vials to boost your energy
// when it drops below 100%.
//
// INSTALLATION: Place this file
// in your /Tribes/config/
// folder (that's it.)
//
// Then to turn it on, simply type
// exec(autovial); in your console
//
// To turn it off, type
// exec(autovial); in your console
// again.
//
//
// ADVANCED OPTIONS:
// You can define how much damage
// you'd like to take before the
// script kicks in and uses a potion.
// The default is 10 damage points.
//
$TakeThisDamage = 10;
//
// You can set the speed at which
// the script checks your MP. The
// default is every 0.3 seconds.
// If that causes your Tribes to
// lag, try increasing the number.
//
$MPCheckInterval = 0.3;
//
////////////////////////////////////
// This toggles the script on or off every time you exec() it
if ($UsingVials == "") {
$UsingVials = "1";
$NoVialAlert = "";
$StartupNumCVials = getItemCount("Crystal Energy Vial");
$StartupNumVials = getItemCount("Energy Vial");
if ($StartupNumCVials == "0" && $StartupNumVials == "0") {
$StartupNumMsg = "<f1>You do not have any vials.";
} else {
$StartupNumMsg = "<f3>You have <f1>" @ $StartupNumCVials @ " Crystal Energy
Vials<f3> and <f1>" @ $StartupNumVials @ " Energy Vials";
}
Client::centerPrint("<jc><f3>Auto-Energy script is now: <f1>on \n " @ $StartupNumMsg, 1);
schedule("Client::centerPrint(\"\", 1);", 5);
} else if ($UsingVials == "1") {
$UsingVials = "";
$NoVialAlert = "";
Client::centerPrint("<jc><f3>Auto-Energy script is now: <f1>off", 1);
schedule("Client::centerPrint(\"\", 1);", 5);
}
// This determines whether or not to run the VialLoop() function
if ($UsingVials == "1") {
if ($FunctionRunning == "") {
VialLoop();
}
} else {
$FunctionRunning = "";
}
// This gets the MP every 0.3 seconds
function VialLoop () {
$FunctionRunning = "1";
remoteEval(2048, fetchData, "MP");
remoteEval(2048, fetchData, "MaxMP");
schedule("$MyMP = $RPGdata[MP];", $MPCheckInterval);
schedule("$MyMaxMP = $RPGdata[MaxMP];", $MPCheckInterval);
schedule("VialDecide();", $MPCheckInterval);
if ($UsingVials == "") {
$FunctionRunning = "";
} else {
schedule("VialLoop();", $MPCheckInterval);
}
} // End VialLoop
// This decides whether or not to use a potion
function VialDecide () {
$MPDownBy = $MyMaxMP - $MyMP;
if ($MPDownBy > $TakeThisDamage) {
if (getItemCount("Crystal Energy Vial")) {
use("Crystal Energy Vial");
$NoVialAlert = "";
} else if (getItemCount("Energy Vial")) {
use("Energy Vial");
$NoVialAlert = "";
} else {
if ($NoVialAlert == "") {
AlertNoVial();
}
}
}
} // End VialDecide
function AlertNoVial () {
$NoVialAlert = 1;
schedule("Client::centerPrint(\"<jc><f2>YOU ARE OUT OF VIALS\", 1);", 0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 0.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE OUT OF VIALS\", 1);", 1.0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 1.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE OUT OF VIALS\", 1);", 2.0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 2.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE OUT OF VIALS\", 1);", 3.0);
schedule("Client::centerPrint(\"\", 1);", 4.0);
} // End AlertNoVial
// This function is necessary if the user doesn't have Deus RPG Pack
function remoteSetRPGdata(%server, %data, %type) {
if (%server == 2048) {
$MyInfo[%type] = %data;
$RPGdata[%type] = %data;
}
} // End remoteSetRPGdata