Jump to content

Do Until, something is wrong in my loop...


layer
 Share

Recommended Posts

Whats wrong with this code...I want it so that IF the user presses mouse1, then it will get the possition its at, and then hit mouse1 10 times, but instead, its just hitting mouse1 even if i don't press mouse1

HotKeySet("^!o", "MyExit") 

Func _IsPressed($hexKey)

  
  Local $aR, $bRv
  $hexKey = '0x' & $hexKey
  $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
 
  If $aR[0] <> 0 Then
     $bRv = 1
  Else
     $bRv = 0
  EndIf
  
  Return $bRv
EndFunc  
While 1
$getpos= MouseGetPos ()
Select
Case _IsPressed('01')
MouseClick ("left", $getpos[0], $getpos[1], 10, 0)
EndSelect
WEnd

Func MyExit()
    Exit 
EndFunc

Could someone tell me why it does this, thanks.

FootbaG
Link to comment
Share on other sites

  • Developers

Also, I'm trying to help The_Lord_Merphy guy below....He's right, you can't open a .ini file with FileOpen...Why?

<{POST_SNAPBACK}>

this works for me ... so what isn't working for you ??

IniWrite("DEMO.INI",'test','testkey','testval')
$file = FileOpen("DEMO.INI", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    MsgBox(0, "Line read:", $line)
Wend

FileClose($file)

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

Well Valik, I was getting lonely without you saying anything about my questions. Thanks for that

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Link to comment
Share on other sites

Or you can do

Run('notepad "SCRIPT NAME HERE"')

As I stated earlier in one of these threads.

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Link to comment
Share on other sites

Or you can do

Run('notepad "SCRIPT NAME HERE"')

As I stated earlier in one of these threads.

<{POST_SNAPBACK}>

I didnt see you state that, but I guess thats another way. But the way I posted is better for things that dont open with notepad also, simply because Windows may not know where to find it (unless you hard code the path ex run('c:/windows/notepad' 'scriptpath') Edited by killaz219
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...