This moves your ore to a BOH. If you want to use a portable thing then grab from other scripts and replace in "moveore" function.
Code: Select all
var config = {
"maxWeight" : (Player.MaxWeight(400)-10), //Max Weight to unload
"pickaxe" : "0x0F39", //Pickaxe type(pickaxe, shovel etc)
"ore" : "0x19B9",
"toolQty" : 1, //To keep in bag
"tileOffset" : 1, // Radius to dig (X+-2, Y+-2)
};
var rBooks = {
1 : {"bSNum" : '0x40516626', "iStops" : 16},
2 : {"bSNum" : '0x40516ACA', "iStops" : 16},
3 : {"bSNum" : '0x4051688D', "iStops" : 16},
4 : {"bSNum" : '0x40516718', "iStops" : 16},
5 : {"bSNum" : '0x405164BC', "iStops" : 16},
}
var bNumber = { // change to 5,15, 25, ect if you want to use recall
1: {"btn" : 7}, 2: {"btn" : 17}, 3: {"btn" : 27}, 4: {"btn" : 37}, 5: {"btn" : 47}, 6: {"btn" : 57},
7: {"btn" : 67}, 8: {"btn" : 77}, 9: {"btn" : 87}, 10: {"btn" : 97}, 11: {"btn" : 107}, 12: {"btn" : 117},
13: {"btn" : 127}, 14: {"btn" : 137}, 15: {"btn" : 147}, 16: {"btn" : 157},
}
function Astart()
{
init();
while(!Player.Dead())
{
for(var rBook in rBooks)
{
var numbStops = rBooks[rBook]['iStops'];
for (i = 0; i <= numbStops -1; i++)
{
Orion.Print(bNumber[i +1]['btn']);
//Move to new location
NextLocation(rBooks[rBook]['bSNum'], bNumber[i +1]['btn']);
for (var x = -config['tileOffset']; x <= config['tileOffset']; x++)
{
for (var y = -config['tileOffset']; y <= config['tileOffset']; y++)
{
MoveOre(); //make sure bag in empty
mine(x,y);
}
}
}
}
}
}
function mine(x,y)
{
while(!Player.Dead())
{
if(checkTool())
{
if(Orion.ValidateTargetTileRelative('mine', x, y))
{
if(Orion.HaveTarget())
Orion.CancelWaitTarget();
Orion.UseType(config['pickaxe']);
Orion.WaitJournal('Where do you wish', Orion.Now(), Orion.Now()+2000, 'me|sys');
Orion.TargetTileRelative('mine', x, y, Player.Z());
var result = Orion.WaitJournal('You put some|You loosen some|There is no metal|Try mining|is too far|no line of| cannot be seen| mine that', Orion.Now(), (Orion.Now() + 7000), 'me|sys');
if(result && (result.FindTextID()==6 || result.FindTextID()==7))
{
break;
}
if(result && result.FindTextID()==2)
{
Orion.Wait(300);
break;
}
}else{
break;
}
}else{ //Not enough tools
break;
}
}
}
function MoveOre()
{
var findItems0 = Orion.FindType('0x19B9|0x1779', '0xFFFF', 'backpack', 'item');
for(items in findItems0)
{
Orion.DragItem(findItems0[items], 0);
Orion.Wait('300');
Orion.DropDraggedItem('0x41C448BA'); //move to my boh. change if you want to move to a pet.
Orion.Wait('500');
}
}
function checkTool()
{
var tools = Orion.FindType(config['pickaxe'], -1, 'backpack');
if(tools && tools.length >= config['toolQty'])
{
return true;
}else{
Orion.Print("[e] Not enough tools");
Orion.PlayWav("Alarm");
Orion.PauseScript();
return false;
}
}
function init()
{
if(Player.WarMode())
{
Player.WarMode(false)
Orion.Print("Initialization...");
}
}
function NextLocation(rBook, iButton)
{
Orion.UseObject(rBook);
Orion.Wait(500);
if (Orion.WaitForGump(1000))
{
var gump0 = Orion.GetGump(any,'0x554B87F3');
if ((gump0 !== null) && (!gump0.Replayed()) && (gump0.ID() === '0x554B87F3'))
{
gump0.Select(Orion.CreateGumpHook(iButton));
Orion.Wait(5000);
}
}
}