chrisyy Posted June 28, 2016 Share Posted June 28, 2016 Heya, google can't help me, so i've created an account and hopefully some of u can help me with my code. My code should overwatch a status div (well, it is a span, but with id) in IE, while it is changing during the game. It is working, but it'll go on error in a few rounds. While 1 sleep(500) $oIE = _IEAttach("Game") Local $oDiv = _IEGetObjById($oIE, "banner") Local $array = _StringExplode($oDiv.innertext, " ", 0) If($array[0] = "State 1") Then ToolTip("State 1") ElseIf($array[0] = "State 2") Then ToolTip("State 2") ElseIf($array[0] = "State 3") Then ToolTip("State 3") ElseIf($array[0] = "State 4") Then ToolTip("State 4") EndIf WEnd So this is roughly the code, where my error will occur. After 1-5 Rounds it will get me to this: "C:\..." (37) : ==> Variable must be of type "Object".: Local $array = _StringExplode($oDiv.innertext, " ", 0) Local $array = _StringExplode($oDiv^ ERROR So it seems that _IEGetObjByID will sometimes get a false, so that _StringExplode cant explode the Object into the array. Tried many things: - Put the IEAttach over the While - Tried to If IsObj on various positions in the code but none of them will work for me. Only when i will put up the sleep-timer, the code will work longer, but i'll reach a timing, where some states wont be recognized. Some Answers, before someone would ask: - I Use Attach, because this Game has a complicated Login System over another platform, then will need me to type in a security code, so i want to start ie with the game, login and then hit "go" - i need the game states to recognize, what i have to do in the next round - yes i got the whole error handle thing imported, but that wont help out for now, i descriped the error Hopefully u can suggest me a solution or maybe another method to do this. Cant go for PixelGetColor, because the state will only be signalized in text form in a span. Thanks ! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 28, 2016 Moderators Share Posted June 28, 2016 chrisyy, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game interaction - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts