Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Nov 21, 2024 7:57 pm

All times are UTC




Post new topic Reply to topic  [ 103 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 11  Next
Author Message
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Fri May 21, 2010 7:57 am 
Active User
Active User



Joined: Thu Feb 11, 2010 4:36 pm
Posts: 38
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 652
@papatsonis: I was waiting for some math genius to drop by with a perfect calculation :D Looks cool, cannot wait to test this when I get home.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Fri May 21, 2010 9:48 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
papatsonis wrote:
...
Due to not supporting trigonometric functions
...


Please do let me know of any function(s) you would like to be added, and I will see to it.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Sat May 22, 2010 3:43 am 
Lifetime VIP Contributor
Lifetime VIP Contributor



Joined: Fri May 21, 2010 12:05 am
Posts: 14
Location: Greece
Been thanked: 0 time(s)
Has thanked: 0 time(s)
Contribution Points: 765
thank you all :)

Gigus wrote:
papatsonis wrote:
...
Due to not supporting trigonometric functions
...


Please do let me know of any function(s) you would like to be added, and I will see to it.


only one basic function (e.g Sin(x)) is fine , cause u can get all other from it, u can add all them though :D (Sin(x) , Cos(x), Tan(x)) , , so the end user only has to select the angle in degrees in macro, and not have to calculate it 1st.

I checked again today to try to avoid these cases that the ball starts near the basket and much lower, so hit the basket ascending, that happens in the rare conditions when the calculated M is less than (basketX+OuterRingX+{half balls diameter!10pixels in mycase})/2 and the ball starts lower from basket.

Instead of bloating the macro with more calculations, i think ( i actually tried in the game this, and worked-did 395 score), is much better for final score, if you kick these balls out of the field immediately with almost zero angle, and to move on to the next (probably better) ball position ;).

the edited code is below
Code:
  begin
     Image.Find location of first occurrence on screen("C:\Program Files (x86)\Blue Eye Macro\basketball.png", "25", "ballX", "ballY")
     Variable.Evaluate (Math)("({ballY}-{basketY})/({ballX}-{basketX})", "L1")
     Variable.Evaluate (Math)("(2*{L1}*{basketX}+{tanF}*({basketX}+{ballX}))/(2*({L1}+{tanF}))", "M")
     Variable.Evaluate (Math)("{M}-{basketX}", "p1")
     Variable.To power of (Math)("p1", "2")
     Variable.Evaluate (Math)("{ballX}-{M}", "p2")
     Variable.To power of (Math)("p2", "2")
     Variable.Evaluate (Math)("({p1}*{ballY}-{p2}*{basketY})/({p1}-{p2})", "B")
     Variable.Evaluate (Math)("{backboardLow}+{ballDia}/2", "checkY")
     Variable.Evaluate (Math)("({basketX}+{OuterRing}+{ballDia}/2)/2", "Mmin")
     if  Variable.Is less than (Math)("M", "{Mmin}")
          and
          Variable.Is greater than (Math)("ballY", "{checkY}")
          begin
               Variable.Set("M", "0")
               Variable.Evaluate (Math)("{ballY}-1", "B")
          end
     Mouse.Move to coordinate("{M}", "{B}")
 end
 


Image
i have put move, instead of click, trying to see if its working. but thats not the case :/, in log, it says this :

Checking if: Variable.Is less than (Math)(Variable name: M, Value: 161,5)
Error: Invalid convertion from one format to another (Probably a text to number conversion - Hint: Invalid variable value?)

any ideas? i tried to reverse the check, if Mmin is greater form M, a few times it worked!!, now same message :S.

at least i can manual decide if a ball is to be wasted, and throw away at zero height with different macro activated from <ctrl> for example. If have enough time later today i might try to abolish completelty the tanF variable, and make the macro "fully" automatic to find itself the best/lowest angle, but you ll have to submit along with ballDia(meter), coordinates for these 5 points as seen on this screenshot.

Image


P.S> with a friend tried to make it automaticaly find out when the next ball is ready and start immidiately the calculation, but with no success, it could be nice if it could repeat himself automaticely and mainly fast ;) , and not rely on your reflexes after the ball is ready to press <alt>


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Sat May 22, 2010 10:10 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Ill have a look at adding the new math functions, they will be included in the release tomorrow night.

About your invalid conversion error.

It is most likely because the variable "M" contains an invalid value.

Invalid being a number too high or too small to fit inside a .Net System.Double.
Or the variable "M" simply does not exist, which should not be the case here.

Try inserting the following line just before the check to find our what the value is:
Code:
 Variable.Evaluate (Math)("({basketX}+{OuterRing}+{ballDia}/2)/2", "Mmin")
 Window.Display Message Box("{M}", "yes")        <-------This line
     if  Variable.Is less than (Math)("M", "{Mmin}")
          and


