Jump to content

Internet...


Gaboury
 Share

Recommended Posts

In my script I want to open Internet Explorer (because it is on all the machines...not like firefox or netscape, I think Internet is automatically installed with Windows...)

But how do I get it to change the link in the adress bar whatever the launch page is? Or is there anyway to make the Internet explorer open automatically on a certain page?

Thanks :whistle:

- Gaboury.

Link to comment
Share on other sites

3 ways:

1. Opens the URL inside the Default Browser (maybe Netscape, Opera or Firefox too)

Run(@Comspec & " /c start " & $url);where $url contains the desired URL as String

2. Open the desired URL inside Internet Explorer

Run(@Comspec & " /c " & @ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $url);where $url contains the desired URL as String

3. Search the forum for Daleholms IE.au3 UDF (uses COM to deal with Internet Explorer, Needs Beta)

Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
Link to comment
Share on other sites

  • Moderators

Run(@Comspec & " /c start " & $url);where $url contains the desired URL as String
For some reason... I've had 1 or 2 people tell me that using the above didn't work... so I just do a fail safe:

$Url = "http://www.myurl.com/"
   Run(@ComSpec & " /c Start " & $Url, "", @SW_HIDE)
   If @error Then
      $Url = "http://www.myurl.com/"
      $OpenUrl = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\command", "")
      $PosParam = StringInStr($OpenUrl, "%") 
      $OpenUrlLeft = StringLeft($OpenUrl, $PosParam - 1)
      $OpenUrlRight = StringMid($OpenUrl, $PosParam + 2, 999)
      Run($OpenUrlLeft & $Url & $OpenUrlRight)
   EndIf

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

@comspec cant handle some urls with weird symbols in them.

best would be dllcall (shellexecute) or com (shell.application & .open)

more specific info found here

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

Well I tried it with the url I had and it works fine :whistle:

Thanks for that help... Now I have another problem which I really don't understand...

To choose if you go to that url or not, I created a GUI asking if they already had a GameSurge Account (My script is for mIRC)... then there are 2 buttons, Yes and Register. If they click register, it brings them to the url but then I don't know how to close that GUI once they've clicked it...

I tried Winclose, Winkill, and nothing seems to work...any ideas?

Link to comment
Share on other sites

Hahaha

Why didn't I think about it?!? Sometimes I am so much of an idiot :whistle: Gonna try that right now and come back over it :dance:

