Author Topic: Eggscavator (Medusa keys) beta  (Read 14212 times)

0 Members and 1 Guest are viewing this topic.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Eggscavator (Medusa keys) beta
« on: May 24, 2021, 12:43:47 PM »
+1
This script needs some fine tuning, but it WORKS. I have a bug that I need help with though. When I do this with a timer or a 8 sec hard wait, it runs flawlessly. I found a way to make it run even faster though by using TM's journal scanner and checking for recharge.
The problem is that when I do use it (it's in this script version now), I get some odd errors. After the journal scanner returns #true for recharge, the script will loop back and try the same hole again, even though I ignored it in the plot_hole sub. If there are no valid snakes, it winds up double clicking the hole, which is BAD. Any thoughts?
Code: [Select]
sub charm
gosub TM_AdvJournalSync FAIL
gosub TM_AdvJournalSync Charm
set #lobjectid %flute2
wait %lagwaits
gosub TM_AdvJournalscan CHARM Valid recharge
If #result = #false
{
event macro 17
}
wait %lagwaits
gosub TM_AdvJournalscan CHARM Valid recharge

If #result = #true
{
wait 1s
gosub charm
}

set #ltargetid %target1
set #ltargetkind 1
  wait %lagwaits
event macro 22
  wait %lagwaits
gosub TM_AdvJournalscan FAIL Valid don't_seem
If #result = #true
{
wait 1s
gosub charm
}

gosub worldxyztoscreenxy %xhole %yhole %zhole
 click %_cursorx %_cursory
 ignoreitem %target2
return

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
BL_EGGScavator_V_3.txt

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #1 on: May 24, 2021, 02:36:17 PM »
+1
I find it easy in my own projects to assume I know what some logic does, but I may never go back and really scrutinize it. This leads to frustration on my part for my own work. I would guess you are down that same path with your project here... ;)

It has been a long time since I farmed Medusa keys manually - probably 8 years - so I do not remember all the rules. I am assuming that you need the flute to recharge before you can try to charm another snake and that is the 8 seconds or journal messages - is that true?

Your subroutine "charm" recursively gosubs to itself. I think this causes your "double click" issue.

Let's break down a part of your routine with comments to help see this at the end of the sub:
Code: easyuo
  1. gosub TM_AdvJournalscan FAIL Valid don't_seem ; test for a journal message and if it isn't found then rerun this subroutine
  2. If #result = #true
  3. {
  4. wait 1s
  5. gosub charm ; here is where we rerun the routine, and once we complete it, we will come out after clicking on the target and complete this execution of the routine
  6. }
  7.  
  8. gosub worldxyztoscreenxy %xhole %yhole %zhole
  9.  click %_cursorx %_cursory ; which leads to this line where we click again
  10.  ignoreitem %target2
  11. return

The reason why I have TM's quote in my sig is my respect for someone writing a functional recursive logic machine in the CLAW. That is something I would never try because I wouldn't think of it as a solution. Recursion is so hard to get working correctly, so anytime it can be done I am very impressed.

How about making this project more simple?

This has lots of code that with a few tweaks is much easier to follow, which means it is easier to understand what it is doing and how to modify it.

Change the code around your gosub Charm in the main loop to:
Code: easyuo
  1. Retry_Charm:
  2. gosub charm
  3. if #result = retry
  4.  goto Retry_Charm

Then change Charm to return with a value when you want it to run again, which eliminates the recursive nature and will fix the double (or potentially more) clicks.
Code: easyuo
  1. ;-----------------------------
  2. sub charm
  3.   gosub TM_AdvJournalSync FAIL
  4.   gosub TM_AdvJournalSync Charm
  5.   set #lobjectid %flute2
  6.   wait %lagwaits
  7.   gosub TM_AdvJournalscan CHARM Valid recharge
  8.   If #result = #false
  9.   {
  10.     event macro 17
  11.   }
  12.   wait %lagwaits
  13.   gosub TM_AdvJournalscan CHARM Valid recharge
  14.  
  15.   If #result = #true
  16.   {
  17.     wait 1s
  18.     return retry ; gosub charm
  19.   }
  20.  
  21.   set #ltargetid %target1
  22.   set #ltargetkind 1
  23.   wait %lagwaits
  24.   event macro 22
  25.   wait %lagwaits
  26.   gosub TM_AdvJournalscan FAIL Valid don't_seem
  27.   If #result = #true
  28.   {
  29.     wait 1s
  30.     return retry ; gosub charm
  31.   }
  32.  
  33.   gosub worldxyztoscreenxy %xhole %yhole %zhole
  34.   click %_cursorx %_cursory
  35.   ignoreitem %target2
  36. return clear

