Author Topic: Ghost Items, Move Item Subs, Etc  (Read 3634 times)

0 Members and 1 Guest are viewing this topic.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +304
  • Referrals: 1
    • View Profile
Ghost Items, Move Item Subs, Etc
« on: November 24, 2009, 08:03:29 AM »
0
I am working on a general purpose imbue sub that throws a lot of stuff around. It picks up resources, makes stuff, then puts those resources away, gets out imbue resources, imbues stuff, etc...  I had a simple version working pretty well, but as it has gotten more complicated with various failsafe's and checks, it started creating ghost items and hanging. I am playing with adding in waits and reopening containers, but I wonder if someone has some insight into why ghost items happen so that there might be some logic behind my tinkering. 
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #1 on: November 24, 2009, 08:07:14 AM »
0
If you can determine where the items are being ghosted, do a drop there. You can open your backpack to eliminate it, but it might come back in your pack.

Maybe a combination of dropc and open pack would be best.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +304
  • Referrals: 1
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #2 on: November 24, 2009, 08:11:43 AM »
0

Here is where the primary ghost/hangup is showing up atm:

Code: [Select]
CheckExceptional:
If %ExceptionalRequired = Y
    {
    Finditem %CurrentItemType C_ , #backpackid
    event property #findid
    If exceptional in #property
       {
       Set %CurrentItemID #Findid
       Gosub OffSetClick 30 450    ; Closes Craft Gump
       Wait 10
       Gosub UnloadResources
       Return
       }
    Wait 10
    Gosub OffSetClick 30 450    ; Closes Craft Gump
    Gosub Dispose #findid
    Goto MakeLastCraftLoop

When it comes back from the Disposal it goes to a series of commands that hits Make Last.
The Dispose Sub looks like this:

Code: [Select]
;==========================================================
Sub Dispose
StartDispose:
Set #lobjectID #BackpackID
Event Macro 17
wait 5
Set %DisposeItemID %1
Finditem %DisposeItemID C , #BackPackID
Set %CurrentDisposeType #FindType
If #FindCnt < 1
Return
If %CurrentDisposeType in %TrashList
   {
   Set #lobjectID %TrashBarrel
   Event Macro 17
   wait 5
   exevent drag %DisposeItemID #Findstack
   wait 10
   exevent dropc %TrashBarrel
   wait 20
   Return
   }
Cut:
If %CurrentDisposeType in %Cutlist
   {
   FindItem %Scissors C_ , #BackpackID
   Set #LobjectID #FindID
   Event Macro 17
   Gosub waitfortargetCursor
        if ! #result
        {
        Goto StartDispose
        }
   set #ltargetID %DisposeItemID
   event macro 22 0
   wait 10
   Return
   }
Smelt:
If %CurrentDisposeType in %Smeltlist
   {
   FindItem %Tongs C_ , #BackpackID
   Set #LobjectID #FindID
   Event Macro 17
         gosub waitforgump %cwin
         if ! #result
         {
         Goto StartDispose
         }
   Gosub OffSetClick 30 350       ; Smelt Item Button
         Gosub waitfortargetCursor
         if ! #result
         {
         Goto StartDispose
         }
   set #ltargetID %DisposeItemID
   event macro 22 0
         gosub waitforgump %cwin
         if ! #result
         {
         Goto StartDispose
         }
   Gosub OffSetClick 30 450
   wait 5
   Return
   }
Display The itemtype you are currently making, %CurrentDisposeType , needs to be added to either the CutList, TrashList or the SmeltList
Halt
« Last Edit: November 24, 2009, 08:14:11 AM by Paulonius »
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +390
  • Referrals: 1
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #3 on: November 24, 2009, 08:29:31 AM »
0
I have seen over about 60 percent of scripts at one point or another cause ghosting.  It is all based around when the item is picked up and droped and the timing there with in.  If the pickup and drop happen to fast and then you mix in a little lag, Voila you have a ghost item.  I can almost reproduce it everytime by starting up a high end virus scan while a script is picking up an item and trying to drop it, boom you now have a ghost item.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +304
  • Referrals: 1
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #4 on: November 24, 2009, 08:35:25 AM »
0
So my failsafes are redundant checks, slow the process down, and re-open containers?
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #5 on: November 24, 2009, 08:48:36 AM »
0
I had thought that a simple item count would work... but we never really had the problem enough to pursue it....

Before dragging and dropping, do an item count of the place your dragging from or to. Then do a repeat drag/drop routine.... maybe one that steps up the delays, until that item count changes....

Code: [Select]
finditem * C_ , %wherever
set %number_of_items #findCnt
set %timout ( #sCnt + 30 ) ; 30 second timout

repeat
{
   exevent drag %DisposeItemID #Findstack
   wait %timer1
   exevent dropc %TrashBarrel
   wait %timer2
   set %timer1 ( %timer1 + 1 )
   set %timer2 ( %timer2 + 1 )
   finditem * C_ , %wherever
}
until #findCNt <> %number_of_items || #sCnt > %timeout
set %timer1 5
set %timer2 20
return
Now you have to be careful cause you dealing with two seperate found items, the one you are actually trying to move, and the ones in the container your counting. If you define yours with a variable, then just use that variable here and let the counter be the last found item.

This was just a concept I'd thought of a long time ago and never really needed. It may work, may not, may be so full of holes it looks like the health care plan... oops.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +304
  • Referrals: 1
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #6 on: November 24, 2009, 08:56:29 AM »
0
I like it, one more tool in the arsenal.  I just finished putting in code to reopen all of the containers in volved with wait 10's after each for every time I am moving something. Slows the script down, but if it makes it stable it will be worth it.  If this doesn't work I will look into turning your item count idea into a general purpose move item sb.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Scrripty

  • Guest
Re: Ghost Items, Move Item Subs, Etc
« Reply #7 on: November 24, 2009, 08:57:39 AM »
0
I like it, one more tool in the arsenal.  I just finished putting in code to reopen all of the containers in volved with wait 10's after each for every time I am moving something. Slows the script down, but if it makes it stable it will be worth it.  If this doesn't work I will look into turning your item count idea into a general purpose move item sb.

Yea who cares how fast a crafting script is really?  I never craft unless I'm doing nothing in UO anyways... :)  Speed is great but stability is WAY better.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #8 on: November 24, 2009, 09:02:22 AM »
0
I've never used this... completely untested and recently (30 mins ago) written. It's just an idea I thought of a long time ago with a Lumberjack program that had a ghosting issue.

The logic seems sound. You drag and drop until the item is actually in the container. If the delays are causing it not to drop, add to the delays.

Lemme know if you test it at all, I'd be interested.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +390
  • Referrals: 1
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #9 on: November 24, 2009, 09:51:27 AM »
0
I dont believe the item counting will help any.  After the item is ghosted it is consider under the cursor and in your backpack at the same time. You can not remove it from your backpack because it thinks it is under your cursor.  Also at the client level it sees it in your backpack and will count it also.  I hope this made sense if not I will try to explain it differently.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #10 on: November 24, 2009, 09:57:13 AM »
0
I always thought it was on your cursor, and you had to drop it to get it off. If thats the case then it's easier to do by using #lliftedID or whatever the command is to tell if you have something on your cursor.

If it's in both places, then check the cursor, if it's only on your cursor, then check the item count. One of those methods should work.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +390
  • Referrals: 1
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #11 on: November 24, 2009, 10:00:37 AM »
0
Had not thought about checking your cursor command to see if its there. I am going to do that today to find out that maybe a new mini snippet for all script to place in then as a lag/ghosting fix.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +304
  • Referrals: 1
    • View Profile
Re: Ghost Items, Move Item Subs, Etc
« Reply #12 on: November 24, 2009, 10:04:45 AM »
0
That would be very cool Mass. Let me know what you find. In the short term, I added code to re-open the containers involved every time I am moving anything in this script with a wait 10 after the bag is opened. Seems to have eliminated my issue for now.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Tags: