DukeJ Posted April 6, 2021 Share Posted April 6, 2021 This was working fine and IDK what I changed but it's throwing an error now. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 6, 2021 Developers Share Posted April 6, 2021 (edited) Post a script in a code box, so no images, which is runnable so we can have a proper look at it, but likely th e array which is pointed to isn't an array. Jos Edited April 6, 2021 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DukeJ Posted April 6, 2021 Author Share Posted April 6, 2021 ;Settings Global $sWinClass = "[CLASS:UnityWndClass]" Global $iTroopType = 1 ; 0, 1, 2 Global $aCheckSum = [ 205, 735, "0xFFFFFF"] Global $aTypes = [ [267, 362], [494, 402], [739, 362]] Global $aTiers = [ [255, 469], [424, 469], [603,469], [772, 469]] Global $aUnit_1 = [ 255, 469] Func CheckTroops() Opt("MouseCoordMode", 2) $hHandle = WinGetHandle($sWinClass, "") Sleep(1000) $iCheck = PixelChecksum( $aCheckSum[0], $aCheckSum[1], $aCheckSum[0]+20, $aCheckSum[1]+20, 1, $hHandle) If WinExists($hHandle) = True Then If @error then Exit While $iCheck = PixelChecksum( $aCheckSum[0], $aCheckSum[1], $aCheckSum[0]+20, $aCheckSum[1]+20, 1, $hHandle) ToolTip("Waiting...") Sleep(200) WEnd Sleep(1500) If PixCheck($hHandle, $aUnitBoost) = False Then MouseMove( $aTypes[$iTroopType[0]], $aTypes[$iTroopType[1]]) CheckSum( $hHandle, $aUnit_1) MouseMove( $aTiers[$iTroopTier[0]], $aTiers[$iTroopTiers[1]]) CheckSum( $hHandle, $aUnit_1) MouseMove( $aUnitTrain[0], $aUnitTrain[1]) CheckSum( $hHandle, $aUnit_1) EndIf EndIf Sleep(500) ControlSend( $hHandle, "" ,"", "{ESC}") EndFunc I think I got it all, my globals are in an include file if that matters. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 6, 2021 Developers Share Posted April 6, 2021 Mmm.... Now tell me this isn't some game bot? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DukeJ Posted April 6, 2021 Author Share Posted April 6, 2021 Just now, Nine said: I don't think so. $iTroopType is not an array. But this should work : MouseMove(($aTypes[$iTroopType])[0], ($aTypes[$iTroopType])[1]) But $iTroopType is pointing to the index of $aTypes no? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 6, 2021 Developers Share Posted April 6, 2021 2 minutes ago, Jos said: Mmm.... Now tell me this isn't some game bot? Can I get that answer first please? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DukeJ Posted April 6, 2021 Author Share Posted April 6, 2021 3 minutes ago, Jos said: Mmm.... Now tell me this isn't some game bot? Just now, Jos said: Can I get that answer first please? I have no interest in bots. I'm just asking why the integer variable cannot be used at an index. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 6, 2021 Moderators Share Posted April 6, 2021 DukeJ, Quote I have no interest in bots And yet the first thing you post is pretty obviously a gamebot, so that line is not going to wash. Want to try again? M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out. 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...
DukeJ Posted April 6, 2021 Author Share Posted April 6, 2021 2 minutes ago, Melba23 said: DukeJ, And yet the first thing you post is pretty obviously a gamebot, so that line is not going to wash. Want to try again? M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out. If the post is not allowed I'm sorry, just close and I will leave. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 6, 2021 Moderators Share Posted April 6, 2021 DukeJ, No need to leave - just read the Forum rules and follow them. You will get help if you stick to them - so make sure you read the bit that says: "Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above" But for now this thread is locked. 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