Buscar

Script de Mineração Industrial


Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

// ========================
// Nome do Script: 	Mining - Industrial
// Criado por: 	CarreiraLeo
// ========================
// Versão: 		Beta	1.3 Version
// Atualizada:				16/05/2022
// Aprovado: 	
// Testado no: 	Ancorp Shard
// Bugs Encontrados: 0
// ========================
//
//===============CONFIGURAÇÕES================
var chestBS='0x40169F47';	// ID bau de ingots/ores
var Smelt = 0; 						// 0 - Não Smaltar | 2 - Para Smaltar
var xMine = 2577;					// X da posição do Mine
var yMine = 479;					// Y da posição do Mine
var xBank = 2580; 				// X da posição do Banco
var yBank = 482; 				// Y da posição do Banco
var xForge = 2580; 				// X da posição da Forja
var yForge = 482; 				// Y da posição da Forja
var hammer = '0x13E3|0x13E4'; 		// Type da marreta
var pickaxe = '0x0E85|0x0E86'; 			// Type da picareta
var typeOres='0x19B9|0x19B8|0x19B7|0x19BA';
var typeJoias='0x0F16|0x0E1F|0x0F26|0x14ED|0x3C2D|0x0F13|0x0F18|0x0F10|0x0F0F|0x0F11';
var typeLingots='0x1BEF|0x1BF5|0x1BE3|0x1BE9|0x1BF2';
var OresPriorities = 'Chaos|Order|Infernal|Celestial|Iron|Ceramic|aproveitavel'; // Nomes dos ores prioritarios que deseja mineirar
//===============CONFIGURAÇÕES================
function Drop(){ // função que retorna as cores dos minerios que serão jogados fora.
	var listDrop = ''; 
	var oresDrop = [
		{name: 'Bronze', color: '0x09B3'},
		{name: 'Silver', color: '0x09B4'},
		{name: 'Radioactive', color: '0x09B7'},
	];
	for(var i in oresDrop){
		listDrop += oresDrop[i].color + '|';
	}
	return listDrop;
}
function Autostart(){
 Orion.Wait(2000);
 Orion.CharPrint(self, 906, 'Bom jogo!');
 Orion.Wait(100);
 Orion.Exec('StartMining', true);
	Orion.Wait(100);
	 Orion.Exec('guards', true);
	Orion.Wait(100);
	 Orion.Exec('autobands')
}
function StartMining(){
	Orion.AddObject('chestBS', chestBS);
	while (true){
		Mining();
		Walk();
		if( Player.Weight() > (Player.MaxWeight() - 50) ){
			if(Smelt==1){
				Go(2); // Ir até a forja
				Smaltar();
			}
			Go(3); // Ir até o banco
			OpenBank();
			PutBank();
			Go(1); // Ir até a mina
		}
	}
}
function autobands() {
 Orion.CharPrint(self, '99', 'Bands On');
 while ( true ) {
 if (Player.Hits() < Player.MaxHits() && !Player.Poisoned()) {
 var bandages = Orion.FindType('0x0E21');
 Orion.Say("guards");
 if (bandages.length > 0) {
 var startTime = Orion.Now();
 Orion.BandageSelf();
 Orion.WaitJournal('curou|escorregaram|envenenado|nao precisa', startTime, startTime + 5600);
 } else {
 Orion.Print('Acabou as bandagens!!');
 Orion.Wait(1000);
 }			}
		}
	}
}
function DropOre(){ //função que joga fora os minerios na lista da funcao Drop();
	var drop = Orion.FindType(typeOres, Drop(), 'backpack');
	for(var i = 0; i < drop.length; i++){
		Orion.DropHere(drop[i], 0);
	}
}
 
function PutBank(){
	if( Smelt == 0 ){
		while ( Orion.Count(typeOres, 'any', backpack) >= 1 ){
			var finditem = Orion.FindType(typeOres, 'any', backpack);
			for( i = 0; i < finditem.length; i++ ){
			 Orion.MoveItem(finditem[i], 0, 'chestBS');
			 Orion.Wait(500);
	 } 
			Orion.Wait(100);
		}
	}
	else if( Smelt == 1 ){
		while ( Orion.Count(typeLingots, 'any', 'backpack') >= 1 ){
			var finditem = Orion.FindType(typeLingots, 'any', 'backpack');
			for( i = 0; i < finditem.length; i++ ){
			 Orion.MoveItem(finditem[i], 0, 'chestBS');
			 Orion.Wait(500);
	 } 
			Orion.Wait(100);
		}
	}
	while ( Orion.Count(typeJoias, 'any', 'backpack') >= 1 ){
		var finditem = Orion.FindType(typeJoias, 'any', 'backpack');
		for( i = 0; i < finditem.length; i++ ){
		 Orion.MoveItem(finditem[i], 0, 'chestBS');
		 Orion.Wait(500);
		} 
		Orion.Wait(100);
	}
}
 
