Jump to content
Sign in to follow this  
ashley

Ctrlclick in IE

Recommended Posts

ashley

ok whats wrong with this code....

It wont clcik on the drop down box on the wep page that it takes it to.

Only under 13 and 13-17 have vbeen scripted ATM

#include <GUIConstants.au3>
#include <IE.au3>
Global $age1
#Region ### START Koda GUI section ### Form=
$Quick = GUICreate("Quick Character maker - RuneCheater", 285, 251, 193, 115, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
$agegroup = GUICtrlCreateGroup("Whats your age:", 8, 8, 265, 49)
$Selectone = GUICtrlCreateCombo("Select one", 16, 24, 145, 25)
GUICtrlSetData(-1, "----------------------|12 and under|13-17|18-24|25-29|30-39|40-49|50-59|60 plus")
$Saveage = GUICtrlCreateButton("Save", 168, 24, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Desired = GUICtrlCreateGroup("Desired Username", 8, 56, 265, 49)
$username = GUICtrlCreateInput("Username", 16, 72, 145, 21)
$savename = GUICtrlCreateButton("Save", 168, 72, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$DesiredP = GUICtrlCreateGroup("DesiredP", 8, 104, 265, 49)
$password = GUICtrlCreateInput("Password", 16, 120, 145, 21)
$savepassword = GUICtrlCreateButton("Save", 168, 120, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Age = GUICtrlCreateLabel("Age", 8, 160, 250, 17)
$User = GUICtrlCreateLabel("User", 8, 176, 250, 17)
$Pass = GUICtrlCreateLabel("Pass", 8, 192, 250, 17)
$Make = GUICtrlCreateButton("Make my new runescape account", 8, 216, 267, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
            Exit
    Case $Saveage
        If GUICtrlRead($Selectone) = "Select one" or GUICtrlRead($Selectone) = "----------------------" Then
            Sleep(1000)
        Else
        $age1 = GUICtrlRead($Selectone) 
        GUICtrlSetData($age, $age1)
        EndIf
    Case $savename
        $name1 = GUICtrlRead($Username)
        GUICtrlSetData($user, $name1)
    Case $savepassword
        $pass1 = GUICtrlRead($password)
        GUICtrlSetData($pass, $pass1)
    Case $Make
        _IECreate("www.Runescape.co.uk")
        WinActive("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer")
        Opt("WinTitleMatchMode", 4)
        WinWait("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar")
        ControlClick("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar","Internet Explorer_Server1")
        
        If GUICtrlRead($age) = "12 and under" Then
        Opt("WinTitleMatchMode", 4)
        WinWait("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar")
        ControlClick("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar","Internet Explorer_Server1")
        WinWait("classname=Internet Explorer_Server","")
        ControlClick("classname=Internet Explorer_Server","","Internet Explorer_Server0")
        WinWait("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar")
        ControlClick("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar","Internet Explorer_Server1")
        MsgBox(48,"Error","At this time RuneScape is limited to users aged 13 and older.")
        Exit
        EndIf

        If GUICtrlRead($age) = "13-17" Then
        Opt("WinTitleMatchMode", 4)
        WinWait("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar")
        ControlClick("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar","Internet Explorer_Server1")
        WinWait("classname=Internet Explorer_Server","")
        ControlClick("classname=Internet Explorer_Server","","Internet Explorer_Server0")
        WinWait("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar")
        ControlClick("RuneScape - the massive online adventure game by Jagex Ltd - Windows Internet Explorer","Command Bar","Internet Explorer_Server1")
        EndIf


    EndSwitch
WEnd
Edited by ashley

Share this post


Link to post
Share on other sites
Jos

This statement is wrong in multiple ways:

$age1 = If GUICtrlRead($Selectone) = "Select one" or "----------------------" Then

what is the plan with $age1 = ?

A valid if would be : If GUICtrlRead($Selectone) = "Select one" or GUICtrlRead($Selectone) = "----------------------" Then


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
BrettF

What if? I get all of these errors in SciTe:

W:\My Scripts\help.au3(31,17) : ERROR: syntax error

$age1 = If

~~~~~~~~~~~~~~~~^

W:\My Scripts\help.au3(31,87) : ERROR: syntax error

$age1 = If GUICtrlRead($Selectone) = "Select one" or "----------------------" Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

W:\My Scripts\help.au3(33,9) : ERROR: missing EndSwitch.

ElseIf

~~~~~~~~^

W:\My Scripts\help.au3(27,17) : REF: missing EndSwitch.

Switch $nMsg

~~~~~~~~~~~~~~~~^

W:\My Scripts\help.au3(33,9) : ERROR: missing Wend.

ElseIf

~~~~~~~~^

W:\My Scripts\help.au3(25,1) : REF: missing Wend.

While

^

W:\My Scripts\help.au3(33,9) : ERROR: syntax error

ElseIf

~~~~~~~~^

W:\My Scripts\help.au3 - 5 error(s), 0 warning(s)

First off you might look at how you wrote this:

$age1 = If GUICtrlRead($Selectone) = "Select one" or "----------------------" Then

Mmmmmm...

Share this post


Link to post
Share on other sites
ashley

This statement is wrong in multiple ways:

$age1 = If GUICtrlRead($Selectone) = "Select one" or "----------------------" Then

what is the plan with $age1 = ?

A valid if would be : If GUICtrlRead($Selectone) = "Select one" or GUICtrlRead($Selectone) = "----------------------" Then

that didnt compleatly fix it...

But it help me get there...

Share this post


Link to post
Share on other sites
AquilaChill

#include <GUIConstants.au3> needs to go at the top for those $WS_ n such to work

line 31

$age1 = If GUICtrlRead($Selectone) = "Select one" or "----------------------" Then
            Sleep(1000)
        ElseIf
$age2 = GUICtrlRead($Selectone)
        GUICtrlSetData($age, $age2)
    EndIf

you can't $var=If, from what i know

seems your confused on the syntax.

if you could tell me what you want that part of the code to do, then i could prolly fix it, as it could go a few different ways..

edit:spelling. also seems i waited to long, but ill still help with more info from ya on what ya want it to do.

Edited by AquilaChill

people are anoying, am i? ;) v2.95

Share this post


Link to post
Share on other sites
BrettF

@Ashley,

This is the worst bit of n00b ever.

What are you trying to achieve? Your code is so n00bish, that I can't even understand what your are trying to achieve. So what is that?

Share this post


Link to post
Share on other sites
ashley

#include <GUIConstants.au3> needs to go at the top for those $WS_ n such to work

line 31

$age1 = If GUICtrlRead($Selectone) = "Select one" or "----------------------" Then
            Sleep(1000)
        ElseIf
$age2 = GUICtrlRead($Selectone)
        GUICtrlSetData($age, $age2)
    EndIf

you can't $var=If, from what i know

seems your confuzed on the syntax.

if you could tell me what you want that part of the code to do, then i could prolly fix it, as it could go a few different ways..

its gona go one www.runescape.com and the make a new character.

Share this post


Link to post
Share on other sites
ashley

@Ashley,

This is the worst bit of n00b ever.

What are you trying to achieve? Your code is so n00bish, that I can't even understand what your are trying to achieve. So what is that?

it will make a new character on www.runescape.com, im doing it for another m8, and so i can learn how to click stuff in IE

Share this post


Link to post
Share on other sites
Jos

that didnt compleatly fix it...

But it help me get there...

I understand and had no intent to fix your code. I expect somebody that is around for as long as you are to think for themselves first !

You should know how to find problems like this running au3check and using the helpfile .....

:P


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
AquilaChill

but if im going to help you i need to know what that bit of code is supposed todo, the If statement inside the switch that is.

i usualy work on the functions first then do (part of) the gui when im stuck on the functions, but thats just me :P

edit:er fixed the if statement i guess, what ya need help with now? the IE part? i don't mess with the browser much, so it would be best to check out some example scripts dealing with IE.

Edited by AquilaChill

people are anoying, am i? ;) v2.95

Share this post


Link to post
Share on other sites
BrettF

but if im going to help you i need to know what that bit of code is supposed todo, the If statement inside the switch that is.

i usualy work on the functions first then do (part of) the gui when im stuck on the functions, but thats just me :P

He shouldn't need help with these if statements. Basically, because with the edit, there is nothing wrong with the code?

Tweaked it a bit:

#include <GUIConstants.au3>
Global $age1
#Region ### START Koda GUI section ### Form=
$Quick = GUICreate("Quick Character maker - RuneCheater", 285, 251, 193, 115, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
$agegroup = GUICtrlCreateGroup("Whats your age:", 8, 8, 265, 49)
$Selectone = GUICtrlCreateCombo("Select one", 16, 24, 145, 25)
GUICtrlSetData(-1, "----------------------|12 and under|13-17|18-24|25-29|30-39|40-49|50-59|60 plus")
$Saveage = GUICtrlCreateButton("Save", 168, 24, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Desired = GUICtrlCreateGroup("Desired Username", 8, 56, 265, 49)
$username = GUICtrlCreateInput("Username", 16, 72, 145, 21)
$savename = GUICtrlCreateButton("Save", 168, 72, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$DesiredP = GUICtrlCreateGroup("DesiredP", 8, 104, 265, 49)
$password = GUICtrlCreateInput("Password", 16, 120, 145, 21)
$savepassword = GUICtrlCreateButton("Save", 168, 120, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Age = GUICtrlCreateLabel("Age", 8, 160, 23, 17)
$User = GUICtrlCreateLabel("User", 8, 176, 26, 17)
$Pass = GUICtrlCreateLabel("Pass", 8, 192, 27, 17)
$Make = GUICtrlCreateButton("Make my new runescape account", 8, 216, 267, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Saveage
            If Not GUICtrlRead($Selectone) = "Select one"  Or GUICtrlRead($Selectone) = "----------------------"  Then
                $age1 = GUICtrlRead($Selectone)
                GUICtrlSetData($Age, $age1)
            EndIf
        Case $savename
            $name1 = GUICtrlRead($username)
            GUICtrlSetData($User, $name1)
        Case $savepassword
            $pass1 = GUICtrlRead($password)
            GUICtrlSetData($Pass, $pass1)
    EndSwitch
WEnd

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  

×