Hello,
Let me begin saying that i'm very new to the world of HAScript, but i've got this script that basically does a large series of input actions and it worked fine, but i wanted to try to make it more dynamic by trying to randomize one of the values it should input in the beginning by using an array... however, ever since i started using the "useVars=true" and added the <vars> and <action>'s withing the <actions> of the <screen>, the script stopped working, and i can't seem to understand what i'm doing incorrectly... this is for a macro on ACS, if that information helps...
<HAScript name="???"
description="???"
timeout="60000"
pausetime="300"
promptall="false"
blockinput="true"
author="???"
creationdate="16/10/2024, 17:24:29"
supressclearevents="false"
usevars="true"
ignorepauseforenhancedtn="true"
delayifnotenhancedtn="0"
ignorepausetimeforenhancedtn="true"
continueontimeout="false">
<vars>
<Variable name="clients" type="number[]">
<Value>191285</Value>
<Value>191576</Value>
<Value>191673</Value>
<Value>191382</Value>
<Value>191479</Value>
<Value>191770</Value>
</Variable>
<Variable name="randomIndex" type="integer"/>
<Variable name="randomValue" type="number"/>
</vars>
<screen name="???" entryscreen="true" exitscreen="true" transient="false">
<description>
<oia status="NOTINHIBITED" optional="false" invertmatch="false" />
</description>
<actions>
<Action name="setRandomIndex">
<Function name="rand()">
<Param name="max" value="clients.length"/>
</Function>
<Target name="randomIndex" type="variable"/>
</Action>
<Action name="setRandomValue">
<Access type="array" name="clients">
<Index name="randomIndex" type="variable"/>
</Access>
<Target name="randomValue" type="variable"/>
</Action>
<input value="[pf6]" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="randomValue[field+]" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="CONTENCSO" row="11" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="CREES_USD" row="11" col="44" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[enter]" row="22" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="100000[field+]" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="10" row="11" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="A" row="11" col="36" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="CO" row="13" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="130000" row="15" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[pagedn]" row="22" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="208" row="18" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[enter]" row="22" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="1" row="10" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="10" row="11" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="M" row="12" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="F" row="13" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[pagedn]" row="22" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[pf4]" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="Ca" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[enter]1[enter]" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="1[enter]" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="1" row="13" col="50" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="A" row="18" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="191285" row="18" col="35" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[pagedn]" row="22" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="874" row="6" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="" row="7" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="2" row="8" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="15" row="9" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="" row="10" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="1" row="11" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="" row="12" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="20500101" row="13" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="" row="14" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="1" row="18" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="0" row="19" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="" row="20" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
<input value="[enter]N[enter]" row="20" col="32" movecursor="true" xlatehostkeys="true" encrypted="false" />
</actions>
</screen>
</HAScript>
------------------------------
Mauro Nobrega
------------------------------