Author Topic: Sub ignore stuff for 3 minutes needs HELP!  (Read 3094 times)

0 Members and 1 Guest are viewing this topic.

Offline BadManiacTopic starter

  • Jr. Member
  • **
  • Posts: 61
  • Activity:
    0%
  • Reputation Power: 4
  • BadManiac has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Sub ignore stuff for 3 minutes needs HELP!
« on: April 10, 2010, 02:54:09 PM »
0
So I thought this would be a good thing to bring the exceptional brains of this site together to work on a simple straight forward problem.
Ignoring something for 3 minutes, and then un-ignoring it.

Here's the background. UO Instanced Corpses take 3 minutes to reset to "public: where everything becomes accessible to anyone. In my looting script I can detect an instanced corpse. I'd like to loot your personal instance if possible, then ignore that corpse for 3 minutes until it goes public, and then loot it again.

Here's the sub I currently use, it's about as reliable as <insert something really unreliable here>
Code: [Select]
; IgnoreList====================
; %1 Item to ignore for 3 minutes
;===============================
SUB IgnoreList
{
  SET %oldlpc #LPC
  SET #LPC 10000
  NAMESPACE PUSH
  NAMESPACE LOCAL IgnoreList
  IF !ignore_cnt = N/A
    SET !ignore_cnt 0
  SET !item #FALSE
  IF %0 > 0
    SET !item %1
  FOR !i 1 !ignore_cnt
  {
    IF #SCNT > !time . !i && !ignore_cnt > 0
    {
      IGNOREITEM RESET !i
      IGNOREITEM RESET !ignore_cnt
      SET !time . !i !time . !ignore_cnt
      SET !item . !i !item . !ignore_cnt
      IGNOREITEM !item . !i !i
      SET !ignore_cnt !ignore_cnt - 1
    }
  }
  IF !item <> #FALSE
  {
    SET !ignore_cnt !ignore_cnt + 1
    SET !item . !ignore_cnt !item
    SET !time . !ignore_cnt #SCNT + 181
    IGNOREITEM !item !ignore_cnt
  }
  NAMESPACE POP
  SET #LPC %oldlpc
  RETURN
}
The idea is to use two lists, or 1D arrays with corpse ID and the time it should be un-ignored. And then go through the list every time and check if the timer has expired, un ignoring it and rearranging the lists. It works like linked lists if you're C fluent...

However it doesn't always work. it ignores stuf just fine, but then it get's stuck in ignored limbo and never get's re-looted. Any ideas? Better way of doing this? Improved version of this?

TM's Claw doesn't do this at all, so if we come up with a good solution it could benefit both scripts. Assuming TM wants to add it. I think it's worth it since there's a lot of group hunting in UO now, Doom, Peerless and SA bosses. And a lot of people don't loot everything. I always find plenty of left over ingredients on bosses for example, when hunting with people who are only there for arties or loot.

Offline b@ndito

  • Jr. Member
  • **
  • Posts: 48
  • Activity:
    0%
  • Reputation Power: 0
  • b@ndito has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: Sub ignore stuff for 3 minutes needs HELP!
« Reply #1 on: April 11, 2010, 07:38:17 AM »
0
i started working on the same idea a little time ago but i didn't managed to get a reliable version...
now you put here your own. thank you i'll check it, knowign your fame i think it should be good ;)
« Last Edit: April 11, 2010, 07:43:59 AM by b@ndito »

Offline NObama

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Sub ignore stuff for 3 minutes needs HELP!
« Reply #2 on: April 11, 2010, 11:58:34 AM »
0
What about timestamping the corpse when it's created and looting it after three minutes?  You might avoid your ignore limbo problem that way...not sure how you want to do looting though...

Offline BadManiacTopic starter

  • Jr. Member
  • **
  • Posts: 61
  • Activity:
    0%
  • Reputation Power: 4
  • BadManiac has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Sub ignore stuff for 3 minutes needs HELP!
« Reply #3 on: April 11, 2010, 02:12:16 PM »
0
Timestamping how? That's almost what I do now, in a way. The reason I chose to ignore them is to prevent a list of hundreds (potentially) of corpses that you have to go through over and over just to find a new lootable corpse.

Offline NObama

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: Sub ignore stuff for 3 minutes needs HELP!
« Reply #4 on: April 11, 2010, 06:16:53 PM »
0
I was thinking it might be possible to do it using a 2D array...but i'm an array newb.  The problem i see with my idea is the same one you just mentioned:  you end up checking increasingly long lists and the script would grind to a halt.

Hmm...this sounds like a job for...ENDLESS NIGHT!

 :P

Scrripty

  • Guest
Re: Sub ignore stuff for 3 minutes needs HELP!
« Reply #5 on: April 11, 2010, 07:08:58 PM »
0
Well I can't ever see there being more than lets say, 100 corpses before the first starts to decay.  That's just a guess and being generous.  Then lets say a corpse has an "instance" timer of 3 minutes.  Then lets say a corpse decay time is 5 minutes.  I don't know what it is but this is just for argument sake.  Now, if you can scan for instanced corpses, and ignore them, then put them in a "list," that takes care of the instance corpse.  Then when it's time is up, you just ignore it again right?  That unignores it.  Then you have a timer for the corpse and it goes on the "decay" list after looting.  It gets ignored until the decay timer for that corpse is up, then it gets unignored again right?  Wouldn't that be the best way?  So you have 2 types of corpses, both detectable.  Regular and instanced.  The regular goes in one list and is ignored, and a "decay timer" is set for it.  When the decay timer is up, it is "ignored" again, basically removing it from the ignore list.  Then it is removed from all ignore lists because it has decayed and can't be found.  If the next corpse is instanced, then you loot it, ignore it, and add it to the "instanced" list.  So after 3 minutes it gets "ignored" again and is relootable.  Then it gets added to the "regular" list and is looted again, then "ignored" again?  Is this how it should all work?  Does that sound right? hehe  That should keep the 2 lists no longer than say 50 corpses max.  And will clean up all the lists as they decay.  So no more than 50 or so corpses would ever be in them.  I have done some FAST killing before, and can't imagine doing a ton more than 100, and that shouldn't everflood the lists so bad that it would slow you down a ton I would think?  But I'm no expert.  Sorry for the blabbering. heh  Just thinking out loud here.  How fast can 100 corpses be realistically looted with the script?
« Last Edit: April 11, 2010, 07:11:38 PM by Scripty »

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Sub ignore stuff for 3 minutes needs HELP!
« Reply #6 on: April 11, 2010, 07:57:04 PM »
0
I would cycle it between different ignore lists (ignoreitem AAAA 1) and switch to a new list every 30 seconds clearing ignore lists older than 3 minutes and restarting from list 1.

Tags: