Jump to content
Sign in to follow this  

Variable help

Recommended Posts


Hello, im pretty new at Autoit so im sure my question is elementary to you fellow auto-ers

ANYWAYS, i was creating simple-ish program that when ran would ask a couple questions, once the correct answer was selected it would launch IE and then log into my myspace then show a message then log out and close (yea pretty pointless). So what i need help with is that making all of the msgs work together and fluintly(sp?), but it doesnt work as planned and i keep getting errors, and every time i try to fix them i get new ones.

here is the code:

#include <IE.au3>
$answer = MsgBox(36, "CLICK YES!!!", "Would you like to go on my Myspace?")
        if $answer = 6 then
            Dim $oIE
    Elseif $answer = 7 then 
            dim $rawr = MsgBox(36, "Why?", "Are you sure you would not like to go on my myspace?")
        if $rawr = 6 then 
            dim $poop = Msgbox(36, "Wtf", "Why the hell not? Just click yes to go on it. If you dont you're a loser")
    Elseif $rawr = 7 then
            dim $answer
        if local $poop = 7 then
            dim $answer
    Elseif $poop = 7 then
            dim $answer

; Open IE and log into myspace
$sUsername = "myusername"
$sPassword = "mypassword"
$oIE = _IECreate("http://myspace.com")
$oform = _IEFormGetObjByName($oIE, "LoginForm")
$ologin = _IEFormElementGetObjByName($oform, "ctl00$ctl00$Main$cpMain$LoginBox$Email_Textbox")
$opassword = _IEFormElementGetObjByName($oform, "ctl00$ctl00$Main$cpMain$LoginBox$Password_Textbox")
_IEFormElementSetValue($ologin, $sUsername)
_IEFormElementSetValue($opassword, $sPassword)

MsgBox(64, "Congratulations", "nice myspace eh?")

; Log Out & close IE
_IENavigate($oIE, "http://collect.myspace.com/index.cfm?fuseaction=signout")
_IEQuit ($oIE)

The actual purpose of logging into my myspace and closing IE works but stringing the messages together doesnt seem to work, althogh im sure i did something wrong.

P.S. the contents of the msgs are by my lovely friend :)

Share this post

Link to post
Share on other sites

Replace the beginning of you code with this.

$answer = MsgBox(36, "CLICK NO!!!", "Would you like to go on my Myspace?")
If $answer = 6 then
    MsgBox(1,"jeez","I dont know why you would want to, but here we go!",5)
Elseif $answer = 7 then
    MsgBox(0, "woowee", "That was close, good choice. Bye!")

MsgBox(1,"GO!","STUPID SPACE!")

Share this post

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
Sign in to follow this