Crome_BAD Posted December 19, 2004 Share Posted December 19, 2004 I was just wondering is AutoIt 3 can multi task, do 2 operations at once, WITHOUT makin 2 programs, my other system program i made i have 5 programs running, it was insane to do, i was wondering if there was a way to multi task. Peace Crome_BAD Link to comment Share on other sites More sharing options...
SlimShady Posted December 19, 2004 Share Posted December 19, 2004 (edited) Can't you put the tasks in seperate functions and call them one at a time? Wait... I see your problem. When a task is run and it waits for something the script won't continue in the mean time. Edited December 19, 2004 by SlimShady Link to comment Share on other sites More sharing options...
t0ddie Posted December 19, 2004 Share Posted December 19, 2004 (edited) i know of only one way. thats the hotkeyset function. it waits for an event.. (you pressing a key) while other functions are being carried out. other than that, it would be nice to have some sort of loop doing something while other functions are being carried out. (something automatic, without user intervention like hotkeyset) Edited December 19, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
SlimShady Posted December 19, 2004 Share Posted December 19, 2004 I understand him. The tasks don't have to run in a loop. The only solution I can think of are seperate scripts. Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 19, 2004 Author Share Posted December 19, 2004 Hmmm Ok, ya i kno the hotkeyset, ill havta expirament, now another question....lol. Im FUll Of Them:P. Is There a way to center a GUI, or is that the default GUICreate( "Info", 500, 500, -1, -1) ? Link to comment Share on other sites More sharing options...
t0ddie Posted December 19, 2004 Share Posted December 19, 2004 (edited) I understand him. The tasks don't have to run in a loop.The only solution I can think of are seperate scripts.<{POST_SNAPBACK}>isnt hotkeyset a loop? constantly checking to see if a key was pressed?it would be nice to have a function like hotkeyset, that would do somethingWHILE another function was executing.instead of waiting for a key to be pressed,wait for some event that the script can detect, itstead of relying on user intervention (pressing a key)checking this, while other parts of the script continue to execute. instead of waiting for the event, and doing nothing until it occurs.i mean, its doable with seperate scripts. but that makes things messy Edited December 19, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 19, 2004 Author Share Posted December 19, 2004 I agree, i posted sum files i was working with on my public space, i had to make 5 seperate programs to do the actual stuff of 1, it was very messy. I kno the hotkeyset would do it, maybe you could define two to run at once? Just a thought, still sorta new at this.... Crome_BAD Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2004 Developers Share Posted December 19, 2004 (edited) Did you checkout the AdlibEnable() function ? Edited December 19, 2004 by JdeB 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 More sharing options...
Crome_BAD Posted December 19, 2004 Author Share Posted December 19, 2004 Is that a User Defined function, im sorry, i dont know that much about it, is there a post on how to set them up or use them? Thank You For All The Help Guys!! Crome_BAD Link to comment Share on other sites More sharing options...
Developers Jos Posted December 19, 2004 Developers Share Posted December 19, 2004 Is that a User Defined function, im sorry, i dont know that much about it, is there a post on how to set them up or use them? Thank You For All The Help Guys!!Crome_BAD<{POST_SNAPBACK}>No, its a build in function that:Every 250 ms (or time ms) the specified "function" is called--typically to check for unforeseen errors. For example, you could use adlib in a script which causes an error window to pop up unpredictably.The adlib function should be kept simple as it is executed often and during this time the main script is paused. Also, the time parameter should be used carefully to avoid CPU load.Check out the helpfile for an example. 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 More sharing options...
Crome_BAD Posted December 19, 2004 Author Share Posted December 19, 2004 (edited) Hmmm never saw it, ok thank you for the help, ill take a look at it and see if i can do anything. Peace, Crome_BAD I could do this.... #include <GUICONSTANTS.AU3> ; -----HotKeySet----- HotKeySet( "{ESC}", "Stop") $hotkey1 = HotKeySet( "!1", "ShowIP") $ctrlkey1 = HotKeySet( "^1", "ClearIP") ; -----Globals------ Global $ip = @IPAddress1 ; -----Main GUI------ $window = GUICreate( "Windows System Information", 250, 250, 0, 0) GUISetBkColor( 0x000000) ; -----Lables, Lists, ETC.------ ; -----GUI State------- GUISetState(@SW_SHOW) Do Sleep(50) Until 1 = 2 Func ShowIP() Global $iplabel = GUICtrlCreateLabel( "IP Address:" & $ip, 5, 25, $SS_SUNKEN) GUICtrlSetColor( $iplabel, 0xffffff) EndFunc Func ClearIP() GUICtrlSetData( $iplabel, "") GUICtrlSetBkColor( $iplabel, 0x000000) EndFunc Func Stop() Exit EndFunc Edited December 19, 2004 by Crome_BAD Link to comment Share on other sites More sharing options...
t0ddie Posted December 19, 2004 Share Posted December 19, 2004 (edited) ahh, so the main script IS paused during adlib execution. better than nothing i suppose. its OLMOST like 2 things running at the same time. but the more you put into adlib, the more you will load the cpu. thats not desirable. just my 2 cents EDIT:to bad there isnt something like call ("function1") AND call ("function2") AND call ("function3") AND get me a beer. Edited December 19, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 19, 2004 Author Share Posted December 19, 2004 (edited) Lol, im slowly wokrin with that code. Ill post it as i go, right now i can get it to show time constantly, ima try to keep my Do $time, and when i press a key, ill see if it will Do $time again in a diferent label. EDIT: Eh it dont work, crap, hmmm scratch that idea O_O Edited December 19, 2004 by Crome_BAD Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 19, 2004 Author Share Posted December 19, 2004 Maybe This WIll Help, Im going to make a help file that opens when the main file opens to show the commands.... expandcollapse popup#include <GUICONSTANTS.AU3> ; -----HotKeySet----- HotKeySet( "{ESC}", "Stop") $hotkey1 = HotKeySet( "!1", "ShowIP") $hotkey2 = HotKeySet( "!2", "Mem") $ctrlkey1 = HotKeySet( "^1", "ClearIp") $ctrlkey1 = HotKeySet( "^2", "ClearMem") ; -----Globals------ Global $ip = @IPAddress1 Global $mem = MemGetStats() ; -----Figures------- $aram = ($mem[1] / 2) ; -----Main GUI------ $window = GUICreate( "Windows System Information", 250, 250, 0, 0) GUISetBkColor( 0x000000) ; -----Lables, Lists, ETC.------ $timelabel = GUICtrlCreateLabel( "Time On This Computer:", 80, 235) ; -----Colors------ GUICtrlSetColor( $timelabel, 0xffffff) ; -----GUI State------- GUISetState(@SW_SHOW) Do Sleep(950) $time = @HOUR & ":" & @MIN & ":" & @SEC $timel = GUICtrlCreateLabel( $time, 200, 230, -1, -1, $SS_SUNKEN, $WS_EX_CLIENTEDGE) GUICtrlSetColor( $timel, 0xffffff) Until 1 = 2 Func ShowIP() Global $iplabel = GUICtrlCreateLabel( "IP Address:" & $ip, 5, 25) GUICtrlSetColor( $iplabel, 0xffffff) EndFunc Func ClearIP() GUICtrlSetData( $iplabel, "") GUICtrlSetColor( $iplabel, 0x000000) EndFunc Func Mem() Global $memstats = GUICtrlCreateLabel( "Available Ram:", 5, 45) GUICtrlSetColor( $memstats, 0xffffff) If $aram > $mem[2] Then Global $availram = GUICtrlCreateLabel( ($mem[2] / 1000), 100, 45) GUICtrlSetColor( $availram, 0xff0000) Else Global $availram = GUICtrlCreateLabel( ($mem[2] / 1000), 100, 45) GUICtrlSetColor( $availram, 0xffffff) EndIf EndFunc Func ClearMem() GUICtrlSetData( $memstats, "") GUICtrlSetData( $availram, "") GUICtrlSetColor( $memstats, 0x000000) GUICtrlSetColor( $availram, 0x000000) EndFunc Func Stop() Exit EndFunc Link to comment Share on other sites More sharing options...
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