vbscript - can someone check my coding here pls -
this vbscript should random number between 1 , 3, , type letter according number , type notepad opened , goto next line, reason doesn't enter letter. can explain problem me please? here code:
set ws = createobject("wscript.shell") ws.run "notepad.exe" wscript.sleep 100 rand = int((3 - 1 + 1) * rnd + 1) if rand=1 key = elseif rand=2 key = b elseif rand=3 key = c end if ws.sendkeys key ws.sendkeys "{enter}" wscript.sleep 1000 loop
key="a" place option explicit first line of file , see trying assign non defined variables instead of string literals
Comments
Post a Comment