Sign in to follow this  
Followers 0
Term!nX

Help with Guild Wars Script - Logging in

10 posts in this topic

#1 ·  Posted (edited)

Hi there!

Im pretty new to AutoIt and atm I labor at a script to log automatically in to Guild Wars. I want to implent a MsgBox which tells me if the log in with the password was successfully or not. Example:

You try to log in in your scnd account, but you used the password from your first account. So I want to implent a MsgBox which tells you sth. like this: LogIn with pword successful/not successful.

Where pword stands for the recently automatically typed password.

Another problem for me is, how does the logged in window distinguish from the failed login-window? I thought of pixelsearch..

If somebody could help me, I would say a prayer for you!!

(I'm from Germany, so dont get eyecancer :lmao: )

Edited by Term!nX

Share this post


Link to post
Share on other sites



Hello,

You should learn how to use the PixelChecksum()

=]

Share this post


Link to post
Share on other sites

Hello,

You should learn how to use the PixelChecksum()

=]

Hey thx, this looks good. But unfortunately, this is not a solution for me... Because when the log in fails, the whole screen gets a bit darker. And if I log in, the screen changes of course, too. So in both cases the screen changes.

Share this post


Link to post
Share on other sites

HI,

first of all try to find something to identify whether it fails or not.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Yes,

heres a screen with a failed Log-In:

http://www.gwebspace.de/zocktempel/Fehlgeschlagen.JPG

heres the one with successful Log-In:

http://www.gwebspace.de/zocktempel/Geglueckt.JPG

Just an idea:

When I look for a pixelcolour, which only appears in the logged in screen, I could try sth like this:

While 1 do

LogIn()

PixelSearch()

EndLoop

The time, when it tries to log in I could search every 100ms for the specific Pxelcolour. If found, its logged in. If its not found, the login failed.

Possbible?

I looked up the PixelSearch function. I found a coordinate which is constantly black and has got the colour 1032. But I do not get, how I can look for this colour in a specific area on the screen.

Edited by Term!nX

Share this post


Link to post
Share on other sites

Look into PixelGetColor()


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

I have never done this pixel stuff before, so please correct me if I'm wrong, but something like this might work...

(Send login)
Sleep(2000)
If PixelGetColor(357, 332) = 9460062 Then $LoginFailed = True

That pixel is the dot in the red exclamation point. If login is successful it might be any color depending on the last toon you logged in as and that race's background, but it won't be black or this particular shade of red.

You might also google memory locations. I know people have made some programs that actually monitor variables in WoW's memory. It should be somewhat similar in Guild Wars, at least in concept.


My UDFs: ExitCodes

Share this post


Link to post
Share on other sites

c0deWorm, man you gave me the solution. I really really thank you!!!

Also thanks to all the others!

Share this post


Link to post
Share on other sites

Opt("WinTitleMatchMode", 2)
HotKeySet("{F2}", "_Quit")

_FileSearchToRun('Gw.exe', '/s -y -a -x')
WinWaitActive("Guild");if this doesnt work, then buy faster PC or replace with Sleep(xxxx).
Send("{TAB}Your Accountname{TAB}Yourpassword{ENTER}")
WinWaitActive("Guild");see above.
_LoginCheck()

Func _FileSearchToRun($filename, $parameters = '')
    Local Const $IDYES = 6
    Local $data, $split, $pid
    Local $drive = DriveGetDrive('FIXED')
    If Not @error Then
        For $i = 1 To UBound($drive) -1
            $pid = Run(@ComSpec & ' /c Dir ' & $drive[$i] & '\' & $filename & ' /B/S', '', @SW_HIDE, 2)
            Do
                $data &= StdOutRead($pid)
            Until @error
        Next
    Else
        Return SetError(2, 0, 0)
    EndIf
    $split = StringSplit(StringStripWS($data, 3), @CRLF, 1)
    If Not @error Then
        For $i = 1 To $split[0]
            If MsgBox(0x40024, 'Run ' & $i & ' of ' & $split[0], $split[$i]) = $IDYES Then
                Return Run($split[$i] & " " & $parameters, '', @SW_MAXIMIZE)
            EndIf
        Next
    Else
        Return Run($split[1] & " " & $parameters, '', @SW_MAXIMIZE)
    EndIf
    Return SetError(1, 0, 0)
EndFunc

Func _LoginCheck()
    Local $loop = 1
    While $loop = 1
        $a = PixelSearch(0, 0, @DesktopWidth, @Desktopheight, 0xCFD3D0)
        If Not @error Then
            MsgBox(0, "Failed", "Wrong Password.")
            $loop = 0
        Else
            MsgBox(0, "Success", "Login Succesfull.")
            $loop = 0
        EndIf
        Sleep(100)
    WEnd
EndFunc

Func _Quit()
    If ProcessExists("Gw.exe") Then
        ProcessClose("Gw.exe")
    EndIf
    Sleep(50)
    Exit
EndFunc

-Ace


[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

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  
Followers 0