It might be because Blue Eye does not do any rounding.

Let me know what the value is, and ill see if i can make sure Blue Eye does not keep more digits than it can actually handle.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Sat May 22, 2010 12:16 pm 
Lifetime VIP Contributor
Lifetime VIP Contributor



Joined: Fri May 21, 2010 12:05 am
Posts: 14
Location: Greece
Been thanked: 0 time(s)
Has thanked: 0 time(s)
Contribution Points: 765
thats what i thought at 1st, that is comparison between different formats, double precision the M result, and single precision the Mmin.

eitherway i added the line u posted, and the results are 11 to 12 decimal digits for M


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Sat May 22, 2010 2:55 pm 
Lifetime VIP Contributor
Lifetime VIP Contributor



Joined: Fri May 21, 2010 12:05 am
Posts: 14
Location: Greece
Been thanked: 0 time(s)
Has thanked: 0 time(s)
Contribution Points: 765
small update to existing macro:

i had seen that all shots were a bit off the center of the basket, which i had countered by adjusting the basket coordinates instead of 143 for example in my case, to 148, but the real cause was other, 1st) the ballX,ballY of the ball from image recognition , -in my case- is always +4,+5 respectively, and 2nd) the point the mouse clicks.. is as ull see not the center of the ball.. but the bottom of the ball :S, so u have to adjust the final B coordinate to be B+{ballDia}/2

so edit the code like this :

Code:
 begin
     Image.Find location of first occurrence on screen("C:\Program Files (x86)\Blue Eye Macro\basketball.png", "25", "ballX", "ballY")
     Variable.Evaluate (Math)("{ballX}-3", "ballX")
     Variable.Evaluate (Math)("{ballY}-5", "ballY")
     Variable.Evaluate (Math)("({ballY}-{basketY})/({ballX}-{basketX})", "L1")
     Variable.Evaluate (Math)("(2*{L1}*{basketX}+{tanF}*({basketX}+{ballX}))/(2*({L1}+{tanF}))", "M")
     Variable.Evaluate (Math)("{M}-{basketX}", "p1")
     Variable.To power of (Math)("p1", "2")
     Variable.Evaluate (Math)("{ballX}-{M}", "p2")
     Variable.To power of (Math)("p2", "2")
     Variable.Evaluate (Math)("({p1}*{ballY}-{p2}*{basketY})/({p1}-{p2})+({ballDia}/2)", "B")
     Mouse.Click button at coordinate("{M}", "{B}", "Left")
 end


of course if u get the center of the ball from mouse cursor, u dont need to compensate for ballX,ballY, and feell free to try some tests, of what ballX,ballY u get from investigator, and what ballX,ballY u get from recognition, as your results may vary, but the adjustment in final height is indepedent of this.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Sat May 22, 2010 7:43 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
papatsonis wrote:
thats what i thought at 1st, that is comparison between different formats, double precision the M result, and single precision the Mmin.

eitherway i added the line u posted, and the results are 11 to 12 decimal digits for M


I will do some testing to fix this issue, thank you for reporting it.

Update:

The bug is quite easy to reproduce just by executing the following code:
Code:
 begin
     Variable.Evaluate (Math)("1/3", "var")
     If  Variable.Is greater than (Math)("var", "0")
          begin
               Macro.Do nothing()
          end
 end


I'm working on a fix, and it will also be part of the new build, planned for release Sunday.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Mon May 24, 2010 10:20 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
Version 1.3 has now been released.

If you recompile your macro, there should no longer be any double precision number errors.
I also added Sine, Cosine, Tangent and Round functions.

Check out the full change log here:
http://www.blueeye-macro.com/viewtopic.php?f=42&t=27

I'm looking very much forward to hearing how it works out.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Mon May 24, 2010 6:42 pm 
New User
New User



Joined: Mon May 24, 2010 6:33 pm
Posts: 2
Been thanked: 0 time(s)
Has thanked: 0 time(s)
Contribution Points: 25
Anyone want to show me how to set this up? I'm so confused and the video was too fast :(


Top
 Profile  
Reply with quote  
 Post subject: Re: Basket Ball Bot v2
Thanked: 0 time(s)  Unread post Posted: Mon May 24, 2010 7:28 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4525
Been thanked: 1346 time(s)
Has thanked: 133 time(s)
Contribution Points: 33209
ffffuuuu wrote:
Anyone want to show me how to set this up? I'm so confused and the video was too fast :(


What is causing you problems?

And sorry about the speed of the video on youtube, however at 1x speed, the videos would get too long :/

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 103 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 11  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