o0johntam0o 0 Posted April 13, 2011 (edited) I tried to use "ControlClick" in this code: For $j=1 to $Sky_SoTang For $i=1 to $Sky_Times $Sky_Tmp=$Sky_xGold While ($Sky_Tmp<=$Sky_xGold+600) ControlClick("KVTM","",$Sky_ClassID, "Left", 1, $Sky_Tmp,$Sky_yGold+5) ControlClick("KVTM","",$Sky_ClassID, "Left", 1, $Sky_Tmp,$Sky_yGold-5) ;MouseClick("left",$Sky_Tmp,$Sky_yGold+5,1,0) ;MouseClick("left",$Sky_Tmp,$Sky_yGold-5,1,0) $Sky_Tmp+=10 If $Sky_KTra=False Then ToolTip("Đã ngừng nhặt gold",0,0,"Thông Báo") $Sky_KTra=True ExitLoop(3) EndIf WEnd Next If ($j<>$Sky_SoTang) Then TangDuoi_Sky() Sleep(500) EndIf Next But the "ControlClick" executed without any "Loop" (Including While...WEnd) I tried replace it by "MouseClick" and it's ok How can i slove this. Edited April 13, 2011 by o0johntam0o Share this post Link to post Share on other sites
MrMitchell 16 Posted April 13, 2011 I tried to use "ControlClick" in this code: For $j=1 to $Sky_SoTang For $i=1 to $Sky_Times $Sky_Tmp=$Sky_xGold While ($Sky_Tmp<=$Sky_xGold+600) ControlClick("KVTM","",$Sky_ClassID, "Left", 1, $Sky_Tmp,$Sky_yGold+5) ControlClick("KVTM","",$Sky_ClassID, "Left", 1, $Sky_Tmp,$Sky_yGold-5) ;MouseClick("left",$Sky_Tmp,$Sky_yGold+5,1,0) ;MouseClick("left",$Sky_Tmp,$Sky_yGold-5,1,0) $Sky_Tmp+=10 If $Sky_KTra=False Then ToolTip("Đã ngừng nhặt gold",0,0,"Thông Báo") $Sky_KTra=True ExitLoop(3) EndIf WEnd Next If ($j<>$Sky_SoTang) Then TangDuoi_Sky() Sleep(500) EndIf Next But the "ControlClick" executed without any "Loop" (Including While...WEnd) I tried replace it by "MouseClick" and it's ok How can i slove this. You can make the following changes: For $j=1 to $Sky_SoTang For $i=1 to $Sky_Times $Sky_Tmp=$Sky_xGold While ($Sky_Tmp<=$Sky_xGold+600) ;ControlClick("KVTM","",$Sky_ClassID, "Left", 1, $Sky_Tmp,$Sky_yGold+5) ;ControlClick("KVTM","",$Sky_ClassID, "Left", 1, $Sky_Tmp,$Sky_yGold-5) MouseClick("left",$Sky_Tmp,$Sky_yGold+5,1,0) MouseClick("left",$Sky_Tmp,$Sky_yGold-5,1,0) $Sky_Tmp+=10 If $Sky_KTra=False Then ToolTip("Đã ngừng nhặt gold",0,0,"Thông Báo") $Sky_KTra=True ExitLoop(3) EndIf WEnd Next If ($j<>$Sky_SoTang) Then TangDuoi_Sky() Sleep(500) EndIf Next More information can be found here Share this post Link to post Share on other sites
o0johntam0o 0 Posted April 13, 2011 T'm so sorry about this trouble, but i just want to know how can i use "ControlClick" in Loop functions Thanks for any replies Share this post Link to post Share on other sites
o0johntam0o 0 Posted April 14, 2011 (edited) Oh I've just realized that i was wrong that "ControlClick" didn't work in Loops 'Cause i didn't use "ControlClick" in another functions which i just used "MouseClick" ( TangDuoi_Sky() ). It must be replaced all by "ControlClick" Thanks. Edited April 14, 2011 by o0johntam0o Share this post Link to post Share on other sites