[Orion] Some Of My Scripts

Name says it all
Post Reply
valiane
Passer by
Posts: 1
Joined: Sat Jan 01, 2022 9:57 am

[Orion] Some Of My Scripts

Post by valiane »

Greetings to all!
I offer for consideration several of my scripts (with notes in Russian, because I am Russian and decided not to translate all my notes into English). Suddenly, someone will find them useful. I must say right away that I am a beginner in programming, therefore the codes below are not a panacea. So...
In order not to sculpt all the scripts into one common huge script, they are all divided into separate files, which I load into Orion through one common small script (this method of combining scripts turned out to be more convenient for me)

1. My common script (separate script file) looks like this:

Code: Select all

//#include D:/Games/UO progs/Orion/Orion Launcher/OA/Excelsior shard/Autoheal.oajs
//#include D:/Games/UO progs/Orion/Orion Launcher/OA/Excelsior shard/AutoLoot.oajs
//#include D:/Games/UO progs/Orion/Orion Launcher/OA/Excelsior shard/AutoVeterinary.oajs
//#include D:/Games/UO progs/Orion/Orion Launcher/OA/Excelsior shard/AutoPickUpArrows.oajs
//#include D:/Games/UO progs/Orion/Orion Launcher/OA/Excelsior shard/AutoSorting.oajs
//#include D:/Games/UO progs/Orion/Orion Launcher/OA/Excelsior shard/RuneBooks.oajs
//#include D:/Games/UO progs/Orion/Orion Launcher/OA/Excelsior shard/WeaponAutoCast.oajs
You can name the file of this script as you like. For me, for example, it is called "ALL_Includes.oajs".
All paths in the current script must strictly match the paths and names of script files on your computer!
For all the mentioned scripts to work (all functions become available in the Orion assistant) - this general script must be active (selected) in the Orion assistant window.
Ultimately, the following main Functions should appear in the Orion assistant:
Autoheal
AutoLoot
AutoVeterinary
AutoPickUpArrows
AutoSorting
RecallHome
WeaponAutoCast

2. The "Autoheal.oajs" script looks like this:

Code: Select all

	var
		MsgBandage = "You finish applying the bandages|You put the bloody bandage|failed";

function Автохил_бинты()
	{
	while(true)
		{
		while (!Player.Dead() && Orion.Count("bandage"))
			{
			if (Player.Hits() < Player.MaxHits() - 1) 
				{
				Orion.ClearJournal(MsgBandage);
				Orion.Print('=> Хилимся...');
				Orion.BandageSelf();
				TimerBandage = Orion.Now() + 5000; //при малом количестве DEX увеличить время с 5000 до 8000-12000
				while (!Orion.InJournal(MsgBandage) && Orion.Now() < TimerBandage)
					{
					Orion.Wait(100);
					}
				}
			else
				{
				Orion.Wait(100);
				}
			}
		}
	}
I run this script before battles and it works non-stop.

3. The script "AutoLoot.oajs" in my current version looks like this (special thanks to Tomers for writing the main code):

Code: Select all

