Author Topic: Sometimes it loots... sometimes it does not....  (Read 4957 times)

0 Members and 1 Guest are viewing this topic.

Offline decloTopic starter

  • Jr. Member
  • **
  • Posts: 90
  • Activity:
    0%
  • Reputation Power: 2
  • declo has no influence.
  • Respect: +16
  • Referrals: 1
    • View Profile
Sometimes it loots... sometimes it does not....
« on: October 07, 2016, 10:00:46 AM »
0
Sometimes it loots... sometimes it does not....  What have am I missing? 

Trying to get this sub to work all the time rather than 50/50ish.  Would love any input!

Code: [Select]
sub lootrock
finditem YFM G_2
if #finditem = -1
   return
wait 20
set #lobjectid #findid
wait 20
set %lootContainer #findid
wait 20
event macro 17 0
gosub wfcontainer container_gump 144_212
if ! #result
   {
   ignoreitem %dead
   goto start
   }
wait 10
if #contsize <> 144_212
   {
   ignoreitem %dead
   goto start
   }
wait 60
finditem POF C_ , %lootContainer
exevent drag #findid #findstack
wait 20
exevent DropC #backpackid
wait 12
hideitem %lootContainer
wait 12
return


;===============================
;Waiting for Container to open
;===============================
sub wfcontainer
set %waittime 120
set %wfgump #sCnt2 + %waittime
gosub wfopen contname %1 contsize %2
return #result

sub wfopen
wfo:
if # . %1 = %2 && # . %3 = %4
   return #true
if %wfgump < #scnt2
    return #false
goto wfo


Offline Tidus

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Sometimes it loots... sometimes it does not....
« Reply #1 on: October 11, 2016, 06:26:06 AM »
0
Could be timing that it is not seeing the item in the container after it opens.  It could also be that there is more than one Item Type for the item. Not sure what items you are looting. 

One way to do it is to add it messages as it goes through the loot process that tells you what it did or did not do.  Takes a bit more logic to add, but it can really help debug when it comes to looting problems.
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline decloTopic starter

  • Jr. Member
  • **
  • Posts: 90
  • Activity:
    0%
  • Reputation Power: 2
  • declo has no influence.
  • Respect: +16
  • Referrals: 1
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #2 on: October 14, 2016, 09:15:11 AM »
0
Where would be the best location to adjust the timing if it's not seeing the gold?  Placing a wait after the finditem and before the exevent drag?

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #3 on: October 14, 2016, 12:26:08 PM »
0
First question that come to mind is why do you use  goto start to exit a Sub routine.

if #contsize <> 144_212 ; can I assume that the size of the corpse

You can try this to loot gold
Code: [Select]
sub lootrock
finditem YFM G_2
  if #finditem = -1
    return
 set #lobjectID %lootContainer
 set #lobjectID #findID
 event macro 17
  wait 10
finditem POF C_ , %lootContainer
if #FINDCNT > 0  ; if you find any gold it will loot
{
exevent drag #findid #findstack
wait 15
exevent dropc #BackPackID
wait 15
}
hideitem %lootContainer
wait 10
return

Offline decloTopic starter

  • Jr. Member
  • **
  • Posts: 90
  • Activity:
    0%
  • Reputation Power: 2
  • declo has no influence.
  • Respect: +16
  • Referrals: 1
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #4 on: October 23, 2016, 12:55:54 PM »
0
You can try this to loot gold
Code: [Select]
sub lootrock
finditem YFM G_2
  if #finditem = -1
    return
 set #lobjectID %lootContainer
 set #lobjectID #findID
 event macro 17
  wait 10
finditem POF C_ , %lootContainer
if #FINDCNT > 0  ; if you find any gold it will loot
{
exevent drag #findid #findstack
wait 15
exevent dropc #BackPackID
wait 15
}
hideitem %lootContainer
wait 10
return
[/quote]

I tweaked to your example.  Still oddly skips looting a corpse now and then... not sure why.  Tried longer waits to see if lag related.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #5 on: October 23, 2016, 01:45:39 PM »
0
Try this if that work better. 

Code: [Select]
sub lootrock
finditem YFM G_2
    if #findkind = -1
        return
 set #lobjectID #findID
 event macro 17
ignoreitem #findid
  wait 10
IF #CONTTYPE = YFM
     set %corpse #contid
finditem POF C_ , %corpse
if #FINDCNT > 0  ; if you find any gold it will loot
{
exevent drag #findid #findstack
wait 15
exevent dropc #BackPackID
wait 15
}

wait 10
return

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: +123
  • Referrals: 1
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #6 on: October 23, 2016, 02:08:00 PM »
0
What I've always had to do is just ignore the Loot Container and just check all containers that aren't your backpack.


Code: [Select]
Finditem POF C
For #Findindex 1 #Findcnt
{
if #Findbagid <> #Backpackid
{
; Loot
}
}

This prevents any errors that come from not getting the property container id.
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 decloTopic starter

  • Jr. Member
  • **
  • Posts: 90
  • Activity:
    0%
  • Reputation Power: 2
  • declo has no influence.
  • Respect: +16
  • Referrals: 1
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #7 on: October 23, 2016, 05:42:41 PM »
0
Try this if that work better. 

Code: [Select]
sub lootrock
finditem YFM G_2
    if #findkind = -1
        return
 set #lobjectID #findID
 event macro 17
ignoreitem #findid
  wait 10
IF #CONTTYPE = YFM
     set %corpse #contid
finditem POF C_ , %corpse
if #FINDCNT > 0  ; if you find any gold it will loot
{
exevent drag #findid #findstack
wait 15
exevent dropc #BackPackID
wait 15
}

wait 10
return

That did it!!  So far, 30 minutes, no missed gold.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #8 on: October 23, 2016, 06:39:48 PM »
0
glad it work, 

Trial and error  that how u learn

Offline decloTopic starter

  • Jr. Member
  • **
  • Posts: 90
  • Activity:
    0%
  • Reputation Power: 2
  • declo has no influence.
  • Respect: +16
  • Referrals: 1
    • View Profile
Re: Sometimes it loots... sometimes it does not....
« Reply #9 on: October 23, 2016, 06:49:11 PM »
0
I have been hitting a wall for several weeks.  Appreciate it!

Tags: