tinkering, tailoring, carpentry a BS - Smoceho kompletka
Napsal: 01 lis 2013 20:57
Kód: Vybrat vše
using System;
using System.Collections.Generic;
using System.Text;
using Phoenix;
using Phoenix.WorldData;
using System.Linq;
using Phoenix.Communication;
using Phoenix.Runtime;
using Phoenix.Runtime.Reflection;
namespace Script.crafts_od_smoce
{//by smoce
public class Craftmenstvi
{//by smoce
[Executable]
public static void craft_tail_bandana()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Cloth", "Headwear", "Headwear", "Bandana" };
Craftmenstvisro("Bandana", 0x175D, 0x0000, 0x153F, box, 0x0F9D, "50", incs);
}
[Executable]
public static void craft_bs_kudle()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Blacksmithing", "Iron Weapons", "Iron Weapons", "Swords & Blades", "Swords & Blades", "Dagger" };
Craftmenstvisro("Dagger", 0x1BEF, 0x0000, 0x0F51, box, 0x1BEF, "10", incs);
}
[Executable]
public static void craft_wire_iron()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Tinkering", "Wires", "Wires", "Iron Wire" };
Craftmenstvisro("Iron Wire", 0x1BEF, 0x0000, 0x1876, box, 0x1EBC, "120", incs);
}
[Executable]
public static void craft_wire_copper()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Tinkering", "Wires", "Wires", "Copper Wire" };
Craftmenstvisro("Copper Wire", 0x1BE3, 0x0000, 0x1877, box, 0x1EBC, "50", incs);
}
[Executable]
public static void craft_wire_gold()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Tinkering", "Wires", "Wires", "Gold Wire" };
Craftmenstvisro("Gold Wire", 0x1BF5, 0x0000, 0x1878, box, 0x1EBC, "200", incs);
}
[Executable]
public static void craft_strings()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Tinkering", "Wires", "Wires", "Iron String" };
Craftmenstvi_v2_sro("Iron String", 0x1BE9, 0x0000, 0x1420, box, 0x1EBC, "100", incs);
}
[Executable]
public static void craft_cbs()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Tinkering", "Special Items", "Special Items", "Crystal Ball (1 charge)" };
Craftmenstvi_v2_sro("Crystal Ball (1 charge)", 0x1BE9, 0x0000, 0x0E2D, box, 0x1EBC, "22", incs);
}
[Executable]
public static void craft_pouch()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Leather", "Packs", "Packs", "Leather Pouch" };
Craftmenstvi_v2_sro("Leather Pouch", 0x1078, 0x0000, 0x0E79, box, 0x0F9D, "2", incs);
}
[Executable]
public static void craft_woden()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Carpentry", "Containers & Cont. parts", "Containers & Cont. parts", "Wooden Box" };
Craftmenstvi_v2_sro("Woden Box", 0x1BDD, 0x0000, 0x0E7D, box, 0x1035, "4", incs);
}
[Executable]
public static void craft_krumpace()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Blacksmithing", "Tools", "Tools", "Pick axe" };
Craftmenstvi_v2_sro("Pick axe", 0x1BEF, 0x0000, 0x0E85, box, 0x1BEF, "6", incs);
}
/*
[Executable]
Volá se to : ,exec <nazev>
public static void <nazev>()
{
UO.PrintInformation("ZVOL BOX S MATERIALEM !!!");
UOItem box = new UOItem(UIManager.TargetObject());
UO.Wait(500);
string[] incs = { "Tinkering", "Special Items", "Special Items", "Crystal Ball (1 charge)" };
Craftmenstvi_v2_sro("Crystal Ball (1 charge)", <typ ironu nebo dreva> ,<barva = typ ironu nebo dreva>, <vyrobek>, box, <naradi>, "<min. pocet materialu>", incs);
}
*/
//Unirezalni
[Executable]
public static void Craftmenstvisro(string name, ushort itemos_iron, ushort color_iron, ushort iron_vyrobek, UOItem box, ushort naradi, string ocet_ironu, string[] incs)
{
UO.Print("Zahajeni crafteni - " + name);
UO.Wait(100);
int y = 0;
int ok = 0;
int fizz = 0;
zacateks:
if (UO.Count(0x0F51, 0x0000) >= 10) //bs noziky
{
UOItem bstrian = World.Ground.FindType(0x0FB1, 0x0161);
bstrian.Use();
UO.Wait(100);
}
if (UO.Count(0x153F) >= 1) // tailor bandana
{
UOItem nuzky = World.Player.Backpack.AllItems.FindType(0x0F9E);
UOItem tailor = World.Player.Backpack.AllItems.FindType(0x153F);
UO.WaitTargetObject(tailor);
UO.UseObject(nuzky);
UO.Wait(100);
//preneseni 20 band pryc
if (UO.Count(0x0E21) >= 20) // tailor bandana
{
UOItem bandy = World.Player.Backpack.AllItems.FindType(0x0E21);
UO.MoveItem(bandy, 0, box);
UO.Wait(200);
}
}
do
{
if (UO.Count(itemos_iron) == 0)
{
box.Use();
UO.PrintInformation("Dosel material. Mrknu do boxu jesteli tam něco neni !");
if (UO.Count(0x0F51, 0x0000) <= 1)
{
if (UO.Count(iron_vyrobek) > 0)
{
//// svitky jsou preneseny do boxu - Z
UOItem svitecky = World.Player.Backpack.AllItems.FindType(iron_vyrobek, 0x0000);
UO.MoveItem(svitecky, 0, box);
UO.Wait(1000);
//// svitky jsou preneseny do boxu - K
}
else
{
UO.Print("V baglu nejsou zadne vyrobky berem z boxu jen material");
UO.Wait(100);
}
}
smocelskd(box, itemos_iron, color_iron, ocet_ironu);
UO.Wait(1000);
}
UO.DeleteJournal();
UO.Wait(1000);
if (naradi != 0x0F9D)
{
UO.WaitMenu(incs);
UOItem naradis = World.Player.Backpack.AllItems.FindType(naradi);
naradis.Use();
}
else
{
UO.Wait(1000);
UOItem cloas = World.Player.Backpack.AllItems.FindType(0x175D);
UO.WaitTargetObject(cloas);
UOItem naradis = World.Player.Backpack.AllItems.FindType(0x0F9D);
UO.UseObject(naradis);
UO.WaitMenu(incs);
}
string[] hlaskys = { "You put", "You fail", "Tinkering failed", "You have","You can" };
Journal.WaitForText(true, hlaskys);
UO.Wait(1000);
if (UO.InJournal("You put"))
{
ok++;
}
else
{
fizz++;
}
y++;
statisticss(ok, fizz, 0);
}
while (UO.Count(0x0E34) >= 1);
goto zacateks;
}
//Unirezalni - KONEC
[Executable]
public static void Craftmenstvi_v2_sro(string name, ushort itemos_iron, ushort color_iron, ushort iron_vyrobek, UOItem box, ushort naradi, string ocet_ironu, string[] incs)
{
UO.Print("Zahajeni crafteni - " + name);
UO.Wait(100);
int y = 0;
int ok = 0;
int fizz = 0;
int soulkamodra = 0;
zacateks:
do
{
if (UO.Count(itemos_iron) == 0)
{
box.Use();
UO.PrintInformation("Dosel material. Mrknu do boxu jesteli tam něco neni !");
if (UO.Count(iron_vyrobek) > 0)
{
//// svitky jsou preneseny do boxu - Z
UOItem svitecky = World.Player.Backpack.AllItems.FindType(iron_vyrobek, 0x0000);
UO.MoveItem(svitecky, 0, box);
UO.Wait(1000);
//// svitky jsou preneseny do boxu - K
}
else
{
UO.Print("V baglu nejsou zadne vyrobky berem z boxu jen material");
UO.Wait(100);
}
smocelskd(box, itemos_iron, color_iron, ocet_ironu);
UO.Wait(1000);
}
UO.DeleteJournal();
UO.WaitMenu(incs);
UOItem naradis = World.Player.Backpack.AllItems.FindType(naradi);
naradis.Use();
string[] hlaskys = { "You put", "You fail", "Tinkering failed" };
Journal.WaitForText(true, hlaskys);
if (UO.InJournal("You put"))
{
ok++;
soulkamodra++;
}
else
{
fizz++;
}
y++;
statisticss(ok, fizz, 0);
if (UO.Count(0x1420, 0x0000) > 26)
{
UO.Print("vyrobku = " + UO.Count(0x1420, 0x0000) + "vytvartim pack");
UO.Wait(100);
smocelskd(box, 0x1BEF, 0x0000, "10");
UO.DeleteJournal();
string[] bec = { "Blacksmithing", "Tools", "Tools", "Spulka dratu" };
UO.WaitMenu(bec);
UOItem naraa = World.Player.Backpack.AllItems.FindType(0x1BEF, 0x0000);
naraa.Use();
string[] hlasks = { "You put", "You fail", "Tinkering failed", "You have failed" };
Journal.WaitForText(true, hlasks);
}
UO.Wait(300);
if (UO.Count(0x1420, 0x08B0) > 10)
{
UO.Print("vyrobku = " + UO.Count(0x1420, 0x0000) + "vytvartim velky pack");
UO.Wait(100);
smocelskd(box, 0x1BEF, 0x0000, "10");
UO.DeleteJournal();
string[] bec = { "Blacksmithing", "Tools", "Tools", "Velka spulka dratu" };
UO.WaitMenu(bec);
UOItem naraa = World.Player.Backpack.AllItems.FindType(0x1BEF, 0x0000);
naraa.Use();
string[] hlasks = { "You put", "You fail", "Tinkering failed", "You have failed" };
Journal.WaitForText(true, hlasks);
if (UO.InJournal("You put"))
{
if (UO.Count(0x1420, 0x08B0) > 5)
{
UOItem svia = World.Player.Backpack.AllItems.FindType(0x1420, 0x0B49);
UO.MoveItem(svia, 0, box);
UO.Wait(1000);
}
}
}
UO.Wait(2000);
}
while (UO.Count(0x0E34) >= 1);
goto zacateks;
}
[Command]
public static void smocelskd(UOItem box, ushort itemos_iron, ushort color_iron, string pocet_ironu)
{
UOItem tod = new UOItem(World.Player.Backpack);
foreach (KeyValuePair<Graphic, string> items in new Dictionary<Graphic, string>
{
{itemos_iron , pocet_ironu}
})
MoveItemsd(box, tod, color_iron, items);
}
private static void MoveItemsd(UOItem from, UOItem to, ushort colors, KeyValuePair<Graphic, string> item)
{
if (string.IsNullOrEmpty(item.Value))
return;
int count = ushort.Parse(item.Value) - to.AllItems.Count(item.Key, colors);
if (count > 0)
MoveItem(from.AllItems.FindType(item.Key, colors), count, to);
else if (count < 0)
MoveItem(to.AllItems.FindType(item.Key, colors), count, from);
}
private static void MoveItem(UOItem item, int count, UOItem dest)
{
if (!item.Exist)
return;
ushort tomove = Math.Min((ushort)Math.Abs(count), item.Amount);
using (ItemUpdateEventWaiter ew = new ItemUpdateEventWaiter(item))
{
item.Move(tomove, dest);
if (ew.Wait(5000))
UO.PrintInformation(item.Graphic + " - " + tomove);
UO.Wait(500);
}
}
[Command]
public static void statisticss(int ok, int fizz, int uspesnostssa)
{
if (ok > 0)
{
uspesnostssa = (ok / (ok + fizz)) * 100;
}
else
{
uspesnostssa = 0;
}
UO.Print("Povedene:Nepovedene - " + ok + ":" + fizz);
}
[Command]
public static void WaitForJournal(string text)
{
do
{
UO.Wait(200);
}
while (UO.InJournal(text));
UO.Wait(500);
}
}
}
mám k nemu aj otázku - chcel by som vyrábať drôty z copper, tak som zmenil skript zo silver na copper. skript sa spustí, ale vyhadzuje že craftenie bolo neúspešné.
niekde ešte niečo treba zmeniť, ale ani za milú jarmilu netuším kde a ktorú hodnotu. viete mi pls niekto poradiť?