Jump to content

how to write corectly this code?


6105
 Share

Recommended Posts

;IF x<0 and y<0 send("{NumPad3}"); move Down-Right
;IF x>0 and y<0 send("{NumPad6}"); move Right
;IF x>0 and y<0 send("{NumPad9}"); move Up-Right
;IF x<0 and y>0 send("{NumPad1}"); move Down-Left
;IF x>0 and y>0 Send("{NumPad3}"); move Left
;IF x>0 and y>0 Send("{NumPad7}"); move Up-Left

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

closest can have different meaning:

1)the shortest hypotetical straight line that connect point A (a yellow pixel ) to point B ( the pig )

2)the shortest walkable path from Point A to point B

Link to comment
Share on other sites

search every yellow pixel and store the position (X, Y coordinates) in one array, then find Pig's coordinates, then calc for each pixel the shortest distance (between pixel and pig) with this formula: Sqrt((X1-X2)² + (Y1-Y2)²), and choose the clostest one, and so on.

the second option is A* Star pathfinding algorithm, google it for more informations

Link to comment
Share on other sites

  • Developers

Where have I been unclear to you you about not opening Multiple threads on the same subject? I think I have been pretty clear about this so why this new thread?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

this is not, old topic is finished, it was a question of how to make a script and I respond to it very well now I have another question entirely and use only 5 points from the figure in order to show movement in action

Seems we differ in our opinions here. I let it go for now, but you haven't had a great start on these forums and don't see much improvement yet.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

ThanksALL :D

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...