shawtayee Posted June 1, 2009 Share Posted June 1, 2009 I actually want to display an Array (with 5x10 size) which I get via _IETableWriteToArray to display in my GUI. Could somebody maybe help me? I am very new to programmin and AutoIt =\ Link to comment Share on other sites More sharing options...
nguyenbason Posted June 1, 2009 Share Posted June 1, 2009 where do you want to display it? or just display by _ArrayDisplay($array)? UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 I want to display it in my GUI with GUICtrlCreateLabel or another command, if there is any better Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 (edited) Well, that my UI looks something like this ______________________ | | | |_| |_| |_| |_| |_| | | |_| |_| |_| |_| |_| | | |_| |_| |_| |_| |_| | | | | |button1| |button2| | | | | | |_____________________| while the "array" (5x3 in this example) will be numbers, names and so on /edit: argh sry it messes it up totally, hope u still understand what I mean Edited June 1, 2009 by shawtayee Link to comment Share on other sites More sharing options...
Roman9 Posted June 1, 2009 Share Posted June 1, 2009 (edited) How about something like $array[3][5] $11 = GUICtrlCreateEdit($array[1][1], coordinate x1, coordinate y1, coordinate x2, coordinate y2) $12 = GUICtrlCreateEdit($array[1][2], coordinate x1, coordinate y1, coordinate x2, coordinate y2) $13 = GUICtrlCreateEdit($array[1][3], coordinate x1, coordinate y1, coordinate x2, coordinate y2) $14 = GUICtrlCreateEdit($array[1][4], coordinate x1, coordinate y1, coordinate x2, coordinate y2) $15 = GUICtrlCreateEdit($array[1][5], coordinate x1, coordinate y1, coordinate x2, coordinate y2) $21 = GUICtrlCreateEdit($array[2][1], coordinate x1, coordinate y1, coordinate x2, coordinate y2) I'm still new to GUIs Edited June 1, 2009 by Roman9 Link to comment Share on other sites More sharing options...
nguyenbason Posted June 1, 2009 Share Posted June 1, 2009 (edited) [3,5] Hope it works #include <array.au3> HotKeySet("{ESC}","_Exit") Local $L[20] $F = GUICreate("",400,400,-1,-1) For $i = 1 to 5 $L[$i] = GUICtrlCreateLabel("label" & $i,$i*50,20,40,15) $L[$i+5] = GUICtrlCreateLabel("label" & $i + 5,$i*50,60,40,15) $L[$i+10] = GUICtrlCreateLabel("label" & $i + 10,$i*50,100,40,15) Next $IEArray = _IETableWriteToArray($IEobject) For $J = 0 to 4 GUICtrlSetData($L[$j +1],$IEArray[1][$j]) GUICtrlSetData($L[$j +6],$IEArray[2][$j]) GUICtrlSetData($L[$j +11],$IEArray[3][$j]) Next GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _Exit() Exit EndFunc Edited June 1, 2009 by nguyenbason UnderWorldVN- Just play the way you like it Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 (edited) ty, that helped me alot, got another question $oTable = _IETableGetCollection ($oIE, 1) $avArray = _IETableWriteToArray ($oTable, True) $check4feed = _ArraySearch($avArray, "BLA BLA BLA") If $check4feed = @error Then MsgBox(4096, "test", "FAIL") is there something wrong with this? He just wont open the msg box, even if no bla bla bla is found in $avArray Edited June 1, 2009 by shawtayee Link to comment Share on other sites More sharing options...
oMBRa Posted June 1, 2009 Share Posted June 1, 2009 (edited) 1)on failure $check4feed is set to -1 and @error to 1 or 2 or 3 etc... so that comparison will be never true 2) there is a missing endif 3)you can either do: If $check4feed = -1 Then MsgBox(4096, "test", "FAIL") endif or If @error Then MsgBox(4096, "test", "FAIL") endif Edited June 1, 2009 by oMBRa Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 I already tried it with "-1" and I just missed to copy the "endif" I dont know why this isnt working, god damn it Link to comment Share on other sites More sharing options...
martin Posted June 1, 2009 Share Posted June 1, 2009 (edited) ty, that helped me alot, got another question $oTable = _IETableGetCollection ($oIE, 1) $avArray = _IETableWriteToArray ($oTable, True) $check4feed = _ArraySearch($avArray, "BLA BLA BLA") If $check4feed = @error Then MsgBox(4096, "test", "FAIL") is there something wrong with this? He just wont open the msg box, even if no bla bla bla is found in $avArray_ArraySearch returns the index but if it fails it sets the global variable @error to a value which lets you know what the problem was. (The help is not quite clear on this to me.) It doesn't set the return to the same value that it sets @error. If there is no error then @error will be 0 so you will only see a message box if there is no error and the index found is 0. So you need something like If $check4feed = -1 Then MsgBox(4096, "test", "FAIL, @error = " & @error ) EndIf Edited June 1, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 #include <IE.au3> #include <Array.au3> $oIE = _IECreate("http://www.dota-league.com/?section=instant/instant_single_game", "", 1) _IENavigate($oIE, "java script:get_playerlist()") $oTable = _IETableGetCollection ($oIE, 1) $avArray = _IETableWriteToArray ($oTable, True) $check4feed = _ArraySearch($avArray, "cr3w.shawtayee") If $check4feed = -1 Then MsgBox(4096, "test", "FAIL") EndIf here is the part that I am talking about, just wont get it working Link to comment Share on other sites More sharing options...
oMBRa Posted June 1, 2009 Share Posted June 1, 2009 you should at least tell us where the error comes from Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 In the code above, the program should create an IE window, refresh the important frame via " _IENavigate($oIE, "java script:get_playerlist()")" then get the table from IE to an array and search for "cr3w.shawtayee" which in this case, won't be found and becuz of that, should open a msgbox if I am not totally mistaken Link to comment Share on other sites More sharing options...
oMBRa Posted June 1, 2009 Share Posted June 1, 2009 I think the problem it's this: _IENavigate($oIE, "java script:get_playerlist()") replace it with : _IEAction ($oIE, "refresh") off topic: I was a dota player too Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 Okay now he is actually doing the "else" instead of just giving me the msgbox xD guess whatever the return is, it is not -1 OT: :DD nice to hear =D why U stopped? Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 ARGH I AM SO STUPID >_> _ArraySearch is supposed to return 6 if nothing is found, thanks guys Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 _ArraySearch returns the index but if it fails it sets the global variable @error to a value which lets you know what the problem was. (The help is not quite clear on this to me.) It doesn't set the return to the same value that it sets @error. If there is no error then @error will be 0 so you will only see a message box if there is no error and the index found is 0. So you need something like If $check4feed = -1 Then MsgBox(4096, "test", "FAIL, @error = " & @error ) EndIf you actually explained everything, 0 is the key, thank you guy Link to comment Share on other sites More sharing options...
shawtayee Posted June 1, 2009 Author Share Posted June 1, 2009 Sorry but I need help again I will give you a code now, so you test on urself... #include <IE.au3> #include <Array.au3> $oIE = _IECreate("http://www.dota-league.com/?section=instant/instant_single_game", "", 1) $oTable = _IETableGetCollection ($oIE, 1) $avArray = _IETableWriteToArray ($oTable, True) $check4feed = _ArraySearch($avArray, "cr3w.shawtayee") _ArrayDisplay($avArray) If "cr3w.shawtayee" is in the table or not, $check4feed is always 0... why??? 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