Hoofdcategorieën

Bekijk bericht in topic: [MMORPG]Silkroad Online, deel 8

Pda programming ftw
Berichten: 1.077
Reg. datum: 10 september 2002

Voor het inloggen heb ik een "semi" oplossing:
Dit is een Autohotkeyscript dat je kan compilen tot een exe, Dit script start silkroad, drukt op de connect knop, vult je username en pwd in. Je vult dan zelf nog wel die "Captcha" in. Maar als je client dan disconnect dan sluit hij silkroad af, en start hem weer opnieuw op.
Ik post hier de code, dit omdat mensen vaak een .exe niet op prijs stellen.

Bijgaand is een inifile genaamd (Settings.ini) die moet je nog even maken
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

CoordMode, Mouse, Relative
CoordMode, Pixel, Relative

IniRead, INI_Path, %A_WorkingDir%\Settings.ini, MyConfig, Path, 0
IniRead, INI_UserName, %A_WorkingDir%\Settings.ini, MyConfig, UserName, 0
IniRead, INI_Password, %A_WorkingDir%\Settings.ini, MyConfig, Password, 0


Poging_Count = 1

loop
{


Stoppen  = false

if INI_Path = 0
{
    MsgBox Inifile is missing data
    break
}
if INI_UserName = 0
{
    MsgBox Inifile is missing data
    break
}
if INI_Password = 0
{
    MsgBox Inifile is missing data
    break
}


;SplashTextOn, 200,50,Teller, Poging %Poging_Count%


Run %INI_Path%
WinWait, Silkroad Online Launcher
MsgBox, 4096, Poging %Poging_Count% , Stop Silkroad Starter?, 3


loop
{

    IfMsgBox OK
    {
        Stoppen = true
        break
    }
    
    PixelGetColor, color,636,371
    StringMid, Green, color , 5 , 2
    if Green = 76
    {
        break
    }
    sleep 100
}

if Stoppen = true
{
    break
}


SplashTextOff
MouseClick, left, 542,355 


WinWait, SRO_Client

loop
{
    WinGetPos, ,,Width,Height
    if width > 400
    {
        break
    }
    sleep 100
}

sleep 1000
WinActivate, SRO_Client  

Send {TAB}
sleep 100
Send {TAB}
sleep 100
Send %INI_UserName%
sleep 100
Send {TAB}
sleep 100
Send %INI_Password%
sleep 100
Send {ENTER}

    WinGetPos, ,,Width,Height
    PixelHeightPoint = Height / 0.9

    If Height = 600
    {
        Exit_Button_Y := 456
        Exit_Button_X := 410

        Server_Full_X := 10
        Server_Full_Y := 546

        Invalid_Captcha_X := 10
        Invalid_Captcha_Y := 543
    }
    If Height = 768
    {
        Exit_Button_X := 522        
        Exit_Button_Y := 540

        Server_Full_X := 10
        Server_Full_Y := 691

        Invalid_Captcha_X := 10
        Invalid_Captcha_Y := 686
    }
    If Height = 800
    {
        Exit_Button_Y := 557
        Exit_Button_X := 650

        Server_Full_X := 10
        Server_Full_Y := 717

        Invalid_Captcha_X := 10
        Invalid_Captcha_Y := 715
    }
    If Height = 864
    {
        Exit_Button_Y := 590
        Exit_Button_X := 586

        Server_Full_X := 10
        Server_Full_Y := 771

        Invalid_Captcha_X := 10
        Invalid_Captcha_Y := 769
    }
    If Height = 960
    {
        Exit_Button_Y := 637
        Exit_Button_X := 650

        Server_Full_X := 10
        Server_Full_Y := 855

        Invalid_Captcha_X := 10
        Invalid_Captcha_Y := 852
    }
    If Height = 1024
    {
        Exit_Button_Y := 670
        Exit_Button_X := 651

        Server_Full_X := 10
        Server_Full_Y := 910

        Invalid_Captcha_X := 10
        Invalid_Captcha_Y := 907
    }



loop
{
    ;Check if SRo is closed, if so we start again
    Winget, wininfomation, ID, SRO_Client
    if wininfomation > 0  then
    {
        sleep 1000
    }    
    else
    {
        break
    }

    
    ;Check if the connection with the server has been lost 
    ;Only for login screen: "Cannot connect due to server traffic"

    ;Check if the server is full
    PixelGetColor, color,Server_Full_X ,Server_Full_Y

    if color = 0x1D67FF 
    {
        ;Make sure it is not the invalid image fault
        PixelGetColor, color,Invalid_Captcha_X,Invalid_Captcha_Y    
        if color != 0x1D67FF
        {
            ;The server is full, press the EXIT button
            MouseClick, left, Exit_Button_X, Exit_Button_Y
        }
    }

}
Poging_Count := Poging_Count + 1


}

De ini file:
code:
1
2
3
4
[MyConfig]
Path="D:\SilkRoad\Silkroad\Silkroad.exe"
UserName="Username"
Password="Pass"

 

Bekijk bericht
Bericht:
Quote bericht:

VNU Media logo Powered by True

© 1998 - 2008 Tweakers.net - Alle rechten voorbehouden

Uitgever van: