fxg4758 Posted November 26, 2010 Posted November 26, 2010 Hi Can someone tell me why i can find the Bank Name, but the script stops when he try to find and click in area. Thanks. $Fox1 = NET_ControlGetHandleByName(Window1, "", "ListBox1") $Fox2 = NET_ControlGetHandleByName(Window1, "", "ListBox2") $Bank = NET_ControlGetHandleByName(Window1, "", "Search") $var = IniReadSection("fox.ini", "bank") [bank] 1=2*Bank Name*Area 2=1*Bank Name*Area Key = Number of Listbox(1/2)*Bank Name*Area For $i = 1 To $var[0][0] $igridText = StringSplit ($var[$i][1], "*",1) ControlSetText(Window1,"", $Bank, $igridText [2]) ControlSend(Window1,"", $Bank, "{Enter}") Sleep(250) If $igridText[1] = 1 Then $igrid = _GUICtrlListBox_FindString($Fox1, $igridText[2], True) _GUICtrlListBox_SetCurSel($Fox1, $igrid) _GUICtrlListBox_ClickItem($Fox1, _GUICtrlListBox_GetCurSel($Fox1), "left", False, 2,1) If $igrid > 0 And $igridText [3] <> "" Then Sleep(1000) $igrid = _GUICtrlListBox_FindString($Fox1, $igridAreas[3], True) _GUICtrlListBox_SetCurSel($Fox1, $igrid) _GUICtrlListBox_ClickItem($Fox1, _GUICtrlListBox_GetCurSel($Fox1), "left", False, 2,1) EndIf Else $igrid = _GUICtrlListBox_FindString($Fox2, $igridText[2], True) _GUICtrlListBox_SetCurSel($Fox2, $igrid) _GUICtrlListBox_ClickItem($Fox2, _GUICtrlListBox_GetCurSel($Fox2), "left", False, 2,1) If $igrid > 0 And $igridText [3] <> "" Then Sleep(1000) $igrid = _GUICtrlListBox_FindString($Fox2, $igridAreas[3], True) _GUICtrlListBox_SetCurSel($Fox2, $igrid) _GUICtrlListBox_ClickItem($Fox2, _GUICtrlListBox_GetCurSel($Fox2), "left", False, 2,1) EndIf Next
SparkSoft Posted November 29, 2010 Posted November 29, 2010 Hi Can someone tell me why i can find the Bank Name, but the script stops when he try to find and click in area. Thanks. $Fox1 = NET_ControlGetHandleByName(Window1, "", "ListBox1") $Fox2 = NET_ControlGetHandleByName(Window1, "", "ListBox2") $Bank = NET_ControlGetHandleByName(Window1, "", "Search") $var = IniReadSection("fox.ini", "bank") [bank] 1=2*Bank Name*Area 2=1*Bank Name*Area Key = Number of Listbox(1/2)*Bank Name*Area For $i = 1 To $var[0][0] $igridText = StringSplit ($var[$i][1], "*",1) ControlSetText(Window1,"", $Bank, $igridText [2]) ControlSend(Window1,"", $Bank, "{Enter}") Sleep(250) If $igridText[1] = 1 Then $igrid = _GUICtrlListBox_FindString($Fox1, $igridText[2], True) _GUICtrlListBox_SetCurSel($Fox1, $igrid) _GUICtrlListBox_ClickItem($Fox1, _GUICtrlListBox_GetCurSel($Fox1), "left", False, 2,1) If $igrid > 0 And $igridText [3] <> "" Then Sleep(1000) $igrid = _GUICtrlListBox_FindString($Fox1, $igridAreas[3], True) _GUICtrlListBox_SetCurSel($Fox1, $igrid) _GUICtrlListBox_ClickItem($Fox1, _GUICtrlListBox_GetCurSel($Fox1), "left", False, 2,1) EndIf Else $igrid = _GUICtrlListBox_FindString($Fox2, $igridText[2], True) _GUICtrlListBox_SetCurSel($Fox2, $igrid) _GUICtrlListBox_ClickItem($Fox2, _GUICtrlListBox_GetCurSel($Fox2), "left", False, 2,1) If $igrid > 0 And $igridText [3] <> "" Then Sleep(1000) $igrid = _GUICtrlListBox_FindString($Fox2, $igridAreas[3], True) _GUICtrlListBox_SetCurSel($Fox2, $igrid) _GUICtrlListBox_ClickItem($Fox2, _GUICtrlListBox_GetCurSel($Fox2), "left", False, 2,1) EndIf Next Im no expert using autoit but the iniread command looks iffy, is the ini file already written to somewhere? You would need to write something to an ini file before you can read from it unless you write the file yourself, also key isnt hasnt got a $ in front of it, so it isnt a variable. But im a newbie soo im proberbly wrong anyways. wait until someone who knows what there talking about answers [center]First Ever Script/App[/center][center]Simple Battery Meter[/center]
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