Sign in to follow this  
Followers 0
layer

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

12 posts in this topic

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

Share this post


Link to post
Share on other sites



Woo hoo! It works, thanks larry!

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


FootbaG

Share this post


Link to post
Share on other sites

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)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Please don't tell me you're both being morons and assuming that "opening" a file means opening it in a text editor like Notepad or SciTE. Thats not what you mean, I hope, right? Please tell me its not.

Share this post


Link to post
Share on other sites

Ooops, looks like I am a moron... =) Sorry, but thats what I was trying to do, lol. =D


FootbaG

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Lol, you need to do something like

RunWait(@COMSPEC & " /c Start c:/thefile.ini")

To run the file.....

;):):):D

Edited by killaz219

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

This is better:

Run('notepad "' & @ScriptFullPath & '"')

Share this post


Link to post
Share on other sites

Yeah that's what I posted


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]

Share this post


Link to post
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
Sign in to follow this  
Followers 0