RandomGuest Posted August 17, 2007 Share Posted August 17, 2007 (edited) How can I make, so when I push the options button a new window will come? I've read a bit and looked at a another script wich is nearly like mine, but I cant get it to work Im might too stupid xD ...What should I write in the Case $button_2 thing? Edit: I want the new window to be like the old one, but with other stuff on it, but I'll fix that myself, just so you know what I mean... Oh well, heres my script: #include <GUIConstants.au3> GUICreate("I AM SIMIAN!") GUISetBkColor (0xE0FFFF) Opt("GUICoordMode",5) $button_2 = GUICtrlCreateButton ("Options", 60, 30, 60) $button_1 = GUICtrlCreateButton ("SIMIAN", 0, -1, 60) GUISetState () While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button_1 Run("C:\Program\Mozilla Firefox\firefox.exe") Sleep(4500) MouseMove(675,65) MouseClick("left") Sleep(1500) Send("http://www.youtube.com/") Send("{ENTER}") Sleep(1500) MouseMove(525,212) MouseClick("left") Sleep(2000) Send("NOBODY KNOWS SIMIAN") Send("{ENTER}") Sleep(1000) MouseMove(369,340) MouseClick("left") Sleep(1000) MouseMove(593,860) Exit Case $button_2 EndSwitch Wend Edited August 18, 2007 by RandomGuest Link to comment Share on other sites More sharing options...
James Posted August 17, 2007 Share Posted August 17, 2007 Make a function, with GuiCreate. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
RandomGuest Posted August 17, 2007 Author Share Posted August 17, 2007 Make a function, with GuiCreate.If you mean: Case $button_2GUICreate("I AM SIMIAN 2!")it doesnt work.. Link to comment Share on other sites More sharing options...
James Posted August 17, 2007 Share Posted August 17, 2007 You need to specifiy a height and width. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
RandomGuest Posted August 17, 2007 Author Share Posted August 17, 2007 You need to specifiy a height and width. Case $button_3GUICreate ("Test", 800, 600,)Still not working Link to comment Share on other sites More sharing options...
James Posted August 17, 2007 Share Posted August 17, 2007 (edited) GUICreate ("Test", 800, 600,) Edited August 17, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
RandomGuest Posted August 17, 2007 Author Share Posted August 17, 2007 (edited) GUICreate ("Test", 800, 600,)Still do not workGUICreate ("Test", 800, 600)Edit: Shouldnt it be ''child'' or ''parent'' or something? Or am I lost? Edited August 17, 2007 by RandomGuest Link to comment Share on other sites More sharing options...
RandomGuest Posted August 17, 2007 Author Share Posted August 17, 2007 Hhmmm.....sooo...? xD Link to comment Share on other sites More sharing options...
RandomGuest Posted August 18, 2007 Author Share Posted August 18, 2007 Uuhm... try the script on your computer, and you'll see it does not work... Link to comment Share on other sites More sharing options...
James Posted August 18, 2007 Share Posted August 18, 2007 Firsty: Run("C:\Program\Mozilla Firefox\firefox.exe") Should be Run("C:\Program Files\Mozilla Firefox\firefox.exe") Now: expandcollapse popup#include <GUIConstants.au3> GUICreate("I AM SIMIAN!") GUISetBkColor(0xE0FFFF) Opt("GUICoordMode", 5) $button_2 = GUICtrlCreateButton("Options", 60, 30, -1, -1) $button_1 = GUICtrlCreateButton("SIMIAN", 0, -1, 60) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button_1 Run("C:\Program Files\Mozilla Firefox\firefox.exe") Sleep(4500) MouseMove(675, 65) MouseClick("left") Sleep(1500) Send("http://www.youtube.com/") Send("{ENTER}") Sleep(1500) MouseMove(525, 212) MouseClick("left") Sleep(2000) Send("NOBODY KNOWS SIMIAN") Send("{ENTER}") Sleep(1000) MouseMove(369, 340) MouseClick("left") Sleep(1000) MouseMove(593, 860) Exit Case $button_2 New() EndSwitch WEnd Func New() $newgui = GUICreate("NEW WINDOW") GUISetBkColor(0xE0FFFF) GUISetState() While WinExists($newgui) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($newgui) EndSwitch WEnd EndFunc ;==>New Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
martin Posted August 18, 2007 Share Posted August 18, 2007 Uuhm... try the script on your computer, and you'll see it does not work... expandcollapse popup#include <GUIConstants.au3> GUICreate("I AM SIMIAN!") GUISetBkColor (0xE0FFFF) Opt("GUICoordMode",5) $button_2 = GUICtrlCreateButton ("Options", 60, 30, 60) $button_1 = GUICtrlCreateButton ("SIMIAN", 0, -1, 60) GUISetState () While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button_2 make2() EndSwitch Wend Func Make2() GUICreate("sim2") $button3 = GUICtrlCreateButton("exit Sim 2",50,50,140,30) GUISetState() While 1 $msg2 = GUIGetMsg() Switch $msg2 Case $GUI_EVENT_CLOSE ExitLoop Case $button3 ExitLoop EndSwitch WEnd GUIDelete("sim2") EndFunc Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
RandomGuest Posted August 18, 2007 Author Share Posted August 18, 2007 Thanks! <3 Much appreciated . Link to comment Share on other sites More sharing options...
James Posted August 18, 2007 Share Posted August 18, 2007 Glad we got there! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ 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