[Orion] Tracking (Proof of Concept)

Discussion about the technical aspects of scripting. Ask about all issues involving your freelance projects here.
Post Reply
MagicUser
Elder Scribe
Posts: 174
Joined: Mon Nov 03, 2014 2:24 pm
Location: PST

[Orion] Tracking (Proof of Concept)

Post by MagicUser »

Was talking with Alibaster recently and heard that the release button on the context menu was causing problems for the macro to record. Makes sense, since each contextible mobile has their own context menu. Macros tends to focus on serials rather than on general find type.

I haven't used this for skill raising, so this is more of a proof of concept. It seems to work, and it would theoretically be afkable (since you don't get any resources from it). I just have no idea if you will gain skill, since I am already capped. Just kinda threw this together. I also added some user guidance in case someone used it incorrectly.

Originally it was daemons, but you lose karma if you summon daemons. If it has to be daemons, let me know. I can change it.

I had a bit of trouble with the context menu closing, but eventually found context menu's are a type of gump. Which is strange, since they use a separate function list than gumps, but whatever. Also, the tracking gumps are generic gumps, so hopefully I took care of all potential error stacking.

I recommend you do this in your house.

Code: Select all

function tracking() {
	var summon_list = [];
	var spellName = 'Summon Daemon';
	var trackingGraphic = '0x0009';
	
	if (Orion.SkillValue('Magery') > 81) {
		while (true) {
			summon(spellName, trackingGraphic);
			
			summon_list = Orion.FindType(trackingGraphic, any, ground, 'red');
			if (summon_list.length > 0) {
				var tracking_sucess = false;
				while (!tracking_sucess) {
					Orion.UseSkill('38');
					Orion.Wait(500);
					
					tracking_sucess = gump_selection('0xB16E7D71', 2);
					gump_selection('0x3B378483', 1);
				}
			}
			Orion.CloseGump('generic');
			
			desummon(trackingGraphic);
		}
	}
	else {
		Orion.Print(32, "You're skill is not high enough to summon 8th tier summons.");
	}
}

function summon(spell, graphic) {
	if (Orion.ScriptRunning('tracking') > 0) {
		var summon_list = Orion.FindType(graphic, any, ground, 'red');
			
		while (summon_list.length == 0) {
			Orion.Cast(spell);
			Orion.Wait(1000);
			
			summon_list = Orion.FindType(graphic, any, ground, 'red');
		}
	}
	else {
		Orion.Print(32, 'Make sure you have the tracking script selected. This is the summon script.');
	}
}

function desummon(graphic) {
	if (Orion.ScriptRunning('tracking') > 0) {
		var summon_list = Orion.FindType(graphic, any, ground, 'red');
		
		while (summon_list.length > 0) {
			Orion.RequestContextMenu(summon_list[0]);
			Orion.WaitForContextMenu();
			var drop_down = Orion.GetContextMenu();
			
			if (drop_down.ItemsCount() == 6) {
				drop_down.Select(5);
				Orion.Wait(500);
			}
			
			Orion.CloseGump('contextmenu');
			
			summon_list = Orion.FindType('0x000E', any, ground, 'red');
		}
	}
	else {
		Orion.Print(32, 'Make sure you have the tracking script selected. This is the desummon script.');
	}
}

function gump_selection(serial, hook) {
	var succeeded = false;

	if (Orion.GetGump(any, serial)) {
		var tracking_gump = Orion.GetGump(any, serial);
		
		tracking_gump.Select(Orion.CreateGumpHook(hook));
		Orion.Wait(500);
		
		succeeded = true;
	}
	
	return succeeded;
}
Last edited by MagicUser on Fri Mar 17, 2023 3:36 pm, edited 3 times in total.
Respectfully,
Paroxysmus ILV Master Spellcaster
Alibaster
Legendary Scribe
Posts: 211
Joined: Wed Nov 16, 2016 11:02 am

Re: [Orion] Tracking (Proof of Concept)

Post by Alibaster »

Awesome! Thanks for doing this. It has to be Deamons since each one summoned are unique and has a unique name. If you summon the same creature and track it, you will not gain on the second and subsequent ones.
Alibaster in game!!
MagicUser
Elder Scribe
Posts: 174
Joined: Mon Nov 03, 2014 2:24 pm
Location: PST

Re: [Orion] Tracking (Proof of Concept)

Post by MagicUser »

Happy to help :).
Alibaster wrote:
Fri Mar 17, 2023 8:58 am
Awesome! Thanks for doing this.
I created a new character and gave him some LRC gear, a spell book, and used the skill ball in magery (so I can cast earth elemental over an over).

After about 2 hours looks like my skill is at 20ish and still gaining. Which makes sense, since I am not sure why the summoned earth elemental would be the same earth elemental every time.
Alibaster wrote:
Fri Mar 17, 2023 8:58 am
It has to be Deamons since each one summoned are unique and has a unique name. If you summon the same creature and track it, you will not gain on the second and subsequent ones.
Respectfully,
Paroxysmus ILV Master Spellcaster
MagicUser
Elder Scribe
Posts: 174
Joined: Mon Nov 03, 2014 2:24 pm
Location: PST

Re: [Orion] Tracking (Proof of Concept)

Post by MagicUser »

At 36.2 I stopped gain, the script has been updated to daemon summons instead of earth elemental summoning. Hopefully this works like you were hoping. If not. The graphic and spell name are easily changable (at the top).
Respectfully,
Paroxysmus ILV Master Spellcaster
User avatar
Eremite
Grandmaster Scribe
Posts: 96
Joined: Sat Jan 28, 2023 7:20 pm

Re: [Orion] Tracking (Proof of Concept)

Post by Eremite »

FWIW, I went all the way to 100.0 pretty quickly just using Summon Creature with the macro here: viewtopic.php?p=81985#p81985 (UOSteam though)

Problem here is that you get a random creature each time, so you may need to adjust the script a bit. I used getfriend, but looks like Orion has a Orion.FindFriend function: https://tal-dor.github.io/OrionUO-docs/ ... stant.html

Uses less mana to summon (easily regens faster than tracking skill cooldown is up) and the summon time matches up pretty good with the skill cooldown timer. Not sure how long it takes to Summon Daemon. ;p
MagicUser
Elder Scribe
Posts: 174
Joined: Mon Nov 03, 2014 2:24 pm
Location: PST

Re: [Orion] Tracking (Proof of Concept)

Post by MagicUser »

About a day from 0 to 100. Not sure how many nights that would be.
Eremite wrote:
Sat Mar 18, 2023 6:52 am
Not sure how long it takes to Summon Daemon. ;p
Alibaster was struggling with making a daemon summoning tracking script in Orion, and couldn't find anything online for it. As I had some time I made it happen.

The title does say proof of concept.

To make this work with summon creature, in theory change the graphic to any and change the flags from red to blue. Of course change the spell name.
Respectfully,
Paroxysmus ILV Master Spellcaster
Post Reply