Jump to content

Background process


Golfboy
 Share

Recommended Posts

My thread got locked, unfrotunately. So here another thread without "game automation".

 

I have been looking for a program that can keep my other programs up to date and I found AutoIt. I have no coding experience. I can just read it a little bit so it was quite hard to actually get something done but after watching a few videos I finally got it working!

Especially the zip part was quite hard since I dont understand what I have to do with the "Zip UDF premade concepts" that users provide. At the end I just did it with Mouseclicks.

 

So now the prgram is working as you can see in the video but I would like to do this in the background. It's not really important for this task but I would like to create more with AutoIt since I think the program is fantastic!

 

so my question is: How can I improve my code and get it to the background so I can do other stuff while AutoIt is busy?

 

Here is the video for the code and how it works.

 

Link to comment
Share on other sites

37 minutes ago, Nikolas92 said:

Hurry change your question more or Yoda the Ban Hammer will lock it again. ;)

But why....

 

there is nothing about game automation. I'm just asking how I can improve the code and how I can get the process to the background :'(

Link to comment
Share on other sites

  • Developers
1 hour ago, Nikolas92 said:

Hurry change your question more or Yoda the Ban Hammer will lock it again. ;)

Please refrain from these type of comments and simply report when you feel you need to act upon this. thanks.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

@Golfboy,

1 hour ago, Golfboy said:

My thread got locked, unfrotunately. So here another thread without "game automation".

Funny you now say you create a thread with game automation  while you stated before in PM it wasn't about game automation at all.
Nikolas92 is right about not re-opening a thread on the same topic in general, but I will let this go as long as it is about general software updates.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators
1 hour ago, Nikolas92 said:

Hurry change your question more or Yoda the Ban Hammer will lock it again. ;)

This is the second or third time I have seen you posting like this - not sure if you're under the mistaken impression that it's clever or funny. Continue with this and and you can personally experience the hammer.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

50 minutes ago, JLogan3o13 said:

This is the second or third time I have seen you posting like this - not sure if you're under the mistaken impression that it's clever or funny. Continue with this and and you can personally experience the hammer.

Second, dont care about impression. Since I rarely get useful answers on my questions I dont really care whose 'hammer' I will get, not much will change... :drool:

Edited by Nikolas92
Link to comment
Share on other sites

  • Developers

Attack is the best defense approach?

7 days to think about that last post whether that is the way you want to continue here or not.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi @Golfboy,

you may have a look at forum netiquette too: http://www.autoitscript.com/wiki/FAQ#What_is_proper_forum_etiquette.3F_What_rules_are_there_for_the_forum.3F

But even there I didn’t find a clear statement about bumping posts. I’m using this forum for a long time and I saw a lot of times admins ask for not bumping posts within 24 hours. So wait a day and you’ll be fine I think.

Conrad

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to comment
Share on other sites

But this does not mean you aren’t allowed to give updates. If you found out something you didn’t post before but could be important for answering feel free to post. While experimenting yourself with your problem and narrowing it is important for the community too. 

If you have something relevant to add post it. If not wait 24 hours. We are a lot of people here but sometimes the one who can answer the question is offline for some days.

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to comment
Share on other sites

InetGet (call ("Downloading"), "RPCS3", 0, 0)

; Getting to the download page and download it (with renaming)
Func Downloading ()
Run("C:\Program Files\Internet Explorer\iexplore.exe -new https://rpcs3.net/download")
WinWait ("[CLASS:IEFrame; TITLE:RPCS3 - Download - Internet Explorer]")
Sleep (1000)
ControlClick ("[CLASS:IEFrame; TITLE:RPCS3 - Download - Internet Explorer]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "Left", 1, 696, 784)
WinWait ("[CLASS:IEFrame]")
Sleep (2000)
ControlClick ("[CLASS:IEFrame]", "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "Left", 1, 604, 312)
Sleep (2000)
ControlClick ("[CLASS:IEFrame]", "", "[CLASS:DirectUIHWND; INSTANCE:1]", "Left", 1, 822, 54)
Sleep (100)
ControlSend ("[CLASS:IEFrame]", "", "[CLASS:DirectUIHWND; INSTANCE:1]", "{Down down}")
Sleep (100)
ControlSend ("[CLASS:IEFrame]", "", "[CLASS:DirectUIHWND; INSTANCE:1]", "{Down up}")
Sleep (100)
ControlSend ("[CLASS:IEFrame]", "", "[CLASS:DirectUIHWND; INSTANCE:1]", "{Down down}")
Sleep (100)
ControlSend ("[CLASS:IEFrame]", "", "[CLASS:DirectUIHWND; INSTANCE:1]", "{Down up}")
Sleep (100)
ControlSend ("[CLASS:IEFrame]", "", "[CLASS:DirectUIHWND; INSTANCE:1]", "{ENTER}")
WinWait ("[CLASS:#32770; Title:Opslaan als]")
ControlSend ("[CLASS:#32770; Title:Opslaan als]", "", "[CLASS:Edit; Instance:1]", "RPCS3")
Sleep (100)
ControlClick ("[CLASS:#32770; Title:Opslaan als]", "", "[CLASS:Button; INSTANCE:2]", "Left")
EndFunc

; Wait till file is done downloading

Do

Sleep (100)
Until FileExists ( "C:\Users\User\Downloads\RPCS3.zip")


; Unzipping and correct folder
Run ("explorer.exe")
WinWait ("[CLASS:CabinetWClass; Title:Verkenner]")
ControlClick ("[CLASS:CabinetWClass; Title:Verkenner]", "", "[CLASS:SysTreeView32; INSTANCE:1]", "Left", 1, 85, 76)
Sleep (200)
controlsend ("[CLASS:CabinetWClass; Title:Verkenner]", "", "[CLASS:SysTreeView32; INSTANCE:1]", "{ENTER}")
Sleep (200)
ControlClick ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "Left", 1, 150, 38)
Sleep (200)
ControlClick ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "right", 1, 150, 38)
Sleep (500)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN down}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN up}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN down}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN up}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN down}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN up}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN down}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN up}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{Right down}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{Right up}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN down}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN up}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN down}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{DOWN up}")
Sleep (50)
ControlSend ("[CLASS:CabinetWClass; Title:Downloads]", "", "[CLASS:DirectUIHWND; INSTANCE:3]", "{ENTER}")
Sleep (400)
ControlSend ("[CLASS:#32770; TITLE:&Uitpakken : C:\Users\User\Downloads\RPCS3.zip]", "", "[CLASS:Edit; INSTANCE:1]", "L:\Hyperspin\Emulators")
Sleep (50)
ControlClick ("[CLASS:#32770; TITLE:&Uitpakken : C:\Users\User\Downloads\RPCS3.zip]", "", "[CLASS:ComboBox; INSTANCE:3]")
sleep (200)
ControlSend ("[CLASS:#32770; TITLE:&Uitpakken : C:\Users\User\Downloads\RPCS3.zip]", "", "[CLASS:ComboBox; INSTANCE:3]", "o")
Sleep (200)
ControlSend ("[CLASS:#32770; TITLE:&Uitpakken : C:\Users\User\Downloads\RPCS3.zip]", "", "[CLASS:ComboBox; INSTANCE:3]", "{ENTER}")
Sleep (200)
ControlClick ("[CLASS:#32770; TITLE:&Uitpakken : C:\Users\User\Downloads\RPCS3.zip]", "", "[CLASS:Button; INSTANCE:7]", "LEFT")
Sleep (5000) ; Waiting to unzip

; delete zip file
FileDelete("C:\Users\User\Downloads\RPCS3.zip")


; close internet explorer

WinActivate ( "[CLASS:IEFrame]")
sleep (200)
Send ( "!{F4}")
Sleep (100)
Send ( "{ENTER}")
Sleep (500)


; Close explorer

WinActivate ( "[CLASS:CabinetWClass; Title:Downloads]")
sleep (200)
Send ( "!{F4}")

Got this currently! Its getting bigger and bigger :P

 

So instead of Mouseclick and Send I changed everything to ControlClick and ControlSend except 2. Those are for the Save As dialog in Internet Explorer. For some reason I can't do it with controlclick. It just highlights it... EDIT: Now it highlights and with 2x down and enter it also works. No Mouseclicks anymore! :lmao:

 

I also have inserted WinWait. When the page is finished loading the automation goes on which is fantastic! Unfortunately the page sometimes still loads while AutoIt thinks it's finished. This is why I put Sleep in it.

 

I didn't hide the whole thing yet. I think It's kinda pointless here because it's short anyways + I found out that with ControlClick (and I hide the automation) I can do other stuff while AutoIt is busy. But if I add ControlSend and I have to type something while the Process is running then I ruin it... Gotta find something for this.

 

thanks @Simpel, I will bump it once a day then :)

 

Some quick translation:

Opslaan als = Save as

Uitpakken = unzip (extract)

Verkenner = explorer

 

Edit:

Ask for a video to see what everything does if the script isn't clear!

Edited by Golfboy
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...