Some context; supervised learning on my finance platform, meaning there are many many child windows need sorting/accessing quickly. Hope it helps explain the purpose.
My "sendA" label calls A and B (my desired child windows).
My main block/sequence can be expressed as:
Code: Select all
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendright
sleep 5000(x*1.25)
gosub sendleft
sleep 4000
gosub sendup
sleep 4000
}
the
Code: Select all
'loop 999999'
Now let's assume all of the sleep intervals can be interrupted (as if using settimer, label, -x)
I need Numpads 1-6 to reassign variable A and send an iteration of the default sequence. If coded the above way, and on a fresh script reload, it would look like:
Code: Select all
Numpad1::
A=1
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendright
sleep 5000(x*1.25)
gosub sendleft
sleep 4000
gosub sendup
sleep 4000
}
Numpad2::
A=29
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendleft
sleep 5000(x*1.25)
gosub sendright
sleep 4000
gosub sendup
sleep 4000
}
Numpad3::
A=57
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendright
gosub sendright
sleep 5000(x*1.25)
gosub sendleft
gosub sendleft
sleep 4000
gosub sendup
sleep 4000
}
Numpad4::
A=85
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendright
gosub sendright
sleep 5000(x*1.25)
gosub sendleft
gosub sendleft
sleep 4000
gosub sendup
sleep 4000
}
Numpad5::
A=113
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendleft
sleep 5000(x*1.25)
gosub sendright
sleep 4000
gosub sendup
sleep 4000
}
Numpad6::
A=141
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendleft
gosub sendleft
sleep 5000(x*1.25)
gosub sendright
gosub sendright
sleep 4000
gosub sendup
sleep 4000
}
Now there needs to be a memory of the last Numpad press, as depending on where A currently stands, I need it to influence the output of the next Numpad press.
Example, if Numpad1 then Numpad3 is pressed, instead of the above routine, it would run a further modified sequence:
Code: Select all
A=57
gosub sendA
sleep 4000(x)
loop 999999
{
gosub sendleft
gosub sendleft
sleep 5000(x*1.25)
gosub sendright
gosub sendright
sleep 4000
gosub sendup
sleep 4000
}
Code: Select all
gosub sendA
If I press Numpad3 again, then it will revert to Numpad3's default routine above (as if the script was reloaded and Numpad3 was pressed).
If I press Numpad6, for instance, it will respect the last press of Numpad3 and give a different predefined sequence.
If someone can let me know if and how this is possible, it would be highly appreciated. Essentially being able to reduce this into a smarter code, than me writing each and every combination out, with a zillion settimers etc? There should be 6 default variations and 30 modified. I can donate $ to the site or for anyone's time.
And, lastly, I would have x assigned with the normal keyboard numbers as 1:1000ms, 2:2000ms, 3:3000ms etc, allowing me to modify the sequence rate of firing immediately and easily.