Sign in to follow this  
Followers 0
TrickyDeath

Program give value / data to another program alternatives?

9 posts in this topic

Hy everyone,

I have a kinda idiot question, but i do not know it is posible or not. I guess posible, but dunno how to do.

So i have a count down timer (simple AutoIT script) like example:

Local $Timer = 1000

do $timer = $timer - 1
sleep(1000)
until $timer = 0
beep(500, 500) ;or anything

And have another program, where i need the information, the timer rich 0. Up till now i come up with a simple idea and it is work. When it  is rich 0, it write something in file, and with other program i reading that file time to time, if it have anything in or not.

Can i send the $timer or his value somehow to the target program? Or maybe can make a send key order and the target program have hotkey on that key, also can work... I want it, cause while the script counting down, nothing else it can do, since the loop is still runing. Do i am think wrong?


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites



If I understand what you are asking you want you scripts to communicate, in which case I recommend using the tcp and/or udp function.

Share this post


Link to post
Share on other sites

Hi there,

Just an ideia for your issue, and what about a registry value?

When time reaches 0 write a regvalues and the other program will probe that value is 0.

Cheers!


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

Thank you for the answares, and let me replay.

//to libreau3 - This is kinda new aspect, but i will check it, and try to understand the codes in help file, to be able to use it on my own way. As i could understand on a first look, this function will "simulate" a server, and the other function (send) will send file / message with useing TCP local network. Right? It is bit complicate for a simple script, but can be useful later, when i will have enough experience.

Can not i just send message (value) with controlsend or similar order then this? For controlSend i need a window handle on the main script, but i do not have, since it is not nessery. The main program is only controlling my PCTV record stuffs.

This is just kinda extra stuff, when i do not have time to watch the movie or i am not at home, and it is cuting out the commercials. Unfortunately the PCTV have no control IDs. When i checked with AutoIT info tool, i had to notice that. All the button are coded the similar way i guess, like file menu on notepad. (just an idea, i do not know how they did exactly) So i had to use a way, like sending mouse click on a specific location (Record button) by useing the PCTV window handle.

//to November - To tell you honestly, i am kinda beginer on programing, and i do not wana mess up my registry with makeing mistakes, and it is familiar with writeing something into a normal file, then the other program, just checking if the file size changed, if yes, it read it into $var and if $var = with something, then i got what i want. But this is what i just wrote down in the first post. :/


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites

Maybe write all the things you need to get shared between programs in an ini file, then read it from both programs ? That way you won't need registry, but this can also get screwed if the ini file get deleted/renamed

Share this post


Link to post
Share on other sites

Have a look at AdLibRegister. This (nearly) allows to run two functions at the same time.

It interrupts the main script every n milliseconds to call a function and then returns to the main script.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I had no other idea how to make the count down timer, to be able to exit from script after X hrs, cause the movie end on TV.

Between, i need only the timer to exit, nothing else. Wont make much more complicate the program, cause it support 100% what i wanted. It make X part movie, between the commercials, then all what i have to do, put them in playlist and watch them.

To call it as ini file or normal txt it is the same. 1 program have to write example "stop" and other have to read the file, if "stop" is there or not.

//to water - I will look after that, sounds very good.

Edited part:

I did read it, and looks like it will solve my problem, all what i have to do, to time properly the script run.

Do i have to unregister the function for it, or it is only if that function have an example while loop, what is never end.

Or unregister, when i do not need to have run it anymore?

Simple other question. How i have to understand this?

$iCount += 1

Dont know what does += mean exactly. :/

Edited by TrickyDeath

Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites

According to the help file: "Addition assignment. e.g. $vVar += 1     (adds 1 to $vVar)"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-03 - Version 1.2.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thank you for the help file link. Did not saw that yet.

So i do not have to use:

$var = $var + 1

Just $var += 1

Helpful stuff. :)


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
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
Sign in to follow this  
Followers 0