Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.74 KB | None | 0 0
  1. #SingleInstance, Force
  2. #NoEnv
  3. #MaxHotkeysPerInterval 99000000
  4. #HotkeyInterval 99000000
  5. #KeyHistory 0
  6. #Persistent ; Stay open in background
  7. #Include %A_ScriptDir%\Resources\Gdip_All.ahk
  8. #Include %A_ScriptDir%\Resources\Gdip_Ext.ahk
  9.  
  10. ListLines Off
  11. Process, Priority, , A
  12. SetBatchLines, -1
  13. SetKeyDelay, -1, -1
  14. SetMouseDelay, -1
  15. SetDefaultMouseSpeed, 0
  16. SetWinDelay, -1
  17. SetControlDelay, -1
  18. SendMode Input
  19. SetTitleMatchMode,2
  20. DetectHiddenWindows, On
  21. SetWorkingDir %A_ScriptDir%
  22. CoordMode, Mouse, Screen
  23. Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
  24.  
  25. ; --- Global Variables
  26. global chatlogkey, start, exit, configkey, config, title, targetwindowx, targetwindowy, prog, Version_Number, changeLog, Update_URL
  27.  
  28. toggle:=1
  29. config:="config.ini"
  30. PH:="<h1>Phoenix Herald</h1>"
  31. file2=\Electronic Arts\Dark Age of Camelot\
  32. file=chat.log
  33.  
  34. Version_Number := 1.1 ;The script's version number
  35. Update_URL := "https://dcscout.000webhostapp.com/DAoCScout/Version.ini"
  36. changeLog := get("https://dcscout.000webhostapp.com/DAoCScout/changelog.txt")
  37.  
  38. ;--- Tray
  39. Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
  40. Menu, Tray, NoStandard
  41. Menu, Tray, Tip, DAoC Scout
  42. Menu, Tray, Add, Run, start
  43. Menu, Tray, Add, Config, config
  44. Menu, Tray, Add ; Separator
  45. Menu, Tray, Add, About, About
  46. Menu, Tray, Add, Donate, OpenPayPal
  47. Menu, Tray, Add, Check for Update, Update
  48. Menu, Tray, Add ; Separator
  49. Menu, Tray, Add, Quit,Quit
  50. Menu, Tray, Icon, Run, %A_ScriptDir%\Resources\Lookup.ico
  51. Menu, Tray, Icon, Config, %A_ScriptDir%\Resources\Config.ico
  52.  
  53. ;--- Check for configini and creates if not one
  54. IfNotExist,%config%
  55. {
  56. MsgBox Could not find config.ini. Generating new one.
  57. IniWrite, F2, %config% ,KEYS, start
  58. IniWrite,Escape, %config% ,KEYS, exit
  59. IniWrite, F3, %config% ,KEYS, configkey
  60. IniWrite, F4, %config% ,KEYS, chatlogkey
  61. IniWrite, x0 y0,%config%,WINDOW POSITION,main
  62. IniWrite, 1,%config%,WINDOW POSITION,targetwindowx
  63. IniWrite, 1,%config%,WINDOW POSITION,targetwindowy
  64. IniWrite, %A_MyDocuments%%file2%%file%,%config%, CHATLOG, file
  65. IniWrite, 1, %config%, OPTIONS, relative
  66. IniWrite, 0, %config%, OPTIONS, Resist1
  67. IniWrite, 0, %config%, OPTIONS, Resist2
  68. IniWrite, 1, %config%, OPTIONS, Resist3
  69. IniWrite, 0, %config%, OPTIONS, dropshadow
  70. IniWrite, Arial, %config%, OPTIONS, Fontstylefont
  71. IniWrite, 16, %config%, OPTIONS, Fontstylesize
  72. IniWrite, 1, %config%, OPTIONS, boldhighlight
  73. Gosub config
  74. }
  75.  
  76. ;--- Read ini file and assign KEYS
  77. IniRead, start, %config%, KEYS, start
  78. IniRead, exit, %config%, KEYS, exit
  79. IniRead, configkey, %config%, KEYS, configkey
  80. IniRead, chatlogkey, %config%, KEYS, chatlogkey
  81. IniRead, chatLog, %config%, CHATLOG, file
  82. IniRead, main, %config%, WINDOW POSITION, main
  83. IniRead, targetwindowx, %config%, WINDOW POSITION, targetwindowx
  84. IniRead, targetwindowy, %config%, WINDOW POSITION, targetwindowy
  85. IniRead, relative, %config%, OPTIONS, relative , 0
  86. IniRead, Resist1, %config%, OPTIONS,Resist1 , 0
  87. IniRead, Resist2, %config%, OPTIONS,Resist2 , 0
  88. IniRead, Resist3, %config%, OPTIONS,Resist3 , 0
  89. IniRead, dropshadow, %config%,OPTIONS,dropshadow
  90. IniRead, Fontstylefont, %config%, OPTIONS, Fontstylefont
  91. IniRead, Fontstylesize, %config%, OPTIONS, Fontstylesize
  92. IniRead, boldhighlight, %config%, OPTIONS, boldhighlight
  93. FileGetSize, filesize, %chatLog%
  94. oldsize:=filesize
  95.  
  96. If (Resist1= 0 and Resist3=0)
  97. AllResist:=2
  98. If (Resist2=0 and Resist3=0)
  99. AllResist:=1
  100. If (Resist1=0 and Resist2=0)
  101. AllResist:=3
  102.  
  103. Hotkey, ~LButton, daoc, off
  104. Hotkey, %start%, start, off
  105. Hotkey, %exit%, escape, on
  106. Hotkey, %configkey%, config, on
  107. OnMessage(0x03, "MsgMonitor")
  108. OnMessage(0x201, "WM_LBUTTONDOWN")
  109. If !pToken := Gdip_Startup()
  110. ExitApp
  111.  
  112. Width:=800, height:=800
  113. Gui, 3: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
  114. Gui, 3: Show, NA
  115. hwnd1 := WinExist()
  116. hbm := CreateDIBSection(Width, Height)
  117. hdc := CreateCompatibleDC()
  118. obm := SelectObject(hdc, hbm)
  119. G := Gdip_GraphicsFromHDC(hdc)
  120. Gdip_SetSmoothingMode(G, 4)
  121. If (dropshadow=0)
  122. {
  123. pBrush := Gdip_BrushCreateSolid(0x590000)
  124. Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
  125. Gdip_DeleteBrush(pBrush)
  126. }
  127. Font = %Fontstylefont%
  128. If !Gdip_FontFamilyCreate(Font)
  129. {
  130. MsgBox Font not installed setting to Arial
  131. IniWrite, Arial, %config%, OPTIONS, Fontstylefont
  132. IniRead, Fontstylefont, %config%, OPTIONS, Fontstylefont
  133. Font = %Fontstylefont%
  134. Gdip_FontFamilyCreate(Font)
  135. }
  136.  
  137. Gui,1: +e0x20 +AlwaysOnTop +LastFound -SysMenu
  138. Gui,1: Color, ffffff, ffffff
  139. Gui,1: Font, Normal c1e91bb
  140. Gui,1: Add, Groupbox, x7 y7 h65 w160, [Scout] Quickstart
  141. Gui,1: Font, Normal s8 c000000, Verdana
  142. Gui 1: Add,Text, x15 y24 BackgroundTrans vtext4 w200,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  143. gui,1: hide
  144. Update()
  145. Return
  146.  
  147.  
  148. ;updater stuff
  149. Update(){
  150. If winactive("DAoC Scout - Configuration")
  151. return
  152. else{
  153. Gui,ProgressBar: -Caption +Border +AlwaysOnTop
  154. Gui,ProgressBar: Margin, 5,5
  155. Gui,ProgressBar: Add, Picture, x1 y5, Resources\Scout.png
  156. Gui,ProgressBar: Add, Progress, x4 w337 h20 BackgroundC9C9C9 c001216 vProg -Smooth, 50
  157. Gui,ProgressBar: Font, c001216 s9 Normal, Verdana
  158. Gui,ProgressBar: Add, Text, x0 y+5 w310 +Center vProgText BackgroundTrans
  159. Gui,ProgressBar: Show
  160. global ProgText, Prog
  161. GuiControl,ProgressBar:, Prog, 0 ; ProgressBar!
  162. GuiControl,ProgressBar:, ProgText, Checking for updates... ; Infotext in the Progressbar
  163. Sleep 50
  164. Random, p, 1, 10
  165. GuiControl,ProgressBar:, Prog, %p%
  166. Sleep 100
  167. Version_Number = %Version_Number% ;The script's version number
  168. changeLog = %changeLog%
  169. Random, p, 11, 35
  170. GuiControl,ProgressBar:, Prog, %p%
  171. Sleep 100
  172. Update_URL = %Update_URL%
  173. Random,Filler,10000000,99999999
  174. Version_File := A_Temp . "\" . Filler . ".ini"
  175. Random, p, 36, 55
  176. GuiControl,ProgressBar:, Prog, %p%
  177. Sleep 100
  178. UrlDownloadToFile,%Update_URL%,%Version_File%
  179. IniRead,Version,%Version_File%,Info,Version
  180. Random, p, 60, 85
  181. GuiControl,ProgressBar:, Prog, %p%
  182. FileDelete,%Version_File%
  183. GuiControl,ProgressBar:, ProgText, Loading functions... ;
  184. sleep 100
  185. GuiControl,ProgressBar:, Prog, 99
  186. sleep 100
  187. Gui,ProgressBar: Destroy
  188. If (Version > Version_Number)
  189. {
  190. Gui,1: Hide
  191. Gui,Update: +AlwaysOnTop
  192. Gui,Update: Color, ffffff, ffffff
  193. Gui,Update: Add, GroupBox, w430 h90 cGreen, Update available!
  194. Gui,Update: Add, Text, x20 y30, Installed version:
  195. Gui,Update: Add, Text, x20 y+2, Latest version:
  196. If (Version > Version_Number)
  197. {
  198.  
  199. currversColor := "cRed"
  200. newversColor := "cGreen"
  201. }
  202. If (Version <= Version_Number)
  203. {
  204. currversColor := "cBlack"
  205. newversColor := "cBlack"
  206. }
  207.  
  208. Gui,Update: Add, Text, x110 y30 %currversColor%, %Version_Number%
  209. Gui,Update: Add, Text, x110 y+2 %newversColor%, %Version%
  210. Gui,Update: Font, Underline
  211. Gui,Update: Add, Text, x20 y68 gOpenZip c0066cc, Download ZIP
  212. Gui,Update: Font
  213. Gui,Update: Add, Button, x107 y63 gButtonCheckForUpdates, Update
  214. Gui,Update: Add, Picture, x199 y33 w112 h19, %A_ScriptDir%\Resources\discordLogo.png
  215. Gui,Update: Font, Underline
  216. Gui,Update: Add, Text, x200 y61 gOpenDiscord c0066cc, bysanUI/Scout Discord
  217. Gui,Update: Font
  218. Gui,Update: Add, Text, x321 y32 h45 0x11
  219. Gui,Update: Add, Picture, x332 y33 w96 h21, %A_ScriptDir%\Resources\paypalLogo.png
  220. Gui,Update: Font, Underline
  221. Gui,Update: Add, Text, x331 y61 gOpenPayPal c0066cc, Support DAoC-Scout
  222. Gui,Update: Font
  223. Gui,Update: Add, Edit, x10 ReadOnly w430 h238 BackgroundTrans, %changeLog%
  224. Gui,Update: Add, Button, x403 y348 gUpdateClose, Close
  225. Gui,Update: Show, w450 h380 xCenter yCenter, DAoC-Scout Update
  226. Return
  227. }
  228. else
  229. {
  230. hotkey, %start%, on
  231. Gui,1: Show, %main% w173 h78 , DAoC Scout
  232. return
  233. }
  234. }
  235. Return
  236. }
  237.  
  238.  
  239. ;--- Start key pushed
  240. start:
  241. Gui,1: hide
  242. ;gui,3:show
  243. Hotkey, ~LButton, toggle
  244. options3=s%Fontstylesize%
  245. Ifwinexist,ahk_exe game.dll
  246. {
  247. winactivate
  248. winwaitactive, ahk_exe game.dll
  249. }
  250. else
  251. winwaitactive, ahk_exe game.dll
  252. return
  253.  
  254. daoc:
  255. If winactive("ahk_exe game.dll")
  256. {
  257. Gui,3:Show, NA
  258. Send {%chatlogkey%}
  259. While A_TimeSinceThisHotkey < 350
  260. {
  261. If A_TimeSinceThisHotkey>=350
  262. Break
  263. }
  264. Send {%chatlogkey%}
  265. While A_TimeSinceThisHotkey < 400
  266. {
  267. If A_TimeSinceThisHotkey>=400
  268. Break
  269. }
  270. g:=0
  271. While (filesize=oldsize)
  272. {
  273. g++
  274. FileGetSize, filesize, %chatLog%
  275. If (filesize != oldsize)
  276. Break
  277.  
  278. If (g>=30)
  279. break
  280. }
  281. oldsize:=filesize
  282.  
  283. lastChar := FindName(chatlog)
  284.  
  285. ; --- Parse Herald
  286. document:= ComObjCreate("HTMLfile")
  287. page1:=get("https://herald.playphoenix.online/c/"+lastChar)
  288.  
  289. lines := StrSplit(page1, "`n")
  290. columns := []
  291. for index, value in lines
  292. columns.Insert(StrSplit(value, "`t"))
  293.  
  294. unfName := columns[49][1]
  295. unfGuild := columns[51][1]
  296. unfClass := columns[53][1]
  297. unfLevel := columns[57][1]
  298. unfRankLevel := columns[61][1]
  299. unfRace := columns[65][1]
  300. unfRankName := columns[67][1]
  301.  
  302. charName := RegExReplace(unfName,"\x20{2,}"," ")""
  303. unfGuild1 := RegExReplace(unfGuild,"<.*?>")
  304. unfGuild2 := RegExReplace(unfGuild1,"(&lt)")
  305. unfGuild3 := RegExReplace(unfGuild2,"(&gt)")
  306. charGuild := RegExReplace(unfGuild3,"\x20{2,}"," ")""
  307. charClass := RegExReplace(unfClass,"\x20{2,}"," ")""
  308. charLevel2 := RegExReplace(unfLevel,"\x20{2,}"," ")""
  309. charLevel := RegExReplace(charLevel2,"Level ")
  310. charLevel := "Lvl"+charLevel
  311. unfRankLevel1 := RegExReplace(unfRankLevel,"\x20{2,}"," ")""
  312. charRankLevel := RegExReplace(unfRankLevel1,"ealm Rank ","")
  313. charRace := RegExReplace(unfRace,"\x20{2,}"," ")""
  314. charRankName := RegExReplace(unfRankName,"\x20{2,}"," ")""
  315.  
  316. StringTrimLeft, charName, charName, 1
  317. StringTrimLeft, charClass, charClass, 1
  318. StringTrimLeft, charLevel, charLevel, 0
  319. StringTrimLeft, charRankLevel, charRankLevel, 1
  320. StringTrimLeft, charRace, charRace, 1
  321. StringTrimLeft, charRankName, charRankName, 1
  322. StringTrimRight, charGuild, charGuild, 1
  323.  
  324.  
  325. If (relative=1)
  326. gosub GetColor
  327. else
  328. targetColor:="cFFFFFFFF"
  329.  
  330. If (dropshadow=0)
  331. {
  332. TTG:="Gdip_TextToGraphics"
  333. options2:=
  334. }
  335. If (dropshadow=1)
  336. {
  337. TTG:="Gdip_TextToGraphics2"
  338. options2:="ow1 ocFF000000"
  339. }
  340.  
  341. If (dropshadow=1)
  342. {
  343. hbm := CreateDIBSection(Width, Height)
  344. hdc := CreateCompatibleDC()
  345. obm := SelectObject(hdc, hbm)
  346. G := Gdip_GraphicsFromHDC(hdc)
  347. Gdip_SetSmoothingMode(G, 4)
  348. pBrush := Gdip_BrushCreateSolid(0x00000000)
  349. Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
  350. Gdip_DeleteBrush(pBrush)
  351. }
  352.  
  353. If (dropshadow=0)
  354. {
  355. G := Gdip_GraphicsFromHDC(hdc)
  356. Gdip_SetCompositingMode(G, 1)
  357. pBrush := Gdip_BrushCreateSolid(0x00000000) ; fully transparent brush 'eraser'
  358. Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
  359. Gdip_DeleteBrush(pBrush)
  360. Gdip_SetCompositingMode(G, 0)
  361. Gdip_SetSmoothingMode(G, 4)
  362. pBrush := Gdip_BrushCreateSolid(0x00000000)
  363. Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
  364. Gdip_DeleteBrush(pBrush)
  365. }
  366. nameLength := StrLen(charName)
  367. guildLength:=StrLen(charGuild)
  368. IfnotInString, page1, %PH%
  369. {
  370. Font:=Fontstylefont
  371. FontSizes := [options3]
  372.  
  373. ; Measure Text Width
  374. For Each, Size in FontSizes {
  375. T := MeasureText(charName, "s" . Size, Fontstylefont)
  376. XW0 := T.W
  377. }
  378. For Each, Size in FontSizes {
  379. T := MeasureText(charRace, "s" . Size, Fontstylefont)
  380. XW1 := T.W
  381. }
  382. For Each, Size in FontSizes {
  383. T := MeasureText(charClass, "s" . Size, Fontstylefont)
  384. XW2 := T.W
  385. }
  386. For Each, Size in FontSizes {
  387. T := MeasureText(charLevel, "s" . Size, Fontstylefont)
  388. XW3 := T.W
  389. }
  390.  
  391. For Each, Size in FontSizes {
  392. T := MeasureText(charRankLevel, "s" . Size, Fontstylefont)
  393. XW4 := T.W
  394. }
  395.  
  396. ; Define gap width
  397. if (Fontstylefont = "Tahoma")
  398. {
  399. xwI := 1.3
  400. }
  401. else if (Fontstylefont = "Verdana")
  402. {
  403. xwI := 1.5
  404. }
  405. else if ((Fontstylefont = "Arial") or (Fontstylefont = "Trebuchet MS") or (Fontstylefont = "Ubuntu Mono"))
  406. {
  407. xwI := 1.6
  408. }
  409. else if ((Fontstylefont = "Segoe UI") or (Fontstylefont = "Bariol") or (Fontstylefont = "Montserrat"))
  410. {
  411. xwI := 1.9
  412. }
  413. else if ((Fontstylefont = "Noto Sans UI") or (Fontstylefont = "Overpass"))
  414. {
  415. xwI := 2.2
  416. }
  417. else if (Fontstylefont = "Gotham")
  418. {
  419. xwI := 2.9
  420. }
  421. else
  422. {
  423. xwI := 100.5
  424. }
  425. Fontsize_x := 17
  426. ; Placement
  427. XW1_1 := (XW1/2)-(0.5*Fontstylesize)
  428. if (XW1 > XW2)
  429. XW2_2 := (Fontstylesize/xwI)+(((XW2/2)+(0.5*Fontstylesize))-((XW2+XW1)*0.1008))
  430. else if (XW1 <= XW2)
  431. XW2_2 := (Fontstylesize/xwI)+((XW2/2)+(0.5*Fontstylesize)-((XW2+XW1)*0.1008))
  432.  
  433. XW3_1 := (XW3/2)-(0.5*Fontstylesize)
  434. if (XW3 > XW4)
  435. XW4_2 := (Fontstylesize/xwI)+(((XW4/2)+(0.5*Fontstylesize))-((XW4+XW3)*0.1008))
  436. else if (XW3 <= XW4)
  437. XW4_2 := (Fontstylesize/xwI)+((XW4/2)+(0.5*Fontstylesize)-((XW4+XW3)*0.1008))
  438.  
  439. X1_0 := (XWI/2)-(0.5*Fontstylesize)
  440.  
  441. y:=0
  442. Options = x%X1_0% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  443. %TTG%(G, charName , Options , Font, Width, Height)
  444.  
  445. If (unfGuild == " </h2>")
  446. {
  447. y:=Fontstylesize
  448. if boldhighlight=1
  449. Options = x-%XW4_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  450. else
  451. Options = x-%XW4_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
  452. %TTG%(G, charLevel, Options , Font, Width, Height)
  453.  
  454. Options = x%XW3_1% y%y% w90p Center %targetColor% %options2% r4 %options3%
  455. %TTG%(G, charRankLevel , Options , Font, Width, Height)
  456.  
  457. y:=Fontstylesize*2.05
  458. if boldhighlight=1
  459. Options = x-%XW2_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
  460. else
  461. Options = x-%XW2_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  462. %TTG%(G, charRace, Options , Font, Width, Height)
  463.  
  464. Options = x%XW1_1% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  465. %TTG%(G, charClass, Options , Font, Width, Height)
  466. }
  467. Else
  468. {
  469. y:=Fontstylesize
  470. if boldhighlight=1
  471. Options = x%X1_0% y%y% w90p Center %targetColor% %options2% r4 %options3%
  472. else
  473. Options = x%X1_0% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  474. %TTG%(G, "<" charGuild ">" , Options , Font, Width, Height)
  475.  
  476. y:=Fontstylesize*2.05
  477. if boldhighlight=1
  478. Options = x-%XW4_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
  479. else
  480. Options = x-%XW4_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  481. %TTG%(G, charLevel, Options , Font, Width, Height)
  482.  
  483. Options = x%XW3_1% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  484. %TTG%(G, charRankLevel , Options , Font, Width, Height)
  485.  
  486. y:=Fontstylesize*3.05
  487. if (boldhighlight=1)
  488. Options = x-%XW2_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
  489. else
  490. Options = x-%XW2_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  491. %TTG%(G, charRace, Options , Font, Width, Height)
  492. Options = x%XW1_1% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
  493. %TTG%(G, charClass, Options , Font, Width, Height)
  494. }
  495.  
  496. gosub getresist
  497. If (Resist1=1)
  498. If (unfGuild == " </h2>")
  499. {
  500. y:=Fontstylesize*3.2
  501. x:=-Fontstylesize*4
  502. Color:=resistances.Thrust.2
  503. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  504. %TTG%(G, "Thrust", Options , Font, Width, Height)
  505.  
  506.  
  507. y:=Fontstylesize*3.2
  508. Color:=resistances.Crush.2
  509. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  510. %TTG%(G, "Crush", Options, Font, Width, Height)
  511.  
  512. Longest2:=Fontstylesize*4
  513. y:=Fontstylesize*3.2
  514. Color:=resistances.Slash.2
  515. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  516. %TTG%(G, "Slash", Options, Font, Width, Height)
  517. }
  518. Else
  519. {
  520. y:=Fontstylesize*4.2
  521. x:=-Fontstylesize*4
  522. Color:=resistances.Thrust.2
  523. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  524. %TTG%(G, "Thrust", Options , Font, Width, Height)
  525.  
  526.  
  527. y:=Fontstylesize*4.2
  528. Color:=resistances.Crush.2
  529. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  530. %TTG%(G, "Crush", Options, Font, Width, Height)
  531.  
  532. Longest2:=Fontstylesize*4
  533. y:=Fontstylesize*4.2
  534. Color:=resistances.Slash.2
  535. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  536. %TTG%(G, "Slash", Options, Font, Width, Height)
  537. }
  538.  
  539. If (Resist2=1)
  540. If (unfGuild == " </h2>")
  541. {
  542. y:=Fontstylesize*3
  543. x:=-Fontstylesize*4
  544. Color:=resistances.Thrust.2
  545. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  546. %TTG%(G, "Thrust", Options , Font, Width, Height)
  547.  
  548.  
  549. y:=Fontstylesize*4
  550. Color:=resistances.Crush.2
  551. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  552. %TTG%(G, "Crush", Options, Font, Width, Height)
  553.  
  554. y:=Fontstylesize*5
  555. Color:=resistances.Slash.2
  556. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  557. %TTG%(G, "Slash", Options, Font, Width, Height)
  558.  
  559. y:=Fontstylesize*3
  560. Color:=resistances.Heat.2
  561. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  562. %TTG%(G, "Heat",Options , Font, Width, Height)
  563.  
  564. y:=Fontstylesize*4
  565. Color:=resistances.Cold.2
  566. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  567. %TTG%(G, "Cold", Options , Font, Width, Height)
  568.  
  569. y:=Fontstylesize*5
  570. Color:=resistances.Matter.2
  571. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  572. %TTG%(G, "Matter", Options , Font, Width, Height)
  573.  
  574. Longest2:=Fontstylesize*4
  575. y:=Fontstylesize*3
  576. Color:=resistances.Energy.2
  577. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  578. %TTG%(G, "Energy", Options , Font, Width, Height)
  579. y:=Fontstylesize*4
  580. Color:=resistances.Spirit.2
  581. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  582. %TTG%(G, "Spirit", Options , Font, Width, Height)
  583.  
  584. y:=Fontstylesize*5
  585. Color:=resistances.Body.2
  586. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  587. %TTG%(G, "Body", Options , Font, Width, Height)
  588. }
  589. Else
  590. {
  591. y:=Fontstylesize*4
  592. x:=-Fontstylesize*4
  593. Color:=resistances.Thrust.2
  594. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  595. %TTG%(G, "Thrust", Options , Font, Width, Height)
  596.  
  597.  
  598. y:=Fontstylesize*5
  599. Color:=resistances.Crush.2
  600. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  601. %TTG%(G, "Crush", Options, Font, Width, Height)
  602.  
  603. y:=Fontstylesize*6
  604. Color:=resistances.Slash.2
  605. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  606. %TTG%(G, "Slash", Options, Font, Width, Height)
  607.  
  608. y:=Fontstylesize*4
  609. Color:=resistances.Heat.2
  610. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  611. %TTG%(G, "Heat",Options , Font, Width, Height)
  612.  
  613. y:=Fontstylesize*5
  614. Color:=resistances.Cold.2
  615. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  616. %TTG%(G, "Cold", Options , Font, Width, Height)
  617.  
  618. y:=Fontstylesize*6
  619. Color:=resistances.Matter.2
  620. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  621. %TTG%(G, "Matter", Options , Font, Width, Height)
  622.  
  623. Longest2:=Fontstylesize*4
  624. y:=Fontstylesize*4
  625. Color:=resistances.Energy.2
  626. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  627. %TTG%(G, "Energy", Options , Font, Width, Height)
  628.  
  629. y:=Fontstylesize*5
  630. Color:=resistances.Spirit.2
  631. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  632. %TTG%(G, "Spirit", Options , Font, Width, Height)
  633.  
  634. y:=Fontstylesize*6
  635. Color:=resistances.Body.2
  636. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  637. %TTG%(G, "Body", Options , Font, Width, Height)
  638. }
  639.  
  640. UpdateLayeredWindow(hwnd1, hdc, targetwindowx,targetwindowy, Width, Height)
  641. }
  642.  
  643. If (filesize>40000)
  644. {
  645. Filedelete, % chatLog
  646. FileAppend , , chatLog
  647. FileGetSize, filesize, %chatLog%
  648. oldsize:=filesize
  649. }
  650.  
  651. ;clearing variables to free memory
  652. unfName :=
  653. unfGuild :=
  654. unfClass :=
  655. unfLevel :=
  656. unfRankLevel :=
  657. unfRace :=
  658. unfRankName :=
  659. charName :=
  660. unfGuild1 :=
  661. unfGuild2 :=
  662. unfGuild3 :=
  663. charGuild :=
  664. charClass :=
  665. charLevel :=
  666. unfRankLevel1 :=
  667. charRankLevel :=
  668. charRace :=
  669. charRankName :=
  670. lines:=
  671. resistances:=
  672. columns :=
  673. ; end clearing
  674. return
  675. }
  676. return
  677.  
  678. ;--------------------------------------config gui 2
  679. config:
  680. IniRead, start, %config%, KEYS, start
  681. IniRead, exit, %config%, KEYS, exit
  682. IniRead, configkey, %config%, KEYS, configkey
  683. IniRead, chatlogkey, %config%, KEYS, chatlogkey
  684. IniRead, chatLog, %config%, CHATLOG, file
  685. IniRead, main, %config%, WINDOW POSITION, main
  686. IniRead, relative, %config%, options, relative , 0
  687. IniRead, Resist1, %config%, options, Resist1
  688. IniRead, Resist2, %config%, options, Resist2
  689. IniRead, Resist3, %config%, options,Resist3 , 0
  690. IniRead, dropshadow, %config%,options,dropshadow
  691. IniRead, Fontstylefont, %config%, options, Fontstylefont
  692. IniRead, Fontstylesize, %config%, options, Fontstylesize
  693. IniRead, boldhighlight, %config%, OPTIONS, boldhighlight
  694. Hotkey, ~LButton, daoc, off
  695. Hotkey, %start%, start, off
  696. Hotkey, %exit%, escape, off
  697. Hotkey, %configkey%, config, off
  698. gui,3: hide
  699. gui,1: hide
  700. Gui,2: +e0x20 +LastFound
  701. Gui,2: Add, Tab3, x0 y5 w619 h341 -wrap, Configuration| FAQ
  702. Gui,2: Font, Normal c1e91bb
  703. Gui,2: Add, Groupbox, x7 y32 w606 h95, [Scout] Instructions
  704. Gui,2: Font,
  705. Gui,2: Add, Text, x16 y51, 1) Select a hotkey to each of the variables. Note: Chatlog have to be an function key (F1-F12).
  706. Gui,2: Add, Text, x16 y+5, 2) Select the directory where your chat.log file is located. Typically this would be in:
  707. Gui,2: Add, Text, x30 y+5, C:\Users\USERNAME\Documents\Electronic Arts\Dark Age of Camelot
  708. Gui,2: Add, Text, x16 y+5, 3) Ingame, do /macro chatlog /chatlog, then do /qbind <bank> <slot> <qbar> and assign it to your selected Chatlog keybind.
  709. Gui,2: Font, Normal c1e91bb
  710. Gui,2: Add, Groupbox, x7 y+13 w143 h120, [Scout] Keybinds
  711. Gui,2: Font,
  712. Gui,2: Add, Text, x61 y155, Start Script
  713. Gui,2: Add, Text, x61 y+10, Chatlog (F1-F12)
  714. Gui,2: Add, Text, x61 y+10, Configurations
  715. Gui,2: Add, Text, x61 y+10, Exit
  716. Gui,2: Font, Normal c1e91bb
  717. Gui,2: Add, Groupbox, x159 y131 w164 h120, [Scout] Options
  718. Gui,2: Font,
  719. Gui,2: Add, Checkbox, x165 y155 Checked%relative%, Use relative realm colors
  720. Gui,2: Font, Normal c1e91bb
  721. Gui,2: Add, Text, x311 y155, ?
  722. Gui,2: Font,
  723. Gui,2: Add, Radio, x165 y+10 gCheck vResist1, Show melee resistances
  724. Gui,2: Add, Radio, x165 y+10 gCheck vResist2, Show all resistances
  725. Gui,2: Add, Radio, x165 y+10 gCheck vResist3, No resists
  726. Gui,2: Font, Normal c1e91bb
  727. Gui,2: Add, Text, x311 y178,?
  728. Gui,2: Font,
  729. Gui,2: Font, Normal c1e91bb
  730. Gui,2: Add, Text, x311 y201,?
  731. Gui,2: Font,
  732. Gui,2: Font, Normal c1e91bb
  733. Gui,2: Add, Text, x311 y224,?
  734. Gui,2: Font,
  735. Gui,2: Add, Text, x307 y156 h14 w1 0x11
  736. Gui,2: Add, Text, x307 y179 h14 w1 0x11
  737. Gui,2: Add, Text, x307 y202 h14 w1 0x11
  738. Gui,2: Add, Text, x307 y225 h14 w1 0x11
  739. Gui,2: Add, Hotkey, x16 y152 w40 h19 vstart, %start%
  740. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vchatlogkey gchatlogged, %chatlogkey%
  741. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vconfigkey, %configkey%
  742. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vexit, %exit%
  743. Gui,2: Font, Normal c1e91bb
  744. Gui,2: Add, Groupbox, x332 y131 w281 h120, [Scout] Fontstyle
  745. Gui,2: Font
  746. Gui,2: Add, DropDownList, x338 y151 w100 vFontstylefont, Arial|Segoe UI|Trebuchet MS|Tahoma|Verdana|-----------------------|Bariol|Gotham|Montserrat|Noto Sans UI|Overpass|Ubuntu Mono
  747. Gui,2: Add, DropDownList, x338 y+2 w100 vFontstylesize, 12|13|14|15|16|17|18|19|20|21|22|23|24
  748. Gui,2: Add, Text, x442 y155, Fontname
  749. Gui,2: Add, Text, x442 y+10, Fontsize
  750. Gui,2: Add, Checkbox, x338 y+10 vdropshadow, Font with dropshadow
  751. Gui,2: Add, Checkbox, x338 y+10 vboldhighlight, Bold highlights
  752. Gui,2: Font, Normal c1e91bb
  753. Gui,2: Add, Groupbox, x7 y255 w606 h56, [Scout] Chatlog Directory
  754. Gui,2: Font,
  755. Gui,2: Add, Edit, x14 y276 w400 h19 +ReadOnly vChatlogLoc,%Chatlog%
  756. Gui,2: Add, Button, x416 y275 w20 h21 gchatlog, ...
  757. Gui,2: Add, Button, x7 y+22 w64 h19 gbuttonsave, Save
  758. Gui,2: Show, w619 h342 Center, DAoC Scout - Configuration
  759. Gui,2: Tab, 2
  760. Gui,2: Font, Normal c1e91bb
  761. Gui,2: Add, Groupbox, x7 y32 w606 h85, [Scout] About
  762. Gui,2: Font,
  763. Gui,2: Add, Text, x16 y51, The script uses the chat.log-file to determine your last target and looks the target up using the Phoenix Herald. It does not`nread or modIfy any game files, and all information is publicly available. Use at your own risk as the script has yet to be`napproved (or disapproved). Read more in the "About" Section.
  764. Gui,2: Add, Text, x16 y+5, The script is programmed in Autohotkey by Bysan and Teehehe with inspiration from Lerox.
  765. Gui,2: Font, Normal c1e91bb
  766. Gui,2: Add, Groupbox, x7 y122 w606 h59, [Scout] Contact
  767. Gui,2: Font,
  768. Gui,2: Add, Text, x16 y141, Errors and questions can be reported at:
  769. Gui,2: Font, underline
  770. Gui,2: Add, Text, x25 y+5 gOpenDiscord c0066cc,- Discord
  771. Gui,2: Font
  772. SetTimer, ToolTip
  773. var_Static9 = Target info color based on realm color. ; Put this at the top along with any others you want to try.
  774. var_Static10 = Shows Crush/Thrust/Slash resistances.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
  775. var_Static11 = Shows Crush/Thrust/Slash in addition to caster type vulnerabilities.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
  776. var_Static12 = Shows no resists.
  777. GuiControl,2: , Button5, %Resist1%
  778. GuiControl,2: , Button6, %Resist2%
  779. GuiControl,2: , Button7, %Resist3%
  780. GuiControl,2: , Button9, %dropshadow%
  781. GuiControl,2: , Button10, %boldhighlight%
  782. GuiControl,2: ChooseString, Fontstylefont, %Fontstylefont%
  783. GuiControl,2: ChooseString, Fontstylesize, %Fontstylesize%
  784. options3=s%Fontstylesize%
  785. ToolTip:
  786. MouseGetPos, , , id, control
  787. WinGetTitle, title, ahk_id %id%
  788. If title = DAoC Scout - Configuration
  789. {
  790. tmpVar := var_%control%
  791. ToolTip, %tmpVar%
  792. }
  793. Return
  794.  
  795. ;-------------------------------------web function
  796.  
  797. get(URL){
  798. ComObjError(false)
  799. r:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
  800. r.Open("GET", URL, true),r.Send(),r.WaitForResponse()
  801. return r.ResponseText
  802. }
  803. ;----------------------------------------------
  804.  
  805. ;--------------------------------------------readchatlog for target line
  806. FindName(chatLog){
  807. Loop, Read, % chatLog
  808. line_count := A_Index
  809. Loop, 30
  810. {
  811. lineIndex := (line_count-A_Index+1)
  812. FileReadLine, string, %chatLog%, %lineIndex%
  813. If RegExMatch(string, "You target \[(.*)\]\.", Output)
  814. Return Output1
  815. If lineIndex = 0
  816. Return
  817. }
  818. }
  819. ----------------------------------------
  820.  
  821. Check:
  822. gui, submit, nohide
  823. Return
  824. Quit:
  825. ExitApp
  826. OpenPayPal:
  827. Run "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TMRB3RCMXPGBN&source=url"
  828. Return
  829. OpenDiscord:
  830. Run "https://discord.gg/cARRWM3"
  831. Return
  832. OpenZIP:
  833. Run "https://dcscout.000webhostapp.com/DAoCScout/DAoCScout.zip"
  834. Return
  835. AboutClose:
  836. DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0x90000)
  837. Gui, About:Cancel
  838. Return
  839.  
  840.  
  841. ;----------------------------------exit
  842. Escape:
  843. ExitApp
  844. Return
  845.  
  846.  
  847. ;--------------------------close config window
  848. 2GuiClose:
  849. Gui, 2:destroy
  850. GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  851. Gui,1: Show, %main% w173 h78 , DAoC Scout
  852. Hotkey, %start%, start, on
  853. Hotkey, %exit%, escape, on
  854. Hotkey, %configkey%, config, on
  855. Return
  856.  
  857. ;-------------------------folder select
  858. chatlog:
  859. Gui,2: +OwnDialogs
  860. fileselectfolder, folder
  861. folder:= RegExReplace(Folder, "\\$")
  862. IniWrite, %CHATLOG%, %config%, CHATLOG, file
  863. GuiControl, , ChatlogLoc, %chatLog%
  864. Return
  865.  
  866. ;--------------------------------------save button
  867. buttonsave:
  868. GuiControlGet, start, 2:
  869. GuiControlGet, exit, 2:
  870. GuiControlGet, configkey, 2:
  871. GuiControlGet, chatlogkey, 2:
  872. GuiControlGet, relative, 2:
  873. GuiControlGet, Resist1, 2:
  874. GuiControlGet, Resist2, 2:
  875. GuiControlGet, Resist3, 2:
  876. GuiControlGet, dropshadow, 2:
  877. GuiControlget, boldhighlight, 2:
  878. GuiControlget, Fontstylefont, 2:
  879. GuiControlget, Fontstylesize, 2:
  880. ;saves KEYS from gui to ini
  881.  
  882. ;--------------------------checks for duplicate hotkey
  883. Keylist := [start, exit, configkey, chatlogkey]
  884. KEYS :={}
  885. For each, key in keylist
  886. {
  887. If !(KEYS.haskey(key))
  888. KEYS[key] := 1
  889. Else
  890. {
  891. MsgBox Error! Make sure the KEYS are unique!
  892. Return
  893. }
  894. }
  895.  
  896. ;-----------------------------------------
  897. IniWrite, %start%, %config%, KEYS, start
  898. IniWrite, %exit%, %config%, KEYS, exit
  899. IniWrite, %configkey%, %config%, KEYS, configkey
  900. IniWrite, %chatlogkey%, %config%, KEYS, chatlogkey
  901. IniWrite, %relative%, %config%, OPTIONS, relative
  902. IniWrite, %Resist1%, %config%, OPTIONS, Resist1
  903. IniWrite, %Resist2%, %config%, OPTIONS, Resist2
  904. IniWrite, %Resist3%, %config%, OPTIONS, Resist3
  905. IniWrite, %dropshadow%, %config%, OPTIONS, dropshadow
  906. IniWrite, %Fontstylefont%, %config%, OPTIONS, Fontstylefont
  907. IniWrite, %Fontstylesize%, %config%, OPTIONS, Fontstylesize
  908. IniWrite, %boldhighlight%, %config%, OPTIONS, boldhighlight
  909. Gui, 2:destroy
  910. ;------------------------------------------read ini file and assign KEYS
  911. IniRead, start, %config%, KEYS, start
  912. IniRead, exit, %config%, KEYS, exit
  913. IniRead, configkey, %config%, KEYS, configkey
  914. IniRead, chatlogkey, %config%, KEYS, chatlogkey
  915. IniRead, relative, %config%, OPTIONS, relative
  916. IniRead, Resist1, %config%, OPTIONS, Resist1
  917. IniRead, Resist2, %config%, OPTIONS, Resist2
  918. IniRead, Resist3, %config%, OPTIONS, Resist3
  919. IniRead, dropshadow, %config%,OPTIONS, dropshadow
  920. IniRead, boldhighlight, %config%,OPTIONS, boldhighlight
  921. IniRead, Fontstylefont, %config%, OPTIONS, Fontstylefont
  922. IniRead, Fontstylesize, %config%, OPTIONS, Fontstylesize
  923. options3=s%Fontstylesize%
  924. Font = %Fontstylefont%
  925. If !Gdip_FontFamilyCreate(Font)
  926. {
  927. MsgBox Font not installed setting to Arial
  928. IniWrite, Arial, %config%, OPTIONS, Fontstylefont
  929. IniRead, Fontstylefont, %config%, OPTIONS, Fontstylefont
  930. Font = %Fontstylefont%
  931. Gdip_FontFamilyCreate(Font)
  932. }
  933. ;-----------------------------------------------
  934. GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  935. Gui,1: Show, %main% w173 h78 , DAoC Scout
  936. Hotkey, %start%, start, on
  937. Hotkey, %exit%, escape, on
  938. Hotkey, %configkey%, config, on
  939. return
  940.  
  941. ;------------------------chatlog key must be a function key possible other KEYS add to list must be wrapped in to work {F1}
  942. ;{ins}{del} etc... https://www.autohotkey.com/docs/commands/Send.htm
  943. chatlogged:
  944. GuiControlGet chatlogkey, 2:
  945. keylist2:=["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]
  946. If !Contains(keylist2, chatlogkey)
  947. MsgBox Please enter a function key F1-F12.
  948.  
  949. Contains(obj, chatlogkey) {
  950. for i, val in obj {
  951. If(val = chatlogkey) {
  952. return true
  953. }
  954. }
  955. }
  956. Return
  957.  
  958. GetColor:
  959. alblist:=["Briton","Highlander","Avalonian","Saracen","Inconnu","Half Ogre"]
  960. hiblist:=["Lurikeen","Celt","Sylvan","Firbolg","Elf","Shar"]
  961. midlist:=["Troll","Dwarf","Kobold","Norseman","Valkyn","Frostalf"]
  962. Error:=["Error"]
  963. If Contains(alblist, charRace)
  964. targetColor = cFFd60000
  965. else If Contains(hiblist, charRace)
  966. targetColor = cFF37d600
  967. else If Contains(midlist, charRace)
  968. targetColor = cFF0056d6
  969. else
  970. targetColor=cFFb80af2
  971. Return
  972.  
  973.  
  974. WM_LBUTTONDOWN(){
  975. PostMessage, 0xA1, 2
  976. }
  977.  
  978.  
  979. MsgMonitor(wParam, lParam){
  980. X := lParam & 0xFFFF
  981. Y := lParam >> 16
  982. If (oX!=X)||(oY!=Y)
  983. {
  984. If (A_Gui=1)
  985. IniWrite, x%X% y%Y%,%config%,WINDOW POSITION,main
  986. If (A_Gui=2)
  987. IniWrite, x%X% y%Y%,%config%,WINDOW POSITION,config
  988. If (A_Gui=3)
  989. {
  990. If (x!=32768)
  991. {
  992. IniWrite, %X%,%config%,WINDOW POSITION,targetwindowx
  993. IniWrite, %Y%,%config%,WINDOW POSITION,targetwindowy
  994. }
  995. }
  996. oX:=%X%
  997. oY:=%Y%
  998. }
  999. IniRead, targetwindowx, %config%, WINDOW POSITION, targetwindowx
  1000. IniRead, targetwindowy, %config%, WINDOW POSITION, targetwindowy
  1001. }
  1002. Return
  1003.  
  1004. UpdateClose:
  1005. Gui, Update: Destroy
  1006. Gui,1: show, %main% w173 h78 , DAoC Scout
  1007. hotkey, %start%, on
  1008. Return
  1009.  
  1010. ButtonCheckForUpdates:
  1011. Check_ForUpdate(1, 1, "", "")
  1012.  
  1013. GetResist:
  1014. ;alb
  1015. If (charClass="Armsman")||(charClass="Paladin")||(charClass="Armswoman")
  1016. resistances:={Thrust:["Resistant","cffff0000"],Crush:["Vulnerable","cFF23fa00"],Slash:["Neutral","cffffffff"],Cold:["Vulnerable","cFF23fa00"],Energy:["Neutral","cffffffff"],Heat:["Resistant","cffff0000"],Matter:["Resistant","cffff0000"],Spirit:["Neutral","cffffffff"],Body:["Vulnerable","cFF23fa00"]}
  1017. If (charClass="Cleric")||(charClass="Mercenary")||(charClass="Minstrel")||(charClass="Reaver")
  1018. resistances:={Thrust:["Vulnerable","cFF23fa00"],Crush:["Resistant","cffff0000"],Slash:["Neutral","cffffffff"],Cold:["Neutral","cffffffff"],Energy:["Vulnerable","cFF23fa00"],Heat:[" Resistant","cffff0000"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Neutral","cffffffff"]}
  1019. If (charClass="Scout")
  1020. resistances:={Thrust:["Vulnerable","cFF23fa00"],Crush:["Resistant","cffff0000"],Slash:["Neutral","cffffffff"],Cold:["Vulnerable","cFF23fa00"],Energy:["Resistant","cffff0000"],Heat:["Resistant","cffff0000"],Matter:["Vulnerable","cFF23fa00"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1021. If (charClass="Friar")||(charClass="Infiltrator")
  1022. resistances:={Thrust:["Resistant","cffff0000"],Crush:["Vulnerable","cFF23fa00"],Slash:["Neutral","cffffffff"],Cold:["Resistant","cffff0000"],Energy:["Neutral","cffffffff"],Heat:[" Vulnerable","cFF23fa00"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1023. If (charClass="Theurgist")||(charClass="Wizard")||(charClass="Cabalist")||(charClass="Sorcerer")||(charClass="Necromancer")||(charClass="Sorceress")
  1024. resistances:={Thrust:["Neutral","cffffffff"],Crush:["Neutral","cffffffff"],Slash:["Neutral","cffffffff"],Cold:["Neutral","cffffffff"],Energy:["Resistant","cffff0000"],Heat:[" Neutral","cffffffff"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1025.  
  1026. ;hib
  1027. If (charClass="Champion")||(charClass="Druid")||(charClass="Hero")||(charClass="Heroine")||(charClass="Warden")
  1028. resistances:={Thrust:["Neutral","cffffffff"],Crush:["Resistant","cffff0000"],Slash:["Vulnerable","cFF23fa00"],Cold:["Vulnerable","cFF23fa00"],Energy:["Vulnerable","cFF23fa00"],Heat:[" Resistant","cffff0000"],Matter:["Resistant","cffff0000"],Spirit:["Neutral","cffffffff"],Body:["Neutral","cffffffff"]}
  1029. If (charClass="Bard")||(charClass="Blademaster")||(charClass="Ranger")
  1030. resistances:={Thrust:["Neutral","cffffffff"],Crush:["Vulnerable","cFF23fa00"],Slash:["Resistant","cffff0000"],Cold:["Vulnerable","cFF23fa00"],Energy:["Resistant","cffff0000"], Heat:["Resistant","cffff0000"],Matter:["Vulnerable","cFF23fa00"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1031. If (charClass="Nightshade")
  1032. resistances:={Thrust:["Neutral","cffffffff"],Crush:["Vulnerable","cFF23fa00"],Slash:["Resistant","cffff0000"],Cold:["Resistant","cffff0000"],Energy:["Neutral","cffffffff"],Heat:[ "Vulnerable","cFF23fa00"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1033. If (charClass="Animist")||(charClass="Enchanter")||(charClass="Mentalist")||(charClass="Eldritch")||(charClass="Valewalker")||(charClass="Enchantress")
  1034. resistances:={Thrust:["Neutral","cffffffff"],Crush:["Neutral","cffffffff"],Slash:["Neutral","cffffffff"],Cold:["Neutral","cffffffff"],Energy:["Resistant","cffff0000"],Heat:[" Neutral","cffffffff"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1035.  
  1036. ;mid
  1037. If(charClass="Healer")||(charClass="Shaman")||(charClass="Skald")||(charClass="Thane")||(charClass="Warrior")
  1038. resistances:={Thrust:["Vulnerable","cFF23fa00"],Crush:["Neutral","cffffffff"],Slash:["Resistant","cffff0000"],Cold:["Neutral","cffffffff"],Energy:["Vulnerable","cFF23fa00"],Heat:["Resistant","cffff0000"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Neutral","cffffffff"]}
  1039. If (charClass="Berserker")||(charClass="Hunter")||(charClass="Savage")
  1040. resistances:={Thrust:["Resistant","cffff0000"],Crush:["Neutral","cffffffff"],Slash:["Vulnerable","cFF23fa00"],Cold:["Vulnerable","cFF23fa00"],Energy:["Resistant","cffff0000"],Heat:[" Resistant","cffff0000"],Matter:["Vulnerable","cFF23fa00"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1041. If (charClass="Shadowblade")
  1042. resistances:={Thrust:["Resistant","cffff0000"],Crush:["Neutral","cffffffff"], Slash:["Vulnerable","cFF23fa00"],Cold:["Resistant","cffff0000"],Energy:["Neutral","cffffffff"],Heat:["Vulnerable","cFF23fa00"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1043. If (charClass="Bonedancer")||(charClass="Runemaster")||(charClass="Spiritmaster")
  1044. resistances:={Thrust:["Neutral","cffffffff"],Crush:["Neutral","cffffffff"],Slash:["Neutral","cffffffff"], Cold:["Neutral","cffffffff"],Energy:["Resistant","cffff0000"],Heat:["Neutral","cffffffff"],Matter:["Neutral","cffffffff"],Spirit:["Neutral","cffffffff"],Body:["Resistant","cffff0000"]}
  1045. Return
  1046.  
  1047. About:
  1048. IfNotEqual, FirstTimeA, No
  1049. {
  1050. Gui, About:-Caption +Border +LastFound
  1051. WinGet GUI_ID, ID
  1052. Gui, About:Color, ffffff, ffffff
  1053. Gui, About:Font, S10 c1e91bb Bold,verdana
  1054. Gui, About:Add, Text, x185 y27 w170 h20, DAoC Scout
  1055. Gui, About:Font, S10 CDefault Normal, Verdana
  1056. Gui, About:Add, Text, x185 y+3 w270, A Dark Age of Camelot tool that`nlooks up a targets information.
  1057. Gui, About:Add, Text, x183 y+5 w248
  1058. Gui, About:Font, S7 CDefault normal, Verdana
  1059. Gui, About:Add, Text, x185 y92 w410 h73,
  1060. (LTrim
  1061. The script reads your chat.log to find your
  1062. current target, looks the name up on the Phoenix
  1063. Herald and returns the essential information.
  1064. All information used by the script is publicly
  1065. available, and does not read or modIfy any
  1066. game files except for the chat.log.
  1067. )
  1068. Gui, About:Add, Text, x183 y+4 w248
  1069. Gui, About:Add, Text, x16 y174 w410 h24,
  1070. (LTrim
  1071. The script is programmed by Bysan and Teehehe in AHK. For feedback, bug reports and additional information, please visit:
  1072. )
  1073. Gui, About: Font, underline
  1074. Gui, About: Add, Text, x25 y+5 gOpenDiscord c0066cc,- Discord
  1075. Gui, About: Font
  1076. Gui, About:Add, Button, 0x8000 x362 y+1 w70 h21 gAboutClose, Close
  1077. Gui, About:Add, Picture, x17 y17 w150 h150, %A_ScriptDir%\Resources\LookupImg.png
  1078.  
  1079. FirstTimeA = No
  1080. }
  1081.  
  1082. height := 240
  1083. width := 435
  1084. Gui, About:Show, Hide h%height% w%width%, DAoC Scout
  1085. DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0xa0000)
  1086. return
  1087.  
  1088. Check_ForUpdate(_ReplaceCurrentScript = 1, _SuppressMsgBox = 0, _CallbackFunction = "", ByRef _Information = ""){
  1089.  
  1090. Retry_Count := 3 ;Retry count for If/when anything goes wrong
  1091.  
  1092. Random,Filler,10000000,99999999
  1093. Version_File := A_Temp . "\" . Filler . ".ini"
  1094. , Temp_FileName := A_Temp . "\" . Filler . ".tmp"
  1095. , VBS_FileName := A_Temp . "\" . Filler . ".vbs"
  1096.  
  1097. Loop,% Retry_Count
  1098. {
  1099. _Information := ""
  1100.  
  1101. UrlDownloadToFile,%Update_URL%,%Version_File%
  1102.  
  1103. IniRead,Version,%Version_File%,Info,Version,N/A
  1104.  
  1105. If (Version = "N/A"){
  1106. FileDelete,%Version_File%
  1107.  
  1108. If (A_Index = Retry_Count)
  1109. _Information .= "The version info file doesn't have a ""Version"" key in the ""Info"" section or the file can't be downloaded."
  1110. Else
  1111. Sleep,500
  1112.  
  1113. Continue
  1114. }
  1115.  
  1116. If (Version > Version_Number){
  1117. If (_SuppressMsgBox != 1 and _SuppressMsgBox != 3){
  1118. MsgBox,0x4,New version available,There is a new version of %Script_Name% available.`nCurrent version: %Version_Number%`nNew version: %Version%`n`nWould you like to download it now?
  1119. IfMsgBox,Yes
  1120. MsgBox_Result := 1
  1121. }
  1122.  
  1123. If (_SuppressMsgBox or MsgBox_Result){
  1124. IniRead,URL,%Version_File%,Info,URL,N/A
  1125.  
  1126. If (URL = "N/A")
  1127. _Information .= "The version info file doesn't have a valid URL key."
  1128. Else {
  1129. SplitPath,URL,,,Extension
  1130.  
  1131. If (Extension = "ahk" And A_AHKPath = "")
  1132. _Information .= "The new version of the script is an .ahk filetype and you do not have AutoHotKey installed on this computer.`r`nReplacing the current script is not supported."
  1133. Else If (Extension != "exe" And Extension != "ahk")
  1134. _Information .= "The new file to download is not an .EXE or an .AHK file type. Replacing the current script is not supported."
  1135. Else {
  1136. IniRead,MD5,%Version_File%,Info,MD5,N/A
  1137.  
  1138. Loop,% Retry_Count
  1139. {
  1140. UrlDownloadToFile,%URL%,%Temp_FileName%
  1141.  
  1142. IfExist,%Temp_FileName%
  1143. {
  1144. If (MD5 = "N/A"){
  1145. _Information .= "The version info file doesn't have a valid MD5 key."
  1146. , Success := True
  1147. Break
  1148. } Else {
  1149. Ptr := A_PtrSize ? "Ptr" : "UInt"
  1150. , H := DllCall("CreateFile",Ptr,&Temp_FileName,"UInt",0x80000000,"UInt",3,"UInt",0,"UInt",3,"UInt",0,"UInt",0)
  1151. , DllCall("GetFileSizeEx",Ptr,H,"Int64*",FileSize)
  1152. , FileSize := FileSize = -1 ? 0 : FileSize
  1153.  
  1154. If (FileSize != 0){
  1155. VarSetCapacity(Data,FileSize,0)
  1156. , DllCall("ReadFile",Ptr,H,Ptr,&Data,"UInt",FileSize,"UInt",0,"UInt",0)
  1157. , DllCall("CloseHandle",Ptr,H)
  1158. , VarSetCapacity(MD5_CTX,104,0)
  1159. , DllCall("advapi32\MD5Init",Ptr,&MD5_CTX)
  1160. , DllCall("advapi32\MD5Update",Ptr,&MD5_CTX,Ptr,&Data,"UInt",FileSize)
  1161. , DllCall("advapi32\MD5Final",Ptr,&MD5_CTX)
  1162.  
  1163. FileMD5 := ""
  1164. Loop % StrLen(Hex:="123456789ABCDEF0")
  1165. N := NumGet(MD5_CTX,87+A_Index,"Char"), FileMD5 .= SubStr(Hex,N>>4,1) . SubStr(Hex,N&15,1)
  1166.  
  1167. VarSetCapacity(Data,FileSize,0)
  1168. , VarSetCapacity(Data,0)
  1169.  
  1170. If (FileMD5 != MD5){
  1171. FileDelete,%Temp_FileName%
  1172.  
  1173. If (A_Index = Retry_Count)
  1174. _Information .= "The MD5 hash of the downloaded file does not match the MD5 hash in the version info file."
  1175. Else
  1176. Sleep,500
  1177.  
  1178. Continue
  1179. } Else
  1180. Success := True
  1181. } Else {
  1182. DllCall("CloseHandle",Ptr,H)
  1183. Success := True
  1184. }
  1185. }
  1186. } Else {
  1187. If (A_Index = Retry_Count)
  1188. _Information .= "Unable to download the latest version of the file from " . URL . "."
  1189. Else
  1190. Sleep,500
  1191. Continue
  1192. }
  1193. }
  1194. }
  1195. }
  1196. }
  1197. } Else
  1198. _Information .= "No update was found."
  1199.  
  1200. FileDelete,%Version_File%
  1201. Break
  1202. }
  1203.  
  1204. If (_ReplaceCurrentScript And Success){
  1205. SplitPath,URL,,,Extension
  1206. Process,Exist
  1207. MyPID := ErrorLevel
  1208.  
  1209. VBS_P1 =
  1210. (LTrim Join`r`n
  1211. On Error Resume Next
  1212. Set objShell = CreateObject("WScript.Shell")
  1213. objShell.Run "TaskKill /F /PID %MyPID%", 0, 1
  1214. Set objFSO = CreateObject("Scripting.FileSystemObject")
  1215. )
  1216.  
  1217. If (A_IsCompiled){
  1218. SplitPath,A_ScriptFullPath,,Dir,,Name
  1219. VBS_P2 =
  1220. (LTrim Join`r`n
  1221. Finished = False
  1222. Count = 0
  1223. Do Until (Finished = True Or Count = 5)
  1224. Err.Clear
  1225. objFSO.CopyFile "%Temp_FileName%", "%Dir%\%Name%.%Extension%", True
  1226. If (Err.Number = 0) then
  1227. Finished = True
  1228. objShell.Run """%Dir%\%Name%.%Extension%"""
  1229. Else
  1230. WScript.Sleep(1000)
  1231. Count = Count + 1
  1232. End If
  1233. Loop
  1234. objFSO.DeleteFile "%Temp_FileName%", True
  1235. )
  1236.  
  1237. Return_Val := Temp_FileName
  1238. } Else {
  1239. If (Extension = "ahk"){
  1240. FileMove,%Temp_FileName%,%A_ScriptFullPath%,1
  1241. If (Errorlevel)
  1242. _Information .= "Error (" . Errorlevel . ") unable to replace current script with the latest version."
  1243. Else {
  1244. VBS_P2 =
  1245. (LTrim Join`r`n
  1246. objShell.Run """%A_ScriptFullPath%"""
  1247. )
  1248.  
  1249. Return_Val := A_ScriptFullPath
  1250. }
  1251. } Else If (Extension = "exe"){
  1252. SplitPath,A_ScriptFullPath,,FDirectory,,FName
  1253. FileMove,%Temp_FileName%,%FDirectory%\%FName%.exe,1
  1254. ;FileDelete,%A_ScriptFullPath%
  1255.  
  1256. VBS_P2 =
  1257. (LTrim Join`r`n
  1258. objShell.Run """%FDirectory%\%FName%.exe"""
  1259. )
  1260.  
  1261. Return_Val := FDirectory . "\" . FName . ".exe"
  1262. } Else {
  1263. FileDelete,%Temp_FileName%
  1264. _Information .= "The downloaded file is not an .EXE or an .AHK file type. Replacing the current script is not supported."
  1265. }
  1266. }
  1267.  
  1268. VBS_P3 =
  1269. (LTrim Join`r`n
  1270. objFSO.DeleteFile "%VBS_FileName%", True
  1271. )
  1272.  
  1273. If (_SuppressMsgBox < 2)
  1274. {
  1275. If (InStr(VBS_P2, "Do Until (Finished = True Or Count = 5)"))
  1276. {
  1277. VBS_P3 .= "`r`nIf (Finished = False) Then"
  1278. VBS_P3 .= "`r`nWScript.Echo ""Update failed."""
  1279. VBS_P3 .= "`r`nElse"
  1280. If (Extension != "exe")
  1281. VBS_P3 .= "`r`nobjFSO.DeleteFile """ A_ScriptFullPath """"
  1282. VBS_P3 .= "`r`nWScript.Echo ""DAoC-Scout has been updated!"""
  1283. VBS_P3 .= "`r`nEnd If"
  1284. } Else
  1285. VBS_P3 .= "`r`nWScript.Echo ""DAoC-Scout has been updated!"""
  1286. }
  1287.  
  1288. FileDelete,%VBS_FileName%
  1289. FileAppend,%VBS_P1%`r`n%VBS_P2%`r`n%VBS_P3%,%VBS_FileName%
  1290.  
  1291. If (_CallbackFunction != ""){
  1292. If (IsFunc(_CallbackFunction))
  1293. %_CallbackFunction%()
  1294. Else
  1295. _Information .= "The callback function is not a valid function name."
  1296. }
  1297.  
  1298. RunWait,%VBS_FileName%,%A_Temp%,VBS_PID
  1299. Sleep,2000
  1300.  
  1301. Process,Close,%VBS_PID%
  1302. _Information := "Error (?) unable to replace current script with the latest version.`r`nPlease make sure your computer supports running .vbs scripts and that the script isn't running in a pipe."
  1303. }
  1304.  
  1305. _Information := _Information = "" ? "None" : _Information
  1306.  
  1307. Return Return_Val
  1308. }
  1309.  
  1310. MeasureText(Str, FontOpts = "", Fontstylefont = "") {
  1311. Static DT_FLAGS := 0x0520 ; DT_SINGLELINE = 0x20, DT_NOCLIP = 0x0100, DT_CALCRECT = 0x0400
  1312. Static WM_GETFONT := 0x31
  1313. Size := {}
  1314. Gui, New
  1315. If (FontOpts <> "") || (Fontstylefont <> "")
  1316. Gui, Font, %FontOpts%, %Fontstylefont%
  1317. Gui, Add, Text, hwndHWND
  1318. SendMessage, WM_GETFONT, 0, 0, , ahk_id %HWND%
  1319. HFONT := ErrorLevel
  1320. HDC := DllCall("User32.dll\GetDC", "Ptr", HWND, "Ptr")
  1321. DllCall("Gdi32.dll\SelectObject", "Ptr", HDC, "Ptr", HFONT)
  1322. VarSetCapacity(RECT, 16, 0)
  1323. DllCall("User32.dll\DrawText", "Ptr", HDC, "Str", Str, "Int", -1, "Ptr", &RECT, "UInt", DT_FLAGS)
  1324. DllCall("User32.dll\ReleaseDC", "Ptr", HWND, "Ptr", HDC)
  1325. Gui, Destroy
  1326. Size.W := NumGet(RECT, 8, "Int")
  1327. Size.H := NumGet(RECT, 12, "Int")
  1328. Return Size, W
  1329. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement