////////////////////////////////////
// Auto-Potion standalone version //
// Created for SINISTER by Taurik //
////////////////////////////////////
//
// This script will automatically
// use Crystal Blue Potions or
// Blue Potions to heal you when
// your health drops below 100%.
//
// INSTALLATION: Place this file
// in your /Tribes/config/
// folder (that's it.)
//
// Then to turn it on, simply type
// exec(autopot); in your console
//
// To turn it off, type
// exec(autopot); 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 HP. The
// default is every 0.3 seconds.
// If that causes your Tribes to
// lag, try increasing the number.
//
$HPCheckInterval = 0.3;
//
// You can set the script to auto
// disconnect you once you run out
// of potions. This is good for when
// you want to AFK level. Enter 1 for
// auto-drop when you're out of
// potions, or enter 0 to stay
// connected.
//
$DropWhenOut = 0;
//
// The script will warn you when you
// are getting low on potions. Here
// you can define how many pots you
// consider to be low. Default is 10.
//
$LowOnPotionsIs = 10;
//
////////////////////////////////////
$autopotver = "Tue_Aug_10_2004";
function AutoPotionMain () {
$StartupNumCPots = getItemCount("Crystal Blue Potion");
$StartupNumPots = getItemCount("Blue Potion");
if ($StartupNumCPots == "0" && $StartupNumPots == "0") {
Client::centerPrint("<jc><f2>ERROR: Can't start script!\n<f1>Please get at least one potion and then re-exec the script...", 1);
schedule("Client::centerPrint(\"\", 1); $potmsgclear = 1;", 15);
return;
}
// This toggles the script on or off every time you exec() it
if ($UsingPotions == "") {
$UsingPotions = "1";
$NoPotAlert = "";
if ($StartupNumCPots == "0" && $StartupNumPots == "0") {
$StartupNumMsg = "<f1>You do not have any potions.";
} else {
$StartupNumMsg = "<f3>You have <f1>" @ $StartupNumCPots @ " Crystal Blue Potions<f3> and <f1>" @ $StartupNumPots @ " Blue Potions";
}
if ($DropWhenOut == "1") {
$StartupDropMsg = "<f2>NOTICE: <f1>If you run out of potions, you will disconnect! To turn this feature off, edit autopot.cs";
} else {
$StartupDropMsg = "<f1>Auto-Drop disabled. You'll stay connected if you run out of potions. (For more info, edit autopot.cs)";
}
Client::centerPrint("<jc><f3>Auto-Potion script is now: <f1>on \n " @ $StartupNumMsg @ " \n " @ $StartupDropMsg, 1);
schedule("Client::centerPrint(\"\", 1); $potmsgclear = 1;", 15);
} else if ($UsingPotions == "1") {
$UsingPotions = "";
$NoPotAlert = "";
Client::centerPrint("<jc><f3>Auto-Potion script is now: <f1>off", 1);
schedule("Client::centerPrint(\"\", 1); $potmsgclear = 1;", 3);
}
// This gets the HP every 0.3 seconds
function PotionLoop () {
$FunctionRunning = "1";
remoteEval(2048, fetchData, "HP");
remoteEval(2048, fetchData, "MaxHP");
schedule("$MyHP = $RPGdata[HP];", $HPCheckInterval);
schedule("$MyMaxHP = $RPGdata[MaxHP];", $HPCheckInterval);
schedule("PotionDecide();", $HPCheckInterval);
if ($UsingPotions == "") {
$FunctionRunning = "";
} else {
schedule("PotionLoop();", $HPCheckInterval);
}
} // End PotionLoop
// This determines whether or not to run the PotionLoop() function
if ($UsingPotions == "1") {
if ($FunctionRunning == "") {
PotionLoop();
}
} else {
$FunctionRunning = "";
}
// This decides whether or not to use a potion
function PotionDecide () {
$warningpotnum = getItemCount("Blue Potion");
$warningcpotnum = getItemCount("Crystal Blue Potion");
$totalpots = $warningpotnum + $warningcpotnum;
if ($totalpots < $LowOnPotionsIs && $totalpots != "0") {
AlertLowPot();
}
$HPDownBy = $MyMaxHP - $MyHP;
if ($HPDownBy > $TakeThisDamage) {
if (getItemCount("Crystal Blue Potion")) {
use("Crystal Blue Potion");
$NoPotAlert = "";
} else if (getItemCount("Blue Potion")) {
use("Blue Potion");
$NoPotAlert = "";
} else {
if ($NoPotAlert == "") {
AlertNoPot();
}
}
}
} // End PotionDecide
function AlertNoPot () {
$NoPotAlert = 1;
if ($DropWhenOut == "1") {
disconnect();
return;
}
schedule("Client::centerPrint(\"<jc><f2>YOU ARE <f1>OUT<f2> OF POTIONS!\", 1);", 0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 0.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE <f1>OUT<f2> OF POTIONS!\", 1);", 1.0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 1.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE <f1>OUT<f2> OF POTIONS!\", 1);", 2.0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 2.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE <f1>OUT<f2> OF POTIONS!\", 1);", 3.0);
schedule("Client::centerPrint(\"\", 1); $potmsgclear = 1;", 4.0);
} // End AlertNoPot
function AlertLowPot () {
if ($potmsgclear == "1") {
Client::centerPrint("<jc><f2>You're low on potions! <f1>" @ $totalpots @ "<f2> potions left!", 1);
}
} // End AlertLowPot
// 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
} // End AutoPotionMain
AutoPotionMain();
////////////////////////////////////
// Auto-Vial standalone version //
// Created for SINISTER by Taurik //
////////////////////////////////////
//
// This script will automatically
// use Crystal Energy Vials or
// Energy Vials to restore mana when
// your mana 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 far your mana
// can fall before the script kicks
// in and uses a vial.
// The default for fighters is 5 mana points.
// The default for mages is 20 mana points.
//
$LoseThisMana = 5;
//
// You can set the speed at which
// the script checks your Mana. The
// default is every 0.3 seconds.
// If that causes your Tribes to
// lag, try increasing the number.
//
$ManaCheckInterval = 0.3;
//
// The script will warn you when you
// are getting low on vials. Here
// you can define how many vials you
// consider to be low. Default is 10.
//
$LowOnVialsIs = 10;
//
////////////////////////////////////
$autovialver = "Tue_Aug_10_2004";
function AutoVialMain () {
$StartupNumCVials = getItemCount("Crystal Energy Vial");
$StartupNumVials = getItemCount("Energy Vial");
if ($StartupNumCVials == "0" && $StartupNumVials == "0") {
Client::centerPrint("<jc><f2>ERROR: Can't start script!\n<f1>Please get at least one vial and then re-exec the script...", 1);
schedule("Client::centerPrint(\"\", 1); $vialmsgclear = 1;", 15);
return;
}
// This toggles the script on or off every time you exec() it
if ($UsingVials == "") {
$UsingVials = "1";
$NoVialAlert = "";
if ($StartupNumCVials == "0" && $StartupNumVials == "0") {
$VialStartupNumMsg = "<f1>You do not have any vials.";
} else {
$VialStartupNumMsg = "<f3>You have <f1>" @ $StartupNumCVials @ " Crystal Energy Vials<f3> and <f1>" @ $StartupNumVials @ " Energy Vials";
}
Client::centerPrint("<jc><f3>Auto-Vial script is now: <f1>on \n " @ $VialStartupNumMsg, 1);
schedule("Client::centerPrint(\"\", 1); $vialmsgclear = 1;", 15);
} else if ($UsingVials == "1") {
$UsingVials = "";
$NoVialAlert = "";
Client::centerPrint("<jc><f3>Auto-Vial script is now: <f1>off", 1);
schedule("Client::centerPrint(\"\", 1); $vialmsgclear = 1;", 3);
}
// This gets the Mana every 0.3 seconds
function VialLoop () {
$VialFunctionRunning = "1";
remoteEval(2048, fetchData, "MANA");
remoteEval(2048, fetchData, "MaxMANA");
schedule("$MyMANA = $RPGdata[MANA];", $ManaCheckInterval);
schedule("$MyMaxMANA = $RPGdata[MaxMANA];", $ManaCheckInterval);
schedule("VialDecide();", $ManaCheckInterval);
if ($UsingVials == "") {
$VialFunctionRunning = "";
} else {
schedule("VialLoop();", $ManaCheckInterval);
}
} // End VialLoop
// This determines whether or not to run the VialLoop() function
if ($UsingVials == "1") {
if ($VialFunctionRunning == "") {
VialLoop();
}
} else {
$VialFunctionRunning = "";
}
// This decides whether or not to use a vial
function VialDecide () {
$warningvialnum = getItemCount("Energy Vial");
$warningcvialnum = getItemCount("Crystal Energy Vial");
$totalvials = $warningvialnum + $warningcvialnum;
if ($totalvials < $LowOnVialsIs && $totalvials != "0") {
AlertLowVial();
}
$MANADownBy = $MyMaxMANA - $MyMANA;
if ($MANADownBy > $LoseThisMana) {
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 <f1>OUT<f2> OF VIALS!\", 1);", 0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 0.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE <f1>OUT<f2> OF VIALS!\", 1);", 1.0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 1.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE <f1>OUT<f2> OF VIALS!\", 1);", 2.0);
schedule("Client::centerPrint(\"<jc><f2> \", 1);", 2.5);
schedule("Client::centerPrint(\"<jc><f2>YOU ARE <f1>OUT<f2> OF VIALS!\", 1);", 3.0);
schedule("Client::centerPrint(\"\", 1); $vialmsgclear = 1;", 4.0);
} // End AlertNoVial
function AlertLowVial () {
if ($vialmsgclear == "1") {
Client::centerPrint("<jc><f2>You're low on vials! <f1>" @ $totalvials @ "<f2> vials left!", 1);
}
} // End AlertLowVial
// 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
} // End AutoVialMain
AutoVialMain();