ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on September 27, 2013, 01:38:49 PM
-
Here's what I'm trying to do:
I'm writing a small script that shows the current count of all the various potions in my backpack in a small menu window. No big deal. Well, EA (in all their infinite wisdom) decided that Invis potions and Confusion potions should use the exact same type. Ok, no big deal - I'll just use propertys to separate them out. But once it finds the first OUF (type for both potions) it ignores the second.
Well, for my semi-solvent old brain - it's turned into a big deal that's driving me batty. Kindly have a look at what I have and tell me what I'm doing wrong.
finditem OUF C_ , #BACKPACKID
for #findIndex 1 #findcnt
{
event Property #findID
if Confusion in #property
{
set %confusion #FINDSTACK
ignoreitem #findid
}
else
if Invisibility in #property
{
set %invis #FINDSTACK
ignoreitem #findid
}
}
else
wait 5
-
Separate them by #Findcol Instead of Property
Finditem OUF C_ , #Backpackid
if #Findcnt > 0 ; <- Important
{
For #Findindex 1 #findcnt
{
if #Findcol = XXXX ; (Not sure what the #Findcol is)
set %Confusion #Findid ; <- You were using #Findstack, #Findstack is how many of them there are in the stack
if #Findcol = XXXY ; Color for Invis
set %Invisibility #Findid
}
}
-
I forgot all about #findcol, which should work. In the end, it turns out I didn't need to use ignoreitem at all. The real key was in the use of #findindex to cycle thru the possible suspects. And I had a mistake in my extra "else".
But, since you mention it in your response, manwinc, why is it always important to add the "if #Findcnt > 0 after Finditem? Is it just so that finditem doesn't waste the time to look beyond that? I mean, that does make sense that you wouldn't want finditem to waste time searching for items and properties that don't exist in the first place... Is that the reason that it's important to use, or is there more to it than that?
-
Another thing, if you are iterating through the finditems found using #FINDINDEX, then you don't have to ignore item unless you really don't want to see that come up again in subsequent searches.
-
I can't remember what causes it, but there are instances where if you do "for #Findindex 1 #Findcnt " and #findcnt = 0, euo will just kep Incrementing #Findindex without stopping. Hard to recreate, but it can happen.
-
Another thing, if you are iterating through the finditems found using #FINDINDEX, then you don't have to ignore item unless you really don't want to see that come up again in subsequent searches.
That's exactly what I've been wondering. So #findindex has it's own "ignore" built in to it. Once it looks at an item in it's "list", then it automatically does not return to it - but rather moves on to the next item by itself on it's loop of items... Is my thinking correct on this?
-
I can't remember what causes it, but there are instances where if you do "for #Findindex 1 #Findcnt " and #findcnt = 0, euo will just kep Incrementing #Findindex without stopping. Hard to recreate, but it can happen.
And that would be ugly when it did happen.... So it would be in an infinite loop of sorts?
-
Its more like an array. You have variables separated by a list
Findid1
Findid2
Findid3
Findid4
Findid5
Findcol1
Findcol2
Findcol3
Findcol4
Findcol5
As you increase #Findindex, it just icrements and goes to the next one. You can Build Similar Lists Youself using parsing(Sp). But that's a little advanced. No Ignoreitem Involved, but you've got the right idea in that it doesn't find the same item twice.