Thanks :(

- Gaboury.

Note: Do you have msn? If you'd like to help me in a faster way, I would enjoy if you could pm me your e-mail adress. Thanks :dance:

Link to comment
Share on other sites

Doesn't work... If you want, here's the code :whistle:

#include <GuiConstants.au3>
Dim $stop = 0, $start = 0, $time = 20;sleep time
;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
;------------------------------------------------------------------------------------------------------------------------------------------ GUI
GuiCreate("mIRC Scrim Finder", 365, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Picture = GuiCtrlCreatePic("C:\Documents and Settings\Jaimie\Bureau\Jaimie\AutoIt\mIRC Scrim Finder\mircscrim.jpg", 20, 10, 325, 65)
$Picture2 = GUICtrlCreatePic("C:\Documents and Settings\Jaimie\Bureau\Jaimie\AutoIt\mIRC Scrim Finder\bygab.jpg", 20, 230, 325, 65)
$input1 = GuiCtrlCreateInput(".: 5 vs 5 | East | Yours | Cal-I | MAP | PM ME :.", 20, 85, 325, 22)
GUICtrlSetState( -1, $GUI_FOCUS)
$label1 = GuiCtrlCreateLabel("Hi.  This is my first program.  I made this mIRC Scrim Finder to make it easier to find scrims.  Just paste whatever line you'd have posted on mIRC to find a scrim and then press Start.  It will also log you in the good mIRC server and make sure you don't bypass the flood protection.", 20, 150, 320, 80)
$startbutton = GuiCtrlCreateButton("Start Finding!", 130, 115, 96, 23)
GUICtrlSetState( -1, $GUI_DEFBUTTON)
$stopbutton = GuiCtrlCreateButton("Stop Finding!", 249, 115, 96, 23)
$progress = GUICtrlCreateProgress( 20, 116, 96, 20)
GUISetState() 
;------------------------------------------------------------------------------------------------------------------------------------------ GUI
;------------------------------------------------------------------------------------------------------------------------------------------ Set On Event
Opt("GUIOnEventMode", 1); Gui On Event ON


GUICtrlSetOnEvent($startbutton, "startit")
GUICtrlSetOnEvent($stopbutton, "stopit")
GUISetOnEvent($GUI_EVENT_CLOSE, "Closeit")

;------------------------------------------------------------------------------------------------------------------------------------------ Set On Event
;------------------------------------------------------------------------------------------------------------------------------------------ GUI Commands
While 1
    If $start = 1 Then
        While 2
                        $getinput = GUICtrlRead($input1)
                        $askbox1 = MsgBox(4, "Are you sure?", "Are those informations about the scrim the good ones?" & @CRLF & $getinput)
                    If $askbox1 = 7 Then
                        MsgBox(0, "Canceled", "The search has been canceled.  Please rectify the informations and search again.", 3)
                        $start = 0
                        ExitLoop
                    ElseIf $askbox1 = 6 Then
                        MsgBox(0, "Info", "The scrim information has been accepted.  Please be patient while mIRC Scrim Finder tries to find your scrim.", 3)
                        $readiniconfig = IniRead(@HomeDrive & "\mIRCScrimFinder\config.ini", "Path", "$mircpath", "NotFound")
                    If Not $readiniconfig = "NotFound" Then
                        Call("mircstart")
                    ElseIf $readiniconfig = "NotFound" Then
                        GUICtrlSetData($progress, 10)
                        MsgBox(0, "Info", "Please wait as we find your mIRC executable.  That action may take up to one minute depending on your system." & @CRLF & "Note that this will only happen the first time you launch this program.", 5)
                        GUICtrlSetData($progress, 20)
                        Sleep($time)
                    If $stop = 1 Then ExitLoop
                        Sleep(1000)
                        GUICtrlSetData($progress, 30)
                        Sleep($time)
                    If $stop = 1 Then ExitLoop
                        runWait(@comspec & ' /c dir /b /s ' & @HomeDrive & '\mirc.exe > "' & @HomeDrive & '\result.txt"', @HomeDrive, @SW_HIDE)
                        GUICtrlSetData($progress, 60)
                        Sleep($time)
                    If $stop = 1 Then ExitLoop
                        $resultopen = FileOpen(@HomeDrive & "\result.txt", 0 )
                        GUICtrlSetData($progress, 70)
                        Sleep($time)
                    If $stop = 1 then ExitLoop
                        $resultread = FileReadLine($resultopen)
                        GUICtrlSetData($progress, 80)
                        Sleep($time)
                    If $stop = 1 then ExitLoop
                        FileClose($resultopen)
                        DirCreate (@HomeDrive & "\mIRCScrimFinder\")
                        GUICtrlSetData($progress, 90)
                        Sleep($time)
                    If $stop = 1 then ExitLoop
                        IniWrite(@homeDrive & "\mIRCScrimFinder\config.ini", "Path", "$mircpath", $resultread)
                        GUICtrlSetData($progress, 100)
                        Sleep($time)
                        EndIf
                    If $stop = 1 then ExitLoop
                        MsgBox(0, "Detected.", "mIRC Scrim Finder detected the path to your mIRC executable." & @CRLF & "The starting is now only a question of seconds.", 2)
                        $start = 0
                        Call("mircstart")
                        ExitLoop
                    EndIf       
                WEnd
            EndIf
        WEnd

;------------------------------------------------------------------------------------------------------------------------------------------------------- GUI Commands
;-------------------------------------------------------------------------------------------------------------------------------------------------------Function            
Func startit()
    $start = 1
EndFunc

Func stopit()
    $stop = 1
EndFunc

Func closeit()
    $surequit = MsgBox(4, "Closing...", "Are you sure you want to quit?")
    If $surequit = 6 Then
        MsgBox(0, "Closing...", "You requested mIRC Scrim Finder to close." & @CRLF & "                  Now Exiting...", 2)
        Exit
    ElseIf $surequit = 7 Then
    EndIf
EndFunc

Func mircstart()
    $readiniconfig1 = IniRead(@HomeDrive & "\mIRCScrimFinder\config.ini", "Path", "$mircpath", "NotFound")
    Run($readiniconfig1)
    Sleep(15000)
    WinActivate("About")
    Send("{RIGHT}")
    Send("{ENTER}")
GuiCreate("Registered?", 364, 119,(@DesktopWidth-364)/2, (@DesktopHeight-119)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
    $yesreg= GuiCtrlCreateButton("Ok", 70, 70, 100, 30)
    $noreg = GuiCtrlCreateButton("Register", 180, 70, 110, 30)
    GUICtrlSetOnEvent($noreg, "register")
    GUICtrlSetOnEvent($yesreg, "continue")
    $registered = GuiCtrlCreateLabel("To use the GameSurge Server to search for scrim, you must register on GameSurge's Website.  If you already have an account, please click Ok.  If you would like to be redirected to GameSurge's Website to create one, please click the Register button.", 20, 10, 320, 60)
    GUISetState(@SW_SHOW)
    EndFunc
    
    Func register()
    Guidelete()
    $url = "http://www.gamesurge.net/createaccount/"
    Run(@Comspec & " /c start " & $url)
    WinWaitActive("Game")
    MsgBox(0, "Info", "Please fill in the informations needed to create your account.  When that is done, please press F10 to continue mIRC Scrim Finder.")
    HotKeySet("{F10}", "continue")
EndFunc

Func continue()
    GuiDelete()
    MsgBox(0, "F10", "F10 Pressed")
    EndFunc
    
    
;-------------------------------------------------------------------------------------------------------------------------------------------------------Functions

A bit long but if you want to read it all to be sure of the answer you wanna give me :dance:

By the way the "Continue" fonction was just a test, it won't show up a msgbox saying F10 pressed :dance: That was just to see if the hotkey was working :(

Edited by Gaboury
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...