nevie niekto pls meno na keg? v nasledujúcom skripte ho mám zadané tak, ako je uvedené vo výrobnom paneli (keď kliknem na pílku, potom containers and containter parts, tak tam mám, mimo iného, keg small a keg, pričom keg small je container a keg by mal slúžiť na nápoje, ako káď ... aspoň dúfam, že sa nemýlim. ak by ale aj - výrobou niečoho sa tréniť treba a formy na láhve sú až od 90 takže ...)
späť teda k otázke - v dole uvedenom skripte mám jeho meno zadané ako "keg", ale skript mi zakaždým vypľuje "keg small".
skript je prepísaný zo skriptu "Carpentry_-_Krafti_Formy" ktorý som stiahol z ultima.smoce.net.
Kód: Vybrat vše
/////////////////////////////////////////////////////////////////////////
//
// www.ultima.smoce.net
// Name: Carpentry - Krafti Formy
//
/////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using Phoenix.WorldData;
using Phoenix.Runtime;
using Phoenix;
namespace Phoenix.Script
{
public class kegy
{
public static void EnsureItem(UOItem item)
{
if (String.IsNullOrEmpty(item.Name)) item.Click();
UO.Wait(800);
}
public static void EnsureContainer(UOItem container)
{
EnsureItem(container);
container.Use();
UO.Wait(500);
}
[Executable]
public static void kraftikegy()
{
EnsureContainer(UO.Backpack);
UOItem pilka = UO.Backpack.Items.FindType(0x1035 , 0x0000);
if (pilka.Serial == Serial.Invalid)
{
pilka = World.Player.Layers.FindType(0x1035, 0x0000);
if (pilka.Serial == Serial.Invalid)
{
UO.Print("Nemas pilku:");
return;
}
}
UO.Print("Zvol konterjner s materialem:");
UOItem container = new UOItem(UIManager.TargetObject());
EnsureContainer(container);
UOItem logs = null;
if ((logs = container.Items.FindType(0x1BDD, 0x0000)) == null)
{
UO.Print("DoslyLogy:");
return;
}
UOItem lids = null;
if ((lids = container.Items.FindType(0x1DB8, 0x0000)) == null)
{
UO.Print("Dosly Barel Lid:");
return;
}
UOItem stavess = null;
if ((stavess = container.Items.FindType(0x1EB1, 0x0000)) == null)
{
UO.Print("Dosly Barel Staves:");
return;
}
UOItem hoopss = null;
if ((hoopss = container.Items.FindType(0x10E1, 0x0000)) == null)
{
UO.Print("Dosly Barel Hoops:");
return;
}
int count = logs.Amount;
for (int i = 0; i < count; i++)
{
UOItem log = GetLog(container);
if (log.Serial == Serial.Invalid)
{
UO.Print("Invalid:");
return;
}
UOItem lid = GetLid(container);
if (lid.Serial == Serial.Invalid)
{
UO.Print("Invalid:");
return;
}
UOItem staves = GetStaves(container);
if (staves.Serial == Serial.Invalid)
{
UO.Print("Invalid:");
return;
}
UOItem hoops = GetHoops(container);
if (hoops.Serial == Serial.Invalid)
{
UO.Print("Invalid:");
return;
}
UO.Print("sychr " + i);
// UO.WaitTargetObject(log);
UO.WaitMenu( "Carpentry", "Containers & Cont. parts", "Containers & Cont. parts", "Keg" );
UO.UseObject(pilka);
JournalEventWaiter jew = new JournalEventWaiter(true, "You put");
jew.Wait(5000);
if (UO.Count(0x0E7F, 0x0909) >= 10)
{
UO.WaitMenu( "Carpentry", "Containers & Cont. parts", "Containers & Cont. parts", "Bedna forem" );
UO.UseObject(pilka);
JournalEventWaiter jew1 = new JournalEventWaiter(true, "You put");
jew1.Wait(5000);
UOItem craftedItem = UO.Backpack.Items.FindType(0x0FAE, 0x0909);
if (craftedItem.Serial != Serial.Invalid)
{
UO.Backpack.Items.FindType(0x1AD6, 0x0000).Move(1, container);
UO.Wait(500);
}
}
}
}
public static UOItem GetLog(UOItem container)
{
UOItem log = null;
if ((log = UO.Backpack.Items.FindType(0x1BDD, 0x0000)).Serial != Serial.Invalid) return log;
container.Items.FindType(0x1BDD, 0x0000).Move(2, UO.Backpack);
UO.Wait(500);
//UO.Print("1");
return UO.Backpack.Items.FindType(0x1BDD, 0x0000);
}
public static UOItem GetLid(UOItem container)
{
UOItem lid = null;
if ((lid = UO.Backpack.Items.FindType(0x1DB8, 0x0000)).Serial != Serial.Invalid) return lid;
container.Items.FindType(0x1DB8, 0x0000).Move(2, UO.Backpack);
UO.Wait(500);
//UO.Print("1");
return UO.Backpack.Items.FindType(0x1DB8, 0x0000);
}
public static UOItem GetStaves(UOItem container)
{
UOItem stavess = null;
if ((stavess = UO.Backpack.Items.FindType(0x1EB1, 0x0000)).Serial != Serial.Invalid) return stavess;
container.Items.FindType(0x1EB1, 0x0000).Move(1, UO.Backpack);
UO.Wait(500);
//UO.Print("1");
return UO.Backpack.Items.FindType(0x1EB1, 0x0000);
}
public static UOItem GetHoops(UOItem container)
{
UOItem hoops = null;
if ((hoops = UO.Backpack.Items.FindType(0x10E1, 0x0000)).Serial != Serial.Invalid) return hoops;
container.Items.FindType(0x10E1, 0x0000).Move(1, UO.Backpack);
UO.Wait(500);
//UO.Print("1");
return UO.Backpack.Items.FindType(0x10E1, 0x0000);
}
}
}