Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs
- Global Const $COLOR_GREEN = 0x008000
- Global Const $COLOR_RED = 0xFF0000
- Global Const $COLOR_YELLOW = 0xFFFF00
- #ce
- $title = "RАGЕ Мultiрlaуer "
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <WinAPI.au3>
- #include <WindowsConstants.au3>
- #include "c:\bod\gta\perekli4ka\Mytesseract.au3"
- ;#include <tesseract.au3>
- Opt("GUICloseOnESC", 0)
- _TesseractTempPathSet("c:\bod\gta\perekli4ka\screens")
- Global $tRect
- global $game_hWnd
- HotKeySet("{ESC}","")
- HotKeySet("{`}","calncetrade")
- HotKeySet("{1}","online_check")
- HotKeySet("{2}","trade_check")
- HotKeySet("{3}","savetrade")
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("nepekJlukatop.", 307, 657, 200, 250, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
- $Button1 = GUICtrlCreateButton("save data1", 16, 616, 75, 25, $WS_GROUP)
- $Button2 = GUICtrlCreateButton("compare", 112, 616, 75, 25, $WS_GROUP)
- $Button3 = GUICtrlCreateButton("save compare", 208, 616, 75, 25, $WS_GROUP)
- $Edit1 = GUICtrlCreateEdit("", 16, 48, 273, 561)
- GUICtrlSetData(-1, "")
- $Label1 = GUICtrlCreateLabel("set hWnd before use this tool", 24, 16, 235, 25)
- $Button4 = GUICtrlCreateButton("hW", 260, 1, 45, 45, $WS_GROUP) ; save hWnd
- GUICtrlSetFont($Label1, 13)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- ;GUICtrlSetBkColor($Label1, "0x008000")
- While 1 ; ////////////////////////////////////////////// MAIN
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- case $Button1
- saveto("data1.txt")
- case $Button2
- compare()
- case $Button3
- savecompare()
- case $Button4
- saveHW()
- EndSwitch
- ;_WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), $tRect, 0, BitOR($RDW_INVALIDATE, $RDW_ALLCHILDREN))
- ;_WinAPI_DrawRect(910, 490, 160, 50, 0x008000)
- Sleep(10)
- WEnd
- Func dev()
- ;personal_check()
- ;GUICtrlSetData($Edit1, "", 0)
- ControlFocus ( $Form1, "", "Edit1" )
- ControlSend($Form1, "", "Edit1", "^{END}")
- EndFunc
- Func online_check() ; проверка онлайна
- ;$game_hWnd = "test.bmp" ; test.bmp "RAGЕ Multiрlаyer "
- WinActivate ( $Form1 )
- ControlFocus ( $Form1, "", "Edit1" )
- ControlSend($Form1, "", "Edit1", "^{END}")
- $cleanup = 0
- $scale = 1
- $dbg = 0
- $2height = 450 ; 700 чем больше значение тем меньше по высоте. piztec kakoi-to 990
- $2width = 1645 ; 1710 1720
- ;_TesseractWinCapture("test.bmp", $win_text = "", $get_last_capture = 0, $delimiter = "", $cleanup = 1, $scale = 2, $left_indent = 0, $top_indent = 0, $right_indent = 0, $bottom_indent = 0, $show_capture = 0)
- $users = _TesseractWinCapture($game_hWnd, "", 0, "", $cleanup, $scale, 900, 580, $2width, $2height, $dbg)
- $users = StringRegExpReplace($users, "(?m)^\s*$\R?", "")
- ;$users = StringReplace($users, Asc(0), "")
- $users = StringSplit($users, @CRLF)
- $users_counter = 0
- For $i=1 to UBound($users)-1
- ;;if Mod($i,2) = 0 Then ; какой то символ ебаный добавляется, убрать не смог, тупо скипаю его
- ;;;;ContinueLoop ненадо, добавляются пустые строки и тогда это все ломает
- ;;EndIf
- if $users[$i] = Chr(0) then
- ContinueLoop
- EndIf
- $users_counter = $users_counter + 1
- ;ConsoleWrite($users[$i]&" "&Asc ( $users[$i] )&@CRLF)
- ;$users[$i] = StringRegExpReplace($users[$i], @CR, "")
- ;$users[$i] = StringRegExpReplace($users[$i], @LF, "")
- ;$users[$i] = StringRegExpReplace($users[$i], @CRLF, "")
- ;$users[$i] = StringRegExpReplace($users[$i], Asc(0), "")
- GUICtrlSetData($Edit1, $users[$i]&@CRLF, 1)
- Sleep(5)
- Next
- ;_ArrayDisplay($users)
- ;ConsoleWrite(Asc ( $users[20] ))
- ;msg($users)
- GUICtrlSetData($Edit1, "-------------------"&@CRLF, 1)
- GUICtrlSetData($Label1, "readed lined: "&$users_counter, "")
- if $users_counter < 8 then
- GUICtrlSetBkColor($Label1, "0xFF0000")
- Beep(100, 100)
- Sleep(1000)
- GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT)
- EndIf
- ;MsgBox(0,0,$users);
- ;GUICtrlSetData($Edit1, $users & @CRLF, 1)
- ;$users = StringStripWS($users, 8)
- EndFunc
- Func trade_check()
- ;$game_hWnd = "test.bmp" ; test.bmp "RAGЕ Multiрlаyer "
- $cleanup = 0
- $scale = 2
- $dbg = 0
- $2height = 1000 ; 700 чем больше значение тем меньше по высоте. piztec kakoi-to 990
- $2width = 1690 ; 1710 1720
- $users = _TesseractWinCapture($game_hWnd, "", 0, "", $cleanup, $scale, 1650, 650, $2width, $2height, $dbg) ; трейд со скрина 1000 1690
- ;$users = _TesseractWinCapture($title, "", 0, "", $cleanup, $scale, 1610, 410, $2width, $2height, $dbg) ; для чтения трейда 1050 1690
- $users = StringReplace($users, "_", " ")
- GUICtrlSetData($Edit1, '') ; cls editbox
- GUICtrlSetData($Edit1, $users, 1)
- GUICtrlSetData($Label1, "trade readed", "")
- EndFunc
- func compare()
- Local $data1[] = []
- Local $data2[] = []
- GUICtrlSetData($Edit1, '') ; cls editbox
- _FileReadToArray("data1.txt", $data1)
- _FileReadToArray("data2.txt", $data2)
- local $chk = false
- For $i = 1 To UBound($data1)-1
- For $i2 = 1 To UBound($data2)-1
- if StringCompare ( StringLower($data1[$i]), StringLower($data2[$i2]) ) = 0 Then
- $chk = true
- ExitLoop
- EndIf
- Next
- if $chk = false then
- ;ConsoleWrite($data1[$i]&@CRLF) ; <<< тот кто есть в data1 и нету в data2
- msg($data1[$i])
- EndIf
- $chk = false
- Next
- GUICtrlSetData($Label1, "compare finished", "")
- EndFunc
- func savetrade()
- Local $hFileOpen = FileOpen("c:\bod\gta\perekli4ka\data2.txt", $FO_APPEND)
- $name = ControlGetText ( $Form1, "", $Edit1 )
- ;$name = StringRegExpReplace($name, "(?m)^\s*$\R?", "")
- FileWriteLine($hFileOpen, $name)
- FileClose($hFileOpen)
- GUICtrlSetData($Label1, "trade saved for: "&$name, "")
- EndFunc
- Func show($str)
- ToolTip($str, 500, 500)
- EndFunc
- Func stop()
- exit
- EndFunc
- func saveto($filename)
- Local $hFileOpen = FileOpen("c:\bod\gta\perekli4ka\"&$filename, $FO_APPEND)
- FileWriteLine($hFileOpen, ControlGetText ( $Form1, "", $Edit1 ))
- FileClose($hFileOpen)
- GUICtrlSetData($Label1, $filename&" saved", "")
- EndFunc
- func savecompare()
- Local $hFileOpen = FileOpen("c:\bod\gta\perekli4ka\compare_result.txt", $FO_APPEND)
- FileWriteLine($hFileOpen, ControlGetText ( $Form1, "", $Edit1 ))
- FileClose($hFileOpen)
- GUICtrlSetData($Label1, "compare saved", "")
- EndFunc
- Func msg($str)
- GUICtrlSetData($Edit1, $str & @CRLF, 1)
- EndFunc
- func saveHW()
- GUICtrlSetData($Label1, "activate window", "")
- $tmp_title = WinGetHandle("[ACTIVE]")
- for $i=0 to 6
- if WinGetHandle("[ACTIVE]") <> $tmp_title then
- ExitLoop
- EndIf
- Sleep(500)
- Next
- $game_hWnd = WinGetHandle("[ACTIVE]")
- ConsoleWrite(WinGetTitle($game_hWnd))
- GUICtrlSetData($Label1, "hWnd title: "&WinGetTitle($game_hWnd), "")
- EndFunc
- Func calncetrade()
- if PixelGetColor ( 998, 744 , $game_hWnd ) = 0x1D2634 then ; we in trade?
- ;MouseClick("left", 0, 500, 0)
- Send("{ESC}")
- Else
- Send("{y}")
- EndIf
- EndFunc
- ; ///////////////////////////////// UNUSED ///////////////////////////////////////
- Func zaplatka($name)
- $names = ObjCreate("Scripting.Dictionary")
- $names.Add ("test11", "test2")
- ConsoleWrite($names.Item($name));
- EndFunc
- Func _WinAPI_DrawRect($start_x, $start_y, $iWidth, $iHeight, $iColor)
- Local $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
- $tRect = DllStructCreate($tagRECT)
- DllStructSetData($tRect, 1, $start_x)
- DllStructSetData($tRect, 2, $start_y)
- DllStructSetData($tRect, 3, $iWidth + $start_x) ; x-coordinate of the lower-right corner of the rectangle
- DllStructSetData($tRect, 4, $iHeight + $start_y) ; y-coordinate of the lower-right corner of the rectangle
- Local $hBrush = _WinAPI_CreateSolidBrush($iColor)
- _WinAPI_FrameRect($hDC, DllStructGetPtr($tRect), $hBrush)
- ; clear resources
- _WinAPI_DeleteObject($hBrush)
- _WinAPI_ReleaseDC(0, $hDC)
- EndFunc ;==>_WinAPI_DrawRect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement