ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Crisis on March 10, 2015, 08:19:30 PM

Title: Finding the Queen
Post by: Crisis on March 10, 2015, 08:19:30 PM
Ok, I am using EN's snippet for finding the queen

Code: [Select]
gosub ENs_findAntQueen
halt

sub ENs_FindAntQueen
  If %QueenLoopValueMax = N/A
    gosub SetupQueenLoopValues
  set !queenfound #False
  set !Loopvalue 0
  repeat
    gosub queenmove !loopvalue
    gosub findqueen
  until #result   ; queen found
  wait 5
Return

sub FindQueen
  set #result #false
  finditem OHB G_7
  If #Findcnt > 0
    {
    set !exit 15
    Repeat
      finditem OHB G_7
      Event Pathfind #findx #findy #findz  ; the queen
      wait 1
      set !exit !exit -1
      finditem OHB G_2
    Until !exit < 1 || #findcnt > 0
    set #result #findcnt > 0
    }
Return #Result

Sub QueenMove
    set !x %QueenLoopValuex . %1
    set !y %QueenLoopValuey . %1
    set !z %QueenLoopValuez . %1
    set !Exit 20
    Repeat
      set !Exit !exit - 1
      event pathfind !x !y !z
      wait 1
    Until ( #Charposx = !x && #charposy = !y ) || !exit < 1
    set !loopvalue !loopValue + 1
    If !loopvalue >= %QueenLoopValueMAx
      set !LoopValue 1
REturn

sub SetupQueenLoopValues
  gosub AddQueenloopvalue 5805 1908 3
  gosub AddQueenloopvalue 5803 1896 2
  gosub AddQueenloopvalue 5796 1889 2
  gosub AddQueenloopvalue 5788 1881 2
  gosub AddQueenloopvalue 5779 1872 0
  gosub AddQueenloopvalue 5770 1872 1
  gosub AddQueenloopvalue 5761 1876 0
  gosub AddQueenloopvalue 5755 1885 0
  gosub AddQueenloopvalue 5752 1895 2
  gosub AddQueenloopvalue 5756 1905 2
  gosub AddQueenloopvalue 5759 1910 5
  gosub AddQueenloopvalue 5769 1919 1
  gosub AddQueenloopvalue 5776 1924 3
  gosub AddQueenloopvalue 5780 1931 1
  gosub AddQueenloopvalue 5788 1933 4
  gosub AddQueenloopvalue 5796 1925 2
  gosub AddQueenloopvalue 5805 1915 3
  gosub AddQueenloopvalue 5810 1918 1
  gosub AddQueenloopvalue 5806 1925 3
  gosub AddQueenloopvalue 5799 1930 2
  gosub AddQueenloopvalue 5794 1926 4
  gosub AddQueenloopvalue 5797 1918 3
  gosub AddQueenloopvalue 5790 1913 3
  gosub AddQueenloopvalue 5781 1907 2
  gosub AddQueenloopvalue 5772 1904 1
  gosub AddQueenloopvalue 5764 1897 3
  gosub AddQueenloopvalue 5769 1889 1
  gosub AddQueenloopvalue 5775 1887 4
  gosub AddQueenloopvalue 5782 1894 1
  gosub AddQueenloopvalue 5777 1899 20
  gosub AddQueenloopvalue 5784 1900 0
  gosub AddQueenloopvalue 5789 1906 0
  gosub AddQueenloopvalue 5795 1912 4
  gosub AddQueenloopvalue 5801 1918 2
  gosub AddQueenloopvalue 5803 1916 5
  gosub AddQueenloopvalue 5807 1911 3
Return

sub AddQueenLoopValue
  if %QueenLoopValueMAx = N/A
     set %QueenLoopValueMax 0
  set %QueenLoopValueMAx %QueenLoopValueMax + 1
  set %QueenLoopValuex . %QueenLoopValueMax   %1
  set %QueenLoopValuey . %QueenLoopValueMax   %2
  set %QueenLoopValuez . %QueenLoopValueMax   %3
Return

I had to use goto commands to get to the hole that he uses as his starting point as mine recalls in and runs through the Trinsic hole and then related holes to get there but I have one other question. I need to drop the seed onto the matriarch. His snippet has it stop on the queen, does this snippet follow the queen if she moves or does it stop once it finds here? I cannot tell I need to add in another sub to drop the seed onto her to start the quest if his snippet stops there and if it doesn't I guess I need to add it in??
Title: Re: Finding the Queen
Post by: The Ghost on March 11, 2015, 10:45:49 AM
IT stop at the queen,  You need to add a new gosub to follow and drop a seed.     It snippet is make to start front the hold at bottom right.   
Title: Re: Finding the Queen
Post by: Ketchup on March 11, 2015, 12:31:49 PM
You working on a powder script Crisis?
Title: Re: Finding the Queen
Post by: Crisis on March 11, 2015, 01:21:34 PM
Yes, I am trying anyways lol.
Title: Re: Finding the Queen
Post by: Tidus on March 11, 2015, 01:27:20 PM
I started on one...  didn't get far.  I could always resurrect it or give you what i have. NOt sure what all i did on it though...
Title: Re: Finding the Queen
Post by: Crisis on March 11, 2015, 03:36:52 PM
I started on one...  didn't get far.  I could always resurrect it or give you what i have. NOt sure what all i did on it though...

That would be great!
Title: Re: Finding the Queen
Post by: Tidus on March 11, 2015, 04:02:13 PM
So I can't find my most recent of it.. but this is where I made it... looks to be as far as you did.. LOL
Title: Re: Finding the Queen
Post by: Crisis on March 11, 2015, 07:03:29 PM
I am trying to drop a seed onto the matriarch queen. I know I am way off (yeah I tested it lol) so how far off am I?

Code: [Select]
sub dropseed
finditem %matriarch G_2
If #Findcnt > 0
{
exevent drag %seed
exevent dropc %matriarch
wait 5
gosub acceptquest
}
return
Title: Re: Finding the Queen
Post by: Tidus on March 11, 2015, 07:58:45 PM
i think it has to do with that the Queen is not a container.... I will have to think about this when I am lucid
Title: Re: Finding the Queen
Post by: Crisis on March 12, 2015, 02:31:04 AM
I thought about that but I also thought that since it was only dropped on the queen it might work. Well I guess I was more hoping it would work.
Title: Re: Finding the Queen
Post by: Crisis on March 12, 2015, 05:58:45 PM
Okay, this little snippet didn't work either but I think I am on the right path

Code: [Select]
set %seed PDF
set %matriarch OHB

wait 5
gosub feed

sub feed

   finditem %seed C_ , %container
   wait 10
   if #findkind > 0

   exevent drag #findid
   wait 20
   exevent dropc %matriarch
   wait 1s
Title: Re: Finding the Queen
Post by: manwinc on March 12, 2015, 07:01:04 PM
You need to get the matriarch's id before that


Finditem %Matriarch G_2
Exevent dropc #Findid
Title: Re: Finding the Queen
Post by: Crisis on March 12, 2015, 07:17:55 PM
I also found out that I had container instead of backpackid but unfortunately it is still not working :(

Code: [Select]
set %seed PDF
set %matriarch OHB

wait 5
gosub feed

sub feed

   finditem %seed C_ , %backpackid
   wait 10
   if #findkind > 0
   {
   exevent drag #findid
   wait 20
   Finditem %matriarch G_2
   Exevent dropc #Findid
   wait 1s
   }
Title: Re: Finding the Queen
Post by: Tidus on March 12, 2015, 07:50:54 PM
%backpackid should be #backpackid
Title: Re: Finding the Queen
Post by: Crisis on March 13, 2015, 02:49:38 AM
Thanks Tidus And Manwinc, I made both of those changes and still had no luck. I knew there had to be something else I was missing in addition to those things.

I got looking at
Code: [Select]
if #Findkind > 0 and was wondering if it should be findcnt because it was looking for a count of the item so I changed it to
Code: [Select]
if #findcnt > 0 and it worked.

I had also added in
Code: [Select]
set %backpackid XXXXXX just in case it needed that. I didn't think it should but I wasn't sure. Do I need that in there or is that something that I can take out?

so my sub now looks like
Code: [Select]
sub dropseed

   Finditem %seed C_ , #backpackid
   wait 10
   if #Findcnt > 0
   {
   Exevent drag #Findid
   wait 10
   Finditem %matriarch G_2
   Exevent dropc #Findid
   wait 1s
   }
return

This will be set at the beginning of the script

Code: [Select]
set %seed PDF
set %matriarch OHB
set %backpackid QNVOUND

I am not sure why I named it feed originally other than when I was thinking about it not working because of the npc not being a container, I started thinking that dropping the seed on the queen would be similar to feeding a pet. I just caught it now that I had named the sub feed lol.

One more question along with the backpackid

Do I need the { } around the action of dropping the seed? I was not sure but it seemed like I should so I added them in there but on other drag and drop things I have looked at they are not there.
Title: Re: Finding the Queen
Post by: The Ghost on March 13, 2015, 11:54:50 AM
U mihgt have to try to do a LTARGETID. and drop it on it.   THat what you have to do for a blue bettle.
Title: Re: Finding the Queen
Post by: Crisis on March 13, 2015, 12:28:38 PM
The last sub I posted worked great and it will drop the seed on the queen and bring up the quest gump. I am going to modify your quest acceptance gump from the seed script yo accept this.

Here is where I am at with what I have done (Still want to do tweaks and adjustments though):

1. Recall sub in place (Thanks TM - though I need to make the changes that he suggested so that if a hole is blocked, it won't go on to the next rune)
2. Recalls to the Trinsic Solen Hole, drops in and travels through the different routes/holes and gets to the area with the Matriarch. (Thanks EN for the Enter Ant Hole sub)
3. EN's rails running around the area looking for the queen. (It works but I may be missing something because the movement looks like someone is having a seizure while controlling the character and it spams pathfinding non-stop)
4. Working sub to drop seed onto the queen bringing up the quest. (final version will have the choice for Friend of the Solens (quests using seed to become friendly which upon completion will start looping with just talking to the matriarch to keep getting powder) and the the looping powder quest.

Here is what I have left: (might take me quite a while lol)
1. Accept quest (thanks Ghost)
2. Recall to wind and autofight solens to kill 7 and then stay and fight until it collects 200 zoogi)
3. Recall and rail to matriarch, turn in quest killing 7 solens and accept next part needing pitchers (8 pitchers will be a prerequisite and a rune must be marked with access to a water trough to refill empty pitchers - Thanks EN for the Fill Pitcher Sub)
4. Turn in that quest then accept powder quest and target and turn in zoogi for powder
5. Start over
Title: Re: Finding the Queen
Post by: Endless Night on April 05, 2015, 04:05:07 PM
3. EN's rails running around the area looking for the queen. (It works but I may be missing something because the movement looks like someone is having a seizure while controlling the character and it spams pathfinding non-stop)

LOL good description...  That ground is very rocky,  the trick is to find rail spots that have simular Z positions  so you dont go up and down so much.

The rail system that i use in my character toolbox probably is a better fit for running the ants nest as it doesn't use z axis at all and only uses  simple movement based commands.   Sadly i didn't release those subs as a separate module but they can be found in my "character toolbox" script  search for  "simple movement recording"

Good luck on the ant project...