Jump to content

Multi Task?


 Share

Recommended Posts

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 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

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 something

WHILE 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 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

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

  • Developers

Did you checkout the AdlibEnable() function ?

Edited 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

  • Developers

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. :idiot:

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

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 by Crome_BAD
Link to comment
Share on other sites

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 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

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 by Crome_BAD
Link to comment
Share on other sites

Maybe This WIll Help, Im going to make a help file that opens when the main file opens to show the commands....

#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

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...