I still want to change the finditem statements with increasing distances. I know in my past I recommended that kind of processing to someone who wanted to check progressively further away, but I have recently done some testing on modest hardware. Many of the script speed recommendations out there are very out of date. Many go back to the pre-EUO 1.5 era - which was a different animal. I recently went to challenge some of my beliefs on how to script - I created timed tests at Luna during prime time. There were something like 200 mobile objects (players and pets) and the difference in a single finditem statement was practically the same regardless of the distance, but trying to have multiple finditem statements was significantly slower. My conclusion is that issuing the one wide range (G_20?) finditem and then looping through the data to glean what I want is 10-15x faster than doing 10 separate finditem statements.
« Last Edit: May 24, 2021, 02:38:45 PM by Gaderian »
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #2 on: May 24, 2021, 02:51:39 PM »
+1
Thank Gaderian, for all your points. You are 100% correct about the ugly nature of the inside out #finditem. Caines has been working with me (bless his patience) in trying to help me code the array as you suggest. I am learning, but still haven't got it quite right yet. That is an upcoming version. I wanted to be able to make progress, so when I hit the wall on the array, I come back to the other subs and polish those.
my basic is idea is:
Find all holes within 20 tiles.
set their x, z, id and find distance.
for each hole that is <than 10, find the closest snake to that hole.
Ignore the snake.
Once all holes within 10 have been used, MOVE to the next closest outside 10. And so on.
Ignore holes that cannont be reach, as some holes can spawn in location that they cannot be clicked on.

The ting I appreciate the most about scripting, or programming in general, is the enforced humility. 100% of the errors are YOUR fault, so never assume you are right until you check it.

I'm going now to change the loops as you suggested. I did not know that I could just throw in a line and go there! that is super cool
« Last Edit: May 24, 2021, 03:04:22 PM by baldielocks »

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #3 on: May 24, 2021, 03:59:13 PM »
+1
another snake reared it's ugly head (where's the pun  :police:)
First, made the suggested change. I still get random clicks on the hole that I don't get with just a hard wait. That's not the issue though. At the end of the charm sub, I have ignoreitem %target1 (snake id) and ignoreitem %target2 (hole id). The snake ignore appears to work, but the hole id does not. That is why it is going back to the same hole.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #4 on: May 24, 2021, 04:05:13 PM »
+1
that last post got me to thinking. Found a hanging bracket and an extra holeid ignore! And if you ignore the same ID twice, it resets it. Bingo!

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #5 on: May 24, 2021, 08:00:13 PM »
+1
Sorry that I didn't mention the extra brace. I knew that, but deleted it from the version I was working with. I found it using the ScriptUO editor and it's Tools/Syntax_Error_Check menu option.

Great catch on the toggle nature of ignoreitem.

Ignoreitem:
You could also have 3 ignoreitem lists:
1) unreachable things
2) holes already targeted
3) snakes already charmed
Anything unreachable (so likely only holes that spawn in bad locations) use no list:
ignoreitem #findid
Snakes could be found that are out of your line of sight, I would just add those to the 'snake' list, because these are mobile and could come back into range later, so when you have no more snakes found, you would want these to be come valid found objects.

Anything that is a hole that you targeted:
ignoreitem %target2 hole
Anything that is a snake charmed:
ignoreitem %target1 snake
Then you replace the hole ignoreitem reset with:
ignoreitem reset hole
And replace the snake ignoreitem reset with:
ignoreitem reset snake

You would never do a ignoreitem reset without the list parameter in the script.

#FINDDIST:
In plothole you have a test after finditem:
  if #finddist > 3 || #finddist = -1

I understand '#finddist > 3', but what does '#finddist = -1' mean?
Was this supposed to be if the hole was no found ('#findkind = -1') in the 2nd half of the test?

Variable Naming Convention:
Name variables clearly to make it obvious what is preserved:
%target1 should be %targetsnake
%target2 should be %targethole


Some logical flow questions:
sub findhole
The end of this issues a recursive gosub findhole

sub findsnake
1) The end of this issues a gosub findhole - why?

2) If there is a need to reset to begin searching again, wouldn't you want to run through the logic of 'mainloop'?

sub eggs_in_one_basket
There is a finditem and a for loop, but the first time through the loop it returns. Why have the for loop?

There is findhole and findsnake subs with nested finditem statements. Suppose you want to find the closest thing, consider this structure:
Code: easyuo
  1. sub FindClosest
  2.  if %0 <> 2
  3.   return #false
  4.  namespace push
  5.  namespace local FindClosest_
  6.  namespace clear
  7.  set !SearchFor %1
  8.  set !finddist %2 + 1 ; initialize distance of closest item found
  9.  set !SearchDist %2
  10.  finditem !SearchFor G_ , !SearchDist
  11.  if #findcnt > 0
  12.   {
  13.   for #findindex 1 #findcnt
  14.    {
  15.    if #finddist < !finddist
  16.     {
  17.     set !findid #findid
  18.     set !findx #findx
  19.     set !findy #findy
  20.     set !findz #findz
  21.     set !finddist #finddist
  22.     }
  23.    }
  24.   }
  25.  if !finddist = !SearchDist
  26.   {
  27.   set #result #false ; nothing was found
  28.   }
  29.  else
  30.   {
  31.   set #result !findid
  32.   }
  33.  namespace pop
  34. return #result
  35.  

Now you use it:
Code: easyuo
  1. gosub FindClosest %type %distance
  2. if ! #result
  3.  {
  4.  ; nothing was found in range or wrong number of parameters passed
  5.  }
  6. if #result
  7.  {
  8.  ; found a valid thing to use
  9.  ; you could go back into the namespace if you need more than just the #findid:
  10.  namespace copy find* from local FindClosest_
  11.  ; now !findid !findx, !findy, !findz and !finddist are copied into your regular namespace
  12.  }
  13.  
That eliminates having a lot of finditems in each of those find* subs and returns the closest one. Much cleaner.

Here is the example on how findsnake tag_snake would change to use that:
Code: easyuo
  1. sub findsnake
  2.  gosub FindClosest %snakes 10
  3.  if ! #result
  4.   {
  5.   ; nothing was found in range or wrong number of parameters passed
  6.     ignoreitem reset
  7.     move 710 714
  8.     gosub findhole ; I still don't understand this statement in the original, but leaving the logic untouched
  9.   }
  10.  else
  11.   {
  12.   ; found a valid thing to use
  13.   set !findid #RESULT ; we only need the ID from the snake, so no need to grab the other variables
  14.   ; to follow the example in searching for the hole, you would do the namespace copy logic...
  15.   }
  16. return
  17. ;---------------
  18. sub tag_snake
  19.   set %target1 !findid
  20.   ignoreitem !findid
  21. return
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #6 on: May 24, 2021, 09:18:46 PM »
+1
as always, good points!
FIrst, the find recursive logic. I did that because I did not think of going back to main loop! I was sorta thinking of preserving some time, but really, that is kind of illogical now. Orignally, I had the script moving back to a starting spot to restart the command, and I think that is what drove my decision to avoid going back to start.

Second, after fixing the bracket and ignore item (but not changing it to lists), the script still wound up clicking on the hole. I had to add a close cursor command to it. And if I am within 2 tiles of the hole, it still tend to double click it , which causes a reveal.

Code: [Select]
;-----------------------------
sub charm
retry_charm:
gosub TM_AdvJournalSync FAIL
gosub TM_AdvJournalSync Charm
set #lobjectid %flute2
wait %lagwaits

event macro 17
wait %lagwaits
gosub TM_AdvJournalscan CHARM Valid recharge
wait %lagwaits
If #result = #true
{
wait 1s
set #targcurs 0
 goto retry_charm
}
set #ltargetid %target1
set #ltargetkind 1
  wait %lagwaits
event macro 22
  wait %lagwaits
gosub TM_AdvJournalscan FAIL Valid don't_seem
If #result = #true
{
wait 10
gosub charm
}
wait 5
gosub worldxyztoscreenxy %xhole %yhole %zhole
 click %_cursorx %_cursory
 ignoreitem %target2
return

Third, thanks for the catch on the egg loop. The end goal for the script is mostly stationary, with moves only when the targets (hole and snake) are out of 10 tile range. The max is 12 tiles, but I want to make sure I capture close snakes on the other side of the hole too. So, the idea for the Find_eggs is when I have done x amount of holes in a loop, to scan for all possible eggs, then restart. I will remove the return and see what it does.

Fourth, the finddist -1 is because that is what shows when you don't find and item. Again, not knowing tons of logic, I was not aware I could do two terms.

Fifth. I appreciate the array examples! I had not thought of using namespace. i am rather new to playing with that, and don't know it's full power, purpose, and scope. The documentation on helps so much. I find it funny that you named the sub find closest, because I am working on a sub for the same purpose with the same name. That's about all the resemblance though.
I can use parts of what you provided to help me get something that fits the script needs. Since snakes move so fast, so much in that area, i have found it is far faster and more reliable to find a hole, find the closest snake to that hole, then go to char. So, I have been told I will  need to do and ABS calc of the snake #finddist and the hole #finddist to come up with the closest one to each other, but still within 12 tiles of ME.

Sixth. From what I can understand of the sample code, your example finds all holes within x distance of me, but I can't tell where it finds the closest. In my experience with #findid, it appears to start furthest out and go clockwise around the character. So, if I read it right, it will give me the first holes around me, but not an ordered list of closest to furthest. Closest to furthest will do several things for the script to speed it up. By the time it cycles through all the holes, all the snakes should be done, and when it re-est I won't have to worry about trying to re-charm a snake that is already charmed.

Things I don't understand from the first script sample, Find_closest.
1) if %0<>2 ; I have no clue to this.

2)  set !SearchFor %1
 set !finddist %2  + 1 ; initialize distance of closest item found
 set !SearchDist %2 ;I think %1 is the type item, and % 2 it the desired distance?

3) I'm completely missing the point of the second code snippet.

This is the code I have been working on for the last couple days. Your seems so much cleaner.

