Author Topic: Ignoreitem's kickin' my arssssss...  (Read 5388 times)

0 Members and 1 Guest are viewing this topic.

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Ignoreitem's kickin' my arssssss...
« on: September 27, 2013, 01:38:49 PM »
0
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.

Code: [Select]
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

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +272
  • Referrals: 1
    • View Profile
Re: Ignoreitem's kickin' my arssssss...
« Reply #1 on: September 27, 2013, 03:20:12 PM »
0
Separate them by #Findcol Instead of Property

Code: [Select]
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
}
}

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Ignoreitem's kickin' my arssssss...
« Reply #2 on: September 28, 2013, 09:43:15 AM »
0
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?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Ignoreitem's kickin' my arssssss...
« Reply #3 on: September 28, 2013, 05:39:46 PM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +272
  • Referrals: 1
    • View Profile
Re: Ignoreitem's kickin' my arssssss...
« Reply #4 on: September 28, 2013, 06:53:07 PM »
0
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.

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Ignoreitem's kickin' my arssssss...
« Reply #5 on: September 29, 2013, 09:03:46 AM »
0
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?

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Ignoreitem's kickin' my arssssss...
« Reply #6 on: September 29, 2013, 09:05:31 AM »
0
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?

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +272
  • Referrals: 1
    • View Profile
Re: Ignoreitem's kickin' my arssssss...
« Reply #7 on: September 29, 2013, 02:57:36 PM »
0
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.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: