odkladiste - docasne misto, kam se odkladaji mensi kupy logu, protoze pokud bereme z velke kupy jeden kus, tak to buguje
sklad - misto, kde mame logy, shafty a peri. Sem se taky ukladaji hotove vyrobky
Nastaveni toho, co chci vyrabet se deje na prvnim radku funkce Arrows(), kde do promenne vyrobek ulozime bud hodnotu Arrows nebo Crossbow bolts uzavrenou uvozovkami
Kód: Vybrat vše
sub Bowcraft_Init()
UO.AddObject("odkladiste")
while UO.Targeting()
wait(100)
wend
UO.AddObject("sklad")
while UO.Targeting()
wait(100)
wend
UO.SaveConfig()
end sub
sub Arrows()
var vyrobek = "Crossbow bolts" ; <--- zde "Arrows" nebo "Crossbow bolts"
var peri = 0x1BD1
var shaft = 0x1BD4
while not uo.dead()
if UO.Count(shaft) == 0 then
UO.FindType(shaft, "-1", "sklad")
if UO.FindCount() == 0 then
UO.Print("Dosly shafty")
return
endif
Move_n_Wait(shaft, "-1", 1000, "sklad", "backpack")
endif
UO.FindType(peri, "-1", "sklad")
if UO.FindCount() == 0 then
UO.Print("Doslo peri")
return
endif
Move_n_Wait(peri, "-1", 1, "sklad", "backpack")
UO.WaitMenu("Select arrow type", vyrobek)
UO.UseType(peri)
UO.DeleteJournal()
WaitForJournal("You put|You fail")
wend
end sub
sub Shafts()
var log = 0x1BDD
var dagger = 0x0F51
while not uo.dead()
UO.FindType(log, "-1", "odkladiste")
if UO.FindCount() == 0 then
UO.FindType(log, "-1", "sklad")
if UO.FindCount() == 0 then
UO.Print("Dosel material na zpracovani")
return
endif
Move_n_Wait(log, "-1", 200, "sklad", "odkladiste")
wait(500)
Move_n_Wait("0x1BD4", "-1", "-1", "backpack", "sklad")
wait(500)
endif
Move_n_Wait(log, "-1", 1, "odkladiste", "backpack")
UO.DeleteJournal()
UO.WaitMenu('Bowcraft', 'Shafts')
UO.WaitTargetType(log)
UO.UseType(dagger)
WaitForJournal("You put the Unfinished|You fail")
If UO.InJournal("You put the Unfinished") Then
UO.DeleteJournal()
UO.UseType("0x1BD6", "0x0742")
WaitForJournal("You put the shaft")
endif
wend
end sub
Sub Move_n_Wait(type, color, count, from, to)
var old_count = 0
var new_count = 0
UO.FindType(type, color, to)
old_count = UO.GetQuantity("finditem")
UO.FindType(type, color, from)
if UO.FindCount() > 0 then
if count == "-1" then
count = UO.GetQuantity("finditem")
endif
UO.MoveItem("finditem", count, to)
repeat
wait(100)
UO.FindType(type, color, to)
new_count = UO.GetQuantity("finditem")
until new_count == old_count + count
endif
end sub
Sub WaitForJournal(text)
repeat
wait(100)
until uo.inJournal(text)
wait(500)
end sub