Code: [Select]
set %Search1 2  ; first search within 4 tiles
set %Search2 3
set %search3 5
;and so on
set %closestHoleID N/A
for %i 1 %holeCount
{
    set %holeX %holeX . %i
    set %closest ( %holeD - %snakeloc )
}
;still working on this part


Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #7 on: May 24, 2021, 10:29:15 PM »
+1
You are correct about the purpose of the variables in my FindClosest sub (#2 in your post).

My sub for finding the closest, loops through and returns either #false (0) which means nothing was found, or it returns the ID of the closest item to you in #RESULT. You can go and get more information about it with my code example to copy info out of the namespace - which would be useful for the hole.

%0 is how many parameters are valid and passed into this sub.
%1 is the first one passed, %2 the second one, and so on...
if %0 = 2 then 2 parameters were passed and the variables %1 and %2 are valid until either the next gosub or call or set for those variables is performed.

The "gosub findhole" in the findsnakes sub... means the script will create a target for a snake which is really a hole for 1 round. I do not believe that is what you want at all. You want to restart the process.

I am attaching my version rewritten from your original post, with the changes discussed.

What is lacking is the start of the mainloop (after getting the egg and before looking for a hole to setup as a target), you want to do a calculation for an area with both a hole and a snake. This is where the combined absolute value of the relative distances between holes and snakes is important. You will move closer to that area, then do all the work you have written here.

You always check anything with if statements. Sometimes you need while, repeat/until or combine these with a timeout and validation when you exit the loop. It will add a lot to your script(s) resiliency going forward.

« Last Edit: May 24, 2021, 10:32:59 PM by Gaderian »
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Eggscavator (Medusa keys) beta
« Reply #8 on: May 25, 2021, 07:32:11 AM »
+1
Sorry that I didn't mention the extra brace. I knew that, but deleted it from the version I was working with. I found it using the ScriptUO editor and it's Tools/Syntax_Error_Check menu option.

It does warm my heart to see people using this feature.  Without a run-time error indicator in EasyUO, this type of error drove me crazy in my early days of scripting.  Thus the feature in ScriptUO - for prevention of sanity loss.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #9 on: May 25, 2021, 07:50:39 AM »
+1
Holy cow Gaderian :o :o
Thank you for this huge boost. I never, ever expected this much help or work. I notice you left this padwan some work to do in the find_snake sub. I'm on it!

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #10 on: May 25, 2021, 08:02:05 AM »
+1
A question about timers Gaderian.
I have read your sig, and the post, many many times, and am convinced that timers are best. I HAD a timer in this script. I set
Code: [Select]
%looptimer #scnt + 8 at the start of the main loop. I used
Code: [Select]
repeat
wait 1s
until #scnt >= %looptimer /code]

Because of hole travel times, the whole cycle sometimes take more than 8 seconds. I wanted to take advantage of the travel time while waiting to recharge.
I noticed though, that the timer for some reason Always waited 8 seconds after arriving at the hole. I didnt know why, so I went with the journal check method instead

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #11 on: May 25, 2021, 09:03:39 AM »
+1
We have some other work to do before a timer revamp makes sense.

I can offer generic information about timer use.
There are several uses for timers, and each get used a little differently. Some go to the point of almost OS like functionality, where a single script controls multiple characters.

I think this project needs a timeout coded for the target cursor logic and you might benefit from one related to movement.

We can definitely work on it later... for now lunch is done and back to work. I will make up an example tonight for the cursor.
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #12 on: May 25, 2021, 11:22:41 AM »
+1
I commented things I did in the attachment. The biggest hurdle for me is I do not know how to compare the ABS result to find the closest snake when used in conjunction with your sub. Now, I could forgo that and just see what happens too once this version is functional.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
BL_EGGScavator_V_3_2.txt

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #13 on: May 25, 2021, 12:48:05 PM »
+1
ABS function works like:
Code: easyuo
  1. set %var1 %var2 - %var3 ABS
  2. ; Now var1 is the positive result of the difference of var2 and var3
  3. ; it doesn’t matter which variable was bigger
  4.  

So you can use that on a cycle of snakes and holes.

I think it would be more practical to do the distance of snakes and holes from a set standing point. This would tell you the most snakes and holes in an area. Walk there and process until you run out.

Then look for a densely populated area and go process there.
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Eggscavator (Medusa keys) beta
« Reply #14 on: May 25, 2021, 02:45:17 PM »
+1
Thank you. I think? I have a working ABS in the script V 3.2 attached, BUT I don't know how to make it work. I feel like I am missing something obvious. The example you provided suggests to me that I pass that distance to your sub, but I don't think I can because I haven't found a snake to subtract it from. I wanted to try to do the ABS value for each snake found and choose the closest, but that too is stumping me.

i did a step through of V1, after changing the %types var to % holes and setting %distance to 10 in sub find_holes. The vars do get pushed to find_closest, find closest does "see" the holes in range, and does exclude those outside. It decrements to set set #result !findid. Then when it returns to find_hole, it does not pass
If ! #result
and goes back to findhole. What did I screw up?

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
BL_EGGScavator_V_3_1.txt
« Last Edit: May 25, 2021, 02:56:42 PM by baldielocks »

Tags: