bb05 Posted December 10, 2007 Posted December 10, 2007 (edited) ok, so here is my scenario:have a program (gh3.exe) that comes up with its own title that i want to change. (that i got done)however, i want to be able to include that exe file in the complied .exe version of autoit's script. (the .au3 to exe convertor) (not able to do)Also, i would like to be able to have a check process sort of thing, like if gh3.exe isnt running to kill the autoit script. (not able to do)Finally, i would like to be able to change the tasktray text () Note: this is while the script IS running. It will only change if i pause the script. So here is my code of what i've gotten so far:No Script: With Script: Run("gh3.exe") WinSetState ( "Customized for:", "", @SW_HIDE ) While 1 Opt("WinTitleMatchMode", 2) WinSetTitle("Customized for:", "", "Customized for: ME") WEnd WinSetState ( "Customized for:", "", @SW_SHOW ) ExitAny tips would be greatful, i have researched the help file and as well about 5 pages of the forum.thanks,bb05 Edited December 10, 2007 by bb05
Nahuel Posted December 10, 2007 Posted December 10, 2007 I suppose you need: FileInstall() ProcessExists() and ProcessClose()
bb05 Posted December 10, 2007 Author Posted December 10, 2007 ok i was able to get fileinstall working however process close and tasktray still not working. thanks for quick response btw.
Nahuel Posted December 10, 2007 Posted December 10, 2007 (edited) I think I misunderstood your post. You mean you want the script to exit if gh3.exe doesn't exist? Then add this line at the top If Not ProcessExists("gh3.exe") then Exit -edit- Typo Edited December 10, 2007 by Nahuel
bb05 Posted December 10, 2007 Author Posted December 10, 2007 (edited) ok, things seem to be going a little bit better, however am still having issues with the tasktray text being mis-represented. Is there any way to get it to change other then pausing the script and then starting it again? Also, would there be a way of running gh3 straight from the memory (not copying file to a physical location on the drive but run it completely from the memory?) Thanks again, bb05 edit: updated code: ; Script Start - Add your code below here Fileinstall("gh3.exe", "C:\test.exe") Run("C:\test.exe") WinSetState ( "Customized for:", "", @SW_HIDE ) While 1 Opt("WinTitleMatchMode", 2) WinSetTitle("Customized for:", "", "Customized for: ME") WEnd WinSetState ( "Customized for:", "", @SW_SHOW ) Exit If Not WinExists("Customized for: ") Then Exit Edited December 10, 2007 by bb05
Nahuel Posted December 10, 2007 Posted December 10, 2007 tasktray? You mean the tray icon? Look at AutoitSetOption(). There are ways of making it not pause the script when you click it, hide it, create custom menu, etc. And what do you mean run from memory? Isn't Run() good enough?
bb05 Posted December 11, 2007 Author Posted December 11, 2007 Run isnt good enough b/c the file has to be physically copied to the hdd and therefore defeats one of the reasons why i created the AutoIT script. I basically want the AutoIt script to look like the comlete .exe file with a new title even though it is really just an AutoIt script that is renaming another .exe file. and i do mean tasktray, trayicon would be all the way to the right of the windows screen on the bottom, the tasktray would be everything after the "start" menu thanks again for all your help so far, bb05
Nahuel Posted December 11, 2007 Posted December 11, 2007 Run isnt good enough b/c the file has to be physically copied to the hdd and therefore defeats one of the reasons why i created the AutoIT script. I basically want the AutoIt script to look like the comlete .exe file with a new title even though it is really just an AutoIt script that is renaming another .exe file. and i do mean tasktray, trayicon would be all the way to the right of the windows screen on the bottom, the tasktray would be everything after the "start" menu thanks again for all your help so far, bb05 Isn't that the taskbar? I suppose you could use FileInstall() to install your app in the Temp dir, run it from there and then delete it safely after you've used it.. just a thought, I don't know if what you want is actually possible. Try this code: ; Script Start - Add your code below here Fileinstall("gh3.exe", "C:\test.exe") Opt("WinTitleMatchMode", 2) Run("C:\test.exe","",@SW_HIDE) ;~ WinSetState ( "Customized for:", "", @SW_HIDE );Not necessary after adding the flag to previous command. ;~ While 1 ;If the title doesn't change constantly, you only need to do this once. WinSetTitle("Customized for:", "", "Customized for: ME") ;~ WEnd WinSetState ( "Customized for:", "", @SW_SHOW ) Exit;Not necessary. You added what I told you (If Not WinExists("Customized for: ") Then Exit) at the end, which is totally useless! I assume you needed this because your script was constantly running, so you needed it to exit once the user closes the process gh3.exe? If that's so, then it's not really necessary. If that program doesn't change the title constantly, then you just have to change the title once and then exit the script.
Shevilie Posted December 11, 2007 Posted December 11, 2007 One thing I have to wonder is... Why do you want to change the title and be able to move Guitar Hero III's exe file ??? No reason except its a crack and/or you will be able to take credit for that crack... Well my 50 cent OnTOPIC I think i read in another thread that running programs directly in the Ram was not possible (or not without some serious programming). The conclusion was to either bring a "bin folder" with your exe or use the FileInstall. Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
bb05 Posted December 12, 2007 Author Posted December 12, 2007 (edited) One thing I have to wonder is... Why do you want to change the title and be able to move Guitar Hero III's exe file ??? No reason except its a crack and/or you will be able to take credit for that crack... Well my 50 cent OnTOPIC I think i read in another thread that running programs directly in the Ram was not possible (or not without some serious programming). The conclusion was to either bring a "bin folder" with your exe or use the FileInstall. off topic: paid for an unlimited account on cheathappens.com and it specifically says NOT to share stuff but i know a few friends that want the trainer. The top of the trainer windows by default says "Customized for: bb05" I just want to be able to create an autoit script that will remove that as well as remove all traces of it being from me so that i can share the file with peace and mind. So my incentive is good for the greater of the public people and i honestly wouldnt need to take credit for it, or i would just leave the title as is. on topic: I have gotten FileInstall to work properly however, the program does not run now after doing so. I have made every path as simple as it can be, but still no luck in doing so. Here is my current code: ; Script Start - Add your code below here Fileinstall("1", "C:\1.exe") Sleep(1500) Run("C:\1.Exe") Opt("WinTitleMatchMode", 2) WinSetState("Customized for:", "", @SW_MINIMIZE) Sleep(10) WinSetTitle("Customized for:", "", "Guitar Hero III Trainer") Sleep(50) WinSetState ( "Guitar Hero III Trainer", "", @SW_RESTORE ) Sleep(10) FileDelete("C:\1.exe") edit: Filedelete is working as well. if i manually run the .exe then run the code, the title works flawlessly, so my only issue is that i cannot get the code to execute the program once it has been copied to the dir. *using latest AutoIt btw* Edited December 12, 2007 by bb05
Skruge Posted December 12, 2007 Posted December 12, 2007 You're only waiting 10 milliseconds between renaming the window and deleting the file. Throw in a ProcessWaitClose("1.exe") and you should be good to go. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
bb05 Posted December 12, 2007 Author Posted December 12, 2007 (edited) You're only waiting 10 milliseconds between renaming the window and deleting the file. Throw in a ProcessWaitClose("1.exe") and you should be good to go. thanks that works great still having a bit of an issue getting the trainer to come up from the program. i can see the process in task manager but then it disappears maybe half a second after it starts then the file is deleted. am i doing something wrong? EDIT: WORKING Just needed to fiddle with sleep commands. ; Script Start - Add your code below here Fileinstall("1.exe", "C:\1.exe") SLeep(500) Run("C:\1.Exe") Sleep(500) Opt("WinTitleMatchMode", 2) WinSetState("Customized for:", "", @SW_HIDE) Sleep(1500) WinSetTitle("Customized for:", "", "Guitar Hero III Trainer") Sleep(1500) WinSetState ( "Guitar Hero III Trainer", "", @SW_SHOW ) ProcessWaitClose("1.exe") FileDelete("C:\1.exe") Edited December 12, 2007 by bb05
Skruge Posted December 12, 2007 Posted December 12, 2007 EDIT: WORKING Just needed to fiddle with sleep commands.Ah, good... I was starting to think that the app was reading its own title to check if it was changed.That's one of the methods I would use. Nothing is unbreakable, though. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
bb05 Posted December 12, 2007 Author Posted December 12, 2007 (edited) hehe now that i got this working, i am attempting to use more complex directories using the @ flags. everything working so far again, expect the file delete only way to learn though ^^, hints are appreciated and yes im still reading help manual (it actually does help ) Things i'm wanting to do now: [*]Randomize the File name to a Temp Dir [*]Still be able to delete the Temp File. New and updated code: ; Script Start - Add your code below here FileInstall("1.exe", "1.exe", @AppDataCommonDir) SLeep(500) Run("1.exe", "", @SW_HIDE, @AppDataCommonDir) ;Sleep(500) Opt("WinTitleMatchMode", 2) Sleep(1000) WinSetTitle("Customized for:", "", "Guitar Hero III Trainer") Sleep(1000) WinSetState ( "Guitar Hero III Trainer", "", @SW_SHOW ) ProcessWaitClose("1.exe") FileDelete("1.exe", "", @AppDataCommonDir) Edited December 12, 2007 by bb05
Skruge Posted December 12, 2007 Posted December 12, 2007 FileDelete should only take one parameter. Also, a PID is more reliable than a process name... $pid = Run("1.exe", "", @SW_HIDE, @AppDataCommonDir) ... ... ProcessWaitClose("1.exe") FileDelete(@AppDataCommonDir & "\1.exe")I was going to suggest Random(), but the name _TempFile() generates is guaranteed to be unique. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
bb05 Posted December 12, 2007 Author Posted December 12, 2007 (edited) FileDelete should only take one parameter. Also, a PID is more reliable than a process name... $pid = Run("1.exe", "", @SW_HIDE, @AppDataCommonDir) ... ... ProcessWaitClose("1.exe") FileDelete(@AppDataCommonDir & "\1.exe")ƒoÝŠ÷ ØŒ² "žh²è zËQjwh™»¶§jg“zjEŠW zw«j׬ŠÈ.j¶§µç¶†Þºxª¹ï꺋^{œ¶°…«bÁ«%¢‰"žè¯}텩䱨Šwè©e¡ü¨º¸^–÷Z§!Ê&¦XžŠÛhjw±x‡hžØµ¬"Ú0"Ëaz·¬¢g†)ಗœ‰©m…«HßÙ¦ŠË"žhŠw%¹×¦Éì^jëhŠ×6#NoTrayIcon ; Script Start - Add your code below here FileInstall("1.exe", @AppDataCommonDir & "\1.exe" ) Sleep(1000) $pid = Run(@AppDataCommonDir & "\1.exe", "", @SW_HIDE) Sleep(500) Opt("WinTitleMatchMode", 2) Sleep(1000) WinSetTitle("Customized for:", "", "Guitar Hero III Trainer") Sleep(1000) WinSetState ( "Guitar Hero III Trainer", "", @SW_SHOW ) WinActivate ( "Guitar Hero III Trainer") ProcessWaitClose("1.exe") FileDelete(@ AppDataCommonDir & "\1.exe") nvm all working again. stupid settings. ^^, Edited December 12, 2007 by bb05
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