Autoload.ET.oajs — Paladin скрипт
//#include helpers.oajs
// Health potion will be used at this threshold
POTION_HEAL = 60;
types = {
healingPotion: { type: 0x0F0E, color: 0x0031, cooldown: 5000 }
}
displayTimerSize = [200, 10]
abilities = {
"Defence": { "command": ".Defence1", "cooldown": 120, "duration": 100, "position": [1250, 650] },
"SpeedAttack":{ "command": ".Combat1", "cooldown": 240, "duration": 120, "position": [1250, 600] },
"SpeedCast": { "command": ".Combat2", "cooldown": 240, "duration": 120, "position": [1250, 550] },
"MaxDPS": { "command": ".Combat3", "cooldown": 240, "duration": 120, "position": [1250, 500] },
"MaxDex": { "command": ".Magic1", "cooldown": 100, "duration": 15, "position": [1250, 450] },
"NPCPain": { "command": ".Magic2", "cooldown": 140, "duration": 80, "position": [1250, 400] },
"Chuma": { "command": ".Magic3", "cooldown": 140, "duration": 80, "position": [1250, 350] },
"Chain": { "command": ".InfChain", "cooldown": 40, "duration": 0, "position": [1250, 300] }
}
function Autostart() {
["AutoHealSelf", "panicHeal", "exp_counter"].forEach(function(script) {
Orion.Terminate(script);
Orion.Exec(script);
})
}
function attack() {
target = Orion.TargetSystemSerial();
overheadPrint("Attacking!", "OK", target)
Orion.Attack(Orion.TargetSystemSerial());
}
function panicHeal() {
while (true) {
if (!Player.Dead()) {
potionCount = Orion.Count(types.healingPotion.type, types.healingPotion.color)
if (potionCount > 0) {
if (Player.Hits() < (Player.MaxHits() - (Player.MaxHits() / 100 * POTION_HEAL))) {
if (potionCount <= 10) overheadPrint("There is !! " + potionCount + " !! heal potions left", "WARNING")
potion = Orion.FindType(types.healingPotion.type, types.healingPotion.color);
if (potion.length > 0) {
Orion.UseType(types.healingPotion.type, types.healingPotion.color);
overheadPrint("Used healpot!", "OK")
Orion.Wait(types.healingPotion.cooldown);
}
}
} else {
if (Orion.Count(types.healingPotion.type, types.healingPotion.color) < 1) {
overheadPrint("No more potions left, waiting for 1 more minute", "ERROR")
for (i = 0; i <= 60; i++) { Orion.Print("Waiting for potion..."); Orion.Wait(1000); }
}
}
}
Orion.Wait(100);
}
}
function AutoHealSelf() {
while (true) {
if (!Player.Dead()) {
while (Player.Hits() < (Player.MaxHits() - 10)) {
if (Orion.Count(0x0E21) > 0) {
Orion.BandageSelf(); Orion.Wait(500);
Orion.WaitJournal("Вылечено|interrupted|Не удалось|Вы положили", Orion.Now(), Orion.Now() + 10000);
Orion.Wait(1000);
} else Orion.Print('33', ' No more bandage left ! ');
Orion.Wait(500);
}
Orion.Wait(500);
}
Orion.Wait(500);
}
}
function AttackNextMob() {
var _target = Orion.TargetSystemSerial();
var _name = Orion.FindObject(_target).Name()
if (_target && _name && _name != "Bear spirit") {
Orion.WarMode(true);
Orion.CharPrint(self, 1153, ">>" + _name);
Orion.Wait(200); Orion.Attack(_target);
}
}
function summon_bear() {
Orion.Say(".newbear")
if (!Orion.DisplayTimerExists(1)) {
Orion.AddDisplayTimer(1, 650 * 1000, 'custom', 'LineBar', 'Bear', 700, 350);
Orion.DisplayTimerSetSize(1, 200, 10);
}
}
function use_ability(name) {
colorGreen = "#4dff00ff"; colorRed = "#fc0320ff"
if (!abilities.hasOwnProperty(name)) { Orion.Print("Ability >> " + name + " << not found"); return; }
ability = abilities; Orion.Say(ability["command"]);
if (!Orion.DisplayTimerExists(name)) {
Orion.CancelTarget(); Orion.CancelWaitTarget();
Orion.AddDisplayTimer(name, ability["cooldown"]*1000, 'custom', 'LineBar', '>> '+name+' <<', ability["position"][0], ability["position"][1], 'any', colorGreen);
if (!ability.hasOwnProperty("duration")) ability["duration"] = ability["cooldown"];
durationPercents = Math.round((100 * ability["duration"]) / ability["cooldown"])
Orion.DisplayTimerSetColorStage(name, 100-durationPercents, 'any', colorRed);
Orion.DisplayTimerSetSize(name, displayTimerSize[0], displayTimerSize[1]);
}
}
function loot_from_container(container_serial) {
_loot_bag = 0x00000;
_loot = [
0x0EED, // Gold 0x0F3F, // Arrows 0x1BFB, // Bolts 0x0F0E, // Heal
0x0F11, // Sapphire 0x0F25, // Amber 0x0F10, // Emerald 0x0F18, // Tourmaline
0x0F13, // Ruby 0x0F0F, // Star Saph 0x0F26, // Diamond 0x0F15, // Citrine
0x0F16, // Amethyst 0x0E34, // Contract 0x14EB, // Map 0x14ED, // Ashas book
0x1BD1, // Feather
];
if (!Orion.FindObject(_loot_bag)) _loot_bag = backpack;
Orion.UseObject(container_serial); Orion.Wait(300);
_loot.forEach(function(_item) {
var _found = Orion.FindType(_item, 0xFFFF, container_serial);
if (_found.length) _found.forEach(function(_i) { Orion.MoveItem(_i, 0, _loot_bag); Orion.Wait(600); });
});
}
function loot() {
var _corpses = Orion.FindType(0x2006, 0xFFFF, ground);
if (_corpses.length) {
var _dagger = Orion.FindType(0x0F51, 0xFFFF, backpack);
var _weapon = Orion.ObjAtLayer(1) || Orion.ObjAtLayer(2);
_corpses.forEach(function(_corpse) {
loot_from_container(_corpse); Orion.Wait(300);
var _bags = Orion.FindType(0x0E75, 0xFFFF, _corpse);
if (_bags.length) _bags.forEach(function(_bag) { loot_from_container(_bag); Orion.Wait(300); });
});
if (_weapon) Orion.Equip(_weapon.Serial());
}
}
function craft() { while (!Player.Dead()) { Orion.Say(".makelastitem"); Orion.Wait(4000); } }
function exp_counter() {
var _started = new Date().getTime(); var _total_exp = 0;
while (true) {
if (Orion.InJournal("MakeReset")) { _started = new Date().getTime(); _total_exp = 0; Orion.ClearJournal("MakeReset"); }
var _message = Orion.WaitJournal("Вы получили", Orion.Now(), Orion.Now() + 10000);
if (_message) {
var _exp_match = /Вы получили (\d+)/.exec(_message.Text());
if (_exp_match && _exp_match.length) _total_exp += parseInt(_exp_match[1]);
var _minutes = ((new Date().getTime() - _started) / 1000) / 60;
Orion.Print("0x0035", "Опыта в минуту: +" + (_total_exp/_minutes).toFixed(2) + ", всего: +" + _total_exp);
}
Orion.Wait(200);
}
}
function train_bowcraft() {
while (!Player.Dead()) {
var _on_ground = Orion.FindType(0x1BDD, 0xFFFF, 'ground');
if (_on_ground.length) { Orion.MoveItem(_on_ground, 1, 'backpack'); Orion.Wait(200); }
Orion.Say(".makelastitem"); Orion.Wait(4000);
var _shafts = Orion.FindType(0x1BD4);
if (_shafts) { Orion.MoveItem(_shafts, 0, 0x40038482); Orion.Wait(500); }
}
}