//#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],
}
}
// Kill existing processes and spawn new ones
function Autostart() {
functions = [
"AutoHealSelf",
"panicHeal",
"exp_counter",
]
functions.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()) {
// If we have some potions - proceed
potionCount = Orion.Count(types.healingPotion.type, types.healingPotion.color)
if (potionCount > 0) {
if (Player.Hits() < (Player.MaxHits() - (Player.MaxHits() / 100 * POTION_HEAL))) {
// Warn if 10 or less potions were found
if (potionCount <= 10) {
overheadPrint("There is !! " + potionCount + " !! heal potions left", "WARNING")
}
// Use potion
overheadPrint("Should use healpot!", "INFO")
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 no potions are present - let's wait, maybe we can get some from loot
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);
}
}
// Autoheal
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);
}
}
// Attack NewTargetSystem target
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);
}
}
// Summon bear + overhead timer
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[name];
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.Print("Duration percents: " + durationPercents);
Orion.DisplayTimerSetColorStage(name, 100 - durationPercents, 'any', colorRed);
Orion.DisplayTimerSetSize(name, displayTimerSize[0], displayTimerSize[1]);
}
}
// Loot from container
function loot_from_container(container_serial) {
_loot_bag = 0x00000;
_loot = [
// General
0x0EED, // Gold
0x0F3F, // Arrows
0x1BFB, // Bolts
0x0F0E, // heal
// Gems
0x0F11, // Sapphire
0x0F25, // Piece of Amber
0x0F10, // Emerald
0x0F18, // Tourmaline
0x0F13, // Rubie
0x0F0F, // Star Sapphire
0x0F26, // Diamond
0x0F15, // Citrine
0x0F16, // Amethyst
// Misc
0x0E34, // Eledars contract
//0x2258, // Recipe
0x14EB, // Map
0x14ED, // Ashas book
// Cutting
0x1BD1, // Feather
//0x0F8E, // Dragon Scale
];
if (!Orion.FindObject(_loot_bag))
_loot_bag = backpack;
// ###################
Orion.UseObject(container_serial);
Orion.Wait(300);
_loot.forEach(function (_item) {
var _found_items = Orion.FindType(_item, 0xFFFF, container_serial);
if (_found_items.length) {
_found_items.forEach(function (_loot_item) {
Orion.MoveItem(_loot_item, 0, _loot_bag);
Orion.Wait(600);
});
}
});
}
function loot() {
_bags = [
0x0E75, // Backpack
];
_bladed = [
0x1401, // Kryss
0x0F51, // Dagger
];
var _counter = 0;
var _to_cut = 0;
var _corpses = Orion.FindType(0x2006, 0xFFFF, ground);
if (_corpses.length) {
var _dagger = Orion.FindType(0x0F51, 0xFFFF, backpack);
if (Orion.ObjAtLayer(1))
_weapon = Orion.ObjAtLayer(1)
else
_weapon = Orion.ObjAtLayer(2)
_bladed.forEach(function (_type) {
if (_type == _weapon.Graphic()) {
Orion.Print("Bladed item equipped");
_dagger = _weapon.Serial();
}
});
_corpses.forEach(function (_corpse) {
_counter++;
Orion.Print("Corpse " + _counter + "/" + _corpses.length);
if (_dagger.length && _to_cut == 1) {
Orion.UseObject(_dagger);
Orion.Wait(200);
Orion.TargetObject(_corpse);
Orion.Wait(650);
}
loot_from_container(_corpse);
Orion.Wait(300);
_bags.forEach(function (_bag) {
var _bags_in_corpse = Orion.FindType(_bag, 0xFFFF, _corpse)
if (_bags_in_corpse.length) {
_bags_in_corpse.forEach(function (_bag_in_corpse) {
loot_from_container(_bag_in_corpse);
Orion.Wait(300);
});
}
});
});
if (_weapon)
Orion.Equip(_weapon.Serial());
}
}
function craft() {
while (!Player.Dead()) {
Orion.Say(".makelastitem");
Orion.Wait(4000);
}
}
function exp_counter() {
// Вы получили {int} единиц опыта
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");
Orion.Print("Опыт сброшен");
}
var _message = Orion.WaitJournal("Вы получили", Orion.Now(), Orion.Now() + 10000);
if (_message) {
var _message_text = _message.Text();
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;
var _exp_per_minute = (_total_exp / _minutes).toFixed(2);
Orion.Print("Минут -> " + _minutes.toFixed(0));
Orion.Print("0x0035", "Опыта в минуту: +" + _exp_per_minute + ", всего: +" + _total_exp);
}
Orion.Wait(200);
}
}
function unload_maps() {
var _maps = Orion.FindType(0x14EB);
Orion.Print(_maps);
if (_maps.length) {
_maps.forEach(function (_item) {
Orion.Print(_item);
var _map = Orion.FindObject(_item);
Orion.Print(_map);
Orion.Print(_map.Properties());
});
}
}
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);
Orion.Print(_shafts);
if (_shafts) {
Orion.MoveItem(_shafts, 0, 0x40038482);
Orion.Wait(500);
}
}
}
function BH() {
Orion.Boxhack(0x40038482);
}
//#include helpers.oajs
// Health potion will be used at this threshold
POTION_HEAL = 60;
types = {
healingPotion: {
type: 0x0F0E,
color: 0x0031,
cooldown: 5000,
}
}
lootLists = [
"loot",
"gems",
"reagents",
"use"
]
useList = "use"
loot_bag = 'backpack'
displayTimerSize = [200, 10]
abilities = {
// Warrior
"absorb": {
"command": ".Brave3",
"cooldown": 260,
"duration": 35,
"position": [700, 350]
},
"strength": {
"command": ".Brave1",
"cooldown": 130,
"duration": 65,
"position": [700, 300],
},
"hpboost": {
"command": ".Brave4",
"cooldown": 70,
"duration": 30,
"position": [700, 250],
},
"reflection": {
"command": ".Brave5",
"cooldown": 70,
"duration": 8,
"position": [700, 200],
},
"chains": {
"command": ".infchain",
"cooldown": 50,
"duration": 0,
"position": [500, 200],
},
"attackspeed": {
"command": ".Attack2",
"cooldown": 90,
"duration": 30,
"position": [500, 350],
},
"damage": {
"command": ".Attack1",
"cooldown": 90,
"duration": 20,
"position": [500, 300],
},
"roar": {
"command": ".Roar",
"cooldown": 55,
"duration": 0,
"position": [500, 250],
},
// Paladin
"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],
}
}
// Kill existing processes and spawn new ones
function Autostart() {
functions = [
"AutoHealSelf",
"panicHeal",
"exp_counter",
]
functions.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()) {
// If we have some potions - proceed
potionCount = Orion.Count(types.healingPotion.type, types.healingPotion.color)
if (potionCount > 0) {
if (Player.Hits() < (Player.MaxHits() - (Player.MaxHits() / 100 * POTION_HEAL))) {
// Warn if 10 or less potions were found
if (potionCount <= 10) {
overheadPrint("There is !! " + potionCount + " !! heal potions left", "WARNING")
}
// Use potion
overheadPrint("Should use healpot!", "INFO")
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 no potions are present - let's wait, maybe we can get some from loot
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);
}
}
// Autoheal
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);
}
}
// Attack NewTargetSystem target
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);
}
}
// Summon bear + overhead timer
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[name];
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.Print("Duration percents: " + durationPercents);
Orion.DisplayTimerSetColorStage(name, 100 - durationPercents, 'any', colorRed);
Orion.DisplayTimerSetSize(name, displayTimerSize[0], displayTimerSize[1]);
}
}
// Loot from container
function loot_from_container(container_serial) {
loot = []
Orion.UseObject(container_serial);
Orion.Wait(300);
lootLists.forEach(function (lootList) {
// Orion.Print(" Found -> " + Orion.FindList(lootList, container_serial))
// Orion.Print("Added " + lootList);
Array.prototype.push.apply(loot, Orion.FindList(lootList, container_serial));
})
Orion.Print(loot)
loot.forEach(function (item) {
Orion.MoveItem(item, 0, loot_bag);
Orion.Wait(600);
});
}
function loot() {
_bags = [
0x0E75, // Backpack
];
var _counter = 0;
var _corpses = Orion.FindType(0x2006, 0xFFFF, ground);
if (_corpses.length) {
_corpses.forEach(function (_corpse) {
_counter++;
Orion.Print("Corpse " + _counter + "/" + _corpses.length);
loot_from_container(_corpse);
Orion.Wait(300);
_bags.forEach(function (_bag) {
var _bags_in_corpse = Orion.FindType(_bag, 0xFFFF, _corpse)
if (_bags_in_corpse.length) {
_bags_in_corpse.forEach(function (_bag_in_corpse) {
loot_from_container(_bag_in_corpse);
Orion.Wait(300);
});
}
});
});
toUse = Orion.FindList(useList, 'backpack');
if (toUse.length) {
Orion.Print("Found " + toUse.length + " items to use");
toUse.forEach(function (item) {
Orion.UseObject(item);
Orion.Wait(1000)
});
}
}
}
function craft() {
while (!Player.Dead()) {
Orion.Say(".makelastitem");
Orion.Wait(4000);
}
}
function exp_counter() {
// Вы получили {int} единиц опыта
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");
Orion.Print("Опыт сброшен");
}
var _message = Orion.WaitJournal("Вы получили", Orion.Now(), Orion.Now() + 10000);
if (_message) {
var _message_text = _message.Text();
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;
var _exp_per_minute = (_total_exp / _minutes).toFixed(2);
Orion.Print("Минут -> " + _minutes.toFixed(0));
Orion.Print("0x0035", "Опыта в минуту: +" + _exp_per_minute + ", всего: +" + _total_exp);
}
Orion.Wait(200);
}
}
function unload_maps() {
var _maps = Orion.FindType(0x14EB);
Orion.Print(_maps);
if (_maps.length) {
_maps.forEach(function (_item) {
Orion.Print(_item);
var _map = Orion.FindObject(_item);
Orion.Print(_map);
Orion.Print(_map.Properties());
});
}
}
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);
Orion.Print(_shafts);
if (_shafts) {
Orion.MoveItem(_shafts, 0, 0x40038482);
Orion.Wait(500);
}
}
}
function BH() {
Orion.Boxhack(0x40038482);
}
// Output levels
output = {
"ERROR": {
"prefix": "P >",
"color": 0x008A,
},
"INFO": {
"prefix": "I >",
"color": 0x0003,
},
"OK": {
"prefix": "O >",
"color": 0x0044,
},
"WARNING": {
"prefix": "W >",
"color": 0x0085,
}
}
// Prints pased message above target/player/whatever
// If target is undefined, prints above player
// If level if undefined, INFO will be used
function overheadPrint(message, level, target) {
if (!target) {
target = Player.Serial();
}
if (!level || !output[level]) {
level = "INFO";
}
Orion.CharPrint(target, output[level]["color"], output[level]["prefix"] + " " + message);
}