elgabionline Posted March 29, 2006 Share Posted March 29, 2006 (edited) Hello, here I want to share with you this script, that contains some functions to use the Joystick. I already proved all the functions and they are well, so I wait that to you also.Those functions are: JoyMoveLeft ($joy_number,$sensivity)JoyMoveRight ($joy_number,$sensivity)JoyMoveUp ($joy_number,$sensivity)JoyMoveDown ($joy_number,$sensivity)$sensivity is a percent value (for analogic Joysticks) 90% is default(All functions for joystick directional moves)JoyButtonPressed ($joy_number,$joy_button) $joy_button is a numeric input as 1, 2, 3... n)JoyGetID ($joy_number) $joy_number is a numeric input as 1,2... n)JoyMaxNumber () Maximum number of joysticks supported by your system[iMPORTANT!!] These scripts needed to run, the beta version 3.1.111 of autoit.[EDIT] 4 April 2006: I added new parameters to the functions.I hope comments and if it was them useful. Bye...Joystick.au3Joystick_Test.au3 Edited April 4, 2006 by elgabionline Link to comment Share on other sites More sharing options...
ConsultingJoe Posted March 29, 2006 Share Posted March 29, 2006 is there a way to emulate a mouse as a joystick for this Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
nfwu Posted March 29, 2006 Share Posted March 29, 2006 So, these functions control a joystick. 1 question: Can I control a joystick which has its drivers installed but is not attached to my computer? #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
elgabionline Posted March 30, 2006 Author Share Posted March 30, 2006 So, these functions control a joystick.1 question: Can I control a joystick which has its drivers installed but is not attached to my computer?#)What do you mean with "attached"? Use Joystick Plug in your computer, of course! This script read a system driver of Win98, not a manufacturer software included with your Joystick. Did I answer your question, or didn't I understand well? Link to comment Share on other sites More sharing options...
elgabionline Posted April 4, 2006 Author Share Posted April 4, 2006 (edited) To emulate a mouse in windows with Joystick control, I put this simple script, for example: Press first button and open "Programs folder". Or hold this button and directional movements of joysticks, and mouse emulate it. Press second button (while hold first button of joystick) for decrease mouse speed. expandcollapse popup#include <GuiConstants.au3> #include <Joystick.au3> Opt ("Trayicondebug",1) While 1 If JoyMoveLeft () Then Send ("{LEFT}") Sleep (50) EndIf if JoyMoveRight () Then Send ("{RIGHT}") Sleep (50) EndIf If JoyMoveUp () Then Send ("{UP}") Sleep (50) EndIf If JoyMoveDown () Then Send ("{DOWN}") Sleep (50) EndIf If JoyButtonPressed (1,1) Then Boton1 () WEnd Func Boton1 () Local $Activ=0,$XMouseCoord,$YMouseCoord While JoyButtonPressed (1,1) $MouseCoord=MouseGetPos () $Vel=13 If JoyButtonPressed (1,2) Then $Vel=3 Select Case JoyMoveLeft () $XMouseCoord =$MouseCoord[0]-$Vel $Activ=1 Case JoyMoveRight () $XMouseCoord = $MouseCoord[0]+$Vel $Activ=1 Case Else Sleep (50) EndSelect Select Case JoyMoveUp () $YMouseCoord =$MouseCoord[1]-$Vel $Activ=1 Case JoyMoveDown () $YMouseCoord= $MouseCoord[1]+$Vel $Activ=1 Case Else Sleep (50) EndSelect MouseMove ($XMouseCoord,$YMouseCoord,0) WEnd Select Case $Activ=1 MouseClick ("primary") Case Else Send ("{LWIN}") EndSelect EndFunc ;BETA VERSION!!! 3.1.1.111 Edited April 16, 2006 by elgabionline Link to comment Share on other sites More sharing options...
zeroZshadow Posted August 3, 2006 Share Posted August 3, 2006 he means the other way. so if i move my mouse up, the joystick moves up. might be handy for games that support a mous and a joystick, but you want 2 mouses *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip... Link to comment Share on other sites More sharing options...
Dellairion Posted October 30, 2006 Share Posted October 30, 2006 hehe very helpfull i will include it in my hotkey controller Hot Key ControllerPinball Trainer? Link to comment Share on other sites More sharing options...
TheArtifice Posted February 23, 2007 Share Posted February 23, 2007 Is there a way to when I Press a Key on the Keyboard, It do a Joystick InPut ? Example: Press the UP key on the Keyboard = the UP with a stick on a Joystick. Link to comment Share on other sites More sharing options...
smstroble Posted February 23, 2007 Share Posted February 23, 2007 I can't get the demo test to work. I'm using a USB Microsoft Sidewinder Precision 2 and I'm on Windows XP. Looks nice hopefully I can get this to work. MUHAHAHAHAHA Link to comment Share on other sites More sharing options...
Adam1213 Posted March 31, 2007 Share Posted March 31, 2007 Your program looped without sleep, causing 100% cpu usage. To emulate a mouse in windows with Joystick control, I put this simple script, for example: Press first button and open "Programs folder". Or hold this button and directional movements of joysticks, and mouse emulate it. Press second button (while hold first button of joystick) for decrease mouse speed. expandcollapse popup;by elgabionline #include <GuiConstants.au3> #include <Joystick.au3> Opt ("Trayicondebug",1) While 1 If JoyMoveLeft () Then Send ("{LEFT}") Sleep (50) EndIf if JoyMoveRight () Then Send ("{RIGHT}") Sleep (50) EndIf If JoyMoveUp () Then Send ("{UP}") Sleep (50) EndIf If JoyMoveDown () Then Send ("{DOWN}") Sleep (50) EndIf If JoyButtonPressed (1,1) Then Boton1 () sleep(100); - Looping without sleep is a waste and uses 100% cpu Adam1213 WEnd Func Boton1 () Local $Activ=0,$XMouseCoord,$YMouseCoord While JoyButtonPressed (1,1) $MouseCoord=MouseGetPos () $Vel=13 If JoyButtonPressed (1,2) Then $Vel=3 Select Case JoyMoveLeft () $XMouseCoord =$MouseCoord[0]-$Vel $Activ=1 Case JoyMoveRight () $XMouseCoord = $MouseCoord[0]+$Vel $Activ=1 Case Else Sleep (50) EndSelect Select Case JoyMoveUp () $YMouseCoord =$MouseCoord[1]-$Vel $Activ=1 Case JoyMoveDown () $YMouseCoord= $MouseCoord[1]+$Vel $Activ=1 Case Else Sleep (50) EndSelect MouseMove ($XMouseCoord,$YMouseCoord,0) WEnd Select Case $Activ=1 MouseClick ("primary") Case Else Send ("{LWIN}") EndSelect EndFunc IRC Client - 75 pages 3728 lines. Blob crumbler (game)Backup (drag to backup + cmd line)RS232 Link to comment Share on other sites More sharing options...
niponcio Posted June 27, 2007 Share Posted June 27, 2007 Hi, I was wondering If I can Send joystick movements to a Window without actually moving the Joystick.. Can this be done with your script? Link to comment Share on other sites More sharing options...
elgabionline Posted July 31, 2007 Author Share Posted July 31, 2007 Is there a way to when I Press a Key on the Keyboard, It do a Joystick InPut ?Example: Press the UP key on the Keyboard = the UP with a stick on a Joystick.Hi, I was wondering If I can Send joystick movements to a Window without actually moving the Joystick.. Can this be done with your script?Hi to all members here. Thanks for their comments and replies. I was thinking about your ideas. While I was analyzing this, the biggest problem that I found is get to be able to simulate Joystick commands "Send", at the game. There were not problems in attempting "record" the movements with a script logger (like a "Joysticks catches"), but: how to carry out the commands to the window?That would be hindering me the things (and for the time being, I don't see solution).I try with some calls to the functions built in winmm.dll but all attempts failed. I think that it could also be some protection in the games, although I'm not sure. It's a pain for me that I couldn't find this problem to "solve it in advance".Well, I'll be searching for any ideas.. (or if I devised something) Bye! Link to comment Share on other sites More sharing options...
FuryCell Posted July 31, 2007 Share Posted July 31, 2007 (edited) Anyone able to run this on Vista? I tried both the mouse script and the default test and all I get is a stack error. Edited July 31, 2007 by P5ych0Gigabyte HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
L3G3NdKillEr Posted October 7, 2007 Share Posted October 7, 2007 i Want to say its Wonderfull. i think that u made this tool for me i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================> Link to comment Share on other sites More sharing options...
majklcze Posted March 27, 2008 Share Posted March 27, 2008 Joystick mapping works like charm but can this be done for simulating Joy movings??? i need something to control joystick move Link to comment Share on other sites More sharing options...
Swift Posted March 27, 2008 Share Posted March 27, 2008 Why is this not working for me? Everytime I close the first dialog, on the test, it crashs, it says: AutoIt has encoutered an error and needs to close. Why? Link to comment Share on other sites More sharing options...
TitanX Posted December 14, 2008 Share Posted December 14, 2008 heya i would like to ask if someone could tell me or just give me a hint or something...how could i make that i control joystick buttons with keyboard...like with autoit i likely pressing 2 buttons all the time and those 2 buttons are clicking 2 joystick buttons... thanks for your help! Link to comment Share on other sites More sharing options...
myspacee Posted April 13, 2009 Share Posted April 13, 2009 Reading about Joystick and AI interactions... Now i'm inoffice so i can't try, but udf is capable to detect also analog stick ? (and their diagonals?) Thank you for any info, m. 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