Jump to content

_ispressed


Recommended Posts

well im makeing a config script for a bot i made a long time ago but i want it to be easy but it does not seem to work..

this is what i have and it no work...

#include <Misc.au3>
while 1=1
    $xy = MouseGetPos()
    ToolTip("Click The Top Left of The Screen",1000,300)
    If _ispressed(01) Then
        IniWrite("info.ini","config","1tl",$xy[0]&","&$xy[1])
        ToolTip("")
        sleep(1000)
        ToolTip("Click The Bottom Right of The Screen",1000,300)
        If _ispressed(01) Then
        IniWrite("info.ini","config","1tr",$xy[0]&","&$xy[1])
        ExitLoop
    Else
        sleep(100)
    EndIf
Else
    sleep(100)
EndIf
WEnd
Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
Link to comment
Share on other sites

Hi,

#include <Misc.au3>

$Ini = @ScriptDir & "\info.ini"

While 1
    ToolTip("Click The Top Left of The Screen",500,300)
    Do
        sleep(100)
    Until _IsPressed("01")  
    $xy = MouseGetPos()
    IniWrite($Ini,"config","1tl",$xy[0]&","&$xy[1])
    ToolTip("Click The Bottom Right of The Screen",500,300)
    Do
        sleep(100)
    Until _IsPressed("01")
    $xy = MouseGetPos()
    IniWrite($Ini,"config","1tr",$xy[0]&","&$xy[1])
    ExitLoop
WEnd

Cheers

Link to comment
Share on other sites

Thanks a lot man, but that

$Ini = @ScriptDir & "\info.ini"

seems useless because doesn't already do that?

Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..
Link to comment
Share on other sites

Yep it's useless, but..

Thinking ahead doesn't hurt..

An absolute path doesn't hurt, as it's just one error you can rule out if you have errors

Later when you want to read the ini, it's easier to use $Ini then it is to use info.ini

Also it makes it so you only need to edit the the path to the ini once.

eg: your script may have many lines that read and write to the 1 ini..

using 1 variable at the top of the script will save you having to edit the path every IniRead()/IniWrite() line in your script.

But to each his own.

Cheers

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