Advertisement
Guest User

Untitled

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