Hyflex Posted May 4, 2007 Posted May 4, 2007 (edited) Ok so... In my script i have: Send($SwitchTG)oÝ÷ Ø Ý¯y«¢+Ù±½°ÀÌØíMݥѡQô%¹¥I¡MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈí½¹¥¹¥¹¤ÅÕ½Ðì°ÅÕ½ÐíMÑÑ¥¹ÌÅÕ½Ðì°ÅÕ½ÐíMݥѡQÅÕ½Ðì°ÅÕ½ÐìÈÅÕ½Ðì¤ In my ini file i have: [Settings] SwitchTG = "2" How can i make it so it actually sends the Number 2 out? not numpad2 I want to be able to change it regually and quickly so its got to be from the ini file... Does anyone know Edited May 4, 2007 by XxXGoD
Xenobiologist Posted May 4, 2007 Posted May 4, 2007 I read the help it sitll doesnt work.HI,this?Send('{NUMPAD' & $SwitchTG& '}') So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Hyflex Posted May 4, 2007 Author Posted May 4, 2007 HI,this?Send('{NUMPAD' & $SwitchTG& '}') So long,MegaI Allready said i dont want it numpad, i knw how to do what u just did, but i dont want that
Hyflex Posted May 5, 2007 Author Posted May 5, 2007 up! Ive tryed: send(isnumber($SwitchTG)) But still nothing...
erebus Posted May 5, 2007 Posted May 5, 2007 It actually sends the number 2 out. It does not presses the NUM-2 button. To verify this, try to turn off your NumLock button and run your script to send a number to Notepad for example.The problem you probably have is not related to AutoIT. Try to tell us in which program you send that number. Some programs handle the keystrocks abnormally.
Hyflex Posted May 5, 2007 Author Posted May 5, 2007 (edited) Well, i test in notepad its not working... It HAS To press the 2 on top left of keyboard as im useing the numpad 2 as the button what sends s series of keys, what includes the number 2 Edited May 5, 2007 by XxXGoD
erebus Posted May 5, 2007 Posted May 5, 2007 What are you talking about? $number = IniRead("test.ini", "MyProg", "Number", "NOTEXIST") Run(@WindowsDir & "\notepad.exe", @WindowsDir) Sleep(1000) WinActivate("Notepad") For $i = 1 To 100 Send($number) Next Also make a "test.ini" file with this contents: [MyProg] Number = "2" And see yourself.
enaiman Posted May 5, 2007 Posted May 5, 2007 Hmm ... maybe I'm wrong but ... I guess the content of your ini file could generate the problem [Settings] SwitchTG = "2"oÝ÷ Ø;^*.涯j[jË(r&yÛhKrÆ~涢'âëaÌ(ºW[z«¨·j®¢Ö§vz-¶§ºfÞ¯k(¶¢{^ÛÜ"VÞªê-Ú«¨¶)ìµæ¡ö¬je{cÉ·²¢çÈZç(קµ«ºÚ"µÍÔÙ][Ü×BÝÚ]ÚÈH SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
erebus Posted May 6, 2007 Posted May 6, 2007 You are wrong. Actually the only difference with quotes or not in your INI values, is when they have spaces. Check my example above and see for yourself.
enaiman Posted May 6, 2007 Posted May 6, 2007 You are wrong.Yep - I am. Sorry.I always thought that IniRead reads exactly what it finds on the key field ... it seems that it ignores the quotes at the begining/end of key.Thanks for pointing that out. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
Hyflex Posted May 7, 2007 Author Posted May 7, 2007 Well here is my script: Still doesnt send 2 when pressed... expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.2.0 Author: Ryan D Script Function: Will Butterfly #ce ---------------------------------------------------------------------------- ;; Global Pause Start Global $Paused ;; Global Pause End ;; Global Pause for Butterfly Start Global $UpBFMove_Used = False Global $DownBFMove_Used = False Global $LeftBFMove_Used = False Global $RightBFMove_Used = False ;; Global Pause for Butterfly End ;; Global Pause for SlashShot Start Global $UpSSMove_Used = False Global $DownSSMove_Used = False Global $LeftSSMove_Used = False Global $RightSSMove_Used = False ;; Global Pause for SlashShot End ;; Ini Read for Movement keys Start Global $UpBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Up", "W") Global $DownBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Down", "S") Global $LeftBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Left", "A") Global $RightBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Right", "D") ;; Ini Read for Movement keys End ;; Ini Read for Butterfly Start Function Keys Start Global $UpBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Up Start", "{UP}") Global $DownBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Down Start", "{DOWN}") Global $LeftBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Left Start", "{LEFT}") Global $RightBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Right Start", "{RIGHT}") ;; Ini Read for Butterfly Start Function Keys End ;; Ini Read for Movement keys Start Global $UpSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Up", "W") Global $DownSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Down", "S") Global $LeftSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Left", "A") Global $RightSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Right", "D") ;; Ini Read for Movement keys End ;; Ini Read for SlashShot Start Function Keys Start Global $UpSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Up Start", "{NUMPAD8}") Global $DownSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Down Start", "{NUMPAD2}") Global $LeftSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Left Start", "{NUMPAD4}") Global $RightSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Right Start", "{NUMPAD6}") ;; Ini Read for SlashShot Start Function Keys End ;; Ini Read for Extra Settings Start Global $EnableBF = IniRead(@ScriptDir & "\config.ini", "Settings", "Enable Butterfly", "Yes") Global $SSSwitchToGun = IniRead(@ScriptDir & "\config.ini", "Settings", "Switch To Gun", "2") Global $SSSwitchToGunRelease = IniRead(@ScriptDir & "\config.ini", "Settings", "Switch To Gun Release", "2") Global $EnableSS = IniRead(@ScriptDir & "\config.ini", "Settings", "Enable SlashShot", "Yes") Global $MinDelay = IniRead(@ScriptDir & "\config.ini", "Delays", "Min Delay", "10") Global $MaxDelay = IniRead(@ScriptDir & "\config.ini", "Delays", "Max Delay", "20") ;; Ini Read for Extra Settings End ;; Misc HotKeys Start HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") ;; Misc HotKeys End ;; ButterFly HotKeys Start HotKeySet($UpBFMoveSF, "UpBFMove") HotKeySet($DownBFMoveSF, "DownBFMove") HotKeySet($LeftBFMoveSF, "LeftBFMove") HotKeySet($RightBFMoveSF, "RightBFMove") ;; ButterFly HotKeys End ;; Slash Shot HotKeys Start HotKeySet($UpSSMoveSF, "UpSSMove") HotKeySet($DownSSMoveSF, "DownSSMove") HotKeySet($LeftSSMoveSF, "LeftSSMove") HotKeySet($RightSSMoveSF, "RightSSMove") ;; Slash Shot HotKeys End ;; Global Sleep Start While 1 Sleep(10) WEnd ;; Global Sleep End ;; TogglePause Start Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;; TogglePause End ;; Terminate/Exit Start Func Terminate() MsgBox(0x0, "", "... Exiting", 1) Exit 0 EndFunc ;; Terminate/Exit End ;; Upwards Butterfly Move Start Func UpBFMove() If $UpBFMove_Used Then Return If $EnableBF = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($UpBFMove) Send($UpBFMove) MouseClick("left") Sleep(Random(200, 210, 1)) Send("{LSHIFT}") $UpBFMove_Used = False EndIf EndFunc ;; Upwards Butterfly Move End ;; Left Butterfly Move Start Func LeftBFMove() If $LeftBFMove_Used Then Return If $EnableBF = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($LeftBFMove) Send($LeftBFMove) MouseClick("left") Sleep(Random(200, 210, 1)) Send("{LSHIFT}") $LeftBFMove_Used = False EndIf EndFunc ;; Left Butterfly Move End ;; Down Butterfly Move Start Func DownBFMove() If $DownBFMove_Used Then Return If $EnableBF = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($DownBFMove) Send($DownBFMove) MouseClick("left") Sleep(Random(200, 210, 1)) Send("{LSHIFT}") $DownBFMove_Used = False EndIf EndFunc ;; Down Butterfly Move End ;; Right Butterfly Move Start Func RightBFMove() If $RightBFMove_Used Then Return If $EnableBF = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($RightBFMove) Send($RightBFMove) MouseClick("left") Sleep(Random(200, 210, 1)) Send("{LSHIFT}") $RightBFMove_Used = False EndIf EndFunc ;; Right Butterfly Move End ;; Upwards SlashShot Move Start Func UpSSMove() If $UpSSMove_Used Then Return If $EnableSS = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($UpSSMove) Send($UpSSMove) MouseDown("left") Send($SSSwitchToGun) Send($SSSwitchToGunRelease) MouseUp("left") $UpSSMove_Used = False EndIf EndFunc ;; Upwards SlashShot Move End ;; Left SlashShot Move Start Func LeftSSMove() If $LeftSSMove_Used Then Return If $EnableSS = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($LeftSSMove) Send($LeftSSMove) MouseDown("left") Send($SSSwitchToGun) Send($SSSwitchToGunRelease) MouseUp("left") $LeftSSMove_Used = False EndIf EndFunc ;; Left SlashShot Move End ;; Down SlashShot Move Start Func DownSSMove() If $DownSSMove_Used Then Return If $EnableSS = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($DownSSMove) Send($DownSSMove) MouseDown("left") Send($SSSwitchToGun) Send($SSSwitchToGunRelease) MouseUp("left") $DownSSMove_Used = False EndIf EndFunc ;; Down SlashShot Move End ;; Right SlashShot Move Start Func RightSSMove() If $RightSSMove_Used Then Return If $EnableSS = "Yes" Then Sleep(Random($MinDelay, $MaxDelay, 1)) Send("{SPACE}") Send($RightSSMove) Send($RightSSMove) MouseDown("left") Send($SSSwitchToGun) Send($SSSwitchToGunRelease) MouseUp("left") $RightSSMove_Used = False EndIf EndFunc ;; Right SlashShot Move End Here is my ini file: expandcollapse popup[HotKeys BF] ;==================================================================================== ; ; HotKeys ; ; * Butterfly Move Up => The button you use to move upwards ; ; * Butterfly Move Down => The button you use to move downwards ; ; * Butterfly Move Left => The button you use to move left ; ; * Butterfly Move Right => The button you use to move right ; ; ; * Butterfly Move Up Start => The button you use to Butterfly upwards ; ; * Butterfly Move Down Start => The button you use to Butterfly downwards ; ; * Butterfly Move Left Start => The button you use to Butterfly left ; ; * Butterfly Move Right Start => The button you use to Butterfly right ; ;==================================================================================== Butterfly Move Up = W Butterfly Move Down = S Butterfly Move Left = A Butterfly Move Right = D Butterfly Move Up Start = "{UP}" Butterfly Move Down Start = "{DOWN}" Butterfly Move Left Start = "{LEFT}" Butterfly Move Right Start = "{RIGHT}" ;==================================================================================== [HotKeys SS] ;==================================================================================== ; ; HotKeys ; ; * SlashShot Move Up => The button you use to move upwards ; ; * SlashShot Move Down => The button you use to move downwards ; ; * SlashShot Move Left => The button you use to move left ; ; * SlashShot Move Right => The button you use to move right ; ; ; * SlashShot Move Up Start => The button you use to SlashShot upwards ; ; * SlashShot Move Down Start => The button you use to SlashShot downwards ; ; * SlashShot Move Left Start => The button you use to SlashShot left ; ; * SlashShot Move Right Start => The button you use to SlashShot right ; ; * Switch To Gun => Key you use to switch to your gun, use 0-9 dont know if Letters ; work ; ;==================================================================================== SlashShot Move Up = W SlashShot Move Down = S SlashShot Move Left = A SlashShot Move Right = D SlashShot Move Up Start = "{NUMPAD8}" SlashShot Move Down Start = "{NUMPAD2}" SlashShot Move Left Start = "{NUMPAD4}" SlashShot Move Right Start = "{NUMPAD6}" Switch To Gun = "2 DOWN" Switch To Gun Release = "2 UP" ;==================================================================================== [Settings] ;==================================================================================== ; ; Settings ; ; * Enable Butterfly => ; ; * Enable SlashShot => ; ;==================================================================================== Enable Butterfly = Yes Enable SlashShot = Yes ;==================================================================================== [Delays] ;==================================================================================== ; ; Delays ; ; IF YOU DONT KNOW WHAT THIS IS STAY OUT ; ; * Min Delay => Mimimum Delay Between Each Action on the script. ; ; * Max Delay => Maximum Delay Between Each Action on the script. ; ; ; Note: Delay is in Miliseconds, so 1000 = 1 Second ; ;==================================================================================== Min Delay = 10 Max Delay = 20
evilertoaster Posted May 7, 2007 Posted May 7, 2007 (edited) Maybe you are looking for send("{ASC 050}") ? Just to be clear: Is the problem that your send command is pressing the non-numlock version of 2 (down) isntead of just sending 2 like you want? Edited May 7, 2007 by evilertoaster
J0ker Posted May 7, 2007 Posted May 7, 2007 (edited) IniRead(@ScriptDir & "\config.ini", "Settings", "SwitchTG", "") and use IniWrite to write the value 2 before the IniRead. Edited May 7, 2007 by J0ker
enaiman Posted May 7, 2007 Posted May 7, 2007 There is something strange ...You said you want to send "2" (SwitchToGun value) but your ini file content shows:Switch To Gun = "2 DOWN"Switch To Gun Release = "2 UP"IMHO the value read fron this ini key will be 2 DOWN which is considered as a string and not a number as you want.If you want to send the number 2 then tyou should change the ini value: Switch To Gun = 2 or Switch To Gun = "2"I don't know what could be the meaning of DOWN and UP? Are you trying to send arrow keys? Are you trying to use something like "_IsPressed" function?I'm really confused. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
Hyflex Posted May 10, 2007 Author Posted May 10, 2007 There is something strange ...You said you want to send "2" (SwitchToGun value) but your ini file content shows:IMHO the value read fron this ini key will be 2 DOWN which is considered as a string and not a number as you want.If you want to send the number 2 then tyou should change the ini value: Switch To Gun = 2 or Switch To Gun = "2"I don't know what could be the meaning of DOWN and UP? Are you trying to send arrow keys? Are you trying to use something like "_IsPressed" function?I'm really confused. LolIf you use: Send("{ENTER DOWN}") then it will hold it down.I tryed that method to see if it was something i was doing wrong, it should be just: Send($SwitchTG) and in the ini file it to be: Switch To Gun = "2"
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