Aceguy Posted July 7, 2007 Posted July 7, 2007 anyone had any similar probs. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
ksmith247 Posted July 7, 2007 Posted July 7, 2007 I use Vista at work and haven't had any issues. Post your code. Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]
Aceguy Posted July 7, 2007 Author Posted July 7, 2007 just a simple program to remember all my serial codes and put them in for me. get fed up of typing them in, (TOO LAZY to look for them too). expandcollapse popup#include <GUIConstants.au3> AutoItSetOption("SendKeyDelay", 45); AutoItSetOption("SendKeyDownDelay", 45); $my_gui = GUICreate("", 300, 150, 200, 200) $code=0 $win="" $list = GUICtrlCreateList("",5,5, 200, 100,BitOR($WS_BORDER, $WS_VSCROLL,$WS_HSCROLL,$WS_EX_TOPMOST)) $check = GUICtrlCreateButton("Read Drive(s)", 210,125, 85 ,20) $stat=GUICtrlCreateLabel("",5,110,200,20) $paste=GUICtrlCreateButton("Paste Key",210,95,85,20) GUICtrlSetState(-1,$GUI_DISABLE) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $check $found=0 $var = DriveGetDrive("CDROM") GUICtrlSetState($paste,$GUI_DISABLE) GUICtrlSetData($list,"") GUICtrlSetData($list,"There are "&$var[0]&" Drives found") guictrlsetdata($stat,"READING DRIVES.... PLEASE WAIT") If Not @error Then For $i = 1 To $var[0] $drive_label = DriveGetLabel($var[$i]) data() Next GUICtrlSetData($stat,"OK! Scan Complete!!") if $found>0 then gUICtrlSetState($paste,$GUI_ENABLE) ElseIf $found=0 Then GUICtrlSetData($list,"No Match found") EndIf EndIf Case $msg = $GUI_EVENT_CLOSE Exit case $msg = $paste ) sleep(500) ; MsgBox(0,"",$code,0) $code_split=StringSplit($code,"-") $wa=WinActivate($win) sleep(500) if $wa =1 Then for $i2= 1 to $code_split[0] ;MsgBox(0,"",$code_split[$i2],) send($code_split[$i2]) sleep(500) Next EndIf MsgBox(0,"","Complete",1) EndSelect WEnd func data() If $drive_label = "BF2142 DVD" Then $code="xxxx-xxxx-xxxx-xxxx-xxxx" $win="Battlefield 2142" ok() EndIf EndFunc func ok() $found=$found+1 GUICtrlSetData($list,"") GUICtrlSetData($list, "Found: " & $drive_label) GUICtrlSetData($list,$code) EndFunc i have ommited my other serials which i have about 30.... you get the idea. i have had no problems when i used to run this in XP. everything worked. untill i installed vista. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Toady Posted July 7, 2007 Posted July 7, 2007 Make sure you have UAP disabled in Vista...How to disable UAP www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding
ksmith247 Posted July 7, 2007 Posted July 7, 2007 Sorry it took so long, had to acquire and boot the work laptop. It shows one drive found with no matches. The only error I get is on line 48 because of the ). I assume that was a copy/paste error though. What error are you getting if any? Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]
Aceguy Posted July 8, 2007 Author Posted July 8, 2007 not Getting an Error but its not working. Have tried a test scrip sending text to Notepad, works fine. but for some reason it wont send the serial to another popup box.? (the serial box). any ideas [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Aceguy Posted July 8, 2007 Author Posted July 8, 2007 it activates the window NP. but just wont send. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
MHz Posted July 8, 2007 Posted July 8, 2007 This works for me. expandcollapse popup#include <GUIConstants.au3> AutoItSetOption("SendKeyDelay", 45); AutoItSetOption("SendKeyDownDelay", 45); Global $code = 0, $win = "" $my_gui = GUICreate("", 300, 150, 200, 200) $list = GUICtrlCreateList("", 5, 5, 200, 100, BitOR($WS_BORDER, $WS_VSCROLL, $WS_HSCROLL, $WS_EX_TOPMOST)) $check = GUICtrlCreateButton("Read Drive(s)", 210, 125, 85, 20) $stat = GUICtrlCreateLabel("", 5, 110, 200, 20) $paste = GUICtrlCreateButton("Paste Key", 210, 95, 85, 20) GUICtrlSetState(Default, $GUI_DISABLE) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $check $found = 0 $var = DriveGetDrive("CDROM") $error = @error GUICtrlSetState($paste, $GUI_DISABLE) GUICtrlSetData($list, "") GUICtrlSetData($list, "There are " & $var[0] & " Drives found") GUICtrlSetData($stat, "READING DRIVES.... PLEASE WAIT") If Not $error Then For $i = 1 To $var[0] $drive_label = DriveGetLabel($var[$i]) If Not @error Then data() EndIf Next GUICtrlSetData($stat, "OK! Scan Complete!!") If $found Then GUICtrlSetState($paste, $GUI_ENABLE) Else GUICtrlSetData($list, "No Match found") EndIf EndIf Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $paste Sleep(500) $code_split = StringSplit($code, "-") FileWrite('Battlefield 2142.txt', ''); test only * ShellExecute('Battlefield 2142.txt'); test only * WinWait($win) WinActivate($win) If WinWaitActive($win, '', 60) Then For $i = 1 To $code_split[0] Send($code_split[$i]) Sleep(500) Next Else MsgBox(0x40030, @ScriptName, 'Window Title: ' & $win & @CRLF & 'was not found') EndIf FileDelete('Battlefield 2142.txt'); test only * Sleep(500) MsgBox(0, "", "Complete", 1) WinKill('Battlefield 2142'); test only * EndSelect WEnd Exit Func data() If $drive_label = "BF2142 DVD" Then $code = "xxxx-xxxx-xxxx-xxxx-xxxx" $win = "Battlefield 2142" ok() EndIf EndFunc Func ok() $found += 1 GUICtrlSetData($list, "") GUICtrlSetData($list, "Found: " & $drive_label) GUICtrlSetData($list, $code) EndFunc
Aceguy Posted July 8, 2007 Author Posted July 8, 2007 Have you tried to send it to the Serial input box of a game.... i still have not succeded. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
MHz Posted July 8, 2007 Posted July 8, 2007 Have you tried to send it to the Serial input box of a game.... i still have not succeded.I normally use ControlSetText() for Games and various software installations. They usually have Edit1, Edit2... Global $serial[5] = ['abcd', 'efgh', 'ijkn', 'opqr', 'stuv'] WinWait('title', 'text', 1) For $i = 0 To UBound($serial) -1 ;~ ControlSetText('title', 'text', 'Edit' & ($i + 1)) MsgBox(0, 'pasting into Edit' & ($i + 1), $serial[$i], 1); test only Next
Aceguy Posted July 8, 2007 Author Posted July 8, 2007 is there way of determining how many inputboxes there are. WinActivate('The Sims 2') sleep(250) $c=1 Do $hnd=ControlGetHandle('The Sims 2','','Edit'&$c) MsgBox(0,'',$hnd,1) $c=$c+1 until $hnd='' MsgBox(0,'',$c-2,0) [\code] [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
MHz Posted July 9, 2007 Posted July 9, 2007 is there way of determining how many inputboxes there are.You could have a button for pasting into multiple controls and a button for a single input control. Each button can call a function suitable to handle the single/multiple control/s.
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