thank for reply but it doesnt work, what i want to do is make 2 separate time counting and do 2 separate things in different times so i make my $time into $timeatt and $timemove, it doesnt work either, the problem is when i take out TimerDiff and TimerInit, do another way and it's all good, when i use TimerDiff and TimerInit, there is no error but nothing happen, can some1 help me pls? #include-once
#include <GUIListView.au3>
#include <GUIConstants.au3>
#include <GuiListView.au3>
#Include <GuiConstants.au3>
TraySetIcon ("icon.ico")
Opt("TrayAutoPause",0)
Opt("WinTitleMatchMode", 2)
Opt("TrayMenuMode",0)
Opt("SendKeyDownDelay", 50)
Opt("MouseClickDownDelay",50)
Opt("PixelCoordMode", 0)
Global $Paused
Global $timea
Global $timem
GUICreate("Auto Game",240,170,-1,-1)
GUICtrlCreateTab(10,10,220,150)
GUICtrlCreateTabItem("Char#1")
GUICtrlCreateLabel("UID",20,45,30,20)
$uid=GUICtrlCreateInput("",60,40,100,20)
$att=GUICtrlCreateCheckbox("T? ??ng ??nh",20,80,100,20)
GUICtrlSetState(-1,$GUI_CHECKED)
$move=GUICtrlCreateCheckbox("T? ??ng ch?y",120,80,100,20)
GUICtrlSetState(-1,$GUI_CHECKED)
$run=GUICtrlCreateButton("Run",20,120,60,20)
$hide=GUICtrlCreateButton("Hide",100,120,60,20)
$show=TrayCreateItem("Show")
$trayexit=TrayCreateItem("Exit")
$m=0
$a=0
$timea=0
$timem=0
GUISetState()
While 1
$msg=GUIGetMsg()
$msg2=TrayGetMsg()
If $msg=$GUI_EVENT_CLOSE Then
Exit
EndIf
If $msg=$hide Then
GUISetState(@SW_HIDE)
EndIf
If $msg2=$show Then
GUISetState(@SW_SHOW)
EndIf
If $msg2=$trayexit Then
Exit
EndIf
If $msg=$run Then
TraySetToolTip ( "Char : "& GUICtrlRead($uid))
$sub= GUICtrlRead($uid)
$tit= WinGetTitle($sub, "")
$m=GUICtrlRead($move)
$a=GUICtrlRead($att)
EndIf
RUNX()
WEnd
Func RUNX()
While 1
$msg=GUIGetMsg()
$show=TrayCreateItem("Show")
If $msg=$hide Then
GUISetState(@SW_HIDE)
EndIf
If $msg2=$show Then
GUISetState(@SW_SHOW)
EndIf
If $msg=$GUI_EVENT_CLOSE Then Exit
If TimerDiff($timea)>=5000 Then
A()
$timea=TimerInit()
EndIf
If TimerDiff($timem)>=3600000 Then
B()
$timem=TimerInit()
EndIf
Wend
EndFunc
Func A()
If $a=1 Then
controlsend($tit,"","","!z")
Sleep(1000)
EndIf
EndFunc
Func B()
If $m=1 Then
_MOUSECLICKPLUS($tit, "left", 780, 520, 1)
Sleep(700)
_MOUSECLICKPLUS($tit, "left", 620, 480, 1)
Sleep(700)
_MOUSECLICKPLUS($tit, "left", 780, 520, 1)
Sleep(700)
EndIf
EndFunc
Func _MOUSECLICKPLUS($WINDOW, $BUTTON = "left", $X = "", $Y = "", $CLICKS = 1)
Local $MK_LBUTTON = 1
Local $WM_LBUTTONDOWN = 513
Local $WM_LBUTTONUP = 514
Local $MK_RBUTTON = 2
Local $WM_RBUTTONDOWN = 516
Local $WM_RBUTTONUP = 517
Local $WM_MOUSEMOVE = 512
Local $I = 0
Select
Case $BUTTON = "left"
$BUTTON = $MK_LBUTTON
$BUTTONDOWN = $WM_LBUTTONDOWN
$BUTTONUP = $WM_LBUTTONUP
Case $BUTTON = "right"
$BUTTON = $MK_RBUTTON
$BUTTONDOWN = $WM_RBUTTONDOWN
$BUTTONUP = $WM_RBUTTONUP
EndSelect
If $X = "" Or $Y = "" Then
$MOUSECOORD = MouseGetPos()
$X = $MOUSECOORD[0]
$Y = $MOUSECOORD[1]
EndIf
For $I = 1 To $CLICKS
DllCall("user32.dll", "int", "SendMessage", "hwnd", WinGetHandle($WINDOW), "int", $WM_MOUSEMOVE, "int", 0, "long", _MAKELONG($X, $Y))
DllCall("user32.dll", "int", "SendMessage", "hwnd", WinGetHandle($WINDOW), "int", $BUTTONDOWN, "int", $BUTTON, "long", _MAKELONG($X, $Y))
DllCall("user32.dll", "int", "SendMessage", "hwnd", WinGetHandle($WINDOW), "int", $BUTTONUP, "int", $BUTTON, "long", _MAKELONG($X, $Y))
Next
EndFunc
Func _MAKELONG($LOWORD, $HIWORD)
Return BitOR($HIWORD * 65536, BitAND($LOWORD, 65535))
EndFunc