///////////////////////////////////////////////////////////////////////// // // www.ultima.smoce.net // Name: Mining s vyhledanim cesty // ///////////////////////////////////////////////////////////////////////// using Phoenix; using Phoenix.WorldData; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Collections; using System.Threading; using System.Diagnostics; using System.Drawing; namespace Phoenix.Scriptsd { public class smoce_dilnd2 { [Command("Mining1")] public void Kopat() { //------ Nastaveni do HIDU ------- int Hid = 0; ushort[] vyhazovat = new ushort[18]; //------ VYKOPAVAT RUDU ------ // 0 - Nevyhazovat // 1 - Vyhazovat vyhazovat[0] = 1; vyhazovat[1] = 1; vyhazovat[2] = 0; vyhazovat[3] = 1; vyhazovat[4] = 1; vyhazovat[5] = 1; vyhazovat[6] = 1; vyhazovat[7] = 1; vyhazovat[8] = 0; vyhazovat[9] = 0; vyhazovat[10] = 0; vyhazovat[11] = 0; vyhazovat[12] = 0; vyhazovat[13] = 0; vyhazovat[14] = 0; vyhazovat[15] = 0; vyhazovat[16] = 0; vyhazovat[17] = 0; ushort[] vykopavat = new ushort[18]; //------ VYKOPAVAT RUDU ------ // 0 - Nevykopavat // 1 - Vykopavat vykopavat[0] = 0; vykopavat[1] = 0; vykopavat[2] = 0; vykopavat[3] = 0; vykopavat[4] = 0; vykopavat[5] = 0; vykopavat[6] = 0; vykopavat[7] = 0; vykopavat[8] = 1; vykopavat[9] = 1; vykopavat[10] = 1; vykopavat[11] = 1; vykopavat[12] = 1; vykopavat[13] = 1; vykopavat[14] = 1; vykopavat[15] = 1; vykopavat[16] = 1; vykopavat[17] = 1; ushort[] color = new ushort[18]; //------ BARVA ORE ------ color[0] = 0x0000; //Iron color[1] = 0x0289; //Copper color[2] = 0x01BF; //Bronze color[3] = 0x0482; //Silver color[4] = 0x0322; //Shadow color[5] = 0x0665; //Rose color[6] = 0x0160; //Golden color[7] = 0x01CB; //Verite color[8] = 0x0253; //Valorite color[9] = 0x04C2; //Blood Rock color[10] = 0x0455; //Black Rock color[11] = 0x052D; //Mytheril color[12] = 0x0006; //Star Sapphire color[13] = 0x0041; //Emerald color[14] = 0x002C; //Citrine color[15] = 0x0015; //Amethyst color[16] = 0x0027; //Ruby color[17] = 0x03E9; //Diamond string[] journal = new string[18]; //------ JOURNAL ------ journal[0] = "You put the Iron"; journal[1] = "You put the Copper"; journal[2] = "You put the Bronze"; journal[3] = "You put the Silver"; journal[4] = "You put the Shadow"; journal[5] = "You put the Rose"; journal[6] = "You put the Golden"; journal[7] = "You put the Verite"; journal[8] = "You put the Valorite"; journal[9] = "You put the Blood Rock"; journal[10] = "You put the Black Rock"; journal[11] = "You put the Mytheril"; journal[12] = "You put the Star Sapphire"; journal[13] = "You put the Emerald"; journal[14] = "You put the Citrine"; journal[15] = "You put the Amethys"; journal[16] = "You put the Ruby"; journal[17] = "You put the Diamond"; ushort[] typ_ore = new ushort[4]; //------ TYPE ORE ------ typ_ore[0] = 0x19B7; // 1 typ_ore[1] = 0x19BA; // 2 typ_ore[2] = 0x19B8; // 3 typ_ore[3] = 0x19B9; // 4 while (!World.Player.Dead) { ushort y = World.Player.Y; ushort y1 = 1; ushort y_1 = (ushort)(y + y1); UO.DeleteJournal(); UO.Print("Debuger : X:{0} Y:{1} Z:{2}",World.Player.X,World.Player.Y+1,World.Player.Z); UO.WaitTargetTile(World.Player.X, y_1, World.Player.Z, 0); if(World.Player.Backpack.AllItems.FindType(0x0E85).Exist) { UO.UseType(0x0E85);//0x0E85 } else { UO.UseType(0x0E86);//0x0E86 } UO.Wait(100); Journal.WaitForText("You loosen", "You put", "There is no","too far","Try mining"); if (UO.InJournal("You put")) { for (int i = 0; i < 18;i++) { if (vyhazovat[i] == 1) { for (int a = 0;a < 4;a++) { if (World.Player.Backpack.AllItems.Count(typ_ore[a], color[i]) > 0) { UO.MoveItem(World.Player.Backpack.AllItems.FindType(typ_ore[a], color[i]), 100, World.Player.X, World.Player.Y, World.Player.Z); UO.Wait(2500); } } } } } if (Hid == 0) { if (!World.Player.Hidden) { UO.UseSkill("Hiding"); UO.Wait(2500); } } if (UO.InJournal("There is no") || UO.InJournal("too far") || UO.InJournal("Try mining")) { Journal.Clear(); Chuze(); return; } for (int o = 0; o < 18;o++) { if (UO.InJournal(""+journal[o]+"") && vykopavat[o] != 1) { Journal.Clear(); Chuze(); return; } } if (UO.InJournal("You lossen")) { Journal.Clear(); Kopat(); return; } } } public void Chuze() { int x = 0; int y = 0; int pauza; if (World.Player.Layers[Layer.Mount].Exist) // Toto udava pauzu chozeni kdyz jsi na mountu. { pauza = 250; } else // Pokud jsi pesky { pauza = 300; } UO.DeleteJournal(); x = World.Player.X; UO.Press(System.Windows.Forms.Keys.Home); UO.Wait(pauza); if (World.Player.X == x) UO.Press(System.Windows.Forms.Keys.Home); UO.Wait(pauza); if (World.Player.X == x) { while (x <= World.Player.X) { UO.Press(System.Windows.Forms.Keys.PageDown); UO.Wait(pauza); if (World.Player.X == x) UO.Press(System.Windows.Forms.Keys.PageDown); UO.Wait(pauza); x = x + 1; } y = World.Player.Y; UO.Press(System.Windows.Forms.Keys.End); UO.Wait(pauza); if (World.Player.Y == y) UO.Press(System.Windows.Forms.Keys.End); UO.Wait(pauza); if (World.Player.Y == y) { while (World.Player.Y != (y+1)) { UO.Press(System.Windows.Forms.Keys.Home); UO.Wait(pauza); if (World.Player.Y == y) UO.Press(System.Windows.Forms.Keys.Home); UO.Wait(pauza); UO.Press(System.Windows.Forms.Keys.End); UO.Wait(pauza); if (World.Player.Y == y) UO.Press(System.Windows.Forms.Keys.End); UO.Wait(pauza); } } x = World.Player.X; while (x <= World.Player.X) { UO.Press(System.Windows.Forms.Keys.PageDown); UO.Wait(pauza); if (World.Player.X == x) UO.Press(System.Windows.Forms.Keys.PageDown); UO.Wait(pauza); x = x + 1; } } Kopat(); } } }