Jump to content

Recommended Posts

  • Developers
Posted (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 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 post
Share on other sites
;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 post
Share on other sites
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 post
Share on other sites
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 post
Share on other sites
  • Moderators

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.

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
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 post
Share on other sites
  • Moderators

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

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...