Author Topic: Exent property issue  (Read 2787 times)

0 Members and 1 Guest are viewing this topic.

Offline The GhostTopic starter

  • 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
Exent property issue
« on: August 15, 2013, 05:20:59 PM »
0
I have a sub that suppose to only trash the blackrock, but for some reason the one that have the same ID of the Diamond don't get pick up 100% of the time.  Did my sub missing something are it just a matter of timing.

Code: [Select]
Sub Clearblackrock
finditem UVF_EWF_FWF_GWF C_ , #backpackid
    for #findindex 1 #findcnt
        {
        event property #findid
        if Blackrock in #property
        set %blackrock #findid    ; Finds only Blackrock, not the Diamonds.
        }
    wait 10
    if #findcnt > 0
       {
       for %i 1 #findcnt
           {
           finditem %blackrock C_ , #backpackid
           exevent Drag #findid #findstack
           exevent Dropc %TrashBarrel 
            wait 20
           }
       }
    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: Exent property issue
« Reply #1 on: August 15, 2013, 06:46:49 PM »
0
You confused the crap out of me.... Seriously... had to change pants.

Code: [Select]
Sub Clearblackrock
finditem UVF_EWF_FWF_GWF C_ , #backpackid
    for #findindex 1 #findcnt
        {
        event property #findid
        if Blackrock in #property
        set %blackrock #findid    ; Finds only Blackrock, not the Diamonds.
        }
    wait 10
    if #findcnt > 0
       {
       for %i 1 #findcnt
           {
           finditem %blackrock C_ , #backpackid
           exevent Drag #findid #findstack
           exevent Dropc %TrashBarrel 
            wait 20
           }
       }
    return

Okay, Lets start at the beginning and work our way to the End. Starting By cutting out your excess. Instead of Setting the Blackrock and then trying to drag it, just drag it the First time you find it.


Code: [Select]
Sub Clearblackrock
finditem UVF_EWF_FWF_GWF C_ , #backpackid
    for #findindex 1 #findcnt
        {
        event property #findid
        if Blackrock in #property
       {
           exevent Drag #findid ; No need for Findstack when it doesn't stack. I think that will actually cause crashes.
           exevent Dropc %TrashBarrel 
           wait 20    ; Finds only Blackrock, not the Diamonds.
        }
        }
    return

a 100,000,000,000,000,000,000,000 more Reliable method would be to use #Findcol to distinguish between diamonds and Blackrock.

Pretty Sure Diamonds have #Findcol = 0

so you would change it to something like


Code: [Select]
finditem UVF_EWF_FWF_GWF C_ , #backpackid
    for #findindex 1 #findcnt
        {
        if #Findcol <> 0
       {
           exevent Drag #findid ; No need for Findstack when it doesn't stack. I think that will actually cause crashes.
           exevent Dropc %TrashBarrel 
           wait 20    ; Finds only Blackrock, not the Diamonds.
        }
        }

Remember, the simple way is usually the best way.
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 The GhostTopic starter

  • 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: Exent property issue
« Reply #2 on: August 15, 2013, 07:09:07 PM »
0
Thx.  trying the mod right now.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Exent property issue
« Reply #3 on: August 16, 2013, 07:02:15 AM »
0
The reason you original code was not working is that you loop through all the blackrock types 1 at a time and if it says blackrock you set the var %blackrock to its value.  Then you loop again and find the item held in blackrock and dump it.

Now think about it  say i have 30 black rock and zero diamonds... in the first loop i set %blackrock to the first items id, then i reset it to the 2nd, then 3rd, 4th .. 5th.....etc to 30th.

So being as %blackrock only holds the last value set. The loop that follows even thow goes from 1-30 can only ever dump the last bit of blackrock and no others.

Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline The GhostTopic starter

  • 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: Exent property issue
« Reply #4 on: August 16, 2013, 01:19:30 PM »
0
manwinc  I have try  both sub and their are still drop some in my secure.  thx for cleaning up the sub  for 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: +123
  • Referrals: 1
    • View Profile
Re: Exent property issue
« Reply #5 on: August 16, 2013, 05:05:37 PM »
0
No problem!

If you ever have a question like that just post it up. We will try and help you sort things out. More than 1 way to skin a cat :)
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: