Jump to content

My first program. I could use some pointers.


Recommended Posts

@Blue_Drache

He wants to read input from the controller, not keyboard!

@Abacusrex

See the Gear next to the search? Use it to make an advanced search for joystick or gamepad in the Examples Forum and you'll find a bunch of UDFs to get input.

Or maybe not. The Xbox 360 controller is made to be used primarely with XInput so try the first (most/all others are based on DirectInput afaik (which should still work btw)).

Edit: Or

Edited by AdmiralAlkex
Link to comment
Share on other sites

@Blue_Drache

He wants to read input from the controller, not keyboard!

It's easy to adapt a scancode sniffer for Xbox controllers to a keyboard. Input from a user device is input, no matter the source, especially if it's scancode based like joysticks.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

I got the _Ispressed360 UDF working, but now I'm faced with another problem.

When I try to get Autoit to run Xpadder.exe or XBMC.exe it can't do it. I tried Run("XBMC.exe") and ShellExecute("XBMC.exe") and some others. It won't launch it. It's almost as if windows doesn't recognize it. When I used ShellExecute it said "Windows cannot find 'XBMC.exe'..."

Any ideas?

Link to comment
Share on other sites

Did you put the full path to the exe? If you don't Windows tries the working dir and PATH, but it's better to just specify. Like when you are using the Run dialog.

You can find macros to common directorys in helpfile under "Macro Reference > Directory Macros". If you can't get it to work post where you have those exes and we can give you samples that should work.

Link to comment
Share on other sites

Thanks. I could have sworn I put in the full path, but maybe I didn't; however, it worked. I thank you. :oops:

Now that's out of the way how can I implement these two pieces of code?

I added the support for the Xbox 360 Controller that ends at DLLCLose($dll). My earlier script picks up there, but requires a 'While 1' to function and so does the Xbox 360 Controller script. How can I get both the Xbox 360 controller script and my earlier script to run together?

My idea was to have the script check if the controller's "A" button [if _IsPressed360(4096, $dll)] was pressed and if not continue with the script, which would be my earlier script. It would than continue that checking process until the "A" button was pressed. When it is pressed it executes the Xbox 360 Controller scripts and than continues its checking process.

That's my idea. I have no knowledge of how to implement that nor whether it would work. I wait for your knowledgeable response.

THANK YOU SO MUCH! Code is below.

While 1
    If _IsPressed360(4096, $dll) Then
   Run("C:\Users\R. Iosephus Parcus\Documents\Stability Tools & Utilities\Stability & Utility Programs\Xpadder.v2012.01.19.Multilingual.Retail-WaLMaRT\Setup\Xpadder.exe")
   Run("C:\Users\R. Iosephus Parcus\Documents\Video Games\XBMC\XBMC.exe")
   If ProcessWaitClose("XBMC.exe") Then
   ProcessClose("Xpadder.exe")
   EndIf
   EndIf
  Wend
DllClose($dll)
;Closes Steam.exe on exit of game.
If ProcessExists("GameOverlayUI.exe") Then
   If ProcessWaitClose("GameOverlayUI.exe") Then
   ProcessClose("Steam.exe")
   EndIf
EndIf
;kills process: "ESN Sonar". (DICE's useless VOIP process)
If ProcessExists("SonarHost.exe") Then
   ProcessClose("SonarHost.exe")
EndIf
  
;Closes Origin.exe on exit of Battlefield 3 "Main Menu" (Google Chrome).
If ProcessExists("chrome.exe") Then
   If ProcessWaitClose("chrome.exe") Then
   ProcessClose("Origin.exe")
   EndIf
EndIf
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...