Jump to content

making script a GUI with instructions


Recommended Posts

well heres the code

;--------> EDIT URL HERE ---v
$sURL = "http://www.neopets.com/explore.phtml"
;--------> EDIT URL HERE ---^

Opt("WinTitleMatchMode", 2)
Global $pause = 0, $win = "- Microsoft Internet Explorer"
$oIE = ObjCreate("InternetExplorer.Application")
With $oIE
  .Navigate($sURL)
  While .ReadyState <> 4
    Sleep(10)
  Wend
  Sleep(500)
  .Visible = 1
EndWith
WinWaitActive($win, "")
Sleep(300)
WinSetState($win, "", @SW_MAXIMIZE)
WinSetOnTop($win, "", 1)

HotkeySet("{PAUSE}", "GoPause")
HotkeySet("{ESC}", "myexit")

While 1
  If not WinActive($win, "") Then WinActivate($win, "")
  If not WinExists($win, "") Then Exit
  Send("{F5}")
  While $oIE.ReadyState <> 4
    If not WinExists($win, "") Then Exit
    Sleep(10)
  Wend
Wend

Func GoPause()
  $pause = 1
  HotkeySet("{PAUSE}", "UnPause")
  While $pause
    Sleep(10)
  Wend
  HotkeySet("{PAUSE}", "GoPause")
EndFunc

Func UnPause()
  $pause = 0
EndFunc

Func myexit()
  WinKill($win, "")
  Exit
EndFunc

i tried gui create but all i got was an error mesage thats its not writen properly

Link to post
Share on other sites

#include <GuiConstants.au3>
Opt ("WinTitleMatchMode", 2)

Global $pause = 0, $win = "- Microsoft Internet Explorer", $oIE 

HotKeySet("{PAUSE}", "GoPause")
HotKeySet("{ESC}", "myexit")

GUICreate("MyGUI", 392, 322)

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40, 340, 20)
$Btn_Navigate = GUICtrlCreateButton("Navigate",392/2 - 60,80,120,25)
GuiCtrlSetOnEvent(-1,"_Navigate")

GUISetState()

_Navigate()

AdlibEnable("_MyAdlib")

While 1
    Sleep(10)
WEnd
Exit

Func _Navigate()
    $oIE = ObjCreate("InternetExplorer.Application")
    With $oIE
        .Navigate (GUICtrlRead($Input_URL))
        While .ReadyState <> 4
            Sleep(10)
        WEnd
        Sleep(500)
        .Visible = 1
    EndWith
    
    WinWaitActive($win, "")
    Sleep(300)
    WinSetState($win, "", @SW_MAXIMIZE)
    WinSetOnTop($win, "", 1)
EndFunc

Func _MyAdlib()
    While 1
        If Not WinActive($win, "") Then WinActivate($win, "")
        If Not WinExists($win, "") Then Exit
        Send("{F5}")
        While $oIE.ReadyState <> 4
            If Not WinExists($win, "") Then Exit
            Sleep(10)
        WEnd
    WEnd
EndFunc  ;==>_MyAdlib

Func GoPause()
    $pause = 1
    HotKeySet("{PAUSE}", "UnPause")
    While $pause
        Sleep(10)
    WEnd
    HotKeySet("{PAUSE}", "GoPause")
EndFunc  ;==>GoPause

Func UnPause()
    $pause = 0
EndFunc  ;==>UnPause

Func myexit()
    WinKill($win, "")
    Exit
EndFunc  ;==>myexit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to post
Share on other sites

#include <GuiConstants.au3>
Opt ("WinTitleMatchMode", 2)

Global $pause = 0, $win = "- Microsoft Internet Explorer", $oIE 

HotKeySet("{PAUSE}", "GoPause")
HotKeySet("{ESC}", "myexit")

GUICreate("MyGUI", 392, 322)

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40, 340, 20)
$Btn_Navigate = GUICtrlCreateButton("Navigate",392/2 - 60,80,120,25)
GuiCtrlSetOnEvent(-1,"_Navigate")

GUISetState()

_Navigate()

AdlibEnable("_MyAdlib")

While 1
    Sleep(10)
WEnd
Exit

Func _Navigate()
    $oIE = ObjCreate("InternetExplorer.Application")
    With $oIE
        .Navigate (GUICtrlRead($Input_URL))
        While .ReadyState <> 4
            Sleep(10)
        WEnd
        Sleep(500)
        .Visible = 1
    EndWith
    
    WinWaitActive($win, "")
    Sleep(300)
    WinSetState($win, "", @SW_MAXIMIZE)
    WinSetOnTop($win, "", 1)
EndFunc

Func _MyAdlib()
    While 1
        If Not WinActive($win, "") Then WinActivate($win, "")
        If Not WinExists($win, "") Then Exit
        Send("{F5}")
        While $oIE.ReadyState <> 4
            If Not WinExists($win, "") Then Exit
            Sleep(10)
        WEnd
    WEnd
EndFunc  ;==>_MyAdlib

Func GoPause()
    $pause = 1
    HotKeySet("{PAUSE}", "UnPause")
    While $pause
        Sleep(10)
    WEnd
    HotKeySet("{PAUSE}", "GoPause")
EndFunc  ;==>GoPause

Func UnPause()
    $pause = 0
EndFunc  ;==>UnPause

Func myexit()
    WinKill($win, "")
    Exit
EndFunc  ;==>myexit

<{POST_SNAPBACK}>

thx for that but if i understand that it goes by x&y coordinates... but not all people have their mouse buttons the same so how would i make it so that it looks for the letters Go or a white arrow

edit:

#include <GuiConstants.au3>
Opt ("WinTitleMatchMode", 2)

Global $pause = 0, $win = "- Microsoft Internet Explorer", $oIE 

HotKeySet("{PAUSE}", "GoPause")
HotKeySet("{ESC}", "myexit")

GUICreate("MyGUI", 392, 322)

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40, 

340, 20)
$Btn_Navigate = GUICtrlCreateButton("Navigate",392/2 - 60,80,120,25)
GUICtrlSetImage (-1, "GO.bmp",22)

GUISetState()

_Navigate()

AdlibEnable("_MyAdlib")

While 1
    Sleep(10)
WEnd
Exit

Func _Navigate()
    $oIE = ObjCreate("InternetExplorer.Application")
    With $oIE
        .Navigate (GUICtrlRead($Input_URL))
        While .ReadyState <> 4
            Sleep(10)
        WEnd
        Sleep(500)
        .Visible = 1
    EndWith
    
    WinWaitActive($win, "")
    Sleep(300)
    WinSetState($win, "", @SW_MAXIMIZE)
    WinSetOnTop($win, "", 1)
EndFunc

Func _MyAdlib()
    While 1
        If Not WinActive($win, "") Then WinActivate($win, "")
        If Not WinExists($win, "") Then Exit
        Send("{F5}")
        While $oIE.ReadyState <> 4
            If Not WinExists($win, "") Then Exit
            Sleep(10)
        WEnd
    WEnd
EndFunc ;==>_MyAdlib

Func GoPause()
    $pause = 1
    HotKeySet("{PAUSE}", "UnPause")
    While $pause
        Sleep(10)
    WEnd
    HotKeySet("{PAUSE}", "GoPause")
EndFunc ;==>GoPause

Func UnPause()
    $pause = 0
EndFunc ;==>UnPause

Func myexit()
    WinKill($win, "")
    Exit
EndFunc ;==>myexit
    EndWith
    
    WinWaitActive($win, "")
    Sleep(300)
    WinSetState($win, "", @SW_MAXIMIZE)
    WinSetOnTop($win, "", 1)
EndFunc

Func _MyAdlib()
    While 1
        If Not WinActive($win, "") Then WinActivate($win, "")
        If Not WinExists($win, "") Then Exit
        Send("{F5}")
        While $oIE.ReadyState <> 4
            If Not WinExists($win, "") Then Exit
            Sleep(10)
        WEnd
    WEnd
EndFunc ;==>_MyAdlib

Func GoPause()
    $pause = 1
    HotKeySet("{PAUSE}", "UnPause")
    While $pause
        Sleep(10)
    WEnd
    HotKeySet("{PAUSE}", "GoPause")
EndFunc ;==>GoPause

Func UnPause()
    $pause = 0
EndFunc ;==>UnPause

Func myexit()
    WinKill($win, "")
    Exit
EndFunc ;==>myexit

thats what i got when i edited it bu i get an error now that says

"Eroor: "func" statement has no matching EndFunc".

Edited by bosko
Link to post
Share on other sites

#include <GuiConstants.au3>
Opt ("WinTitleMatchMode", 2)

Global $pause = 0, $win = "- Microsoft Internet Explorer", $oIE

HotKeySet("{PAUSE}", "GoPause")
HotKeySet("{ESC}", "myexit")

GUICreate("MyGUI", 392, 322)

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40,

340, 20)
$Btn_Navigate = GUICtrlCreateButton("Navigate", 392 / 2 - 60, 80, 120, 25)
GUICtrlSetImage(-1, "GO.bmp", 22)

GUISetState()

_Navigate()

AdlibEnable("_MyAdlib")

While 1
    Sleep(10)
WEnd
Exit

Func _Navigate()
    $oIE = ObjCreate("InternetExplorer.Application")
    With $oIE
        .Navigate (GUICtrlRead($Input_URL))
        While .ReadyState <> 4
            Sleep(10)
        WEnd
        Sleep(500)
        .Visible = 1
    EndWith
    
    WinWaitActive($win, "")
    Sleep(300)
    WinSetState($win, "", @SW_MAXIMIZE)
    WinSetOnTop($win, "", 1)
EndFunc  ;==>_Navigate

Func _MyAdlib()
    While 1
        If Not WinActive($win, "") Then WinActivate($win, "")
        If Not WinExists($win, "") Then Exit
        Send("{F5}")
        While $oIE.ReadyState <> 4
            If Not WinExists($win, "") Then Exit
            Sleep(10)
        WEnd
    WEnd
EndFunc  ;==>_MyAdlib

