Sign in to follow this  
Followers 0
fxg4758

Read/Selection ListBox

2 posts in this topic

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. :graduated:

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

Share this post


Link to post
Share on other sites



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. :graduated:

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 :D


[center]First Ever Script/App[/center][center]Simple Battery Meter[/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0