function AutoLoot()
	{
	Orion.Print('0x08F1', '⇒ СТАРТ АВТОЛУТА');
	Orion.IgnoreReset;
	for (var i = 0; i < 20; i++)
		{
		var nowcorpse = Orion.FindType('0x2006|0x0ECB|0x0ECC|0x0ED1|0x0ECE|0x0ED0|0x0ECD|0x0ED2','any', 'ground', ' ', '2');
		if (nowcorpse<1) {break}
		Orion.UseType('0x0EC3', 'any', 'backpack');
		Orion.WaitTargetObject(nowcorpse);
		Orion.CancelTarget();
		Orion.Ignore(nowcorpse);
		Orion.Wait(650);
		}
	Orion.IgnoreReset();
	for (var i = 0; i < 20; i++)
		{
		if(Player.Weight() > 200)
			{
			for (var j = 0; j<10; j++)
				{
				var nowfur = Orion.FindType('0x1079','an	y', 'backpack', ' ', '0');
				if (nowfur<1) {break}
				Orion.UseType('0x0F9F', 'any', 'backpack');
				Orion.WaitTargetObject(nowfur);
				Orion.Wait(650);
				}
			}
		var nowcorpse = Orion.FindType('0x2006|0x0ECB|0x0ECC|0x0ED1|0x0ECE|0x0ED0|0x0ECD|0x0ED2','any', 'ground', ' ', '2');
		if (nowcorpse<1) {break}
		Orion.Say('[claimall');
		Orion.WaitTargetObject(nowcorpse);
		Orion.Ignore(nowcorpse);
		Orion.Wait(400);
		}
	Orion.CancelTarget();
	for (var k = 0; k<10; k++)
		{
		var GroundFur = Orion.FindType('0x1079','any', 'ground', ' ', '1');
		if (GroundFur<1) {break}
		Orion.UseType('0x0F9F', 'any', 'backpack');
		Orion.WaitTargetObject(GroundFur);
		Orion.Wait(650);
		}
	for (var L = 0; L<10; L++)
		{
		var GroundLeather = Orion.FindType('0x1081', 'any', 'ground', ' ', '2');
		if (GroundLeather<1) {break};
		for(items2 in GroundLeather)
			{
			Orion.DragItem(GroundLeather[items2], 0);
				Orion.Wait('300');
			Orion.DropDraggedItem('backpack');
			Orion.Wait('500');
			Orion.Ignore(GroundLeather[items2]);
			}
		}
	Orion.Print('0x08F1', '⇒ АВТОЛУТ ЗАВЕРШЁН');
	}
This script cuts all corpses within a radius of 2 cells, then advertises all these corpses and simultaneously cuts the skin in the inventory. If a part of the leather remains on the floor during advertising, he also cuts it and tries to pick it up in inventory. When overweight, some of the loot may remain on the floor. After sorting and emptying the inventory, you can restart AutoLoot and the remaining skin on the floor will also be picked up to the inventory.
Due to conflicts, run with disabled scripts
AutoVeterinary
AutoPickUpArrows
AutoSorting

3. Script "AutoVeterinary.oajs"

Code: Select all

function AutoVeterinary()
	{
	while(true)
		{
		while (!Player.Dead() && Orion.Count("bandage") && Orion.GetDistance(Orion.FindFriend('fast', '1'))<2)
			{
				{
				Orion.Print('=> Лечим живку с наименьшим ХП...');
				Orion.Say('[band');
				if (Orion.WaitForTarget(1000))
					Orion.TargetObject(Orion.FindFriend('injured', '1'));
				Orion.Wait(3000);
				}
			}
		}
	}
This script works rather clumsily due to the fact that I was unable to solve a number of problems (the main one is determining the current and maximum HP of animals), but it still heals.
Before starting, add all your animals that we will heal to friends in the Orion assistant (Lists => Friends).
Due to conflicts, run with disabled scripts
AutoLoot
AutoPickUpArrows
AutoSorting

4. Script "AutoPickUpArrows.oajs"

Code: Select all

var LootArrows = '0x0F3F|0x1BFB'; //стрелы, болты
var LootBag = '0x0026BB0C'; //сумка, куда сбрасывать

function AutoPickUpArrows()
	{
	while(true)
		{
		while (!Player.Dead()) 
			{
			var findItems = Orion.FindType(LootArrows,'any', 'ground', ' ', '2');
			if (findItems<1) {break}
				{
				Orion.MoveItem(findItems, 0, LootBag);
				Orion.Wait('600');
				}
			}
		}
	}
Due to conflicts, run with disabled scripts
AutoLoot
AutoVeterinary
AutoSorting

5. Script "AutoSorting.oajs"

Code: Select all

	var config = {
		"Pet" 						: "0x00471D24", //<<<<<<<======!!!!!CHANGE THIS!!!!!
		"Quiver"						: "0x44856317", //<<<<<<<======!!!!!CHANGE THIS!!!!!
//что упаковывать в SpellCasters Keys
		"SCLoot"					: "0x0F7A|0x0F7B|0x0F84|0x0F85|0x0F86|0x0F88|0x0F8C|0x0F8D|0x0F78|0x0F8F|0x0F7D|0x0F8E|0x0F8A|0x0EF3|0x0F7E|0x0F0E",
//что упаковывать в Metal Workers Keys
		"MetalLoot"				: "0x1BF2",
//что упаковывать в Tailors Keys
		"TailorLoot"				: "0x1766|0x0DF8|0x1081|0x26B4|0x0F95",
//что упаковывать в Wood Workers Keys
		"WoodLoot"				: "0x1BD7|0x0F3F|0x1BFB|0x1BD1|0x1BD4|0x318F|0x3191|0x2F5F|0x3190|0x0DE1",
//что упаковывать в Gem Puch
		"GemLoot"					: "0x0F10|0x0F2D|0x0F13|0x0F19|0x0F26|0x0F16|0x0F21|0x0F25|0x0F15|0x3192|0x1EA7|0x3196|0x3195|0x3199|0x3195|0x3193|0x3197|0x3198|0x3194",
//что упаковывать в Tolls House
		"TollsLoot"					: "0x1EB8|0x1034|0x0E86|0x0F9D|0x13E4|0x097F|0x0E9B|0x1022|0x0FBF|0x0F43|0x0F39",
//что сбрасывать в Trash 4 Tokens сумку. Скроллы, мясо, что ещё?
	//оружие
		"TrashWeapon"			: "0x27A6|0x27A8|0x13eb|0x13f0|0x13ee|0x13ec|0x13bb|0x13be|0x13bf|0x1410|0x1414|0x1413|0x1411|0x1415|0x1C04|0x140C|0x1408|0x140A|0x140E|0x1412|0x2774|0x1412|0x2777|0x2781|0x2784|0x2778|0x2785|0x2789|0x26bb|0x0F5E|0x26C1|0x1441|0x0F52|0x13FF|0x1401|0x0F61|0x13B6|0x13B9|0x27A2|0x2D33|0x2D2F|0x2D20|0x2D21|0x2D22|0x2D32|0x2D35|0x0F49|0x0F47|0x0F4B|0x0F45|0x13FB|0x1443|0x13B0|0x2D28|0x0F4D|0x26BD|0x26BF|0x143E|0x26C0|0x26BE|0x1403|0x26BA|0x0F62|0x1405|0x0E87|0x0E87|0x143D|0x0F5C|0x143B|0x26BC|0x1407|0x1439|0x27A3|0x2D24|0x0E89|0x1B7A|0x1B76|0x1B72|0x1B7B|0x13B4|0x0E81|0x1B74|0x13F6|0x0DF0|0x13B2|0x13FD|0x26C3|0x13F8|0x0E86|0x27AF|0x0EC4",
	//armors
		"TrashArmor"				: "|0x144F|0x13DB|0x1450|0x1451|0x144E|0x1452|0x1DB9|0x13CB|0x1C08|0x1C0C|0x13DC|0x1C00|0x13C6|0x27C6|0x278A|0x277E|0x2793|0x2791|0x2796|0x278E|0x2792|0x2797",
	//bows, crossbows
		"TrashBows"				: "|0x0F50|0x26C2",
	//bijouterie
		"TrashBiga"				: "|0x1086|0x108A|0x1F09|0x1F06",
	//ores, logs
		"TrashRes"				: "|0x1BDD|0x19B9",
	//trash
		"TrashOther"				: "|0x1718|0x170F|0x1609|0x09B9|0x1516|0x1EFD|0x09F1|0x0EB2|0x1F0B|0x1C02|0x13CD|0x1C0A|0x13DA|0x13D5|0x1C06|0x13C7|0x13CC|0x13D6|0x13BE|0x13BF|0x1B73|0x1B79|0x3190|0x0FC7|0x0EB1|0x1F03|0x170D|0x1711|0x0A28|0x09C7|0x09C8|0x2782|0x2798|0x27A1",
	//scrolls
		"TrashScroll"				: "|0x1F65|0x0E39|0x1F30|0x1F3F|0x1F3B|0x1F2D|0x1F3D|0x2262|0x1F40|0x2264|0x1F39|0x1F43|0x1F44|0x1F33|0x2263|0x1F35|0x1F36|0x1F3A|0x1F42|0x1F31|0x1F2F|0x1F5F|0x2269|0x2265|0x1F32|0x1F63|0x1F64|0x226A|0x1F45|0x226B|0x1F46|0x1F41|0x1F50|0x1F55|0x1F54|0x1F53|0x1F37|0x1F3C|0x1F5D|0x1F2E|0x1F34|0x1F48|0x1F58|0x2260|0x1F3E|0x1F4C|0x2261|0x1F56|0x1F4F|0x1F4E|0x2267|0x1F52|0x1F49|0x2268|0x1F38|0x1F51|0x1F5C|0x1F61|0x1F5A|0x2266|0x1F47|0x226E|0x1F4D|0x1F5B|0x1F5E|0x1F62|0x1F57|0x1F59|0x1F60|0x1F4A|0x1F4B|0x226F",
	//bottles
		"TrashBottles"			: "|0x0F07|0x0F08|0x0F09|0x0F0C|0x0F0B|0x0F0A",

		"TokensBag"				: Orion.FindType('0x09B2','0x0495','backpack', 'item|recurce', '', '', true), //"0x426A4626", //A Safe Trash 4 Tokens Backpack ID. 
		"SCKeysID"				: Orion.FindType('0x176B','0x0021','backpack', 'item|recurce', '', '', true), //"0x42E42C8E", //Spell Casters Keys ID. 
		"MWKeysID"				: Orion.FindType('0x176B','0x0014','backpack', 'item|recurce', '', '', true), //"0x421A01BE", //Metal Workers Keys ID.
		"TKeysID"					: Orion.FindType('0x176B','0x0045','backpack', 'item|recurce', '', '', true), //"0x421A4A2E",	//Tailors Keys ID. 
		"WWKeysID"				: Orion.FindType('0x176B','0x0058','backpack', 'item|recurce', '', '', true), //"0x40FA14A0",	//Wood Workers Keys ID. 
		"GemPouchID"			: Orion.FindType('0x0E79','0x0875','backpack', 'item|recurce', '', '', true), //"0x469811C9",	//Gem Pouch ID.
		"TollsHouseID"			: Orion.FindType('0x22C4','0x0045','backpack', 'item|recurce', '', '', true), //"0x4256A2D4",	//Tolls House ID. 
		"SCKeysGump"			: "0x0EBCD833", //гамп Spell Casters Keys
		"MetalKeysGump"		: "0xFB1E68CB", //гамп Metal Workers Keys
		"TailorKeysGump"		: "0x41F8FC19", //гамп Tailors Keys
		"WoodKeysGump"		: "0x0A57934D", //гамп Wood Workers Keys
		"GemPouchGump"		: "0x1277DD7B", //гамп Gem Pouch
		"TollsHouseGump"		: "0x5A356683", //гамп Tolls House
		"SCKeysAddButton"		: 60030, 			//Кнопка добавления в Spell Casters Keys gump
		"MetalKeysAddButton"	: 60015, 			//Кнопка добавления в Metal Workers gump
		"TailorKeysAddButton"	: 60029, 			//Кнопка добавления в Tailors Keys gump
		"WoodKeysAddButton"	: 60023, 			//Кнопка добавления в Wood Workers Keys gump
		"GemPouchAddButton": 30, 					//Кнопка добавления в Gem Pouch gump
		"TollsHouseAddButton": 60030,			//Кнопка добавления в Tolls House gump
	//QUESTS loot items
		//QuestLeggings - 0x3407 Crystallized Ectoplasm
		//QuestCuiras - 0x3F31 - Essences of the Abyss
		//QuestBoots - 0x3B92 - Scraps of Undead Hide
		//QuestGauntlets - 0x3F30 - Scale of Vile Deeds
		//QuestPauldrons - 0x3CD4 - Unearthly Stones
		//QuestCoif - 0x393D - Rough Undead Sinew
		//QuestReaperOfSouls - 0x3407|0x3CD4 - Crystallized Ectoplasm | Unearthly Stones
		//QuestSashOfFog - 0x3F30|0x393D - Scale of Vile Deeds | Rough Undead Sinew
		//QuestCloakOfMist - 0x3B92|0x3F31 - Scraps of Undead Hide | Essences of the Abyss
		//Quest2DaemonicBlood - 0x195C - Vial Of Daemonic Blood
		//"0x3407|0x3F31|0x393D|0x3B92|0x3CD4|0x3F30|0x195C|0x3737|0x1CED" - полный список из вышеупомянутых квестовых вещей
		"QuestTrashItems"	: "0x3407|0x3F31|0x393D|0x3B92|0x3CD4|0x3F30|0x195C|0x3737|0x1CED", //что нужно сохранять - убрать из списка
		};

