Jump to content

multiple things done at once


gnomic
 Share

Recommended Posts

Hey,

How can i run two functions at the same time? i read that, if i use two .Au3 at the same time, then it will use multiple processors? and not multithreating - i dont know the difference?

thanks :)

You cannot

It will use tow processes

Correct

Try a web search

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

:ermm: Multi-threading... is basically, calling multiple functions within ur script (not supported in AU3) at the same time, ideally using a single process. You can get help on your subject reading this: http://www.autoitscript.com/wiki/Interrupting_a_running_function :gathering:

Not upto the mark, but something useful.

Edited by MKISH

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

  • Moderators

@JohnOne

If they each run on a different processor, then my guess would be, it was posible to run at the same time? else i dont see the point, atleast :)

Not different processor different process. As JohnOne suggested, do some searching online for multithreading.

"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

This worked, when i ran them at the same time, so i guess this is enough.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$hWnd = GUICreate("", 200, 200, 200, 200)
$label = GUICtrlCreateLabel("", 0, 0, 50, 50)
GUISetState(@SW_SHOW)
Local $i = 0
While $i <= 5000
   GUICtrlSetData ($label, $i)
   $i = $i + 1
   sleep(20)
WEnd
While 1
   $msg = GUIGetMsg()
WEnd
Link to comment
Share on other sites

  • Moderators

gnomic,

Can you explain what you are trying to do that requires you to run 2 scripts? Then we might be able to offer some concrete help rather than vague hints. ;)

M23

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

In help file, search for 'command Line Parameters'...you can do a Run () command with the Form4 type:

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Hello World!'', ''Hi!'')"')

or, you can call a seperate exe you compiled, to initiate that script while the current still runs also.

edit...oh, just noticed what you are doing...you just want a switch case within one of your while loops, or conditional steps

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hWnd = GUICreate("", 200, 200, 200, 200)
$label = GUICtrlCreateLabel("", 0, 0, 50, 50)
GUISetState(@SW_SHOW)
Local $i = 0
While 1
 $msg = GUIGetMsg()
 If $i <= 5000 Then
  GUICtrlSetData ($label, $i)
  $i = $i + 1
  sleep(20)
 EndIf
 ; add in any messages you are looking for here...use switch case when lots
 If $msg = $GUI_EVENT_CLOSE Then
  Exit
 EndIf
WEnd
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...