Jump to content

CloudD901

Members
  • Posts

    14
  • Joined

  • Last visited

About CloudD901

  • Birthday 01/27/1986

CloudD901's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Sorry about that. Autoit v3.3.8.0 (Win7) v3.3.6.0 (WinXP) SciTE v2.28 Cisco Agent v8.0.2.200 (Program with ListView) My scripts is actually about 2600 lines. This is the trimmed version of the part of my script giving the issue. This same script works fine in Windows XP (both 32bit). Tested script compiled under both XP and 7 using 3.3.6.0 and 3.3.8.0. -Verified that $Agent is correct. Verified $list is correct. $Line returns 0. $Queue returns blank. #include <Array.au3> #include <Constants.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> $Agent = GetAgentHandle() If Not @error Then ConsoleWrite(@CRLF & $Agent) $list = ControlGetHandle($Agent, "", "[CLASS:SysListView32; INSTANCE:2]") If Not @error Then ConsoleWrite(@CRLF & $list) $Line = _GUICtrlListView_FindText($list, "CSQName") $Queue = _GUICtrlListView_GetItemText($list, $Line, 1) Else TrayTip("Cisco Assistant", "Failed to Find ListView Handle.", 7, 17) EndIf Else TrayTip("Cisco Assistant", "Failed to Find the Cisco Agent.", 7, 17) EndIf MsgBox(0,"",$Queue) Func GetAgentHandle() Local $Agent $Agent = WinGetHandle("Reserved - Cisco Agent Desktop") If @error Then $Agent = WinGetHandle("Talking - Cisco Agent Desktop") If @error Then $Agent = WinGetHandle("Work - Cisco Agent Desktop") If @error Then $Agent = WinGetHandle("Ready - Cisco Agent Desktop") If @error Then $Agent = WinGetHandle("Not Ready - Cisco Agent Desktop") If @error Then $Agent = WinGetHandle("Cisco Agent Desktop") EndIf EndIf EndIf EndIf EndIf If $Agent = "" Then SetError(1) Return $Agent EndFunc ;==>GetAgentHandle By cloudd901 at 2012-01-11 Please let me know if you have any thoughts or ideas. There has to be some difference between XP and Win7 when reading this ListView. Edit: I've had time to test some more tonight and still no luck. I've tried changing "_GUICtrlListView_GetItemText" and "_GUICtrlListView_FindText" with "ControlListView". Still the same results. Works on XP but not Win7. Tried combinations of "Name or Handle" for the Window with "ClassnameNN or Handle or Advanced Info" for the Control. Any other way of getting information from a ListView control? Edit 2: ... I'm speachless ... The ammount I worked on this just to find the simplest solution is crazy. I went through every step of the _ListView_FindText() function and found the fault. I found that I was getting an access error in the internal memory function __Mem_OpenProcess(). This could only mean one thing.......... UAC. #RequireAdmin seems to be the best rout to ensure a working script.
  2. Hello, I hope someone would be able to assist with my problem. I've been using a program for a while on Windows XP. Now, we are switching to Windows 7 (32) and part of my scripts stopped working. I found that anything related to _GUICtrlListView_ is giving me trouble. The code to get the handle of the main window and the handle of the SysListView32 works. The following examples are trying to find an "Issue Number" of a multicolumn ListView. This example returns 0 (even when entering the handle manually and "Issue Number" exists). $Line = _GUICtrlListView_FindText($list, "Issue Number") This example returns blank (even when entering the handle and line manually). $IssueNumber = _GUICtrlListView_GetItemText($list, $Line, 1) Please let me know if any further information is needed. I've tested this on x64 and 32 bit Win7. Thanks!
  3. LOL that's awesome. I think my head's been in my script too long. I usually call exe's with command line parameters. ($cmdline[] is less mess than working with extra files.) Thanks!
  4. I thought about that, but it might look a little strange. The first script uses the progress bar for other functions very often so keeping it in that GUI is a must. If I could somehow use the second script to hide that progress bar and create a new one over it temporarily, that would be good, but i don't know how to add controls to another GUI. A transparent window over the top might work as well, but then you loose the ability to move the window and see two GUI's on the task bar. Thanks though. I have a few scripts that are anything but simple. It's these kinds of things that keep me going.
  5. I have a small issue with a progress bar. The script I am using it on is to clean temporary files remotely in my workplace. My old script used folder recursion to find every file in the temp folders and run a 'FileDelete' command on each file. Using a progress bar for this situation was simple; make an array containing all folders and use 'For Next' and add a progress bar. My new script attempts to run a 'DirRemove' on the folder first. This seems to have cut down on half the time, but I am unable to modify the progress bar while this command is running. It is possible for a pc to have well over 10k temp files and removing the folder may take 5-10 min. During this time, I have no way of editing the progress bar. 1) My thoughts were to use 'DirGetSize' and 'AdlibRegister' to get a file count every 10-30 seconds and update the progress bar. But 'AdlibRegister' will not call the function while 'DirRemove' is working. 2) My second thought was to use 'DirGetSize' in a separate script to continuously check the file count and in return update the progress bar. But I can't seem to get the second script to modify the progress bar on the first script. 'GUICtrlSetData' won't work from one script to another and I can't find a function that will. 3)? Any thoughts?
  6. I have the script finished, but I may need some help cleaning it up a bit. (Marked comments in code.) #include <Array.au3> #include <Misc.au3> Global $save = @ScriptDir & "\FF7 Loader.ini" Global $start = 0, $mount = 0, $Pause = 0, $GameConfig = 0, $Backupstring, $runkeycapture = 1 Global $LsettingsGUI, $KeyGui, $allKeys, $keyBackup Global $radio1, $radio2, $radio3, $radio4, $radio5 Global $key[17][3] ;=========================These keys have an INI and GUI interface that can be set to any keys. $key[1][0] = IniRead($save, "Keys", "Up", "w") $key[2][0] = IniRead($save, "Keys", "Down", "s") $key[3][0] = IniRead($save, "Keys", "Left", "a") $key[4][0] = IniRead($save, "Keys", "Right", "d") $key[5][0] = IniRead($save, "Keys", "OK", "c") $key[6][0] = IniRead($save, "Keys", "Cancel", "{lshift}") $key[7][0] = IniRead($save, "Keys", "Menu", "v") $key[8][0] = IniRead($save, "Keys", "Switch", "{tab}") $key[9][0] = IniRead($save, "Keys", "PUp", "q") $key[10][0] = IniRead($save, "Keys", "PDown", "e") $key[11][0] = IniRead($save, "Keys", "View", "f") $key[12][0] = IniRead($save, "Keys", "Run", "r") $key[13][0] = IniRead($save, "Keys", "Target", "t") $key[14][0] = IniRead($save, "Keys", "Start", "p") $key[15][0] = IniRead($save, "Keys", "Assist", "z") $key[16][0] = IniRead($save, "Keys", "Quit", "") ;=========================These are the keys that autoit actually presses to make the character move. $key[1][1] = "{numpad8}" $key[2][1] = "{numpad2}" $key[3][1] = "{numpad4}" $key[4][1] = "{numpad6}" $key[5][1] = "{numpadenter}" $key[6][1] = "{numpad0}" $key[7][1] = "{numpadadd}" $key[8][1] = "{numpaddot}" $key[9][1] = "{numpad9}" $key[10][1] = "{numpad3}" $key[11][1] = "{numpad7}" $key[12][1] = "{numpad7}{numpad3}" $key[13][1] = "{numpad1}" $key[14][1] = "{numpad5}" $key[15][1] = "{numpadsub}" $key[16][1] = "" $sticky = RegRead("HKEY_CURRENT_USER \Control Panel \Accessibility \StickyKeys", "Flags") ;=========================Start running the key script here. I place this after the run command for the game. keycapture() While 1 Sleep(100) WEnd Func keycapture() ;=========================Disable the Sticky Keys for using buttons like shift or ctrl. RegWrite("HKEY_CURRENT_USER \Control Panel \Accessibility \StickyKeys", "Flags", "REG_SZ", 506) $hDll = DllOpen("user32.dll") While $runkeycapture = 1 If _IsPressed(41, $hDll) Then $allKeys &= "a|" EndIf If _IsPressed(42, $hDll) Then $allKeys &= "b|" EndIf If _IsPressed(43, $hDll) Then $allKeys &= "c|" EndIf If _IsPressed(44, $hDll) Then $allKeys &= "d|" EndIf If _IsPressed(45, $hDll) Then $allKeys &= "e|" EndIf If _IsPressed(46, $hDll) Then $allKeys &= "f|" EndIf If _IsPressed(47, $hDll) Then $allKeys &= "g|" EndIf If _IsPressed(48, $hDll) Then $allKeys &= "h|" EndIf If _IsPressed(49, $hDll) Then $allKeys &= "i|" EndIf If _IsPressed('4a', $hDll) Then $allKeys &= "j|" EndIf If _IsPressed('4b', $hDll) Then $allKeys &= "k|" EndIf If _IsPressed('4c', $hDll) Then $allKeys &= "l|" EndIf If _IsPressed('4d', $hDll) Then $allKeys &= "m|" EndIf If _IsPressed('4e') = 1 Then $allKeys &= "n|" EndIf If _IsPressed('4f', $hDll) Then $allKeys &= "o|" EndIf If _IsPressed(50) Then $allKeys &= "p|" EndIf If _IsPressed(51) Then $allKeys &= "q|" EndIf If _IsPressed(52) Then $allKeys &= "r|" EndIf If _IsPressed(53) Then $allKeys &= "s|" EndIf If _IsPressed(54) Then $allKeys &= "t|" EndIf If _IsPressed(55) Then $allKeys &= "u|" EndIf If _IsPressed(56) Then $allKeys &= "v|" EndIf If _IsPressed(57) Then $allKeys &= "w|" EndIf If _IsPressed(58) Then $allKeys &= "x|" EndIf If _IsPressed(59) Then $allKeys &= "y|" EndIf If _IsPressed('5a', $hDll) Then $allKeys &= "z|" EndIf If _IsPressed('01', $hDll) Then $allKeys &= "{LEFT MOUSE}|" EndIf If _IsPressed('02', $hDll) Then $allKeys &= "{RIGHT MOUSE}|" EndIf If _IsPressed('08', $hDll) Then $allKeys &= "{BACKSPACE}|" EndIf If _IsPressed('09', $hDll) Then $allKeys &= "{TAB}|" EndIf If _IsPressed('0d', $hDll) Then $allKeys &= "{ENTER}|" EndIf If _IsPressed('10', $hDll) Then $allKeys &= "{LSHIFT}|" EndIf If _IsPressed('11', $hDll) Then $allKeys &= "{LCTRL}|" EndIf If _IsPressed('12', $hDll) Then $allKeys &= "{ALT}|" EndIf If _IsPressed('13', $hDll) Then $allKeys &= "{PAUSE}|" EndIf If _IsPressed('14', $hDll) Then $allKeys &= "{CAPSLOCK}|" EndIf If _IsPressed('1b', $hDll) Then $allKeys &= "{ESC}|" EndIf If _IsPressed('20', $hDll) Then $allKeys &= " |" EndIf If _IsPressed('21', $hDll) Then $allKeys &= "{PGUP}|" EndIf If _IsPressed('22', $hDll) Then $allKeys &= "{PGDN}|" EndIf If _IsPressed('23', $hDll) Then $allKeys &= "{END}|" EndIf If _IsPressed('24', $hDll) Then $allKeys &= "{HOME}|" EndIf If _IsPressed('25', $hDll) Then $allKeys &= "{LEFT}|" EndIf If _IsPressed('26', $hDll) Then $allKeys &= "{UP}|" EndIf If _IsPressed('27', $hDll) Then $allKeys &= "{RIGHT}|" EndIf If _IsPressed('28', $hDll) Then $allKeys &= "{DOWN}|" EndIf If _IsPressed('2c', $hDll) Then $allKeys &= "{PRINTSCREEN}|" EndIf If _IsPressed('2d', $hDll) Then $allKeys &= "{INSERT}|" EndIf If _IsPressed('2e', $hDll) Then $allKeys &= "{DEL}|" EndIf If _IsPressed('30', $hDll) Then $allKeys &= "0|" EndIf If _IsPressed('31', $hDll) Then $allKeys &= "1|" EndIf If _IsPressed('32', $hDll) Then $allKeys &= "2|" EndIf If _IsPressed('33', $hDll) Then $allKeys &= "3|" EndIf If _IsPressed('34', $hDll) Then $allKeys &= "4|" EndIf If _IsPressed('35', $hDll) Then $allKeys &= "5|" EndIf If _IsPressed('36', $hDll) Then $allKeys &= "6|" EndIf If _IsPressed('37', $hDll) Then $allKeys &= "7|" EndIf If _IsPressed('38', $hDll) Then $allKeys &= "8|" EndIf If _IsPressed('39', $hDll) Then $allKeys &= "9|" EndIf _KeyIsPressed($allKeys) $allKeys = "" WEnd DllClose($hDll) RegWrite("HKEY_CURRENT_USER \Control Panel \Accessibility \StickyKeys", "Flags", "REG_SZ", $sticky) EndFunc ;==>keycapture ;=================I found that if I set a backup keystring and compair it to the new keystring, I can find out ;================= what keys were released. Then I use "Down" to simulate the keypress and "Up" to simulate the keyrelease. Func _KeyIsPressed($allKeys) Local $keysSend = "", $keyArray = "", $keysfound = "", $relSend = "", $locstring = "" $keyArray = StringSplit($allKeys, "|") For $i = 1 To $keyArray[0] Step 1 $keysfound = _ArraySearch($key, $keyArray[$i]) If Not @error Then $keysSend &= $key[$keysfound][1] EndIf Next If StringInStr($keysSend, "}") Then $keysSend = StringReplace($keysSend, "}", " Down}") EndIf $kstring1 = StringSplit($keysSend, "}") $kstring2 = StringSplit($Backupstring, "}") For $i = $kstring1[0] To 1 Step -1 $loc = _ArraySearch($kstring2, $kstring1[$i]) If Not @error Then _ArrayDelete($kstring2, $loc) Next $Backupstring = _ArrayToString($kstring2, "}", 1) If Not @error Then $Backupstring &= "}" If StringInStr($Backupstring, "Down") Then $relSend = StringReplace($Backupstring, "Down", "Up") EndIf ;=========================Added msgbox to view what keys will be sent to the game. ;~ Send($relSend) ;~ Send($keysSend) MsgBox(0, "", $keysSend&"|"&$relSend) $Backupstring = $keysSend EndFunc ;==>_KeyIsPressed This solves the issue I was having. This allows the character to continue walking if I hold down a key; and stop walking if I release a key. Also accepts multiple keystrokes at once using 'Down' with Send(). If anyone would know how to clean it up a bit or if anyone knows another, quicker, way of doing this; please let me know. The only issue I've ran into so far using this script is the fact that it doesn't always release the "lshift" key. I tried temporarily disabling 'StickyKeys' in the registry and seemed to help it work better. But after holding it for a while; I am still forced to press it again a couple of times to get it to unstick. Is there another reg option for sticky keys? Thanks again, Hope this code can be usefull to someone else as well. My complete FF7 Loader is about 1k lines. I use it to make my FF7PC installation portable.
  7. Ok, I've been playing around with some code and came up with something that halfway works. I started using _IsPressed instead of HotKeySet. #include <Array.au3> #include <Misc.au3> Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 200) Global $key[17][3] Global $save = @ScriptDir & "\FF7 Loader.ini" Global $sethotkeys = 1 Global $LsettingsGUI, $KeyGui, $allKeys, $runkeycapture=1 $key[1][0] = IniRead($save, "Keys", "Up", "w") $key[2][0] = IniRead($save, "Keys", "Down", "s") $key[3][0] = IniRead($save, "Keys", "Left", "a") $key[4][0] = IniRead($save, "Keys", "Right", "d") $key[5][0] = IniRead($save, "Keys", "OK", "c") $key[6][0] = IniRead($save, "Keys", "Cancel", "x") $key[7][0] = IniRead($save, "Keys", "Menu", "v") $key[8][0] = IniRead($save, "Keys", "Switch", "{tab}") $key[9][0] = IniRead($save, "Keys", "PUp", "q") $key[10][0] = IniRead($save, "Keys", "PDown", "e") $key[11][0] = IniRead($save, "Keys", "View", "f") $key[12][0] = IniRead($save, "Keys", "Run", "r") $key[13][0] = IniRead($save, "Keys", "Target", "t") $key[14][0] = IniRead($save, "Keys", "Start", "p") $key[15][0] = IniRead($save, "Keys", "Assist", "z") $key[16][0] = IniRead($save, "Keys", "Quit", "") $key[1][1] = "{numpad8}" $key[2][1] = "{numpad2}" $key[3][1] = "{numpad4}" $key[4][1] = "{numpad6}" $key[5][1] = "{numpadenter}" $key[6][1] = "{numpad0}" $key[7][1] = "{numpadadd}" $key[8][1] = "{numpaddot}" $key[9][1] = "{numpad9}" $key[10][1] = "{numpad3}" $key[11][1] = "{numpad7}" $key[12][1] = "{numpad7}{numpad3}" $key[13][1] = "{numpad1}" $key[14][1] = "{numpad5}" $key[15][1] = "{numpadsub}" $key[16][1] = "" ;-------------Start Key Modification Here keycapture() While 1 sleep(100) WEnd ;------------Keep track of what key is pressed and add to a variable ;------------I have listed all keys so the user can use any key he wants in the ini file. Func keycapture() $hDll = DllOpen("user32.dll") While $runkeycapture = 1 If _IsPressed(41, $hDll) Then $allKeys &= "a|" EndIf If _IsPressed(42, $hDll) Then $allKeys &= "b|" EndIf If _IsPressed(43, $hDll) Then $allKeys &= "c|" EndIf If _IsPressed(44, $hDll) Then $allKeys &= "d|" EndIf If _IsPressed(45, $hDll) Then $allKeys &= "e|" EndIf If _IsPressed(46, $hDll) Then $allKeys &= "f|" EndIf If _IsPressed(47, $hDll) Then $allKeys &= "g|" EndIf If _IsPressed(48, $hDll) Then $allKeys &= "h|" EndIf If _IsPressed(49, $hDll) Then $allKeys &= "i|" EndIf If _IsPressed('4a', $hDll) Then $allKeys &= "j|" EndIf If _IsPressed('4b', $hDll) Then $allKeys &= "k|" EndIf If _IsPressed('4c', $hDll) Then $allKeys &= "l|" EndIf If _IsPressed('4d', $hDll) Then $allKeys &= "m|" EndIf If _IsPressed('4e') = 1 Then $allKeys &= "n|" EndIf If _IsPressed('4f', $hDll) Then $allKeys &= "o|" EndIf If _IsPressed(50) Then $allKeys &= "p|" EndIf If _IsPressed(51) Then $allKeys &= "q|" EndIf If _IsPressed(52) Then $allKeys &= "r|" EndIf If _IsPressed(53) Then $allKeys &= "s|" EndIf If _IsPressed(54) Then $allKeys &= "t|" EndIf If _IsPressed(55) Then $allKeys &= "u|" EndIf If _IsPressed(56) Then $allKeys &= "v|" EndIf If _IsPressed(57) Then $allKeys &= "w|" EndIf If _IsPressed(58) Then $allKeys &= "x|" EndIf If _IsPressed(59) Then $allKeys &= "y|" EndIf If _IsPressed('5a', $hDll) Then $allKeys &= "z|" EndIf If _IsPressed('01', $hDll) Then $allKeys &= "{LEFT MOUSE}|" EndIf If _IsPressed('02', $hDll) Then $allKeys &= "{RIGHT MOUSE}|" EndIf If _IsPressed('08', $hDll) Then $allKeys &= "{BACKSPACE}|" EndIf If _IsPressed('09', $hDll) Then $allKeys &= "{TAB}|" EndIf If _IsPressed('0d', $hDll) Then $allKeys &= "{ENTER}|" EndIf If _IsPressed('10', $hDll) Then $allKeys &= "{LSHIFT}|" EndIf If _IsPressed('11', $hDll) Then $allKeys &= "{LCTRL}|" EndIf If _IsPressed('12', $hDll) Then $allKeys &= "{ALT}|" EndIf If _IsPressed('13', $hDll) Then $allKeys &= "{PAUSE}|" EndIf If _IsPressed('14', $hDll) Then $allKeys &= "{CAPSLOCK}|" EndIf If _IsPressed('1b', $hDll) Then $allKeys &= "{ESC}|" EndIf If _IsPressed('20', $hDll) Then $allKeys &= " |" EndIf If _IsPressed('21', $hDll) Then $allKeys &= "{PGUP}|" EndIf If _IsPressed('22', $hDll) Then $allKeys &= "{PGDN}|" EndIf If _IsPressed('23', $hDll) Then $allKeys &= "{END}|" EndIf If _IsPressed('24', $hDll) Then $allKeys &= "{HOME}|" EndIf If _IsPressed('25', $hDll) Then $allKeys &= "{LEFT}|" EndIf If _IsPressed('26', $hDll) Then $allKeys &= "{UP}|" EndIf If _IsPressed('27', $hDll) Then $allKeys &= "{RIGHT}|" EndIf If _IsPressed('28', $hDll) Then $allKeys &= "{DOWN}|" EndIf If _IsPressed('2c', $hDll) Then $allKeys &= "{PRINTSCREEN}|" EndIf If _IsPressed('2d', $hDll) Then $allKeys &= "{INSERT}|" EndIf If _IsPressed('2e', $hDll) Then $allKeys &= "{DEL}|" EndIf If _IsPressed('30', $hDll) Then $allKeys &= "0|" EndIf If _IsPressed('31', $hDll) Then $allKeys &= "1|" EndIf If _IsPressed('32', $hDll) Then $allKeys &= "2|" EndIf If _IsPressed('33', $hDll) Then $allKeys &= "3|" EndIf If _IsPressed('34', $hDll) Then $allKeys &= "4|" EndIf If _IsPressed('35', $hDll) Then $allKeys &= "5|" EndIf If _IsPressed('36', $hDll) Then $allKeys &= "6|" EndIf If _IsPressed('37', $hDll) Then $allKeys &= "7|" EndIf If _IsPressed('38', $hDll) Then $allKeys &= "8|" EndIf If _IsPressed('39', $hDll) Then $allKeys &= "9|" EndIf _KeyIsPressed($allKeys) $allKeys = "" WEnd DllClose($hDll) EndFunc ;==>keycapture ;----------Track keys pressed and find them in an array of defined keys. ;----------If found, add the numberpad variant to a Send command. ;----------I added the 'Down' and 'Up' to the Send string to try and simulate diagonal instead of left then up. Func _KeyIsPressed($keypressed) Local $keysSend = "", $keyArray = "", $keysfound = "", $relSend = "" $keyArray = StringSplit($allKeys, "|") For $i = 1 To $keyArray[0] Step 1 $keysfound = _ArraySearch($key,$keyArray[$i]) If Not @error Then $keysSend &= $key[$keysfound][1] EndIf Next if StringInStr($keysSend, "}") Then $keysSend=StringReplace($keysSend, "}", " Down}") $relSend=StringReplace($keysSend, "Down", "Up") Send($keysSend&$relSend) EndIf EndFunc ;==>_KeyIsPressed I marked comments in the code to show my intentions. The problem I'm getting is when AutoIt sends the keys back UP. The movement of the character becomes "Jagged" and he seems to start and stop quickly. The SendKeyDownDelay seems to help, but I don't know how to tell AutoIt to "only send the key UP if I let go". I'll continue to look into it myself, but I'm hoping that someone knows an easy way.
  8. I'm assuming you are using XP. I think it's the OS that keeps the icon there when you kill the program. If you exit correctly instead of 'Stopping' the script with the editor, then the Icon disappears. Just add an exit or close function in the scripts from now on. Also, I came across a 'RefreshSystemTray' UDF not too long ago. It's not mine, but it works: ; =================================================================== ; _RefreshSystemTray($nDealy = 1000) ; ; Removes any dead icons from the notification area. ; Parameters: ; $nDelay - IN/OPTIONAL - The delay to wait for the notification area to expand with Windows XP's ; "Hide Inactive Icons" feature (In milliseconds). ; Returns: ; Sets @error on failure: ; 1 - Tray couldn't be found. ; 2 - DllCall error. ; =================================================================== _RefreshSystemTray() Func _RefreshSystemTray($nDelay = 1000) ; Save Opt settings Local $oldMatchMode = Opt("WinTitleMatchMode", 4) Local $oldChildMode = Opt("WinSearchChildren", 1) Local $error = 0 Do; Pseudo loop Local $hWnd = WinGetHandle("classname=TrayNotifyWnd") If @error Then $error = 1 ExitLoop EndIf Local $hControl = ControlGetHandle($hWnd, "", "Button1") ; We're on XP and the Hide Inactive Icons button is there, so expand it If $hControl <> "" And ControlCommand($hWnd, "", $hControl, "IsVisible") Then ControlClick($hWnd, "", $hControl) Sleep($nDelay) EndIf Local $posStart = MouseGetPos() Local $posWin = WinGetPos($hWnd) Local $y = $posWin[1] While $y < $posWin[3] + $posWin[1] Local $x = $posWin[0] While $x < $posWin[2] + $posWin[0] DllCall("user32.dll", "int", "SetCursorPos", "int", $x, "int", $y) If @error Then $error = 2 ExitLoop 3; Jump out of While/While/Do EndIf $x = $x + 8 WEnd $y = $y + 8 WEnd DllCall("user32.dll", "int", "SetCursorPos", "int", $posStart[0], "int", $posStart[1]) ; We're on XP so we need to hide the inactive icons again. If $hControl <> "" And ControlCommand($hWnd, "", $hControl, "IsVisible") Then ControlClick($hWnd, "", $hControl) EndIf Until 1 ; Restore Opt settings Opt("WinTitleMatchMode", $oldMatchMode) Opt("WinSearchChildren", $oldChildMode) SetError($error) EndFunc; _RefreshSystemTray()
  9. Actually http://en.wikipedia.org/wiki/Final_Fantasy_VII I use to be a huge fan. Decided I wanted to get back into it, so I found a copy.
  10. Been a few days. Thought I'd bump this topic to see if anyone knows how to emulate the number pad using other keys in AutoIt. Thanks again.
  11. OK, I have FF7 for the PC. I am trying to write a script to change the keys in-game (ex. Up, Down). The game is hard coded to only use the number pad for all of the keys. There are no options to change this. The issue that I'm having may not be solvable with AutoIt. I have tried using HotKeySet along with a function that send the keystroke to the game which corresponds with the number pad. Here are the problems: When walking using "w" (or any other key), the key sticks and continues walking after I release.I am unable to use multiple keys at a time (such as "w" & "a") to move diagonal.The code I use is: ;----These are the AutoIt options I have set. (still playing around with these) Opt("SendKeyDelay",5) Opt("SendKeyDownDelay", 60) ;---- Reads all of the keys from an INI file. $key[1][0] = IniRead($save, "Keys", "Up", "w") $key[2][0] = IniRead($save, "Keys", "Down", "s") $key[3][0] = IniRead($save, "Keys", "Left", "a") $key[4][0] = IniRead($save, "Keys", "Right", "d") $key[5][0] = IniRead($save, "Keys", "OK", "c") $key[6][0] = IniRead($save, "Keys", "Cancel", "x") $key[7][0] = IniRead($save, "Keys", "Menu", "v") $key[8][0] = IniRead($save, "Keys", "Switch", "{tab}") $key[9][0] = IniRead($save, "Keys", "PUp", "q") $key[10][0] = IniRead($save, "Keys", "PDown", "e") $key[11][0] = IniRead($save, "Keys", "View", "f") $key[12][0] = IniRead($save, "Keys", "Run", "r") $key[13][0] = IniRead($save, "Keys", "Target", "t") $key[14][0] = IniRead($save, "Keys", "Start", "p") $key[15][0] = IniRead($save, "Keys", "Assist", "z") $key[16][0] = IniRead($save, "Keys", "Quit", "") ;---- These are the Hard coded Number Pad references. $key[1][1] = "{numpad8}" $key[2][1] = "{numpad2}" $key[3][1] = "{numpad4}" $key[4][1] = "{numpad6}" $key[5][1] = "{numpadenter}" $key[6][1] = "{numpad0}" $key[7][1] = "{numpadadd}" $key[8][1] = "{numpaddot}" $key[9][1] = "{numpad9}" $key[10][1] = "{numpad3}" $key[11][1] = "{numpad7}" $key[12][1] = "{numpad7}{numpad3}" $key[13][1] = "{numpad1}" $key[14][1] = "{numpad5}" $key[15][1] = "{numpadsub}" $key[16][1] = "" ;---- Here loads the game settings along with the game, then sets the hotkeys. ;---- The Hotkyes unload once the game is minimized or quit. for $i=1 to 16 step 1 HotKeySet($key[$i][0],"Sendkey") Next ;---- This is the function I use to emulate the Number Pad. Func SendKey() $loc=_ArraySearch($key, @HotKeyPressed) Send($key[$loc][1]) EndFunc This is a small piece of the script I have. If more is needed, please let me know. These are all options that deal with the Keystrokes. Single keystrokes work fine; but the game is a pain to play not being able to use multiple keys as input. Thanks for taking a look!
  12. That's sweet!!! Thanks. I've started with a workaround that involved a blank label over the left tab and a script that would unselect the tab if the user happened to have found it. Now this works great.
  13. Close, but not quite. The tabs looked perfect, but I need the window to stay normal... lol That is cool though.
  14. This is my first post at these forums so please forgive me if I miss any info you may need to help. I have been using AutoIt for quite some time now but haven't used tabs much. What I am trying to do is create tabbed section in my window but have the tabs appear in the right side on the top of the control (opposite of default). I have tried many of the control styles that I found in the help reference but am unable to find the right one or combination. If someone knows a work around or the correct control style that would be great. Thanks.
×
×
  • Create New...