function AutoSorting() //основная функция автосортинга
	{
	Orion.Print('0x0013', '⇒ СТАРТ СОРТИРОВКИ');
	PackTo(config['SCLoot'], config['SCKeysID'], config['SCKeysGump'], config['SCKeysAddButton']); //добавление вещей в Spell Casters Keys
	PackTo(config['MetalLoot'], config['MWKeysID'], config['MetalKeysGump'], config['MetalKeysAddButton']); //добавление вещей в Metal Workers Keys
	PackTo(config['TailorLoot'], config['TKeysID'], config['TailorKeysGump'], config['TailorKeysAddButton']); //добавление вещей в Tailors Keys
	PackTo(config['WoodLoot'], config['WWKeysID'], config['WoodKeysGump'], config['WoodKeysAddButton']); //добавление вещей в Wood Workers Keys
	PackTo(config['GemLoot'], config['GemPouchID'], config['GemPouchGump'], config['GemPouchAddButton']); //добавление вещей в Gem Pouch
	PackTo(config['TollsLoot'], config['TollsHouseID'], config['TollsHouseGump'], config['TollsHouseAddButton']); //добавление вещей в Tolls House
	LootToPet(config['Pet']); //сброс золота в лошадь
	TrashToTrashA(config['TokensBag']); //сброс хлама 1
	TrashToTrashB(config['TokensBag']); //сброс хлама 2
	TrashToTrash(config['QuestTrashItems'], config['TokensBag']); //сброс не нужных квестовых вещей
	ReloadQuiver();
	Orion.Print('0x0013', '⇒ СОРТИРОВКА ЗАВЕРШЕНА');
	}

function PackTo(finditems, keysID, gumpID, GumpAddButton) //вспомогательная функция
	{
	for (var i = 0; i < 1; i++)
		{
		Orion.IgnoreReset();
		var nowfinditems = Orion.FindType(finditems, 'any', 'backpack', ' ', '0');	// Поиск типов для активации разгруза
		if (nowfinditems<1) {Orion.Print('0x0015', '⇒ Нет вещей...'); break}; // Выход из текущего разгруза, если нет типов
		Orion.UseObject(keysID);	Orion.Print('0x0015', '⇒ Нашли вещи...');
		while (true)
			{
			var nowfinditems = Orion.FindType(finditems, 'any', 'backpack', ' ', '0');	// Поиск типов для разгруза
			if (!nowfinditems.length) {break};// Выход из цикла, если нет типов
			for (var j = 0; j < nowfinditems.length; j++) // Разгруз
				{
				gump(gumpID, GumpAddButton);		Orion.Print('0x0015', '⇒ Сохраняем вещи...');
				Orion.WaitForTarget();
				Orion.WaitTargetObject(nowfinditems[j]);
				if (Orion.InJournal('not a valid type', 'my|sys'))
					{Orion.Ignore(nowfinditems[j]); break};
				Orion.Wait('300');
				}
			}
		gump(gumpID, 0); //закрываем гамп
		//Orion.Wait(500); 
		gump(gumpID, 0); //закрываем гамп
		Orion.Wait(500); 
		if (Orion.HaveTarget())				
			Orion.CancelTarget(); //убираем прицел
		}
	Orion.Wait(100);
	}