Func GoPause()
    $pause = 1
    HotKeySet("{PAUSE}", "UnPause")
    While $pause
        Sleep(10)
    WEnd
    HotKeySet("{PAUSE}", "GoPause")
EndFunc  ;==>GoPause

Func UnPause()
    $pause = 0
EndFunc  ;==>UnPause

;Func myexit()
;   WinKill($win, "")
;   Exit
;EndFunc  ;==>myexit
;### Tidy Error: next line creates a negative tablevel.
;### Tidy Error: next line creates a negative tablevel for the line after it.
;EndWith
;
;WinWaitActive($win, "")
;Sleep(300)
;WinSetState($win, "", @SW_MAXIMIZE)
;WinSetOnTop($win, "", 1)
;### Tidy Error: next line creates a negative tablevel.
;### Tidy Error: next line creates a negative tablevel for the line after it.
;EndFunc  ;==>myexit

Func _MyAdlib()
    While 1
        If Not WinActive($win, "") Then WinActivate($win, "")
        If Not WinExists($win, "") Then Exit
        Send("{F5}")
        While $oIE.ReadyState <> 4
            If Not WinExists($win, "") Then Exit
            Sleep(10)
        WEnd
    WEnd
EndFunc  ;==>_MyAdlib

Func GoPause()
    $pause = 1
    HotKeySet("{PAUSE}", "UnPause")
    While $pause
        Sleep(10)
    WEnd
    HotKeySet("{PAUSE}", "GoPause")
EndFunc  ;==>GoPause

Func UnPause()
    $pause = 0
EndFunc  ;==>UnPause

Func myexit()
    WinKill($win, "")
    Exit
EndFunc  ;==>myexit

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to post
Share on other sites

Here's an example straight out of the help file for 3.1.1 release version

#include <GUIConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW)    ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to post
Share on other sites

Here's an example straight out of the help file for 3.1.1 release version

#include <GUIConstants.au3>

GUICreate("My GUI"); will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW)      ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

<{POST_SNAPBACK}>

i was using a diff version that was the problem but i got another error when i used 3.1.1

Func_Myadlib()

Error: Duplicate function name.

Link to post
Share on other sites

#include <GuiConstants.au3>
Opt ("WinTitleMatchMode", 2)

Global $pause = 0, $win = "- Microsoft Internet Explorer", $oIE

HotKeySet("{PAUSE}", "GoPause")
HotKeySet("{ESC}", "myexit")

GUICreate("MyGUI", 392, 322)

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40,

340, 20)
$Btn_Navigate = GUICtrlCreateButton("Navigate", 392 / 2 - 60, 80, 120, 25)
GUICtrlSetImage(-1, "GO.bmp", 22)

GUISetState()

_Navigate()

AdlibEnable("_MyAdlib")

While 1
    Sleep(10)
WEnd
Exit

Func _Navigate()
    $oIE = ObjCreate("InternetExplorer.Application")
    With $oIE
        .Navigate (GUICtrlRead($Input_URL))
        While .ReadyState <> 4
            Sleep(10)
        WEnd
        Sleep(500)
        .Visible = 1
    EndWith
    
    WinWaitActive($win, "")
    Sleep(300)
    WinSetState($win, "", @SW_MAXIMIZE)
    WinSetOnTop($win, "", 1)
EndFunc ;==>_Navigate

Func _MyAdlib()
    While 1
        If Not WinActive($win, "") Then WinActivate($win, "")
        If Not WinExists($win, "") Then Exit
        Send("{F5}")
        While $oIE.ReadyState <> 4
            If Not WinExists($win, "") Then Exit
            Sleep(10)
        WEnd
    WEnd
EndFunc ;==>_MyAdlib

Func GoPause()
    $pause = 1
    HotKeySet("{PAUSE}", "UnPause")
    While $pause
        Sleep(10)
    WEnd
    HotKeySet("{PAUSE}", "GoPause")
EndFunc ;==>GoPause

Func UnPause()
    $pause = 0
EndFunc ;==>UnPause

Func myexit()
    WinKill($win, "")
    Exit
EndFunc ;==>myexit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to post
Share on other sites
  • Developers

$oIE = ObjCreate("InternetExplorer.Application")

$oIE = ^ERROR

Error: Unknown function name.

<{POST_SNAPBACK}>

You need the AutoIt3 Beta version for this command....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

with beta i get this error

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40,

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40^

ERROR

Error parsing function call.

Link to post
Share on other sites
  • Developers

with beta i get this error

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40,

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40^

ERROR

Error parsing function call.

<{POST_SNAPBACK}>

ofcourse you had a look at the syntax and found that there are probably some crlf's that souldn't be there and that the line should say:

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40,340, 20)

Right ?? :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

ofcourse you had a look at the syntax and found that there are probably some crlf's that souldn't be there and that the line should say:

$Input_URL = GUICtrlCreateInput("http://www.neopets.com/explore.phtml", 20, 40,340, 20)

Right ??  :)

<{POST_SNAPBACK}>

I LOVE YOU AND GAFROST

but yeah i always miss them sons of a b*****

it doesnt navigate to different pages... is there any way i could just make a browser......

Edited by bosko
Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...