Jump to content

Need help with InputBox


Recommended Posts

Ive shortened the code a bit:

#include <IE.au3> 
#Include<GUIConstants.au3>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Alla definitioner;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$trafiksidan = "http://www.trafiksidan.com"
$meraporr = "http://www.meraporr.com"
$password = "lallare"
$pagetitle = "Elins Lilla Sida"
$pagedescription = "Se mig posera naken framför kameran"
$emailadress = "stevenzzzon@yahoo.com"
$email1 = "mobilekillen@hotmail.com"
$pass1 = "daddlos"
$pornstar = "http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=31"
$porrfilm = "http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=40"
$hittafitta = "http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=41"
$gratisporr = "http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=42"
$smsporr = "http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=38"
$klassiskporr = "http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=32"
$city = "Stockholm"
$Number = 0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Här börjar scriptet;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Ställer in Värden;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Opt("WinTitleMatchMode", 2)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Öppnar IE och navigerar till Trafiksidan;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$oIE = _IECreate($trafiksidan)

If Not WinActive("www.trafiksidan.com") Then
WinActivate("www.trafiksidan.com")
EndIf

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Trafiksidan uppe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$o_form1 = _IEFormGetObjByName ($oIE, "login")
$o_email1 = _IEFormElementGetObjByName ($o_form1, "email")
$o_pass1 = _IEFormElementGetObjByName ($o_form1, "password")
$o_submit1 = _IEFormElementGetObjByName ($o_form1, "submit")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Loggar in på trafiksidan;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

_IEFormElementSetValue ($o_email1, $email1)
_IEFormElementSetValue ($o_pass1, $pass1)
_IEFormSubmit ($o_form1)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Öppnar nytt IE fönster med porrlänkar;;;;;;;;;;;;;;;;;;;;;;;;;;;

$oIE2 = _IECreate($meraporr)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Flippar tillbaka till trafiksidan;;;;;;;;;;;;;;;;;;;;;;;;;;;;

If Not WinActive("www.trafiksidan.com") Then
WinActivate("www.trafiksidan.com")
EndIf

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Påbörjar WHILE loop;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

While 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Väljer SITE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Opt("GUIOnEventMode",1)

$mainfrm=GUICreate("Välj Site",150,200,5,5,-1)
$button1=GUICtrlCreateButton("Pornstar",25,3,110,30)
$button2=GUICtrlCreateButton("Porrfilm",25,33,110,30)
$button3=GUICtrlCreateButton("HittaFitta",25,66,110,30)
$button4=GUICtrlCreateButton("GratisPorr",25,99,110,30)
$button5=GUICtrlCreateButton("SMSPorr",25,132,110,30)
$button6=GUICtrlCreateButton("KlassiskPorr",25,165,110,30)
GUICtrLSetOnEvent($button1,"Knapp1")
GUICtrlSetOnEvent($button2,"Knapp2")
GUICtrlSetOnEvent($button3,"Knapp3")
GUICtrlSetOnEvent($button4,"Knapp4")
GUICtrlSetOnEvent($button5,"Knapp5")
GUICtrlSetOnEvent($button6,"Knapp6")
GUISetOnEvent($GUI_EVENT_CLOSE,"Quit")
GUISetState()
;While 1
    Sleep(10000)
;WEnd

Func Knapp1()
    _IENavigate($oIE,"http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=31")
EndFunc

Func Knapp2()
    _IENavigate($oIE,"http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=40")
EndFunc

Func Knapp3()
    _IENavigate($oIE,"http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=41")
EndFunc

Func Knapp4()
    _IENavigate($oIE,"http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=42")
EndFunc

Func Knapp5()
    _IENavigate($oIE,"http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=38")
EndFunc

Func Knapp6()
    _IENavigate($oIE,"http://www.trafiksidan.com/link/index.jsp?a=profile&s=links&siteId=32")
EndFunc

Func Quit()
    Exit
EndFunc

WEnd
Maybe sort out your code and we can help you. It's too messy to look at.
Link to comment
Share on other sites

Maybe sort out your code and we can help you. It's too messy to look at.

I think that Bill has already solved his problem. He was just asking why you cannot have a Func inside a While/WEnd... at least that is what I think he wanted to know.

In the end, I think that he will have GUI code, a While/Sleep/WEnd and some Func/EndFunc code.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Yes i solved the problem and the code works fine! Thank you all for all of your help!

Thanks for explaining about the func and while.

Now i have another question, is it possible to make the script pause and wait for a keystroke? im thinking something like inputwait({CTRLDOWN}c{CTRLUP}) :)

//Bill

Edited by bills
Link to comment
Share on other sites

...is it possible to make the script pause and wait for a keystroke? im thinking something like inputwait({CTRLDOWN}c{CTRLUP})...

You can click on the AutoIt icon in the system tray (by the clock) to pause and unpause the script or look in the help file under HotKeySet or _IsPressed.

Try adding the pause/unpause feature to your code yourself and if you get stuck - post the latest code that you have tried and maybe someone can help you out.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

I used _IsPressed and it works great! Thanks a lot!

Now ive got another question (always a lot of questions :))

When i use a messagebox, i get different values from each button right?

For example "yes" returns "6" and "no" returns "7".

How do i use these?

Id like a message box that says :

Would you like to open Google?

This is from within a internet explorer script.

If yes is chosen then _IENavigate("$oIE, "http://www.google.se")

If no is chosen then Exit

I cant figure out how to use the returning values into a IF.

//Bill

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...