lopolop Posted June 26, 2006 Share Posted June 26, 2006 Im trying to set this up, i am trying to add a bunch of flash games together and be able to choose then from a combo box... but for each game i want it to do something else.. i can figure out how to check if the game is a game do this... but there may be alot to choose from... bascially does anyone have any ideas how to set up what im looking for in a nice easy way? here is some code: ;###/"Includes and Options"\### #include <GuiConstants.au3> Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) ;###/"Choose Game - Gui"\### If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("Multi-Flash Bot", 290, 90,(@DesktopWidth-290)/2, (@DesktopHeight-90)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Group_1 = GuiCtrlCreateGroup("Choose a Game from List", 10, 10, 270, 70) $Combo = GuiCtrlCreateCombo("Games", 30, 40, 140, 21) GUICtrlSetData($Combo,"ReBound") GUICtrlSetData($Combo,"Clickage") $BotButton = GuiCtrlCreateButton("Bot!", 190, 30, 70, 40) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
NELyon Posted June 26, 2006 Share Posted June 26, 2006 whoa, did we get the autoit tags back? Link to comment Share on other sites More sharing options...
syberschmo Posted June 26, 2006 Share Posted June 26, 2006 Im trying to set this up, i am trying to add a bunch of flash games together and be able to choose then from a combo box... but for each game i want it to do something else.. i can figure out how to check if the game is a game do this... but there may be alot to choose from... bascially does anyone have any ideas how to set up what im looking for in a nice easy way?Your question is unclear... are you looking for something like this in your While loop? While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $BotButton If GuiCtrlRead($combo) = "ReBound" Then MsgBox(48,"Debug","You chose ReBound") If GuiCtrlRead($combo) = "Clickage" Then MsgBox(48,"Debug","You chose Clickage") Case Else ;;; EndSelect WEnd If you could clarify your question I could post a better answer. Regards, Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
lopolop Posted June 26, 2006 Author Share Posted June 26, 2006 (edited) lol thanks... im not sure what i was looking for.. sorry that will work perfect [EDIT] For some reason my script wont open the second GUI Window after i selected a game... any ideas? expandcollapse popup#include <GuiConstants.au3> Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) ;###/"Choose Game - Gui"\### If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 $ChooseGame = GuiCreate("Multi-Flash Bot", 290, 90,(@DesktopWidth-290)/2, (@DesktopHeight-90)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Group_1 = GuiCtrlCreateGroup("Choose a Game from List", 10, 10, 270, 70) $Combo = GuiCtrlCreateCombo("Games", 30, 40, 140, 21) GUICtrlSetData($Combo,"ReBound") GUICtrlSetData($Combo,"Clickage") $BotButton = GuiCtrlCreateButton("Bot!", 190, 30, 70, 40) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $BotButton If GuiCtrlRead($combo) = "ReBound" Then $Game = "ReBound" GUIDelete($ChooseGame) EndIf If GuiCtrlRead($combo) = "Clickage" Then $Game = "Clickage" GUIDelete($ChooseGame) EndIf Case Else EndSelect WEnd $oGame = ObjCreate ("ShockwaveFlash.ShockwaveFlash.1") $FlashGui = GUICtrlCreateObj($oGame, 10, 10, 630, 440) $MainGui = GuiCreate("MyGUI", 650, 500,(@DesktopWidth-650)/2, (@DesktopHeight-500)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $ChangeGame = GuiCtrlCreateButton("Change Game", 10, 460, 90, 30) $Exit = GuiCtrlCreateButton("Exit", 120, 460, 90, 30) ;###/"Bot Function"\### If $Game = "ReBound" then With $oGame .bgcolor = "#000000" .Movie = 'http://farm.addictinggames.com/D78AQSAKQLQWI9/2898.swf' .ScaleMode = 2 .Loop = True .wmode = "Opaque" EndWith EndIf If $Game = "Clickage" Then With $oGame .bgcolor = "#000000" .Movie = 'http://farm.addictinggames.com/D78AQSAKQLQWI9/2898.swf' .ScaleMode = 2 .Loop = True .wmode = "Opaque" EndWith EndIf GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Edited June 26, 2006 by lopolop Link to comment Share on other sites More sharing options...
syberschmo Posted June 26, 2006 Share Posted June 26, 2006 For some reason my script wont open the second GUI Window after i selected a game... any ideas I changed a few things.. This works for me: expandcollapse popup#include <GuiConstants.au3> Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) ;###/"Choose Game - Gui"\### If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 $ChooseGame = GuiCreate("Multi-Flash Bot", 290, 90,(@DesktopWidth-290)/2, (@DesktopHeight-90)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Group_1 = GuiCtrlCreateGroup("Choose a Game from List", 10, 10, 270, 70) $Combo = GuiCtrlCreateCombo("Games", 30, 40, 140, 21) GUICtrlSetData($Combo,"ReBound") GUICtrlSetData($Combo,"Clickage") $BotButton = GuiCtrlCreateButton("Bot!", 190, 30, 70, 40) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $BotButton If GuiCtrlRead($combo) = "ReBound" Then $Game = "ReBound" ExitLoop EndIf If GuiCtrlRead($combo) = "Clickage" Then $Game = "Clickage" ExitLoop EndIf Case Else EndSelect WEnd GUIDelete($ChooseGame) $MainGui = GuiCreate("MyGUI", 650, 500,(@DesktopWidth-650)/2, (@DesktopHeight-500)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $oGame = ObjCreate ("ShockwaveFlash.ShockwaveFlash.1") $FlashGui = GUICtrlCreateObj($oGame, 10, 10, 630, 440) $ChangeGame = GuiCtrlCreateButton("Change Game", 10, 460, 90, 30) $Exit = GuiCtrlCreateButton("Exit", 120, 460, 90, 30) ;###/"Bot Function"\### If $Game = "ReBound" then With $oGame .bgcolor = "#000000" .Movie = 'http://farm.addictinggames.com/D78AQSAKQLQWI9/2898.swf' .ScaleMode = 2 .Loop = True .wmode = "Opaque" EndWith EndIf If $Game = "Clickage" Then With $oGame .bgcolor = "#000000" .Movie = 'http://farm.addictinggames.com/D78AQSAKQLQWI9/2898.swf' .ScaleMode = 2 .Loop = True .wmode = "Opaque" EndWith EndIf GuiSetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Regards, Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
lopolop Posted June 27, 2006 Author Share Posted June 27, 2006 That worked thanks... im having some trouble though... i cant seem to find a way to setup so that i figure out which game is choosen then run that script. this sounds simple.. probably is any help would be great.. Link to comment Share on other sites More sharing options...
syberschmo Posted June 27, 2006 Share Posted June 27, 2006 That worked thanks... im having some trouble though... i cant seem to find a way to setup so that i figure out which game is choosen then run that script. this sounds simple.. probably is any help would be great..I don't understand your question... $game is set to the chosen game. you probably aren't seeing any difference in the two choices because with each object, .Movie = 'http://farm.addictinggames.com/D78AQSAKQLQWI9/2898.swf' points to the same movie file. Regards, Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
lopolop Posted June 27, 2006 Author Share Posted June 27, 2006 (edited) no i fixed that.. i woundering how i should set up the next part, after it loades the game... i want a hotkey like ` and when pressed runs a bot function, but how do i set it up so the ` works for the second game(choosen) and not the first... If you still dont under ill explain it better Edited June 27, 2006 by lopolop Link to comment Share on other sites More sharing options...
syberschmo Posted June 27, 2006 Share Posted June 27, 2006 no i fixed that.. i woundering how i should set up the next part, after it loades the game... i want a hotkey like ` and when pressed runs a bot function, but how do i set it up so the ` works for the second game(choosen) and not the first... If you still dont under ill explain it betterCase $msg = $BotButton If GuiCtrlRead($combo) = "ReBound" Then $Game = "ReBound" HotKeySet("{SPACE}", "_Game1Func") ExitLoop EndIf If GuiCtrlRead($combo) = "Clickage" Then $Game = "Clickage" HotKeySet("{SPACE}", "_Game2Func") ExitLoop Change the hotkey to whatever is desired. Regards, Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
lopolop Posted June 27, 2006 Author Share Posted June 27, 2006 O lol that was easy :"> .. thanks! Link to comment Share on other sites More sharing options...
lopolop Posted June 28, 2006 Author Share Posted June 28, 2006 OK.. One final question, and i do think i learned alot about gui.. and thanks to everyone that helped... My last question is i want a change game button... which goes back to the first gui. i was thinking of putting my whole script in a loop but that gave me errors saying that some things i didnt have WEnd at the end, so is there something else i can do? Link to comment Share on other sites More sharing options...
syberschmo Posted June 28, 2006 Share Posted June 28, 2006 OK.. One final question, and i do think i learned alot about gui.. and thanks to everyone that helped... My last question is i want a change game button... which goes back to the first gui. i was thinking of putting my whole script in a loop but that gave me errors saying that some things i didnt have WEnd at the end, so is there something else i can do?This is one way of doing it, although there may be other ways: expandcollapse popup#include <GuiConstants.au3> Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) ;###/"Choose Game - Gui"\### If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 $ChooseGame = GuiCreate("Multi-Flash Bot", 290, 90,(@DesktopWidth-290)/2, (@DesktopHeight-90)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Group_1 = GuiCtrlCreateGroup("Choose a Game from List", 10, 10, 270, 70) $Combo = GuiCtrlCreateCombo("Games", 30, 40, 140, 21) GUICtrlSetData($Combo,"ReBound") GUICtrlSetData($Combo,"Clickage") $BotButton = GuiCtrlCreateButton("Bot!", 190, 30, 70, 40) GuiSetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $BotButton If GuiCtrlRead($combo) = "ReBound" Then GuiSetState(@SW_HIDE, $ChooseGame) $Game = "ReBound" _GameGUI($game) GuiSetState(@SW_SHOW, $ChooseGame) EndIf If GuiCtrlRead($combo) = "Clickage" Then GuiSetState(@SW_HIDE, $ChooseGame) $Game = "Clickage" _GameGUI($game) GuiSetState(@SW_SHOW, $ChooseGame) EndIf Case Else EndSelect WEnd Func _GameGUI($game) $MainGui = GuiCreate("MyGUI", 650, 500,(@DesktopWidth-650)/2, (@DesktopHeight-500)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $oGame = ObjCreate ("ShockwaveFlash.ShockwaveFlash.1") $FlashGui = GUICtrlCreateObj($oGame, 10, 10, 630, 440) $ChangeGame = GuiCtrlCreateButton("Change Game", 10, 460, 90, 30) $Exit = GuiCtrlCreateButton("Exit", 120, 460, 90, 30) ;###/"Bot Function"\### If $Game = "ReBound" then With $oGame .bgcolor = "#000000" .Movie = 'http://farm.addictinggames.com/D78AQSAKQLQWI9/2898.swf' .ScaleMode = 2 .Loop = True .wmode = "Opaque" EndWith EndIf If $Game = "Clickage" Then With $oGame .bgcolor = "#000000" .Movie = 'http://farm.addictinggames.com/D78AQSAKQLQWI9/2898.swf' .ScaleMode = 2 .Loop = True .wmode = "Opaque" EndWith EndIf GuiSetState(@SW_SHOW, $MainGUI) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete($MainGUI) Return Case $msg = $Exit GUIDelete($MainGUI) Return EndSelect WEnd EndFunc I separated the game gui into its own function. The $choosegame Gui calls the _GameGUI Function with $game as an argument. I think this approach may prove more useful, given the nature of your program. For example, you could modify the function like Func _GameGUI($game, $gameURL="") so that the user could enter the URL of a custom flash game, should they desire. For more information on functions, consult the helpfile. I hope this helps. Gradient-Filled Progress Bars UDF Link to comment Share on other sites More sharing options...
lopolop Posted June 28, 2006 Author Share Posted June 28, 2006 well even that keep giving me problems... so i did it a 100x easier way which was Run the .exe again and exit.. Thanks for all the help! 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