HaNdLoRdz Posted July 19, 2014 Share Posted July 19, 2014 (edited) expandcollapse popup#include <ImageSearch.au3> #include <MsgBoxConstants.au3> HotKeySet("p", "pause") HotKeySet("o", "CheckImage") global $y = 0, $x = 0 $apos = MouseGetPos() ;;;; koordinat kalah di posisi DOWN = X: 820, Y:506 ;;;; koordinat kalah di posisi up = X: 137, Y:506 While 1 sleep (50) Checkimage() WEnd Func CheckImage() sleep (100) menang() sleep(100) kalah() sleep(100) error() EndFunc Func Menang() Local $search = _ImageSearch('Binary.bmp', 0, $x, $y, 0) ;local $searchPlay = _ImageSearch('PlayAgain.bmp', 0, $x, $y, 0) If $search = 1 then;AND $searchPlay = 1 then ;If $searchPlay = 1 then MouseMove(862,485,10) sleep(100) mouseclick("left",862,485,1) sleep(100) pindah() sleep(100) resetstake() sleep(2000) MouseMove(800,320,10) sleep(100) mouseclick("left",800,320,1) Sleep(100) ;MsgBox(0,"status","menang") EndIf ;Else ; kalah() ;EndIf EndFunc Func Kalah() Local $search = _ImageSearch('kalah.bmp', 0, $x, $y, 0) ;Local $searchPlay = _ImageSearch('PlayAgain.bmp', 0, $x, $y, 0) If $search = 1 then ;AND $searchPlay = 1 then MouseMove(862,485,10) sleep(100) mouseclick("left",862,485,1) sleep(100) MouseMove(853,233,10) sleep(50) mouseclick("left",853,233,2) sleep(100) MouseMove(800,320,10) sleep(100) mouseclick("left",800,320,1) sleep(1000) EndIf EndFunc Func pause() sleep(100000000000) endfunc Func resetstake() Sleep(100) MouseMove(820,234,10); Sleep(100) mouseclick("left",820,234,1) Sleep(500) MouseMove(819,265,10) Sleep(500) mouseclick("left",819,265,3) sleep(100) MouseMove(770,258,10) Sleep(200) mouseclick("left",770,258,1) Sleep(100) endfunc func pindah() sleep(100) MouseMove(150,200,10);;;;;;buat klik ditempat kosong sleep(500) mouseclick("left",150,200,3) sleep(500) ;WinActivate("Mozilla") ; sleep(100) Send("{CTRLDOWN}") sleep(100) send("{TAB}") sleep (100) Send("{CTRLUP}") sleep(100) endfunc Func restart() sleep(6000) MouseMove(105,16,10);klik tab 1 firefox sleep(100) mouseclick("left",105,16,1) sleep(100) MouseMove(126,154,10) sleep(1000) mouseclick("left",126,154,1) sleep (1000) send ("{F5}") sleep(10000) mousemove(943,452,10) sleep(100) MouseClick("left",943,452,1) sleep(100) send("{DOWN}") sleep(100) send("{ENTER}") sleep(100) mousemove(820,424,10) sleep(100) MouseClick("left",820,424,1) sleep(100) mousemove(819,462,10) sleep(100) MouseClick("left",819,462,1) sleep(100) mousemove(763,444,10) sleep(100) MouseClick("left",763,444,1) sleep(100) mousemove(758,506,10) sleep(100) MouseClick("left",758,506,1) sleep(100) send("{UP}") sleep(100) send("{ENTER}") sleep(1000) MouseMove(326,16,10) sleep(100) mouseclick("left",326,16,1) sleep(100) MouseMove(126,154,10) sleep(1000) mouseclick("left",126,154,1); sleep (1000) send ("{F5}") sleep(10000) mousemove(943,452,10); sleep(100) MouseClick("left",943,452,1) sleep(100) send("{DOWN}") sleep(100) send("{ENTER}"); sleep(100) mousemove(820,424,10); sleep(100) MouseClick("left",820,424,1) sleep(100) mousemove(819,462,10); sleep(100) MouseClick("left",819,462,1) sleep(100) mousemove(763,444,10); sleep(100) MouseClick("left",763,444,1) sleep(100) mousemove(758,506,10); sleep(100) MouseClick("left",758,506,1) sleep(100) send("{DOWN}") sleep(100) send("{ENTER}"); sleep(100) MouseMove(797,506,10) sleep(100) mouseclick("left",797,506,1) Sleep(100) EndFunc Func error() Local $search = _ImageSearch('error.bmp', 0, $x, $y, 0) If $search = 1 then restart() EndIf EndFunc can anyone help me with my unfinished code?? i just want when the condition for Func Kalah() = true for the first time then i will send "2", after that if that condition still "TRUE" then it will send "5", and if still "TRUE" it will send "10",etc how can i got the correct code for that?? oh...n one more, beside its running Checkimage() over n over, at the same time i want to Pause after 10 minutes of running n at the same time it will running another Function and then after that it will go to the top code again. can someone help me?? sorry im new comer n sorry for my bad english regards, Edited July 19, 2014 by HaNdLoRdz Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 19, 2014 Moderators Share Posted July 19, 2014 HaNdLoRdz,I see the words "Win" & "Lose" in that code - what are you automating? M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
HaNdLoRdz Posted July 19, 2014 Author Share Posted July 19, 2014 hi m23, i want to automate some game in my computer (flash base) could u help me ? hmmm...just confuse how can i send "2" and "5" and "1" cos its like shortcut n it cant be replace with another key. thx Link to comment Share on other sites More sharing options...
water Posted July 19, 2014 Share Posted July 19, 2014 (edited) Looks like you missed to read the forum rules. Game automation isn't allowed here. Edit: Looks like I missed that Melba already asked a similar question. A smartphone screen is way too small Edited July 19, 2014 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 19, 2014 Moderators Share Posted July 19, 2014 HaNdLoRdz, i want to automate some gameI was afraid of that - which is why I asked. water is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts