Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <ScrollBarsConstants.au3>
- #include <EditConstants.au3>
- #include <GuiEdit.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <MsgBoxConstants.au3>
- $Form1 = GUICreate("RaGeWeaver", 615, 194, 192, 124)
- $Group1 = GUICtrlCreateGroup("Statistics", 8, 8, 249, 145)
- $Label1 = GUICtrlCreateLabel("Number of Games played:", 16, 128, 155, 17)
- GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
- $cln_found = GUICtrlCreateLabel("SpellWeaver Client found:", 16, 32, 154, 18)
- GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
- GUICtrlCreateLabel("blub", 80, 32, 4, 4)
- $cln_wpos = GUICtrlCreateLabel("", 16, 52, 154, 18)
- GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
- $clnfn = GUICtrlCreateLabel("not detected", 176, 32, 75, 17)
- GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
- $games_played = GUICtrlCreateLabel("0", 184, 128, 67, 17, $SS_RIGHT)
- GUICtrlSetFont(-1, 8, 400, 0, "Verdana")
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Group2 = GUICtrlCreateGroup("Settings", 264, 8, 345, 145)
- $Edit1 = GUICtrlCreateEdit("press Start", 272, 24, 329, 121, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$ES_READONLY))
- GUICtrlSetData(-1, "press Start")
- $Button1 = GUICtrlCreateButton("Start", 528, 160, 75, 25)
- $Button2 = GUICtrlCreateButton("TopCorner", 428, 160, 75, 25)
- $Button3 = GUICtrlCreateButton("Restore", 328, 160, 75, 25)
- GUISetState(@SW_SHOW)
- Global $LogFile = ""
- Global $games = 0
- Global $posx = 0
- Global $posy = 0
- Global $posw = 0
- Global $posh = 0
- Global $restw = 0
- Global $resth = 0
- Global $botRun = false
- Global $round = 0
- ; 0 = OutOfGame 1 = Starting Game 2 = Accepting Hand 3 = FinishRound
- Global $status = 0
- Global $hWnd = -1
- Func StartBotGame()
- $LogFile = $LogFile & @CRLF & "choosing botgame"
- ControlClick ($hWnd, '','', "left", 1, 660, 805);
- $status = 1
- $games = $games+1
- $round = 0
- Sleep(2000)
- EndFunc
- Func CheckGameButton()
- $col = PixelSearch($posx + 44, $posy +77, $posx+174, $posy+168, 0xFF0000,100,1,$hWnd)
- If Not @error Then
- ;MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $col[0] & "," & $col[1])
- ;Sleep(1000)
- $LogFile = $LogFile & @CRLF & "starting a game"
- ControlClick ($hWnd, '','', "left", 1, $col[0]-$posx, $col[1]-$posy);
- Sleep(1000)
- StartBotGame()
- EndIf
- EndFunc
- Func KeepCards()
- $col = PixelSearch($posx + 763, $posy +641, $posx+803, $posy+681, 0x44210D,100,1,$hWnd)
- If Not @error Then
- ;MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $col[0] & "," & $col[1])
- ;Sleep(1000)
- $LogFile = $LogFile & @CRLF & "keeping cards"
- ControlClick ($hWnd, '','', "left", 1, $col[0]-$posx, $col[1]-$posy);
- $status = 2
- ;Sleep(1000)
- ;StartBotGame()
- EndIf
- EndFunc
- Func EndRound()
- $col = PixelSearch($posx + 1191, $posy +564, $posx+1191, $posy+564, 0xedd96b,60,1,$hWnd)
- If Not @error Then
- $round = $round + 1
- $LogFile = $LogFile & @CRLF & "ending round "&$round
- ;$status = 3
- ControlClick ($hWnd, '','', "left", 1, $col[0]-$posx, $col[1]-$posy);
- $k = Random(1000, 5000, 1)
- Sleep($k)
- EndIf
- EndFunc
- Func FindACardToPlay()
- $colc = PixelSearch($posx + 336, $posy +748, $posx+982, $posy+989, 0x78D843,30,1,$hWnd)
- If Not @error Then
- MouseMove($colc[0]-$posx,$colc[1]-$posy)
- EndIf
- EndFunc
- Func FinalizeGame()
- $colc = PixelSearch($posx + 541, $posy +650, $posx+541, $posy+650, 0x685222,30,1,$hWnd)
- If Not @error Then
- Sleep(1000)
- $colc = PixelSearch($posx + 541, $posy +650, $posx+541, $posy+650, 0x685222,30,1,$hWnd)
- If Not @error Then
- $LogFile = $LogFile & @CRLF & "ending game "
- MouseMove($colc[0]-$posx,$colc[1]-$posy)
- ControlClick ($hWnd, '','', "left", 1, $colc[0]-$posx, $colc[1]-$posy);
- $k = Random(1000, 5000, 1)
- $status = 0
- Sleep($k)
- EndIf
- Else
- ;$status = 2
- EndIf
- EndFunc
- While 1
- GUICtrlSetData ($games_played, $games)
- $hWnd = WinGetHandle("[CLASS:ApolloRuntimeContentWindow]")
- If @error Then
- GUICtrlSetData ($clnfn, "not found")
- Else
- GUICtrlSetData ($clnfn, "found")
- $aPos = WinGetPos("[CLASS:ApolloRuntimeContentWindow]")
- ;GUICtrlSetData ($cln_wpos, "Window Position: "&$aPos[0]&","&$aPos[1])
- $posx = $aPos[0]
- $posy = $aPos[1]
- $posw = $aPos[2]
- $posh = $aPos[3]
- EndIf
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- ;WinMove($hWnd, "", 0, 0,$restw,$resth)
- Exit
- Case $Button3
- ;WinMove($hWnd, "", 0, 0,$restw,$resth)
- Case $Button2
- ;$restw = $posw
- ;$resth = $posh
- WinMove($hWnd, "", 0, 0)
- Case $Button1
- if Not $botRun Then
- $botRun = true
- GUICtrlSetData($Button1, "Stop")
- else
- $botRun = false
- GUICtrlSetData($Button1, "Start")
- EndIf
- ;GUICtrlSetState($Button1, $GUI_DISABLE)
- ;WinMove($hWnd, "", 0, 0)
- ;CheckGameButton()
- ;ControlClick ($hWnd, '','', "left", 1, 117, 121)
- GUICtrlSetState($Button1, $GUI_ENABLE)
- EndSwitch
- GUICtrlSetData ($cln_wpos, "Status: "&$status)
- If $botRun Then
- GUICtrlSetData($Edit1, $LogFile)
- _GUICtrlEdit_Scroll($Edit1, $SB_SCROLLCARET)
- ;FindACardToPlay()
- Switch $status
- Case 0
- CheckGameButton()
- Case 1
- KeepCards()
- Case 2
- EndRound()
- FinalizeGame()
- EndSwitch
- EndIf
- Sleep(100)
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement