sub testen()
UO.FindType("0x0190", "-1", 'ground')
if uo.FindCount() then
uo.print(uo.getname('finditem'))
else
uo.print("no item around")
endif
end sub
sub testen()
UO.FindType("0x0190", "-1", 'ground')
if uo.FindCount() then
uo.print(str(uo.getQuantity('finditem'))+' '+uo.getname('finditem'))
else
uo.print("no item around")
endif
end sub
if i use this with a char then is says something like
"0 Hontar Hugmool".
thus, again my question:
how can i get the "name" of an object? or should i say description or property?
the reason is that i want to chance my lootscript. some object on our shard are named like "[magic] garment". and i will loot all this "[magic]" items too.
if "[magic]" in getproperty(finditem) then
gosub loot()
endif
thanks
taya
PS: sorry i'm more familiar with easyUO but for lootscripts i think injection is the much better solution. in easyUO it's the command "event property #findid"
sub testen()
UO.FindType("-1", "-1", 'ground')
if uo.FindCount() then
if not uo.getname('finditem') then
uo.click('finditem')
wait(100)
end if
if InStr(uo.getname('finditem'), "[mag]") > 0 then
uo.print("Get it")
end if
else
uo.print("no item around")
endif
end sub
sub InStr(Source, subStr)
var n = len(subStr)
var j
for var i = 0 to len(Source)-n
j = 0
while (j < n) and (Source[i+j] == subStr[j])
j = j+1;
wend
if j == n then
return i
end if
next
return -1
end sub
sub InStr(Source, subStr)
var n = len(subStr)
var j
if len(Source)>=len(subStr) then
for var i = 0 to len(Source)-n
j = 0
while (j < n) and (Source[i+j] == subStr[j])
j = j+1;
wend
if j == n then
return i
end if
next
else
end if
return -1
end sub