Files
TempleOS-Rijn/LT/Doc/AutoFile.TXZ
T
2018-09-08 21:45:20 +02:00

9 lines
1.3 KiB
Plaintext

$WW,1$$FG,2$AutoFiles$FG$ are used to fake user input to a task to automate operations. The LoseThos tour is done with an $FG,2$AutoFile$FG$.
When an $FG,2$AutoFile$FG$ runs, a child task is $LK,"Spawn","MN:Spawn"$()ed which intercepts real user input and generates fake input. AutoFiles are $FG,2$C+$FG$ scripts run by the child who's stdout goes to the parent's input buffer. $LK,"Msg","MN:Msg"$() can be included in an $FG,2$AutoFile$FG$ to send special keys or mouse commands to the parent. While an $FG,2$AutoFile$FG$ is running, the normal input gets diverted to the AutoFile task and can be filtered and sent back to the parent task. Unless you are driving functions which prompt for data, you can probably use an $FG,2$#include$FG$ file in place of an $FG,2$AutoFile$FG$.
See $LK,"::/LT/Demo/AutoFile/Demo1.AUZ","FI:::/LT/Demo/AutoFile/Demo1.AUZ"$.
Note: $LK,"Auto","MN:Auto"$("") can be used if all you need to do is send ASCII characters. It differs from $LK,"AutoStr","MN:AutoStr"$(). You'll probably use $LK,"Auto","MN:Auto"$() a lot but not $LK,"AutoStr","MN:AutoStr"$(). With $LK,"Auto","MN:Auto"$(), for example, you can place answers to the prompts for recompiling the $FG,2$OSMain$FG$ module when doing $LK,"InstallBoot","MN:InstallBoot"$().