BuddyBoy Posted November 25, 2007 Share Posted November 25, 2007 I'm a noob at AutoIt coding... I looked at the FileOpen, but its only for read and write text purposes... What if I want to open up mozilla firefox? Or MSN messenger? I tried replacing my direct path of my MSN with the same coding they gave in the AutoIt help and it wouldn't open... any ideas? Thanks in advance. Link to comment Share on other sites More sharing options...
ame1011 Posted November 25, 2007 Share Posted November 25, 2007 Run() [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 25, 2007 Author Share Posted November 25, 2007 Thanks, I got it to work, but I didn't My current script is : Run( *my mozilla firefox location* ) Theres no While 1 in there but it opens up firefox MANY times , causing my computer to crash -.- How do i do it so it only opens up one time? Link to comment Share on other sites More sharing options...
Didonet Posted November 25, 2007 Share Posted November 25, 2007 show your source Link to comment Share on other sites More sharing options...
ame1011 Posted November 25, 2007 Share Posted November 25, 2007 post some code and we'll see if we can help [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 25, 2007 Author Share Posted November 25, 2007 If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then Run("C:\Program Files\Mozilla Firefox\firefox.exe") EndIf I do got all my checkbox stuff working good... thats all up in the script, didn't think it was too necesary to take up room here. I don't see why it opens it like crazy with that right there Link to comment Share on other sites More sharing options...
ame1011 Posted November 25, 2007 Share Posted November 25, 2007 that bit is probabl in a while loop reading the GUI messages. As far as I can tell, it's being called as long as the checkbox is checked. [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
JustinReno Posted November 25, 2007 Share Posted November 25, 2007 Is your If/EndIf loop in a While loop? Link to comment Share on other sites More sharing options...
Didonet Posted November 25, 2007 Share Posted November 25, 2007 Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) Run("Notepad.exe", "", @SW_MAXIMIZE) @help file Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 25, 2007 Author Share Posted November 25, 2007 (edited) expandcollapse popup#include <GuiConstants.au3> Opt("GUIOnEventMode",1) HotKeySet("{F5}", "_Start") HotKeySet("{F7}", "_NoClick") HotKeySet("{ESC}","Terminate") HotKeySet("^g", "_GetPos") $ClickIt = 0 GUICreate("", 400, 300) GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate") $Checkbox_1 = GUICtrlCreateCheckbox("", 20, 40, 150, 20) $Checkbox_2 = GUICtrlCreateCheckbox("", 20, 80, 150, 20) $Checkbox_3 = GUICtrlCreateCheckbox("F", 20, 120, 150, 20) $Checkbox_4 = GUICtrlCreateCheckbox("Ri", 20, 160, 150, 20) $Checkbox_5 = GUICtrlCreateCheckbox("Lcker", 20, 200, 150, 20) $Checkbox_6 = GUICtrlCreateCheckbox("Sate", 20, 240, 200, 20) $Checkbox_7 = GUICtrlCreateCheckbox("Ar", 180, 40, 300, 20) $Checkbox_8 = GUICtrlCreateCheckbox("Ctn", 180, 80, 300, 20) $Checkbox_9 = GUICtrlCreateCheckbox("Press CTRL+g For coordinates", 180, 120, 300, 20) $Checkbox_10 = GUICtrlCreateCheckbox("A", 180, 160, 300, 20) $Checkbox_11 = GUICtrlCreateCheckbox("ro", 180, 200, 300, 20) GUISetState() While 1 Sleep( 10 ) WEnd Exit Func _Start () $ClickIt = 1 While $ClickIt = 1 If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then Run("C:\Program Files\Mozilla Firefox\firefox.exe") EndIf If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("left", 429, 443) MouseClick("right", 503, 330) Sleep(120000) EndIf If BitAND(GUICtrlRead($Checkbox_3), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("right", 503, 330) Sleep(4500) EndIf If BitAND(GUICtrlRead($Checkbox_4), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("right") EndIf If BitAND(GUICtrlRead($Checkbox_5), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("left") EndIf If BitAND(GUICtrlRead($Checkbox_6), $GUI_CHECKED) = $GUI_CHECKED Then While 1 Send('{F1}') Sleep(10500) Send('{F4}') Sleep(3500) WEnd EndIf If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then While 1 WinWaitActive("Instruction") WinClose("Instruction") Sleep(360000) MouseClick("left", 943, 670, 1) Sleep(8000) MouseClick("right") WEnd EndIf If BitAND(GUICtrlRead($Checkbox_8), $GUI_CHECKED) = $GUI_CHECKED Then While 1 Send('{CTRLDOWN}') WEnd EndIf If BitAND(GUICtrlRead($Checkbox_9), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then _GetPos () While 1 Sleep(10000) WEnd EndIf EndIf If BitAND(GUICtrlRead($Checkbox_10), $GUI_CHECKED) = $GUI_CHECKED Then $color = 0xB50400 While 1 $colorpos = PixelSearch(0+5, 0+5, @DesktopWidth-5, @DesktopHeight-5, $color, 10, 1) If IsArray($colorpos) Then $drop = 20 $buttonposx = $pos[0] = $drop $buttonposy = $pos[1] MouseClick("Right", $buttonposx , $buttonposy, 1, 0) EndIf WEnd EndIf If BitAND(GUICtrlRead($Checkbox_11), $GUI_CHECKED) = $GUI_CHECKED Then While 1 MouseClick("left", 802, 624) Sleep(2500) MouseClick("left", 505, 365) Sleep(500) MouseClick("left", 707, 496) Sleep(26500) Wend EndIf WEnd EndFunc;==>_Start Func _GetPos () Local $pos = MouseGetPos() MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1]) EndFunc;==>_GetPos Func _NoClick () ToolTip("") $ClickIt = 0 EndFunc;==>_NoClick Func Terminate () Exit EndFunc;==>Terminate Theres the whole script... My friend just gave me the checkbox things and got it all set up... I just filled in the blank between the checkboxes So i hope you guys can figure it out I did see that in the help file... But how would that solve my problem of it opening continuously? Edited November 25, 2007 by BuddyBoy Link to comment Share on other sites More sharing options...
JustinReno Posted November 25, 2007 Share Posted November 25, 2007 (edited) Try This: expandcollapse popup#include <GuiConstants.au3> Opt("GUIOnEventMode",1) HotKeySet("{F5}", "_Start") HotKeySet("{F7}", "_NoClick") HotKeySet("{ESC}","Terminate") HotKeySet("^g", "_GetPos") $ClickIt = 0 $VARIABLE = 0 GUICreate("", 400, 300) GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate") $Checkbox_1 = GUICtrlCreateCheckbox("", 20, 40, 150, 20) $Checkbox_2 = GUICtrlCreateCheckbox("", 20, 80, 150, 20) $Checkbox_3 = GUICtrlCreateCheckbox("F", 20, 120, 150, 20) $Checkbox_4 = GUICtrlCreateCheckbox("Ri", 20, 160, 150, 20) $Checkbox_5 = GUICtrlCreateCheckbox("Lcker", 20, 200, 150, 20) $Checkbox_6 = GUICtrlCreateCheckbox("Sate", 20, 240, 200, 20) $Checkbox_7 = GUICtrlCreateCheckbox("Ar", 180, 40, 300, 20) $Checkbox_8 = GUICtrlCreateCheckbox("Ctn", 180, 80, 300, 20) $Checkbox_9 = GUICtrlCreateCheckbox("Press CTRL+g For coordinates", 180, 120, 300, 20) $Checkbox_10 = GUICtrlCreateCheckbox("A", 180, 160, 300, 20) $Checkbox_11 = GUICtrlCreateCheckbox("ro", 180, 200, 300, 20) GUISetState() While 1 Sleep( 10 ) WEnd Exit Func _Start () $ClickIt = 1 While $ClickIt = 1 If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then If $VARIABLE = 0 Then Run("C:\Program Files\Mozilla Firefox\firefox.exe") $VARIABLE = 1 Endif EndIf If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("left", 429, 443) MouseClick("right", 503, 330) Sleep(120000) EndIf If BitAND(GUICtrlRead($Checkbox_3), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("right", 503, 330) Sleep(4500) EndIf If BitAND(GUICtrlRead($Checkbox_4), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("right") EndIf If BitAND(GUICtrlRead($Checkbox_5), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("left") EndIf If BitAND(GUICtrlRead($Checkbox_6), $GUI_CHECKED) = $GUI_CHECKED Then While 1 Send('{F1}') Sleep(10500) Send('{F4}') Sleep(3500) WEnd EndIf If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then While 1 WinWaitActive("Instruction") WinClose("Instruction") Sleep(360000) MouseClick("left", 943, 670, 1) Sleep(8000) MouseClick("right") WEnd EndIf If BitAND(GUICtrlRead($Checkbox_8), $GUI_CHECKED) = $GUI_CHECKED Then While 1 Send('{CTRLDOWN}') WEnd EndIf If BitAND(GUICtrlRead($Checkbox_9), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then _GetPos () While 1 Sleep(10000) WEnd EndIf EndIf If BitAND(GUICtrlRead($Checkbox_10), $GUI_CHECKED) = $GUI_CHECKED Then $color = 0xB50400 While 1 $colorpos = PixelSearch(0+5, 0+5, @DesktopWidth-5, @DesktopHeight-5, $color, 10, 1) If IsArray($colorpos) Then $drop = 20 $buttonposx = $pos[0] = $drop $buttonposy = $pos[1] MouseClick("Right", $buttonposx , $buttonposy, 1, 0) EndIf WEnd EndIf If BitAND(GUICtrlRead($Checkbox_11), $GUI_CHECKED) = $GUI_CHECKED Then While 1 MouseClick("left", 802, 624) Sleep(2500) MouseClick("left", 505, 365) Sleep(500) MouseClick("left", 707, 496) Sleep(26500) Wend EndIf WEnd EndFunc ;==>_Start Func _GetPos () Local $pos = MouseGetPos() MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1]) EndFunc ;==>_GetPos Func _NoClick () ToolTip("") $ClickIt = 0 EndFunc ;==>_NoClick Func Terminate () Exit EndFunc ;==>Terminate Edited November 25, 2007 by JustinReno Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 25, 2007 Author Share Posted November 25, 2007 (edited) AWESOME, it worked. thank you all for your support in a nooby like me Edited November 25, 2007 by BuddyBoy Link to comment Share on other sites More sharing options...
ame1011 Posted November 25, 2007 Share Posted November 25, 2007 or a more accurate method: expandcollapse popup#include <GuiConstants.au3> Opt("GUIOnEventMode",1) HotKeySet("{F5}", "_Start") HotKeySet("{F7}", "_NoClick") HotKeySet("{ESC}","Terminate") HotKeySet("^g", "_GetPos") $ClickIt = 0 $VARIABLE = 0 GUICreate("", 400, 300) GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate") $Checkbox_1 = GUICtrlCreateCheckbox("", 20, 40, 150, 20) $Checkbox_2 = GUICtrlCreateCheckbox("", 20, 80, 150, 20) $Checkbox_3 = GUICtrlCreateCheckbox("F", 20, 120, 150, 20) $Checkbox_4 = GUICtrlCreateCheckbox("Ri", 20, 160, 150, 20) $Checkbox_5 = GUICtrlCreateCheckbox("Lcker", 20, 200, 150, 20) $Checkbox_6 = GUICtrlCreateCheckbox("Sate", 20, 240, 200, 20) $Checkbox_7 = GUICtrlCreateCheckbox("Ar", 180, 40, 300, 20) $Checkbox_8 = GUICtrlCreateCheckbox("Ctn", 180, 80, 300, 20) $Checkbox_9 = GUICtrlCreateCheckbox("Press CTRL+g For coordinates", 180, 120, 300, 20) $Checkbox_10 = GUICtrlCreateCheckbox("A", 180, 160, 300, 20) $Checkbox_11 = GUICtrlCreateCheckbox("ro", 180, 200, 300, 20) GUISetState() While 1 Sleep( 10 ) WEnd Exit Func _Start () $ClickIt = 1 While $ClickIt = 1 If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then If Not ProcessExists("firefox.exe") Then Run("C:\Program Files\Mozilla Firefox\firefox.exe") Endif EndIf If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("left", 429, 443) MouseClick("right", 503, 330) Sleep(120000) EndIf If BitAND(GUICtrlRead($Checkbox_3), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("right", 503, 330) Sleep(4500) EndIf If BitAND(GUICtrlRead($Checkbox_4), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("right") EndIf If BitAND(GUICtrlRead($Checkbox_5), $GUI_CHECKED) = $GUI_CHECKED Then MouseClick("left") EndIf If BitAND(GUICtrlRead($Checkbox_6), $GUI_CHECKED) = $GUI_CHECKED Then While 1 Send('{F1}') Sleep(10500) Send('{F4}') Sleep(3500) WEnd EndIf If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then While 1 WinWaitActive("Instruction") WinClose("Instruction") Sleep(360000) MouseClick("left", 943, 670, 1) Sleep(8000) MouseClick("right") WEnd EndIf If BitAND(GUICtrlRead($Checkbox_8), $GUI_CHECKED) = $GUI_CHECKED Then While 1 Send('{CTRLDOWN}') WEnd EndIf If BitAND(GUICtrlRead($Checkbox_9), $GUI_CHECKED) = $GUI_CHECKED Then If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then _GetPos () While 1 Sleep(10000) WEnd EndIf EndIf If BitAND(GUICtrlRead($Checkbox_10), $GUI_CHECKED) = $GUI_CHECKED Then $color = 0xB50400 While 1 $colorpos = PixelSearch(0+5, 0+5, @DesktopWidth-5, @DesktopHeight-5, $color, 10, 1) If IsArray($colorpos) Then $drop = 20 $buttonposx = $pos[0] = $drop $buttonposy = $pos[1] MouseClick("Right", $buttonposx , $buttonposy, 1, 0) EndIf WEnd EndIf If BitAND(GUICtrlRead($Checkbox_11), $GUI_CHECKED) = $GUI_CHECKED Then While 1 MouseClick("left", 802, 624) Sleep(2500) MouseClick("left", 505, 365) Sleep(500) MouseClick("left", 707, 496) Sleep(26500) Wend EndIf WEnd EndFunc ;==>_Start Func _GetPos () Local $pos = MouseGetPos() MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1]) EndFunc ;==>_GetPos Func _NoClick () ToolTip("") $ClickIt = 0 EndFunc ;==>_NoClick Func Terminate () Exit EndFunc ;==>Terminate [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
BuddyBoy Posted November 25, 2007 Author Share Posted November 25, 2007 Is there a difference? Link to comment Share on other sites More sharing options...
ame1011 Posted November 25, 2007 Share Posted November 25, 2007 not much, his script opens firefox once and never opens it again. Mine checks to see if firefox is running and opens it if its not currently running. [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
JustinReno Posted November 25, 2007 Share Posted November 25, 2007 Your welcome BuddyBoy. 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