Nave47 Posted March 11, 2007 Posted March 11, 2007 This is not a keylogger attempt, What I intended this program to do is to detect if a key is pressed and the script would simulate keyboard presses(in example: "Y" button is set simulate this keyboard combo "[f1]+[1]+[2]". Anyone knows which functions/commands I needed to make my script. I intended to make this script to help those who don't have a G15 keyboard with programmable macros, to have the same advantage with those who have G15 Keyboards. Yes, this is for a game. I hope you can help me. Thanks. - Nave47
ChrisL Posted March 11, 2007 Posted March 11, 2007 Welcome to the Forums! You need to take a look in the help file for HotKeySet() and Send() you will also need to look at creating a loop for your script to keep it running waiting for the keypress. While 1 sleep(100) Wend [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
Nave47 Posted March 12, 2007 Author Posted March 12, 2007 Hmm... Thanks for the welcome note. On Topic : Ah, Maybe you can provide a simple template to just to have an idea on how I'll make my script? I'm still learing, Sorry about that.
Moderators SmOke_N Posted March 12, 2007 Moderators Posted March 12, 2007 Hmm... Thanks for the welcome note.On Topic : Ah, Maybe you can provide a simple template to just to have an idea on how I'll make my script? I'm still learing, Sorry about that.Take a look at what he suggested, at the bottom of the description, you'll see your "template". Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Nave47 Posted March 12, 2007 Author Posted March 12, 2007 I'm such a newbie... I searched the help file but can you tell me what command detects keypresses? Maybe this will be my last question. Thanks.
seandisanti Posted March 12, 2007 Posted March 12, 2007 I'm such a newbie... I searched the help file but can you tell me what command detects keypresses? Maybe this will be my last question. Thanks.HotKeySet()
Nave47 Posted March 12, 2007 Author Posted March 12, 2007 (edited) Anyone mind to check this? I'm still a newbie and learning, So I don't if anything is wrong or missing. Actually this is my first script. Thanks expandcollapse popup;========================================== ;========================================== ; ; ; MacroScript by : Nave47 ; ; Current State : Unfinished ; ; ; ; ;========================================== ;========================================== ;=== Start === #No TrayIcon ;#include <GuiConstants.au3> ;=== Gui === ;GuiCreate("MacroScript", 475, 325) ;$F9 = GUICtrlCreateInput("W", 32, 25, 209, 21) ;$F10 = GUICtrlCreateInput("E", 32, 50, 209, 21) ;$F11 = GUICtrlCreateInput("R", 32, 75, 209, 21) ;$F12 = GUICtrlCreateInput("T", 32, 100, 209, 21) ;$Label1 = GUICtrlCreateLabel("W", 10, 28, 16, 17) ;$Label2 = GUICtrlCreateLabel("E", 5, 53, 22, 17) ;$Label3 = GUICtrlCreateLabel("R", 7, 77, 22, 17) ;$Label4 = GUICtrlCreateLabel("T", 6, 104, 22, 17) ;$Label5 = GUICtrlCreateLabel("Made by Nave47", 24, 0, 157, 17) ;=== Scipt Controls === MsgBox(64, "MacroScript", "Script Loaded") HotKeySet("{/}","TogglePause") HotKeySet("{*}","Terminate") Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc ;=== Variables === ;$Macro[0]="Q" ;$Macro[1]="W" ;$Macro[2]="E" ;$Macro[3]="R" ;$Macro[4]="T" ;$Macro[5]="Y" ;=== Key Detection === Func CheckKeyPress() While $Paused = Not $Paused HotKeySet("Q"[,"Macro1"]) HotKeySet("W"[,"Macro2"]) ;HotKeySet("E"[,"Macro3"]) ;HotKeySet("R"[,"Macro4"]) ;HotKeySet("T"[,"Macro5"]) ;HotKeySet("Y[,"Macro6"]) Sleep(50) WEnd EndFunc ;=== Macro Sets === Func Macro1() Send("{F1}{8}"[,1]) Sleep(50) Send("{F1}{8}"[,1]) EndFunc Func Macro2() Send("{F2}{9}{0}"[,1]) Sleep(50) Send("{F2}{9}{0}"[,1]) EndFunc ;Func Macro3() ;Send("{F3}{0}"[,1]) ;Sleep(50) ;Send("{F3}"[,1]) ;EndFunc ;=== To Be Continued If Sucessful == I'm sure no one would steal my work, because I'm not yet sure if its working. (Can't test it now, Server too crowded) Edited March 12, 2007 by Nave47
seandisanti Posted March 12, 2007 Posted March 12, 2007 *bump*you don't want to do that..... you weren't even off the first page yet... have you tried your script? does it work? it doesn't look like there's anything in it that would HAVE to be done in game to test...
Misha Posted March 12, 2007 Posted March 12, 2007 The right way to do is with _IsPressed function (I think only in beta) it receives only hex of the keys but it checks if it is pressed actually and the fact that your program doesnt have a connection to CheckKeyPress function..basicly rewrite it ._.
Nave47 Posted March 12, 2007 Author Posted March 12, 2007 you don't want to do that..... you weren't even off the first page yet... have you tried your script? does it work? it doesn't look like there's anything in it that would HAVE to be done in game to test...I'm sure no one would steal my work, because I'm not yet sure if its working. (Can't test it now, Server too crowded)Sorry About the bump thing.The right way to do is with _IsPressed function (I think only in beta) it receives only hex of the keys but it checks if it is pressed actually and the fact that your program doesnt have a connection to CheckKeyPress function..basicly rewrite it ._.o.O my functions are not synchronized. Thanks for that.
Toady Posted March 21, 2007 Posted March 21, 2007 This is not a keylogger attempt, What I intended this program to do is to detect if a key is pressed and the script would simulate keyboard presses(in example: "Y" button is set simulate this keyboard combo "[f1]+[1]+[2]". Anyone knows which functions/commands I needed to make my script. I intended to make this script to help those who don't have a G15 keyboard with programmable macros, to have the same advantage with those who have G15 Keyboards. Yes, this is for a game. I hope you can help me. Thanks. - Nave47 Hey I have already done this. watch this youtube video of me using it. MacroGamer Beta Video If you are interested in how I did it, Ill be happy to show you. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding
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