Dangerous Posted May 16, 2012 Share Posted May 16, 2012 Hi guys, i am trying to make a game: For example there are some radioboxes in some sequense. You choose the start and end location and the script must find the way from Start to End Location. I have no idea yet how to do this, if you can help me and advice me which functioins i have to use/learn to do this i will be gratefull here is an image of what i am trying to achieve: Link to comment Share on other sites More sharing options...
JohnOne Posted May 16, 2012 Share Posted May 16, 2012 Mathematics and GUICtrlGetState(), GUICtrlSetState() should do you. Tip: put your Ctrl handles in an array for easier looping. Dangerous 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spudw2k Posted May 16, 2012 Share Posted May 16, 2012 (edited) Wow, you just gave me a great idea (to create an AutoIt script game inspired by this project)!Moved to new thread Edited May 18, 2012 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Dangerous Posted May 17, 2012 Author Share Posted May 17, 2012 Is there any way the script to find the shortest way from start to end? Link to comment Share on other sites More sharing options...
spudw2k Posted May 17, 2012 Share Posted May 17, 2012 It will take an algorithm of sorts. the logic (in my head) would go like this. Start at beginning, try a path, if back track occurs note step before backtrack and start over You should be able to find the shortest path via something like that. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
JohnOne Posted May 17, 2012 Share Posted May 17, 2012 Wow, you just gave me a great idea (to create an AutoIt script game inspired by this project)! expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiSlider.au3> Dim $arrSliders[4][2] $Form1 = GUICreate("Form1", 422, 291, 314, 242) $arrSliders[0][0] = GUICtrlCreateSlider(112, 104, 38, 149, BitOR($TBS_VERT,$TBS_BOTH)) GUICtrlSetData(-1,100) $arrSliders[1][0] = GUICtrlCreateSlider(186, 105, 38, 149, BitOR($TBS_VERT,$TBS_BOTH)) GUICtrlSetData(-1,100) $arrSliders[2][0] = GUICtrlCreateSlider(264, 105, 38, 149, BitOR($TBS_VERT,$TBS_BOTH)) GUICtrlSetData(-1,100) $arrSliders[3][0] = GUICtrlCreateSlider(343, 105, 38, 149, BitOR($TBS_VERT,$TBS_BOTH)) GUICtrlSetData(-1,100) $LevelSelect = GUICtrlCreateInput("0", 36, 230, 41, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_READONLY)) $UpDown = GUICtrlCreateUpdown($LevelSelect) GUICtrlSetLimit(-1,10,0) $Reset = GUICtrlCreateButton("Reset", 24, 160, 67, 41) GUICtrlCreateLabel("0", 129, 252, 10, 17) GUICtrlCreateLabel("0", 202, 252, 10, 17) GUICtrlCreateLabel("0", 360, 252, 10, 17) GUICtrlCreateLabel("0", 281, 252, 10, 17) GUICtrlCreateLabel("1", 129, 84, 10, 17) GUICtrlCreateLabel("1", 202, 84, 10, 17) GUICtrlCreateLabel("1", 281, 84, 10, 17) GUICtrlCreateLabel("1", 360, 84, 10, 17) GUICtrlCreateLabel("4-bit Puzzle", 144, 16, 140, 33) GUICtrlSetFont(-1, 18, 800, 4, "MS Sans Serif") GUIRegisterMsg($WM_VSCROLL, "WM_Slider") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Reset _SlideUp($arrSliders) _SlideDown($arrSliders) EndSwitch WEnd Func _SlideUp($hwnd) If IsArray($hwnd) Then For $x = 0 to UBound($hwnd)-1 $hwnd[$x][1] = 100-_GUICtrlSlider_GetPos($hwnd[$x][0]) Next For $pos = 1 to 100 For $x = 0 to UBound($hwnd)-1 _GUICtrlSlider_SetPos($hwnd[$x][0],(100-_ExpoEaseInOut($pos, $hwnd[$x][1], 101, 100))) Next $timer = TimerInit() While TimerDiff($timer) < 10 Wend $timer = 0 Next Else $start = 100-_GUICtrlSlider_GetPos($hwnd) For $pos = 1 to 100 _GUICtrlSlider_SetPos($hwnd,(100-_ExpoEaseInOut($pos, $start, 101, 100))) $timer = TimerInit() While TimerDiff($timer) < 10 Wend $timer = 0 Next EndIf EndFunc Func _SlideDown($hwnd) If IsArray($hwnd) Then For $x = 0 to UBound($hwnd)-1 $hwnd[$x][1] = _GUICtrlSlider_GetPos($hwnd[$x][0]) Next For $pos = 1 to 100 For $x = 0 to UBound($hwnd)-1 _GUICtrlSlider_SetPos($hwnd[$x][0],(_ExpoEaseInOut($pos, $hwnd[$x][1], 101, 100))) Next $timer = TimerInit() While TimerDiff($timer) < 10 Wend $timer = 0 Next Else $start = _GUICtrlSlider_GetPos($hwnd) For $pos = 1 to 100 _GUICtrlSlider_SetPos($hwnd,(_ExpoEaseInOut($pos, $start, 101, 100))) $timer = TimerInit() While TimerDiff($timer) < 10 Wend $timer = 0 Next EndIf EndFunc Func WM_Slider($hWnd, $iMsg, $wParam, $lParam) ;If $lParam = GUICtrlGetHandle($Slider1) Then ConsoleWrite($wParam & ":" & $lParam & ":" & _GUICtrlSlider_GetPos($lParam) & @CRLF) ;EndIf ;Return $GUI_RUNDEFMSG EndFunc Func _ExpoEaseInOut($iFrame, $iStartValue, $iInterval, $iEndValue) ;Credit to Josh Rowe - http://autoitscript.com/forum/topic/102851-transitions-udf/ $iFrame = $iFrame / ($iEndValue / 2) If $iFrame < 1 Then Return $iInterval / 2 * (2 ^ (10 * ($iFrame - 1))) + $iStartValue EndIf $iFrame = $iFrame - 1 Return $iInterval / 2 * (-(2 ^ (-10 * $iFrame)) + 2) + $iStartValue EndFunc ;==>_ExpoEaseInOut One would usually provide a hint as to what this code is supposed to be, do etc... AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spudw2k Posted May 17, 2012 Share Posted May 17, 2012 (edited) One would usually provide a hint as to what this code is supposed to be, do etc...It seemed fairly obvious to me if you look at the link and the spoileredit: the code in the spoiler is incomplete, but if you watched the video in the link I'm pretty sure you can guess what it, "is supposed to be".edit: sorry for the hijack Dangerous Edited May 17, 2012 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
JohnOne Posted May 17, 2012 Share Posted May 17, 2012 I see, I'm not really into watching videos. Thanks for the explanation anyway. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spudw2k Posted May 17, 2012 Share Posted May 17, 2012 (edited) I could understand not going out of your way to/or wasting time watching random videos, but when a video answers a question and you refuse to watch it seems to me that you are doing yourself an injustice. Why comment on something if you don't want to hear the answer? No offense. Edited May 17, 2012 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
JohnOne Posted May 17, 2012 Share Posted May 17, 2012 It's how I roll. No offence taken. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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