Skip to content

Commit f96b3ee

Browse files
committed
D2A v1.2
1 parent 6697879 commit f96b3ee

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed
Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ Menu, tray, add, Dotabuff
1010
Menu, tray, add
1111
Menu, tray, add, Rosh, Rosh
1212
Menu, tray, add
13-
Menu, tray, add, Open autoexec.cfg, autoexec.cfg
13+
Menu, tray, add, Open cfg folder, autoexec.cfg
1414
Menu, tray, add, Exit
1515
;Menu, Tray, Icon, %A_ScriptDir%\%A_ScriptName%,1,1
1616

17-
Version=v1.1
18-
IniRead, RunAtStart, %A_temp%\d2a.ini, Config, RunAtStart, 0
17+
Version=v1.2
18+
IniRead, RunAtStart, %A_MyDocuments%\d2a.ini, Config, RunAtStart, 0
1919
if RunAtStart {
2020
FileCreateShortcut , %A_ScriptDir%\%A_ScriptName%, %A_Startup%\D2A.lnk
2121
} else{
2222
IfExist %A_Startup%\D2A.lnk
2323
FileDelete, %A_Startup%\D2A.lnk
2424
}
2525

26-
IniRead, accepter, %A_temp%\d2a.ini, Config, Accepter, F11
27-
IniRead, rageq, %A_temp%\d2a.ini, Config, RageQuit, !F4
26+
IniRead, accepter, %A_MyDocuments%\d2a.ini, Config, Accepter, F11
27+
IniRead, rageq, %A_MyDocuments%\d2a.ini, Config, RageQuit, !F4
2828

29-
IniRead, PosX, %A_temp%\d2a.ini, Config, Custom PosX, %A_Space%
30-
IniRead, PosY, %A_temp%\d2a.ini, Config, Custom PosY, %A_Space%
31-
IniRead, AcceptMethod, %A_temp%\d2a.ini, Config, AcceptMethod, 1
29+
IniRead, PosX, %A_MyDocuments%\d2a.ini, Config, Custom PosX, %A_Space%
30+
IniRead, PosY, %A_MyDocuments%\d2a.ini, Config, Custom PosY, %A_Space%
31+
IniRead, AcceptMethod, %A_MyDocuments%\d2a.ini, Config, AcceptMethod, 1
3232

3333
if (AcceptMethod==1){
3434
AcceptMethod1:=1
@@ -50,12 +50,12 @@ gojoin:=!gojoin
5050
if gojoin
5151
{
5252
if (!PosX){
53-
x:=A_ScreenWidth*.4
53+
x:=A_ScreenWidth*.5
5454
} else {
5555
x:=PosX
5656
}
5757
if (!PosY){
58-
y:=A_ScreenHeight*.497
58+
y:=A_ScreenHeight*.4907
5959
} else {
6060
y:=PosY
6161
}
@@ -87,6 +87,7 @@ Click
8787
return
8888

8989
Config:
90+
Gui, Destroy
9091
gui, font, s10 w500
9192

9293
Gui, Add, Hotkey, vaccepter x5 y5 w50 h20 , %accepter%
@@ -114,12 +115,12 @@ return
114115

115116
saveconfig:
116117
gui, submit
117-
IniWrite,%accepter%, %A_temp%\d2a.ini, Config, Accepter
118-
IniWrite,%rageq%, %A_temp%\d2a.ini, Config, RageQuit
119-
IniWrite, %RunatStart%, %A_temp%\d2a.ini, Config, RunatStart
120-
IniWrite,%NewPosX%, %A_temp%\d2a.ini, Config, Custom PosX
121-
IniWrite,%NewPosY%, %A_temp%\d2a.ini, Config, Custom PosY
122-
IniWrite,%AcceptMethod%, %A_temp%\d2a.ini, Config, AcceptMethod
118+
IniWrite,%accepter%, %A_MyDocuments%\d2a.ini, Config, Accepter
119+
IniWrite,%rageq%, %A_MyDocuments%\d2a.ini, Config, RageQuit
120+
IniWrite, %RunatStart%, %A_MyDocuments%\d2a.ini, Config, RunatStart
121+
IniWrite,%NewPosX%, %A_MyDocuments%\d2a.ini, Config, Custom PosX
122+
IniWrite,%NewPosY%, %A_MyDocuments%\d2a.ini, Config, Custom PosY
123+
IniWrite,%AcceptMethod%, %A_MyDocuments%\d2a.ini, Config, AcceptMethod
123124
if RunAtStart {
124125
FileCreateShortcut , %A_ScriptDir%\%A_ScriptName%, %A_Startup%\D2A.lnk
125126
} else{
@@ -153,24 +154,28 @@ return
153154

154155
SteamIdFinder:
155156
FileRead, Contents, %SteamPath%\logs\connection_log.txt
156-
FoundPos := RegExMatch(Contents, "(?<=\[U:\d:)(\d+)(?=\] 'OK')", SteamID, -1200)
157+
StringGetPos, pos, Contents,ConnectionCompleted(),R,1
158+
FoundPos := RegExMatch(Contents, "(?<=\[U:\d:)(\d+)(?=\] 'OK')", SteamID, pos)
157159
Run https://steamid.xyz/%SteamID%
158160
return
159161

160162
Dotabuff:
161163
FileRead, Contents, %SteamPath%\logs\connection_log.txt
162-
FoundPos := RegExMatch(Contents, "(?<=\[U:\d:)(\d+)(?=\] 'OK')", SteamID, -1200)
164+
StringGetPos, pos, Contents,ConnectionCompleted(),R,1
165+
FoundPos := RegExMatch(Contents, "(?<=\[U:\d:)(\d+)(?=\] 'OK')", SteamID, pos)
163166
Run http://www.dotabuff.com/players/%SteamID%
164167
return
165168

166169
autoexec.cfg:
167-
Run, Notepad.exe %SteamPath%/SteamApps/common/dota 2 beta/dota/cfg/autoexec.cfg
170+
;FileAppend, , %SteamPath%\steamapps\common\dota 2 beta\game\dota\cfg\autoexec.cfg
171+
;Run, Notepad.exe %SteamPath%\steamapps\common\dota 2 beta\game\dota\cfg\autoexec.cfg
172+
Run, Explore %SteamPath%/steamapps/common/dota 2 beta/game/dota/cfg
168173
return
169174

170175

171176
UpdateCheck:
172-
UrlDownloadToFile, https://dl.dropboxusercontent.com/u/45755423/D2A/latestD2A.html, %A_Temp%\latestD2A.html
173-
FileReadLine, NetVer, %A_Temp%\latestD2A.html, 1
177+
UrlDownloadToFile, https://dl.dropboxusercontent.com/u/45755423/D2A/latestD2A.html, %A_MyDocuments%\latestD2A.html
178+
FileReadLine, NetVer, %A_MyDocuments%\latestD2A.html, 1
174179
If (Version <> NetVer)
175180
{
176181
;MsgBox, 4,Check for update, %NetVer% is available! `nWould you like to download new version?

0 commit comments

Comments
 (0)