Jump to content

2 programs / threads? in one


Recommended Posts

Hey,

I'd like to be able to do this...

I have a script that does a few things (sending keystrokes, mouse clicks, lunching programs and everything). The program is in a form of loop, and each time it goes trough a loop, it updates a ToolTip(). What I would like to be able to do is to make this tooltip() update itself in real-time. So to do that, I would need to run like....2 programs at the same time...but I still want it to be one single program. So I would have to be able to have like.... 2 threads or IDK.

Link to comment
Share on other sites

Hey,

I'd like to be able to do this...

I have a script that does a few things (sending keystrokes, mouse clicks, lunching programs and everything). The program is in a form of loop, and each time it goes trough a loop, it updates a ToolTip(). What I would like to be able to do is to make this tooltip() update itself in real-time. So to do that, I would need to run like....2 programs at the same time...but I still want it to be one single program. So I would have to be able to have like.... 2 threads or IDK.

When does the ToolTip get updated? During the loop? What would change if it were being updated in constantly (real-time)?

You can try AdlibEnable to have it update the tooltip, but I don't see how it would make any difference.

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

When does the ToolTip get updated? During the loop? What would change if it were being updated in constantly (real-time)?

You can try AdlibEnable to have it update the tooltip, but I don't see how it would make any difference.

Well for now the tooltip is updated at the start of the loop. But the variables that the tooltip uses are updated during the loop.

I would like the variables to be updated live, because the variable change a lot during the loop ( one of the variable is a chrono, and there are 6 other variables that equals to the number of time the program has achieved specific things)...

Cause I would know a way to do this...but it is quite painful. It would be to make 2 different programs, and pass the program1 variables to the program2 (which would be the tooltip)...But I'm almost sure there is a more simple way to do this...

Link to comment
Share on other sites

Well for now the tooltip is updated at the start of the loop. But the variables that the tooltip uses are updated during the loop.

I would like the variables to be updated live, because the variable change a lot during the loop ( one of the variable is a chrono, and there are 6 other variables that equals to the number of time the program has achieved specific things)...

Cause I would know a way to do this...but it is quite painful. It would be to make 2 different programs, and pass the program1 variables to the program2 (which would be the tooltip)...But I'm almost sure there is a more simple way to do this...

So... why aren't you updating the tooltip during the loop? There is no additional charge for each call to Tooltip() sprinkle in as many as you need.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

So... why aren't you updating the tooltip during the loop? There is no additional charge for each call to Tooltip() sprinkle in as many as you need.

^_^

Yeah, I could do that for all the variables, except for the timer... I would have to call a Tooltip every sec :)

Link to comment
Share on other sites

Yeah, I could do that for all the variables, except for the timer... I would have to call a Tooltip every sec ^_^

So? Are you afraid your tooltip will overheat?

Are you saying you want to update your tooltip every second without doing an update every second...?

What's the issue?

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

So? Are you afraid your tooltip will overheat?

Are you saying you want to update your tooltip every second without doing an update every second...?

What's the issue?

:)

I hate it when my tooltip overheats...or do I love it?

Link to comment
Share on other sites

No ...I say that I want to update my tooltip every second...without having to do something like that :

Tooltip(XXXXX)
MouseClick("left", 12,12)
Tooltip(XXXXXX)
Run("Myprog.exe")
Tooltip(XXXXX)
WinActivate("Window")
Tooltip(XXXXXX)
Send("{ENTER}")
Tooltip(XXXXXX)
Send("hey")
Tooltip(XXXXXX)
Send("   !!!", 1)
[...]

For now my code has over 3000 lines of code...and it is quite optimized...doing this would take a LOT of time and would be completely...well completely stupid !

Edited by EliTe_ThuT
Link to comment
Share on other sites

AdLibEnable() ?

:)

Ohhhhh, I had never heard of that function...and the way you were speaking in the first post I tough that you just said that like this but that it wasn't the solution....

This is exactly what I would need...but if the function that I call with adlibenable contains:

ToolTip("Window 1 : " & $RunS1 & "/ " & $Run1 & @CRLF & "Window 2 : " & $RunS2 & "/ " & $Run2 & @CRLF & "Window 3 : " & $RunS3 & "/ " & $Run3, 815, 10, $dif & " minutes")

So only one line of code, with a few global functions...and lets say that I set adlibenable to 1000ms delay would it load the CPU a LOT more, or not that much...

Link to comment
Share on other sites

No offense @EliTe_ThuT but is sounds like you need sleep (or more sugar/coffee) to get your imagination started again..^_^

Anyway. If you have to get a tooltip update every sec. AddLib is not your thing. For a test try something like (from the top of my head):

adlibenable("cbToolTip", 1000)
While 1
    WoorkingHero()
Wend
Func WoorkingHero()
    x = cos(30) + sin(30)
EndFunc
Func cbToolTip()
    ToolTip(@Hour & ":" & @min & ":" & @sec)
EndFunc

My point is: Your while loop might block autoit from trigging AddLib calls as frequently as you expect. So calling it from inside the loop now and the might be just as reliable and efficient. You don't have to call it every second line only as often as you need it to.

Happy scripting..:)

Link to comment
Share on other sites

No offense @EliTe_ThuT but is sounds like you need sleep (or more sugar/coffee) to get your imagination started again..^_^

Anyway. If you have to get a tooltip update every sec. AddLib is not your thing. For a test try something like (from the top of my head):

adlibenable("cbToolTip", 1000)
While 1
    WoorkingHero()
Wend
Func WoorkingHero()
    x = cos(30) + sin(30)
EndFunc
Func cbToolTip()
    ToolTip(@Hour & ":" & @min & ":" & @sec)
EndFunc

My point is: Your while loop might block autoit from trigging AddLib calls as frequently as you expect. So calling it from inside the loop now and the might be just as reliable and efficient. You don't have to call it every second line only as often as you need it to.

Happy scripting..:)

Yeah, I think it's going to be a better solution...

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