function gump(gumpID, Gbutton) //вспомогательная функция - гампы хранилищ (ключи, гем пунч, домики,...)
	{
	if (Orion.WaitForGump(2000))
		{
		var gump0 = Orion.GetGump('last');
		if ((gump0 !== null) && (!gump0.Replayed()) && (gump0.ID() === gumpID))
			{
			gump0.Select(Orion.CreateGumpHook(Gbutton));
			Orion.Wait(200);
			}
		}	
	}

function TrashToTrashA(TrashBag) //функция уборки ненужного оружия, брони, луков, ресурсов
	{
	while (true)
		{
		Orion.IgnoreReset();
		var TrashLists1 = config['TrashWeapon'] + config['TrashArmor'] + config['TrashBows'] + config['TrashRes'];
		var TrashListsA = Orion.FindType(TrashLists1, '0x0000', 'backpack', ' ', '0');
		if (!TrashListsA.length) {Orion.Print('0x0015', '⇒ Хлам отсутствует...'); break};// Выход из цикла, если нет хлама
		for(items in TrashListsA)
			{
			TimerToTrash = Orion.Now() + 3000;
			Orion.Print('0x0015', '⇒ Убираем хлам...');
			Orion.MoveItem(TrashListsA[items], 0, TrashBag);
			Orion.Wait('600');
			Orion.Ignore(TrashListsA[items]);
			if (Orion.Now() > TimerToTrash) {break};
			}
		}
	}

function TrashToTrashB(TrashBag) //функция уборки ненужных свитков, бутылок, иных вещей
	{
	while (true)
		{
		Orion.IgnoreReset();
		var TrashLists2 = config['TrashOther'] + config['TrashScroll'] + config['TrashBottles'];
		var TrashListsB = Orion.FindType(TrashLists2, 'any', 'backpack', ' ', '0');
		if (!TrashListsB.length) {Orion.Print('0x0015', '⇒ Хлам отсутствует...'); break};// Выход из цикла, если нет хлама
		for(items in TrashListsB)
			{
			TimerToTrash = Orion.Now() + 3000;
			Orion.Print('0x0015', '⇒ Убираем хлам...');
			Orion.MoveItem(TrashListsB[items], 0, TrashBag);
			Orion.Wait('600');
			Orion.Ignore(TrashListsB[items]);
			if (Orion.Now() > TimerToTrash) {break};
			}
		}
	}

function TrashToTrash(TrashList, TrashBag)
	{
	while (true)
		{
		Orion.IgnoreReset();
		var TrashListsQ = Orion.FindType(TrashList, 'any', 'backpack', ' ', '0');
		if (!TrashListsQ.length) {Orion.Print('0x0015', '⇒ Хлам отсутствует...'); break};// Выход из цикла, если нет хлама
		for(items in TrashListsQ)
			{
			TimerToTrash = Orion.Now() + 3000;
			Orion.Print('0x0015', '⇒ Убираем хлам...');
			Orion.MoveItem(TrashListsQ[items], 0, TrashBag);
			Orion.Wait('600');
			Orion.Ignore(TrashListsQ[items]);
			if (Orion.Now() > TimerToTrash) {break};
			}
		}
	}

function ReloadQuiver() // функция перезарядки Колчана
	{
	var QuiverID = config['Quiver'];
	if (Orion.Count('0x0F3F', 'any', QuiverID)>=400)
		Orion.Print('0x0015', '⇒ Стрел достаточно');
	if (Orion.Count('0x0F3F', 'any', QuiverID)<400)
		{
		var ArrowsNeeded = (489 - Orion.Count('0x0F3F', 'any', QuiverID));		Orion.Print('0x0015', '⇒ Пополняем стрелы...');
		Orion.UseObject(config['WWKeysID']);	
		gump(config['WoodKeysGump'], 60013);
		Orion.Wait(500);
		var ArrowsPlaced = Orion.FindType('0x0F3F', 'any', 'backpack');
		Orion.MoveItem(ArrowsPlaced, ArrowsNeeded, QuiverID);
		Orion.Wait('600');
		gump(config['WoodKeysGump'], 60023);
		if (Orion.WaitForTarget(1000))
			Orion.TargetObject(Orion.FindType('0x0F3F', 'any', 'backpack'));
		Orion.Wait(200); 
		if (Orion.HaveTarget())				
			Orion.CancelTarget();
		gump(config['WoodKeysGump'], 0);
		}
	}

function LootToPet(Pet) //функция сброса золота в лошадь
	{
	while (true)
		{
		Orion.IgnoreReset();
		var Gold = Orion.FindType('0x0EED', 'any', 'backpack', 'item|fast|recurse');
		if (!Gold.length) {break};// Выход из цикла, если нет золота
		if (Orion.GetDistance(Pet)>1) {break};
		for(items in Gold)
			{
			Orion.MoveItem(Gold[items], 0, Pet);
			Orion.Wait('500');
			Orion.Ignore(Gold[items]);
			}
		}
	}
This script
- moves all the collected loot to the storages (Keys, Gem Pouch, ToolHouse)
- drops unnecessary trash into a trash bag
- drops unnecessary quest items into the trash bag
- drops all gold from the main backpack into the horse
- reloads Quiver with arrows (before the first activation of the script, open Quiver manually, otherwise arrows in Quiver will not be replenished)
Due to conflicts, run with disabled scripts
AutoLoot
AutoVeterinary
AutoPickUpArrows

6. Script "RuneBooks.oajs"

Code: Select all

   var
	    BASE = '0x44F1CBEC'; //рунбука с названием BASE
	    Rune1 = 7; //руна 1
	    Rune2 = 17; //руна 2
   	    Rune3 = 27; //руна 3
	    Rune4 = 37; //руна 4
	    Rune5 = 47; //руна 5
	    Rune6 = 57; //руна 6
   	    Rune7 = 67; //руна 7
	    Rune8 = 77; //руна 8
	    Rune9 = 87; //руна 9
	    Rune10 = 97; //руна 10
   	    Rune11 = 107; //руна 11
	    Rune12 = 117; //руна 12
	    Rune13 = 127; //руна 13
	    Rune14 = 137; //руна 14
   	    Rune15 = 147; //руна 15
	    Rune16 = 157; //руна 16

function RecallHome() //основная функция реколла по конкретной руне из конкретной рунбуки
	{
	CastRuneBook(BASE, Rune1);
	}

function CastRuneBook(RuneBook, RuneIndex) //вспомогательная функция реколла
	{
    Orion.WaitGump(Orion.CreateGumpHook(RuneIndex));
    Orion.UseObject(RuneBook);
	}
This script makes it possible to assign to Hotkey recall for a specific rune from a specific RuneBook.

7. Script "WeaponAutoCast.oajs"

Code: Select all

function WeaponAutoCast()
	{
	while (true)
		{
		while (!Player.Dead()) 
			{
			var Timer;
			var Enemies = Orion.FindType('any','any','ground','live|ignorefriends|ignoreself', '1', '3|4|5|6');
			if (Enemies>1 && Player.Mana()>10) {Orion.UseAbility('Secondary', true); Orion.Wait(200);break}
			else {Orion.UseAbility('Primary', true); Orion.Wait(200);break}
			}
		}
	}
I run this script before battles and it works non-stop.
Doesn't conflict with other scripts.
Adjusted for the Reaper Of Souls weapon, but can be used with any weapon if needed, including crossbows and bows.
Post Reply