Author Topic: slowpoke beetles + handling the drop, help needed  (Read 4132 times)

0 Members and 1 Guest are viewing this topic.

Offline GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
slowpoke beetles + handling the drop, help needed
« on: October 23, 2015, 05:04:14 AM »
0
Hey folks,

I've got a handy little script that lets me assign items to a list quickly and just walk around to load my beetle up. It's been helpful for all sorts of things from mining to picking up(and/or dropping) runes to redecorating. The thing is while walking around it works great but as soon as I run at all the drops sometimes fail because the beetle is more than 2 tiles away momentarily. I was making due with a small delay in the drop but that doesn't work with my ninja when in animal form... the beetle doesn't always keep up.

I'm having trouble getting a reliable check in the code to make sure the beetle is close enough to drop on before dropping. I've tried checking to make sure the beetle is within G_2 but doing that and adding a delay is causing it to glitch a bit too often. Is there a way to simply NOT do the drop until the beetle is in range without using a set delay time?

example of a glitch: I added a finditem for the beetle within G_2 and looped until it returned true but this forced me to stop whatever I was doing and stand still or the beetle might get within G_2 momentarily and be at G_3+ by the time the drop happens...

example of the code(simplified)

Code: [Select]
set %beetleID XXXXXX
set %stuffTypes BLAH_BLAH_BLAH
gosub beetleAction
;-------------------
sub beetleAction
finditem %stuffTypes G_2
if #FINDCNT > 0
{
  exevent drag #FINDID
  wait 10
  exevent dropc %beetleID
  wait 12
gosub beetleAction
}

If there is a rock solid way to handle the drop with slowpoke beetles I'd love to know, thanks in advance for any pointers.

Offline addicted

  • Jr. Member
  • **
  • Posts: 19
  • Activity:
    0%
  • Reputation Power: 1
  • addicted has no influence.
  • Respect: +3
  • Referrals: 1
    • View Profile
Re: slowpoke beetles + handling the drop, help needed
« Reply #1 on: October 23, 2015, 07:32:44 AM »
0
as far i know a solid way is using the Ball of pet summoning so you can run fast as you want.
ofc it's a bit expensive if the items don't worth the powder.

why you don't just load your #backpackid and only when the beetle is at G_1 drop on it?

dunno maybe i don't understand what do you want to do :D
« Last Edit: October 23, 2015, 07:39:31 AM by addicted »

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: slowpoke beetles + handling the drop, help needed
« Reply #2 on: October 23, 2015, 11:13:28 AM »
0
you had recursive code with no exit.   A sub that calls itself repeatedly.

Code: [Select]
set %beetleID XXXXXX
set %stuffTypes BLAH_BLAH_BLAH
Repeat
   gosub beetleAction
until  #charghost = yes
halt
;-------------------
sub beetleAction
  finditem %beetleID G_2
  If #findcnt > 0
     {   ; beetle is near me so i can drag stuff
     finditem %stuffTypes G_2
     if #FINDCNT > 0
       {    
        exevent drag #FINDID
        wait 10
        exevent dropc %beetleID
        wait 12
       }
   }
return
« Last Edit: October 23, 2015, 11:17:02 AM by Endless Night »
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 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: slowpoke beetles + handling the drop, help needed
« Reply #3 on: October 23, 2015, 11:16:48 AM »
0
Rethinking about this if you are permanently moving then this might work... all untested

Code: [Select]
set %beetleID XXXXXX
set %stuffTypes BLAH_BLAH_BLAH
Repeat
   gosub beetleAction
until  #charghost = yes
halt
;-------------------
sub beetleAction
   finditem %stuffTypes G_2
   if #FINDCNT > 0
     {    
      exevent drag #FINDID
      wait 10
      repeat    ; loop until beetle is close... of course you cannot pickup again until you drop so you should stop moving.
         finditem %beetleID G_2
      until #findcnt > 0
      exevent dropc %beetleID
      wait 12
     }
return
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 GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
Re: slowpoke beetles + handling the drop, help needed
« Reply #4 on: October 23, 2015, 01:32:35 PM »
0
Both great examples, thank you. I'm just trying to work out possible scenarios in which they may cause problems...

one possible problem, If my beetle gets attacked after I've performed the drag and it is out of range I will not be able to drop the items and will be blocked from casting or doing much to help the beetle. I could call it, or run to it to drop the items in hopes of being able to then cast to save it, but if it should die then I am completely stuck and have to run to survive. Hmm, if the item being dragged is too heavy for me then I'd sit there and die as well  :-X

The solutions are good however, a way is needed to "hit abort" on the drag after I've done it if I can't reach the beetle for the drop, I had previously asked about that in another thread here - http://www.scriptuo.com/index.php?topic=13437.0

Thanks for the pointers!

Offline GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
Re: slowpoke beetles + handling the drop, help needed
« Reply #5 on: October 23, 2015, 01:45:18 PM »
0
Now tested, repeating the finditem %beetleID search within 2 tiles until it is found before dropping works reliably. Well, it worked almost every time, the first time it glitched because I had something else performing an event in the background. I don't think that's because of this code though, I turned it off and it worked.

Couple other questions

#1 - Is it a good idea in general to double up the drop line in case the first fails(due to lag, etc)? ie:
Code: [Select]
exevent dropc %beetleID
exevent dropc %beetleID ;this line is the double to the one above it. Degrades nicely but does it make the script more reliable?

#2 - Is it good to use an ignoreitem after the drop to make sure the script doesn't somehow keep trying to handle a dropped item? This would have the benefit of my being able to dump the item on the ground again and not have it instantly picked up.

Thanks again


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: slowpoke beetles + handling the drop, help needed
« Reply #6 on: October 23, 2015, 02:53:00 PM »
0
As if was explain to me.
Code: [Select]
if #FINDCNT > 0 kept count of what was found and therefor can loop to drop items where you want it.

as to enter a double line
Code: [Select]
exevent dropc %beetleIDit definitely not a good idea. It like trying to perform the same action twice.
this what I use to drag an drop items. 
Code: [Select]
{
   exevent drag #findid #findstack
   exevent dropc #backpackid
   wait 30
  }
If you are afraid of lag you can add a wait 20 in between  both event.

Tags: