Cyber Posted March 27, 2007 Share Posted March 27, 2007 (edited) Teel me you level goal feedback is appreciatesUpdate-Bug for path (thanks mrRevoked)-Use graphic not icon (thanks GtaSpider)expandcollapse popup#include <GUIConstants.au3> ; == GUI generated with Koda == Global $title = "ReflectIT!" Global $level = 1 Global $levelTime = 5000 Global $state = 0 Global $time Global $tent = 0 Dim $lev[21] $lev[0] = 20;***level number $lev[1] = 2000 $lev[2] = 1600 $lev[3] = 1200 $lev[4] = 1000 $lev[5] = 800 $lev[6] = 700 $lev[7] = 600 $lev[8] = 500 $lev[9] = 450 $lev[10] = 400 $lev[11] = 380 $lev[12] = 350 $lev[13] = 330 $lev[14] = 310 $lev[15] = 300 $lev[16] = 290 $lev[17] = 280 $lev[18] = 270 $lev[19] = 260 $lev[20] = 250 $Form1 = GUICreate($title, 519, 270, 285, 353) $level_ = GUICtrlCreateGroup("AGroup1", 16, 72, 137, 89) $levelTime_ = GUICtrlCreateLabel("5 sec", 72, 120, 30, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $hit = GUICtrlCreateButton("HIT!", 192, 72, 217, 161) GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlCreateLabel("Time for pass", 40, 96, 93, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x000080) $start = GUICtrlCreateButton("Start", 32, 176, 105, 33) $Icon1 = GUICtrlCreateGraphic(280, 16, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") GUISetState(@SW_SHOW) $xi = 0 While 1 $msg = GUIGetMsg() $ret = _reflex($state) If $xi = 1 Then $timeDiff = TimerDiff($time) MsgBox(0, "", Round($timeDiff / 1000, 2) & " seconds" & @CRLF & $timeDiff) EndIf If $ret = 1 Then GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0xee0000, 0xff0000) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) ;$xi=1 EndIf Select Case $msg = $hit If $state = 2 Then $timeDiff = TimerDiff($time) ;MsgBox(0,"",Round($timeDiff / 1000,2) & " seconds" & @CRLF & $timeDiff) GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlSetState($start, $GUI_ENABLE) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) $state = 0 If $timeDiff <= $lev[$level] Then MsgBox(32, $title, "Success!! (" & Round($timeDiff / 1000, 2) & " second/s)" & @CRLF & "Level passed!") _levelUp() GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") Else MsgBox(16, $title, "Fail (" & Round($timeDiff / 1000, 2) & " second/s)" & @CRLF & "Level fail") $level = 1 GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") EndIf Else MsgBox(16, $title, "Fail! Wait red icon") $state = 0 $level = 1 GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlSetState($start, $GUI_ENABLE) GUICtrlSetData($level_, "Level " & $level) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) EndIf Case $msg = $start GUICtrlSetState($start, $GUI_DISABLE) GUICtrlSetData($start, "3") Sleep(1000) GUICtrlSetData($start, "2") Sleep(1000) GUICtrlSetData($start, "1") Sleep(1000) GUICtrlSetData($start, "Start") GUICtrlSetState($hit, $GUI_ENABLE) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0xeeee00, 0xffff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) $state = 1 $tent = 0 ;Sleep(1000) Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Func _levelUp() $level = $level + 1 $levelTime = $lev[$level] If $level > $lev[0] Then MsgBox(0, $title, "Congratulation! Your reflex is optimal!") $level = 1 $levelTime = $lev[$level] EndIf EndFunc ;==>_levelUp Func _reflex($s) If $s = 1 Then $rand = Random(1, 1000+ ($level * 200), 1) ;MsgBox(0,"",$rand) If $rand = 1 Or $tent >= ($level * 500) Then ;Return 1 $state = 2 $time = TimerInit() Return 1 Else $tent = $tent + 1 ;ToolTip($tent) Return 0 EndIf EndIf EndFunc ;==>_reflexreflectIT.au3 Edited March 28, 2007 by Cyber Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted March 27, 2007 Share Posted March 27, 2007 (edited) pretty interesting.. i kept getting 'fail wait red icon' cause i never saw the icon. GUICtrlCreateIcon("F:\AutoIT\green.ico", 0, 280, 16) all these that use fullpaths should be changed to.. GUICtrlCreateIcon(@scriptdir & "\green.ico", 0, 280, 16) Edited March 27, 2007 by mrRevoked Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
GtaSpider Posted March 27, 2007 Share Posted March 27, 2007 (edited) Hello! Why you dont use GuiCtrlSEtGraphic? if you use it you dont need the icons.. Like this: expandcollapse popup#include <GUIConstants.au3> ; == GUI generated with Koda == Global $title = "ReflectIT!" Global $level = 1 Global $levelTime = 5000 Global $state = 0 Global $time Global $tent = 0 Dim $lev[21] $lev[0] = 20;***level number $lev[1] = 2000 $lev[2] = 1600 $lev[3] = 1200 $lev[4] = 1000 $lev[5] = 800 $lev[6] = 700 $lev[7] = 600 $lev[8] = 500 $lev[9] = 450 $lev[10] = 400 $lev[11] = 380 $lev[12] = 350 $lev[13] = 330 $lev[14] = 310 $lev[15] = 300 $lev[16] = 290 $lev[17] = 280 $lev[18] = 270 $lev[19] = 260 $lev[20] = 250 $Form1 = GUICreate($title, 519, 270, 285, 353) $level_ = GUICtrlCreateGroup("AGroup1", 16, 72, 137, 89) $levelTime_ = GUICtrlCreateLabel("5 sec", 72, 120, 30, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $hit = GUICtrlCreateButton("HIT!", 192, 72, 217, 161) GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlCreateLabel("Time for pass", 40, 96, 93, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x000080) $start = GUICtrlCreateButton("Start", 32, 176, 105, 33) $Icon1 = GUICtrlCreateGraphic(280, 16, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") GUISetState(@SW_SHOW) $xi = 0 While 1 $msg = GUIGetMsg() $ret = _reflex($state) If $xi = 1 Then $timeDiff = TimerDiff($time) MsgBox(0, "", Round($timeDiff / 1000, 2) & " seconds" & @CRLF & $timeDiff) EndIf If $ret = 1 Then GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0xee0000, 0xff0000) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) ;$xi=1 EndIf Select Case $msg = $hit If $state = 2 Then $timeDiff = TimerDiff($time) ;MsgBox(0,"",Round($timeDiff / 1000,2) & " seconds" & @CRLF & $timeDiff) GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlSetState($start, $GUI_ENABLE) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) $state = 0 If $timeDiff <= $lev[$level] Then MsgBox(32, $title, "Success!! (" & Round($timeDiff / 1000, 2) & " second/s)" & @CRLF & "Level passed!") _levelUp() GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") Else MsgBox(16, $title, "Fail (" & Round($timeDiff / 1000, 2) & " second/s)" & @CRLF & "Level fail") $level = 1 GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") EndIf Else MsgBox(16, $title, "Fail! Wait red icon") $state = 0 $level = 1 GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlSetState($start, $GUI_ENABLE) GUICtrlSetData($level_, "Level " & $level) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) EndIf Case $msg = $start GUICtrlSetState($start, $GUI_DISABLE) GUICtrlSetData($start, "3") Sleep(1000) GUICtrlSetData($start, "2") Sleep(1000) GUICtrlSetData($start, "1") Sleep(1000) GUICtrlSetData($start, "Start") GUICtrlSetState($hit, $GUI_ENABLE) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0xeeee00, 0xffff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) $state = 1 $tent = 0 ;Sleep(1000) Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Func _levelUp() $level = $level + 1 $levelTime = $lev[$level] If $level > $lev[0] Then MsgBox(0, $title, "Congratulation! Your reflex is optimal!") $level = 1 $levelTime = $lev[$level] EndIf EndFunc ;==>_levelUp Func _reflex($s) If $s = 1 Then $rand = Random(1, 1000+ ($level * 200), 1) ;MsgBox(0,"",$rand) If $rand = 1 Or $tent >= ($level * 500) Then ;Return 1 $state = 2 $time = TimerInit() Return 1 Else $tent = $tent + 1 ;ToolTip($tent) Return 0 EndIf EndIf EndFunc ;==>_reflex Mfg/Best regards Spider Edited March 27, 2007 by GtaSpider www.AutoIt.de - Moderator of the German AutoIt Forum  Link to comment Share on other sites More sharing options...
rambo3889 Posted March 27, 2007 Share Posted March 27, 2007 Nice Script Cyber I've found a bug: i was in level 5 and hit while icon were yellow so it sent me back to level one but the time werent reset. My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youÂ’re the best in town Fight! Link to comment Share on other sites More sharing options...
BillLuvsU Posted March 27, 2007 Share Posted March 27, 2007 Happened to me too. Heres the fixed version: expandcollapse popup#include <GUIConstants.au3> ; == GUI generated with Koda == Global $title = "ReflectIT!" Global $level = 1 Global $levelTime = 5000 Global $state = 0 Global $time Global $tent = 0 Dim $lev[21] $lev[0] = 20;***level number $lev[1] = 2000 $lev[2] = 1600 $lev[3] = 1200 $lev[4] = 1000 $lev[5] = 800 $lev[6] = 700 $lev[7] = 600 $lev[8] = 500 $lev[9] = 450 $lev[10] = 400 $lev[11] = 380 $lev[12] = 350 $lev[13] = 330 $lev[14] = 310 $lev[15] = 300 $lev[16] = 290 $lev[17] = 280 $lev[18] = 270 $lev[19] = 260 $lev[20] = 250 $Form1 = GUICreate($title, 519, 270, 285, 353) $level_ = GUICtrlCreateGroup("AGroup1", 16, 72, 137, 89) $levelTime_ = GUICtrlCreateLabel("5 sec", 72, 120, 30, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $hit = GUICtrlCreateButton("HIT!", 192, 72, 217, 161) GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlCreateLabel("Time for pass", 40, 96, 93, 20) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") GUICtrlSetColor(-1, 0x000080) $start = GUICtrlCreateButton("Start", 32, 176, 105, 33) $Icon1 = GUICtrlCreateGraphic(280, 16, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") GUISetState(@SW_SHOW) $xi = 0 While 1 $msg = GUIGetMsg() $ret = _reflex($state) If $xi = 1 Then $timeDiff = TimerDiff($time) MsgBox(0, "", Round($timeDiff / 1000, 2) & " seconds" & @CRLF & $timeDiff) EndIf If $ret = 1 Then GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0xee0000, 0xff0000) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) ;$xi=1 EndIf Select Case $msg = $hit If $state = 2 Then $timeDiff = TimerDiff($time) ;MsgBox(0,"",Round($timeDiff / 1000,2) & " seconds" & @CRLF & $timeDiff) GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlSetState($start, $GUI_ENABLE) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) $state = 0 If $timeDiff <= $lev[$level] Then MsgBox(32, $title, "Success!! (" & Round($timeDiff / 1000, 2) & " second/s)" & @CRLF & "Level passed!") _levelUp() GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") Else MsgBox(16, $title, "Fail (" & Round($timeDiff / 1000, 2) & " second/s)" & @CRLF & "Level fail") $level = 1 GUICtrlSetData($level_, "Level " & $level) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") EndIf Else MsgBox(16, $title, "Fail! Wait red icon") $state = 0 $level = 1 GUICtrlSetState($hit, $GUI_DISABLE) GUICtrlSetState($start, $GUI_ENABLE) GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") GUICtrlSetData($level_, "Level " & $level) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0x00ee00, 0x00ff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) EndIf Case $msg = $start GUICtrlSetState($start, $GUI_DISABLE) GUICtrlSetData($start, "3") Sleep(1000) GUICtrlSetData($start, "2") Sleep(1000) GUICtrlSetData($start, "1") Sleep(1000) GUICtrlSetData($start, "Start") GUICtrlSetState($hit, $GUI_ENABLE) GUICtrlSetGraphic($Icon1, $GUI_GR_COLOR, 0xeeee00, 0xffff00) GUICtrlSetGraphic($Icon1, $GUI_GR_ELLIPSE, 0, 0, 32, 32) GUICtrlSetGraphic($Icon1, $GUI_GR_REFRESH) $state = 1 $tent = 0 ;Sleep(1000) Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit Func _levelUp() $level = $level + 1 $levelTime = $lev[$level] If $level > $lev[0] Then MsgBox(0, $title, "Congratulation! Your reflex is optimal!") $level = 1 $levelTime = $lev[$level] EndIf EndFunc ;==>_levelUp Func _reflex($s) If $s = 1 Then $rand = Random(1, 1000+ ($level * 200), 1) ;MsgBox(0,"",$rand) If $rand = 1 Or $tent >= ($level * 500) Then ;Return 1 $state = 2 $time = TimerInit() Return 1 Else $tent = $tent + 1 ;ToolTip($tent) Return 0 EndIf EndIf EndFunc ;==>_reflex Just added GUICtrlSetData($levelTime_, Round($lev[$level] / 1000, 2) & " sec") to the commands for when you hit the button too early. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
DarthVega Posted March 27, 2007 Share Posted March 27, 2007 0.4 seconds Link to comment Share on other sites More sharing options...
BillLuvsU Posted March 27, 2007 Share Posted March 27, 2007 Ha, I can get 0.23 secs. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
McGod Posted March 27, 2007 Share Posted March 27, 2007 0.02 . . . . . With a bot:P [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted March 27, 2007 Share Posted March 27, 2007 0.00, changed the code, just a tad Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
McGod Posted March 27, 2007 Share Posted March 27, 2007 Theres an error when you beat the game try yourself and see it 19 Line code to beat the game Opt("CaretCoordMode", 2) Opt("PixelCoordMode", 2) WinActivate("ReflectIT!") WinWaitActive("ReflectIT!", "", 10) While 1 Sleep(1) $pix = PixelGetColor(295, 30) If $pix = 65280 Then ControlClick("ReflectIT!", "", 8, "left", 1) sleep(3000) ContinueLoop ElseIf $pix = 16776960 Then ContinueLoop ElseIf $pix = 16711680 Then ControlClick("ReflectIT!", "", 6, "left", 1) Send("{ENTER}") ContinueLoop EndIf WEnd [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Cyber Posted March 27, 2007 Author Share Posted March 27, 2007 Thanks sorry for the full path... debug mode @mrRevoked Wait the red icon for click on HIT! I dont use graphic for fast programming but now i try with youe code, thanks Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
Cyber Posted March 28, 2007 Author Share Posted March 28, 2007 UP Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
jaenster Posted March 29, 2007 Share Posted March 29, 2007 "Sucess!! (0.03 second/s) Level passed!" Oh i love my bottie -jaenster Link to comment Share on other sites More sharing options...
Cyber Posted March 29, 2007 Author Share Posted March 29, 2007 Now i developer multiplayer version Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
BillLuvsU Posted March 29, 2007 Share Posted March 29, 2007 Omg, you should totally make it an MMO! Rofl. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Cyber Posted March 30, 2007 Author Share Posted March 30, 2007 Eheheh 2 day I think Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now