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;
}