DesireDenied Posted May 23, 2007 Share Posted May 23, 2007 #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 MyExit() For $i = 4 To 0 Step -2 MouseMove(500-(10 * $i), 800-(10 * $i),$i) MyExit() MouseMove(300+(10 / $i), 500+(10 / $i),$i+1) MyExit() Next WEnd DllClose($dll) Func MyExit() If _IsPressed(01 & 01, $dll) Then MsgBox(0,"", "exit",0.25) Exit EndIf EndFunc 01 Left mouse button 02 Right mouse button A2 Left CONTROL key A3 Right CONTROL key my problem is that im not really sure why expression '01 & 01' gives me hex 0xA2 value in my code. would you explain to me why it is like that? Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 23, 2007 Share Posted May 23, 2007 (edited) Because '&' is a string operator and your numbers were converted to strings before combining them, not mathematically adding them. P.S. What did you really want out of that "01 & 01", anyway? Edited May 23, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DesireDenied Posted May 23, 2007 Author Share Posted May 23, 2007 exactly nothing -.- i was just wondering what can i get out of this. but how i get hex value = 0xA2 out of two strings '01' anyway? Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 23, 2007 Share Posted May 23, 2007 Also, IsPressed() is an odd bird in that it want numeric input, but requires them in a string. Assuming you want left mouse button, the correct value is "01" (a string of the number), not 01 (not a literal number). That always struck me as sloppy, but people much smarter than me wrote it, and I reckon they had their reasons. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DesireDenied Posted May 23, 2007 Author Share Posted May 23, 2007 i meaned why expression:$i = 01 & 01 gives me$i = 11whiledecimal 11 = hex 0x0Band _IsPressed() interprete it as 0xA2 Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 23, 2007 Share Posted May 23, 2007 ...and _IsPressed() interprete it as 0xA2No, _IsPressed() interprets its input as a string representations of a hex number, in this case "11". Which, if you look it up under _IsPressed in the help file, is CTRL, as opposed to A2 ("Left CONTROL"). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now