Jump to content
AC Tool Forums
Sign in to follow this  
Perilous

Game crashes when SetActiveWindow attempted

Recommended Posts

that just does not make sense, Can you try to get an image with the window border? That might help me figure out one of the issues i'm seeing. but it does not explain what the 143, 80 puts the cursor on the healer's health bar. But the 97, 177 does not put the cursor on the group member's healt bar.

Share this post


Link to post
Share on other sites

Ok, to simplify things and give you an exact rendering of their positions I took pictures of my screen with my phone. Here are the images with the mouse pointer in view:

97, 177:

97x177.jpg

143x80:

143x80.jpg

Edited by Perilous

Share this post


Link to post
Share on other sites

The reason I ask is because XLoc1 and YLoc1 would not be 97, 177. To help you see what I am talking about. Add the following lines just before the MousePos(XLoc1, YLoc1);

 

TimeStamp('XLoc1: '+IntToStr(XLoc1));
TimeStamp('YLoc1: '+IntToStr(YLoc1));
TimeStamp('');

 

Share this post


Link to post
Share on other sites

Actually, from my testing it only shoots off to the Desktop when I added those additional lines into the test script as a second repositioning of the mouse cursor. When I merely alter the test script's original code and replace the original locs with those coords it stays within the confines of the 1024x768 client.

Share this post


Link to post
Share on other sites

To be exact, the coords are 97, 173 but I see what you mean. Below are the testlog results:

TimeStamp: 10/28/2019 04:47:45:242 pm - XLoc1: 857
TimeStamp: 10/28/2019 04:47:45:243 pm - YLoc1: 489
TimeStamp: 10/28/2019 04:47:45:243 pm -

However, there is no doubt that it is placing the mouse cursor in exactly the right spot on the target's health bar at the 40% mark.

Share this post


Link to post
Share on other sites

Okay, that is what I needed to hear. We will stick to the 97, 177 and 143, 80 for the coordinates. Until such time as we find it does not work as it should.

Share this post


Link to post
Share on other sites

Okay, here is the new script. So, lets give it a try. It will post debug information to the Test Log. So, when we are done testing it. Change the Debug from being true to False. Also, I had made it so that you can have the Target macro and the Healing Spell in what ever hotslot that you want. Just read the comments at the beginning of the script. And make any necessary changes.

 

 

EDITED: removed file

 

Share this post


Link to post
Share on other sites

The new script will target/follow the healee and also heals non-stop when the target doesn't require any.

I think there is little doubt left that somehow it is not focused on the correct spot for determining color.

TimeStamp: 10/28/2019 05:13:35:700 pm - Setting mywow2 as the active window.
TimeStamp: 10/28/2019 05:13:36:717 pm - Targeting the groupmember to auto heal.
TimeStamp: 10/28/2019 05:13:37:724 pm - Checking to see if need to heal groupmember.
TimeStamp: 10/28/2019 05:13:37:744 pm - Checking to see if need to heal self.
TimeStamp: 10/28/2019 05:13:37:761 pm - Targeting Self.
TimeStamp: 10/28/2019 05:13:38:268 pm - Healing self.
TimeStamp: 10/28/2019 05:13:40:274 pm - Re-Targeting the groupmember.

Share this post


Link to post
Share on other sites

And yet.. I modified the MousePos script as follows and everything checks out. At full health I get the popup saying No Healing Needed. When at 20% health I got the popup saying he Needs Healing. It is working as it should, except for the constant healing when not needed.

uses
  Classes, Dialogs, Divide;

var
  // Define Global variables
  XLoc1;
  YLoc1;

begin
  SetActiveWindow('mywow2');
  Delay(2, 'sec');

  // Set the global variables with the pixel location
  XLoc1 := WindowLeft + 97;
  YLoc1 := WindowTop + 173;

  if not Isgreen(WindowLeft + 97, WindowTop + 173) then
    MessageDlg('Needs Healing', mtInformation, mbOK, 0);
  else
    MessageDlg('Does Not Need Healing', mtError, mbOK, 0);

end;

 

Share this post


Link to post
Share on other sites

Correction!

I thought the healer was healing the target non-stop when not needed, but in actuality she is self-healing non-stop when not needed. TestLog results confirm:

TimeStamp: 10/28/2019 05:48:57:780 pm - Setting mywow2 as the active window.
TimeStamp: 10/28/2019 05:48:58:795 pm - Targeting the groupmember to auto heal.
TimeStamp: 10/28/2019 05:48:59:802 pm - Checking to see if need to heal groupmember.
TimeStamp: 10/28/2019 05:48:59:815 pm - Checking to see if need to heal self.
TimeStamp: 10/28/2019 05:48:59:833 pm - Targeting Self.
TimeStamp: 10/28/2019 05:49:00:339 pm - Healing self.
TimeStamp: 10/28/2019 05:49:02:345 pm - Re-Targeting the groupmember.
TimeStamp: 10/28/2019 05:49:02:851 pm - Checking to see if need to heal groupmember.
TimeStamp: 10/28/2019 05:49:02:869 pm - Checking to see if need to heal self.
TimeStamp: 10/28/2019 05:49:02:885 pm - Targeting Self.
TimeStamp: 10/28/2019 05:49:03:391 pm - Healing self.
TimeStamp: 10/28/2019 05:49:05:399 pm - Re-Targeting the groupmember.
TimeStamp: 10/28/2019 05:49:05:908 pm - Checking to see if need to heal groupmember.
TimeStamp: 10/28/2019 05:49:05:920 pm - Checking to see if need to heal self.
TimeStamp: 10/28/2019 05:49:05:937 pm - Targeting Self.
TimeStamp: 10/28/2019 05:49:06:444 pm - Healing self.
TimeStamp: 10/28/2019 05:49:08:451 pm - Re-Targeting the groupmember.

I will re-confirm MousePos for the healer.

Share this post


Link to post
Share on other sites

Ok, the test log is showing that the script is trying to heal the healer, not the person to be healed. it is bypassing the healing of the groupmember. And it is constantly trying to heal the healer.

And I think i know why it is bypassing the groupmember. We had decided to use the 97, 177 coordinates. but, i had use the WindowLeft+97, WindowTop+173, which is the same as the XLoc1, and YLoc1.

And the reason it might be trying to constantly heal the healer, is because of where it is looking. The numbers might be interfering with the check. We will have to adjust the coordinates on the X axis so that the numbers does not interfere.

I have added comments at the beginning of the script, about it/description/instructions/etc. And I have made two changes, based on the current results.

I commented out line 130 and added line 131 to be as we were going to do. I then adjusted the coordinates in line 144 to hopefully cause the check to be not on a number.

So, give the new script a try. and if the healer is self healing all the time. Adjust the 146 in line 144 until you get the right place that works.

 

 

EDITED: removed file

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.