Jump to content

CptSpike

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by CptSpike

  1. *headslap* Cheers mate. I feel very sheepish. Thanks
  2. Hi all, As the name suggests, GUICtrlRead seems to return nothing. I hope I'm missing something simple. This is a quick GUI I've put together to demonstrate the problem. The msgbox comes up blank. Any help is greatly appreciated. #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) GUICreate("",500,500) $edit = GUICtrlCreateEdit("",10,10,100,100) $accept = GUICtrlCreateButton("accept",200,200) $input = GUICtrlRead($edit) GUISetState(@sw_show) GUISetOnEvent($GUI_EVENT_CLOSE, "close") GUICtrlSetOnEvent($accept, "accept") while(1) sleep(100) WEnd func close() Exit EndFunc Func accept() MsgBox(4096,"",$input) EndFunc Please tell me if you need any more information
  3. This is pretty smart - I can see that this has great potential. Nice work. -CptSpike
  4. Thought it would be nice to ask anyways thanks everyone for the help. -CptSpike
  5. (OffTopic) I love this forum. So helpful. (OnTopic) Will play around with my code more tomorrow, looks like the array method is the way to go. Thanks for pointing out the mathemathical flaw Melba - I assumed the colours would follow a linear decimal pattern. But life is never simple jdelaney, may I shamelessly steal your code?
  6. Oh I see. Hadn't thought about that. Still not sure where to go from there - most of the decimal values the program looks up won't be listed in the ini file, how would I get it to pick the closest match instead?
  7. No I mean there are no section names to compare - only one section name. [Decimal] to be precise.
  8. Exactly 907 entries, only one section name Firefox.
  9. Title may not be particularly clear, sorry I'm struggling to put my problem in to words. But here goes. I'm writing a program that takes pixel colour info from the mouse pointer, and looks it up in an INI file to see the corresponding Pantone colour. Snippet of the INI looks like this: 16702208=108C 16765184=109C 14396928=110C (Pantone colour on the right) This is great if the pixel colour matches exactly, but if not, the user gets nothing. I want them to get the nearest match. Is it possible for AutoIt to select the nearest listed decimal number? I tried adding 1 to the pixel decimal number until it hits a matching a Pantone colour but this is far too slow. Sorry if I'm not articulating this very well. Many thanks. -CptSpike
  10. EDIT: God I'm an idiot. Still got the problem, but _IsPressed doesn't seem to work. Oh well the principle is the same Hi all, So I'm having a slight problem with the MouseUp function. Here's the example code I'm working with: #include <Misc.au3> HotKeySet("{ESC}","quit") while(1) $input1=_IsPressed(11) if $input1=1 then mousedown("right") elseif $input1=0 then mouseup("right") EndIf WEnd func quit() Exit EndFunc (Forgot the html code to put it in special tags:() I'd be careful running that though; for me it constantly right clicks regardless of whether 'W' is pressed or not. Had the same problem using any input by the way, just put that in for ease of use. I want it to work like the Send() function when you hold down a key, i.e, while this button is being held down, hold down the mouse button, then release...you get the idea. (I know this looks pointless at the mo, but I'm trying to convert pulling the trigger on a game controller to holding down the right mouse button. NOT GAME AUTOMATION just using a controller with a game that doesn't support one) Thanks for reading -CptSpike
  11. I was going to, then realised I was using it wrong was trying to use AdLib to run multiple functions at once, which AutoIt doesn't support. So I found another way around it
  12. Ah, didn't notice that. Hmm. Can I assume he gives his consent?
  13. Hi guys, I'm also struggling with AdLibRegister, the functions I call are not run in a loop - the script terminates almost instantly, with no errors. Am I doing something wrong? (I am calling the functions as strings )
  14. I have a 360 Controller hooked up to my PC best of both worlds, PC games with better graphics, 360 Controller for better ergonomic support. But not all games support it, so may I tweak this to convert controller input to keyboard/mouse output? You sir are nothing less than a genius.
  15. Hi water, I would like to assign it to a variable if possible, to be used with IF statements in a While loop, something like: while(true) if $input=$stickup then sendkey ("w") endif wend etc MKISH, you're better than Google. I will certainly look into it. Thanks -CptSpike
  16. Hi all, first apologies if this question has been asked a million times, Google says it hasn't. I was wondering if there is a UDF, or someone could help me code one, that can 'read' input from a USB game controller (Xbox360 one to be exact) and convert it into mouse and keyboard movements? The mouse and keyboard movement part isn't too tricky for me, but I have no idea how to go about reading input from a USB port. (If that's even possible with AutoIt). I've read on these forums that people have had success communicating over a COMM port, using COM objects in their scripts, but I have no experience of either. (Serial COMM ports were before my time ) Any help would be greatly appreciated. Thanks for reading. -CptSpike
×
×
  • Create New...