Jump to content

Math solve for X?


foot1221
 Share

Recommended Posts

What I'm trying to do is create a program that reads the distance from one point to another, then divides the distance by 3. Then clicks on a point, drags to a certain point and then lets go.

This would be easy if this had worked:

Local $b = ($m * $throwX) - $throwY
    Local $x = int($x = Sqrt($d^2 - ($m * ($x + $d)) + $b))
    Local $y = $m * $x + $b
    MouseMove($throwX, $throwY)
    MouseDown("left")
    Sleep(50)
    MouseMove($x, $y, 4)
    MouseUp("left")
    Sleep(100)

The problem is $x is being used to define itself, which can't be done apparently.

In above, $b is the y-intercept, $x is the x cord of where the mouse is being dragged to, and $y is the y of where the mouse is being dragged to, $throwX and $throwY is the point where dragging starts.

In short, I'm asking for something that can solver for X in the 2nd line, does such a function exist in AutoIt?

Edited by foot1221
Link to comment
Share on other sites

What I'm trying to do is create a program that reads the distance from one point to another, then divides the distance by 3. Then clicks on a point, drags to a certain point and then lets go.

This would be easy if this had worked:

Local $b = ($m * $throwX) - $throwY
    Local $x = int($x = Sqrt($d^2 - ($m * ($x + $d)) + $b))
    Local $y = $m * $x + $b
    MouseMove($throwX, $throwY)
    MouseDown("left")
    Sleep(50)
    MouseMove($x, $y, 4)
    MouseUp("left")
    Sleep(100)

The problem is $x is being used to define itself, which can't be done apparently.

In above, $b is the y-intercept, $x is the x cord of where the mouse is being dragged to, and $y is the y of where the mouse is being dragged to, $throwX and $throwY is the point where dragging starts.

In short, I'm asking for something that can solver for X in the 2nd line, does such a function exist in AutoIt?

Can you use this and then divide by 3

http://www.autoitscript.com/forum/index.ph...c=35311&hl=

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

  • Developers

This doesn't look right :

Local $x = int($x = Sqrt($d^2 - ($m * ($x + $d)) + $b))

Maybe :

Local $x = int(Sqrt($d^2 - ($m * ($x + $d)) + $b))

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

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...