Sardith Posted February 22, 2007 Share Posted February 22, 2007 (edited) Hi, i've never randomed a array result. $var[$i][0] What I was going to do. Dim $Var, $i Func Test() $var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then ToolTip("", 0, 0) Sleep(10) ToolTip("Title= " & $var[$i][0] & @LF & "Handle= " & $var[$i][1], 0, 0) Sleep(2000) EndIf Next EndFunc Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc While 1 Test() sleep(4000) WEnd What I wanted to do, is some how random one the array, so I could pick a random window title, that is visable to the user. Not sure where to go beyond this. Edited February 22, 2007 by Sardith [font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 22, 2007 Moderators Share Posted February 22, 2007 Hi, i've never randomed a array result. $var[$i][0] What I was going to do. $Rprogram = Random(1, 100, 1) $var[$RProgram][0] Would that work? If so, how do I check a array, to make sure it's not blank, and if it is. It will random again?Sardith.. how about trying it and seeing if it would work with a simple demonstration? Dim $var[6][2] $var[1][0] = 3 $var[2][0] = "" $var[3][0] = 5 $var[4][0] = 7 $var[5][0] = 9 While 1 $nRprogram = Random(1, 5, 1) $sOutput = $var[$nRprogram][0] If $sOutput <> '' Then ToolTip('Output: ' & $sOutput, 0, 0) Else;Only to show you that it blocks [2][0] ToolTip('Value Empty : $nRprogram = ' & $nRprogram, 0, 0);$nRprogram should always be 2 since I left that empty above EndIf Sleep(2000) WEnd As long as you've been here, you think you would simply test some theories yourself in "simple mode". Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
herewasplato Posted February 22, 2007 Share Posted February 22, 2007 Parsnips (Ask a random question, get a random answer.) Sorry Sardith but I just had to... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Sardith Posted February 22, 2007 Author Share Posted February 22, 2007 (edited) Not a random question. Random the funcation? Sorry, but I just had to. Do you even know what a Parsnip is? Hope you like eatting fleshy roots for dinner? Edited February 22, 2007 by Sardith [font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font] Link to comment Share on other sites More sharing options...
tAKTelapis Posted February 22, 2007 Share Posted February 22, 2007 Parsnip.. thats like a white carrot isnt it ? those things are awesome baked. Link to comment Share on other sites More sharing options...
herewasplato Posted February 23, 2007 Share Posted February 23, 2007 http://en.wikipedia.org/wiki/Parsniphttp://en.wikipedia.org/wiki/Cow_parsnip...but your topic title is a question about http://en.wikipedia.org/wiki/Radom:-) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now