Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Sun Sep 20, 2020 3:24 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Wed Sep 09, 2020 9:28 am 
New User
New User



Joined: Sun Sep 06, 2020 12:08 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 13
So I've been trying to figure this one out all day and it's a serious headache for me. I'm using macroblitz's auto farming script as a base and I am tweaking to my own needs and I understand 90% of the logic HOWEVER I can't seem to figure out this loop problem. I'm trying to make it so when my character fails to kill a monster for "x" amount of attempts or seconds it will teleport away. Some tiles are flagged "unwalkable" such as cliffs and walls but the character will still attempt to attack monsters that are unreachable.

if Color.Pixel pattern can be located on screen("0,0,0,-5,0,0,0,0,2,-3,0,0,0,3,0,0,0,0,-3,3,0,0,0,0,4,0,0,0,3,3,0,0,0,2,-2,0,0,0,3,-2,0,0,0,-2,-1,0,0,0,4,1,0,0,0,-4,4,0,0,0,3,0,0,0,0,2,-1,0,0,0,1,-1,0,0,0,1,-3,0,0,0,2,-1,0,0,0,1,-2,0,0,0,1,3,0,0,0,-1,3,0,0,0,0,2,0,0,0,2,-1,0,0,0,1,-1,0,0,0,1,-2,0,0,0,0,-1,0,0,0,4,-2,0,0,0,-2,0,0,0,0,2,3,0,0,0,0,2,0,0,0,3,0,0,0,0,0,-6,0,0,0,0,3,0,0,0,0,2,0,0,0,3,-2,0,0,0,-1,4,0,0,0,-2,1,0,0,0,-5,-4,0,0,0", "0")
begin loop()
Macro.Get parent loop iteration("count")
Variable.Set("x", "{count}")
if Variable.Is equal to("x","30")
begin
Function.Execute("FlyWithoutCondition")
end
Macro.Pause("100")

Problem with this method is that BE will start counting as soon as it detects the monster's name regardless of whether the character is stuck or not. After 30 counts it will teleport once and stop working. Yes I know about Macro.Restart loop iteration but that doesn't really solve the first issue.

I've also messed around with Macro. Read stopwatch compared to a set variable (I tried every 15 seconds) but that just makes the character teleport every 15 seconds. Something like this:

if Color.Pixel pattern can be located on screen("0,0,0,-5,0,0,0,0,2,-3,0,0,0,3,0,0,0,0,-3,3,0,0,0,0,4,0,0,0,3,3,0,0,0,2,-2,0,0,0,3,-2,0,0,0,-2,-1,0,0,0,4,1,0,0,0,-4,4,0,0,0,3,0,0,0,0,2,-1,0,0,0,1,-1,0,0,0,1,-3,0,0,0,2,-1,0,0,0,1,-2,0,0,0,1,3,0,0,0,-1,3,0,0,0,0,2,0,0,0,2,-1,0,0,0,1,-1,0,0,0,1,-2,0,0,0,0,-1,0,0,0,4,-2,0,0,0,-2,0,0,0,0,2,3,0,0,0,0,2,0,0,0,3,0,0,0,0,0,-6,0,0,0,0,3,0,0,0,0,2,0,0,0,3,-2,0,0,0,-1,4,0,0,0,-2,1,0,0,0,-5,-4,0,0,0", "0")
begin
Macro.Read stopwatch("Time", "waitTime")
if Variable.Is greater than (Math)("waitTime", "15000")
begin
autofly etc etc


I am thinking of adding in to my attack function something that goes like this:
1. Character attempts to attack monster
2. Gets stuck (i.e trying to attack from behind wall or cliff)
3. BE recognizes the state of my character
4. Will attempt to kill the monster until "x" amount of attempts or duration in seconds has passed
5. If unsuccessful will teleport away

I apologize I am still very new to all this. Just started literally a couple of days ago so please go easy on me :oops:


Top
 Profile  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Thu Sep 10, 2020 2:40 am 
New User
New User



Joined: Sun Sep 06, 2020 12:08 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 13
Nevermind guys I actually figured it out. Everything is working perfectly now :D :D :D


Top
 Profile  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 1 time(s)  Unread post Posted: Sat Sep 12, 2020 8:58 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2110
Location: USA
Been thanked: 488 time(s)
Has thanked: 37 time(s)
Contribution Points: 17260
Yea the scripts you posted were missing #3 (from what you were going to try).

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Sun Sep 13, 2020 12:31 am 
New User
New User



Joined: Sun Sep 06, 2020 12:08 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 13
Yes it was pretty tricky to figure out a solution but the start and reset stopwatch macro ended up being perfect along with some color editing for the in game sprites although I never managed to figure out how to get the reset loop iteration to work. Every time I checked the log the count never reset back to 0, instead it just kept going on and on i.e 39, 40.....50,51 etc.

Right now I'm working on a new project to get multiple clients running in the background with a dedicated macro for each one and I'm getting pretty close. This thread was the inspiration viewtopic.php?f=279&t=24878

Learning something new everyday :D

Also I forgot to properly thank you for helping me with the license activation Syrifina. Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Sun Sep 13, 2020 7:13 am 


Ok so I didn't want to start another topic so I'll ask here. I have my dual client script setup and its working 99% EXCEPT for one command I've been trying to use albiet without success. It's the Window. Send mouse click. Couple of things I want to note:

1. Yes I have successfully installed virtual drivers and have it selected as the input option for both mouse and kb in settings.
2. Game (Ragnarok Online) has EAC protection BUT I tested Window. Send press keys with success so I know the clicks and keystrokes are not being blocked by the anti cheat.

I am having the same exact problem as OP in this thread http://blueeye-macro.com/viewtopic.php?f=122&t=4042

Coordinates are not being recognized. When I hover my mouse over the game client my character does move so I know it's working but the coordinates are not being recognized. So what I'm doing now is using Color.Find coordinate of occurrence on screen closest to coordinate (RGB) to get the coordinates of the monster (red) on screen and using Mouse.Ghost click at coordinate("{x}", "{y}", "left") to attack. It actually works very well with 1 client but not so great with 2+ screens.

If I can get Window.Send mouse click working it would be PERFECT (I can have like 6 clients running on my monitor). Any ideas?


Top
  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Sun Sep 13, 2020 7:14 am 
New User
New User



Joined: Sun Sep 06, 2020 12:08 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 13
Really sorry the above post was by me.


Top
 Profile  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Mon Sep 14, 2020 2:38 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2110
Location: USA
Been thanked: 488 time(s)
Has thanked: 37 time(s)
Contribution Points: 17260
Quote:
I never managed to figure out how to get the reset loop iteration to work
There is no "Instruction" to reset loop iteration. The only way to "reset" it is to exit the loop.

This part: Macro.Get parent loop iteration("count")
is setting the loop iteration to a variable so you can read it or do something with it; but the loop iteration itself is not a variable, it's an event (something that is happening). So to change it, you need to change the event.

Which leads to this part:
Variable.Set("x", "{count}")
if Variable.Is equal to("x","30")
-- these do nothing, at least not how you scripted it. Well technically you're reading the variable "x" instead of "count" but there's no point to it. You could have just used, "if variable.is equal to("count","30").
- Hopefully this won't confuse you more, but you could use the variable x to do other stuff...but remember it will not affect the variable "count" i.e. the loop iteration. If you wanted to keep this in here, you could just add more conditions, like at 30, 60, 90...do what you want; but the cleanest thing to do is to exit the loop and reset the loop iteration.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 1 time(s)  Unread post Posted: Mon Sep 14, 2020 3:02 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 2110
Location: USA
Been thanked: 488 time(s)
Has thanked: 37 time(s)
Contribution Points: 17260
Guest wrote:
Ok so I didn't want to start another topic so I'll ask here. I have my dual client script setup and its working 99% EXCEPT for one command I've been trying to use albiet without success. It's the Window. Send mouse click. Couple of things I want to note:

1. Yes I have successfully installed virtual drivers and have it selected as the input option for both mouse and kb in settings.
2. Game (Ragnarok Online) has EAC protection BUT I tested Window. Send press keys with success so I know the clicks and keystrokes are not being blocked by the anti cheat.

I am having the same exact problem as OP in this thread http://blueeye-macro.com/viewtopic.php?f=122&t=4042

Coordinates are not being recognized. When I hover my mouse over the game client my character does move so I know it's working but the coordinates are not being recognized. So what I'm doing now is using Color.Find coordinate of occurrence on screen closest to coordinate (RGB) to get the coordinates of the monster (red) on screen and using Mouse.Ghost click at coordinate("{x}", "{y}", "left") to attack. It actually works very well with 1 client but not so great with 2+ screens.

If I can get Window.Send mouse click working it would be PERFECT (I can have like 6 clients running on my monitor). Any ideas?
Well Gigus provided feedback on things to try to figure that one out. I don't really have anything to test this on at the moment. If I get some time, I'll try to set up some multiple clients...until then try what Gigus said...or...

I never tried to move multiple characters independently with mouse.send keys...but I did use this: http://blueeye-macro.com/viewtopic.php?f=10&t=1173. Basically it's doing the same thing, but instead of send keys, I brought the windows to the front first which works great. I guess people might be opposed to this because it's visible (brings the other windows to the front instead of just clicking behind the scenes) but it should do what you're trying to do...

...unless...

you're trying to click on different windows at the same time, which you can't do no matter what.

I mentioned I haven't tested this, but from memory...if you move your mouse while it's trying to click on another window, then it's gonna mess it up. It needs focus unless you're using ghost click which you mentioned. Perhaps that's a key to what's going wrong. Additionally, one of the reasons I never experimented with this (or looked into fixing it) is because I realized using memory pointers is much better. Guess that doesn't help you but the link to the other thread should.

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Tue Sep 15, 2020 12:19 am 


Ah that really cleared things up for me :D . I was using the command incorrectly then as I assumed that Macro.Restart loop would reset the variable "count" back to zero. Macro.Break from loop would be more appropriate then in this case. Got it!

Yes I did take a look at the script you wrote and considered it before but my goal was to try and run multiple clients in the background leaving me free to do whatever else I wanted BUT I also do not mind leaving two windows open as I can just leave it running at night when I sleep. But ultimately my goal is to try and get Window. send mouse click to work and if I can't I think your script will work wonderfully with the ghost click command while alternating between two windows. And yes I realized it just doesn't work trying to have the mouse click at two screens at the same time...even with ghost click.

I've tried to pointer scan for memory using cheat engine but the game will not attach the debugger to the process (it forces the game to close if I try) and bypassing EAC is way beyond my knowledge and skill level. I haven't tried using VMWare workstation but I suspect it too is blocked by EAC.


Top
  
Reply with quote  
 Post subject: Re: "Stuck" characters and loop problem
Thanked: 0 time(s)  Unread post Posted: Tue Sep 15, 2020 12:21 am 
New User
New User



Joined: Sun Sep 06, 2020 12:08 am
Posts: 6
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 13
Above post is by me :oops:


EDIT: I kind of got it to work. I've reinstalled Windows 7 to see if it would fix it...it's still the same as before it won't recognize the coordinates. If I use Mouse.Set coordinate it will work but definitely not with 2+ clients at the same time.

begin
Color.Find coordinate of occurrence on screen closest to coordinate (RGB)("99", "66", "132", "0", "364", "264", "x", "y")
Mouse.Set coordinate("{x}", "{y}")
Window.Send mouse click("Ragnarok1", "Yes", "0", "{x}", "{y}", "Left")


I am trying to make it so I can use it without the middle line like this:

begin
Color.Find coordinate of occurrence on screen closest to coordinate (RGB)("99", "66", "132", "0", "364", "264", "x", "y")
Window.Send mouse click("Ragnarok1", "Yes", "0", "{x}", "{y}", "Left")

But when I try it like this it will only register movement if I hover my mouse over the client. I tried Gigus' code where it draws a straight line diagonally in MS paint and it works perfectly. I've also checked with investigator and the game client does not have any child windows so I set it to "0".

Windows. Send press keys works perfectly so I definitely know it's not being blocked. Puzzled :?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group