function Walk(){
	Orion.WalkTo(Player.X()+Orion.Random(-7, 8), Player.Y()+Orion.Random(-5, 6), Player.Z());
}
 
function Mining(){//função que executa a mineração
 for(var x = -2; x <= 2; x++){
		for(var y = -2; y <= 2; y++){
			Orion.ClearJournal();
			if ((y == 0) && (x == 0))
				y++;
			Orion.Print('X: ' + x + ' | Y: '+ y);
			Orion.WaitTargetTile('#0x400', Player.X() + x, Player.Y() + y, Player.Z());
			Orion.UseType(pickaxe);
			var time =Orion.Now()
			Orion.WaitJournal('Voce pos|Tente|Voce nao|Nao ha|You cannot|O alvo', time, time+15000);
			DropOre();
			if (Orion.InJournal(OresPriorities))
				y--;
		}
	}
}
function Smaltar(){
	Orion.UseType(hammer);
	Orion.Wait(200);
	var gump = Orion.GetGump('last');
	gump.Select(Orion.CreateGumpHook(0));
	var listbs = [
		{id: '1', nome: 'Ores iron', color: '0x0000', qtd: '200'},
		{id: '2', nome: 'Ores Ceramic', color: '0x09B0', qtd: '200'},
		{id: '3', nome: 'Ores Bronze', color: '0x09B3', qtd: '150'},
		{id: '4', nome: 'Ores Silver', color: '0x09B4', qtd: '150'},
		{id: '3', nome: 'Ores Gold', color: '0x09B5', qtd: '50'},
		{id: '0', nome: 'Ores Radiotive', color: '0x09B7', qtd: '25'},
		{id: '6', nome: 'Ores Order', color: '0x09B9', qtd: '2'},
		{id: '7', nome: 'Ores Chaos', color: '0x09BA', qtd: '2'},
		{id: '6', nome: 'Ores Infernal', color: '0x09BD', qtd: '2'},
		{id: '7', nome: 'Ores Celestial', color: '0x09BC', qtd: '2'},
 ];
	for(var i=0; i< listbs.length; i++){ 
		while(Orion.Count(typeOres, listbs[i].color, 'backpack')>0){
			ores = Orion.FindType(typeOres, listbs[i].color, 'backpack');
			Orion.ClearJournal();
			Orion.DragItem(ores[0], listbs[i].qtd);
			Orion.Wait(200);
			Orion.DropDraggedItem('backpack', 1, 1);
			Orion.Wait(200);
			Orion.UseObject(ores[0]);
			Orion.WaitJournal('esmeltou|You can|Voce nao', Orion.Now(), Orion.Now()+3000);				 
		}
	}
}
function Go(x){
	if(x==1){
		Orion.WalkTo(xMine, yMine, Player.Z(), Orion.Random(0,8));
	}
	else if(x==2){
		Orion.WalkTo(xForge, yForge, Player.Z(), 0);
	}
	else if(x==3){
		Orion.WalkTo(xBank, yBank, Player.Z(), 0);	
	}
}
function OpenBank(){
	Orion.SetTimer('openBank');
	Orion.ClearJournal();
	Orion.Say('Banker Bank')
	do {
		Orion.Wait(10);
	} while (!Orion.InJournal('Bank Box') && Orion.Timer('openBank') < 800 );
	Orion.Boxhack(Player.BankSerial());
}
function autobands() {
	Orion.CharPrint(self, '99', 'Bands On');
 while ( true ) {
 if (Player.Hits() < Player.MaxHits() && !Player.Poisoned()) {
 var bandages = Orion.FindType('0x0E21');
 if (bandages.length > 0) {
 var startTime = Orion.Now();
 Orion.BandageSelf();
 Orion.WaitJournal('curou|escorregaram|envenenado|nao precisa', startTime, startTime + 5600);
 } else {
 Orion.Print('Acabou as bandagens!!');
 Orion.Wait(1000);
 }
 }
 }
}

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Mais conteúdos dessa disciplina