Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.76 KB | None | 0 0
  1. #singleinstance, force
  2. SetTitleMatchMode,2
  3. DetectHiddenWindows, On
  4. #noenv
  5. #include %A_ScriptDir%\Resources\Gdip_All.ahk
  6. #include %A_ScriptDir%\Resources\Gdip_Ext.ahk
  7. SetWorkingDir %A_ScriptDir%
  8. CoordMode, Mouse, Screen
  9. Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
  10. #Persistent ; Stay open in background
  11. counter:=0
  12. ; --- Global variables
  13. global chatlogkey, start, widthList, exit, configkey,config, title,gui3_x,gui3_y, newpos, charName,vText, charRace,targetwindowx, targetwindowy
  14. toggle:=1
  15. title:=Dark Age of Camelot
  16. PH:="<h1>Phoenix Herald</h1>"
  17. config:="config.ini"
  18. file2=\Electronic Arts\Dark Age of Camelot\
  19. file=chat.log
  20. cLog := file2 file
  21.  
  22. ; --- Tray
  23. Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
  24. Menu, Tray, NoStandard
  25. Menu, Tray, Tip, DAoC Scout
  26. Menu, Tray, Add, Run, start
  27. Menu, Tray, Add, Config, config
  28. Menu, Tray, Add ; Separator
  29. Menu, Tray, Add, About, About
  30. Menu, Tray, Add, Donate, OpenPayPal
  31. Menu, Tray, Add ; Separator
  32. Menu, Tray, Add,Quit,Quit
  33. Menu, Tray, Icon, Run, %A_ScriptDir%\Resources\Lookup.ico
  34. Menu, Tray, Icon, Config, %A_ScriptDir%\Resources\Config.ico
  35.  
  36.  
  37. ;--- Check for configini and creates if not one
  38. ifnotexist,%config%
  39. {
  40. msgbox Could not find config file generating new one
  41. IniWrite, F2, %config% ,Keys, start
  42. IniWrite,Escape, %config% ,Keys, exit
  43. IniWrite, F3, %config% ,Keys, configkey
  44. IniWrite, F4, %config% ,Keys, chatlogkey
  45. iniwrite, x0 y0,%config%,window position,main
  46. iniwrite, 1,%config%,window position,targetwindowx
  47. iniwrite, 1,%config%,window position,targetwindowy
  48. IniWrite, %A_MyDocuments%%file2%%file%,%config%, chatlog, file
  49. IniWrite, 1, %config%, options, relative
  50. IniWrite, 1, %config%, options, Resist1
  51. IniWrite, 0, %config%, options, Resist2
  52. IniWrite, 0, %config%, options, dropshadow
  53. IniWrite, Arial, %config%, options, Fontstylefont
  54. IniWrite, 16, %config%, options, Fontstylesize
  55. Iniwrite, 0, %config%, options, dropshadow
  56. While ! FileExist( config )
  57. {
  58. Sleep 250
  59. }
  60. gosub config
  61. }
  62.  
  63. if (Resist1= 0 and Resist3=0)
  64. AllResist:=2
  65. If (Resist2=0 and Resist3=0)
  66. AllResist:=1
  67. If (Resist1=0 and Resist2=0)
  68. AllResist:=3
  69. ;--- Read ini file and assign keys
  70. IniRead, start, %config%, Keys, start
  71. IniRead, exit, %config%, Keys, exit
  72. IniRead, configkey, %config%, Keys, configkey
  73. IniRead, chatlogkey, %config%, Keys, chatlogkey
  74. IniRead, chatLog, %config%, chatlog, file
  75. IniRead, main, %config%, window position, main
  76. IniRead, targetwindowx, %config%, window position, targetwindowx
  77. IniRead, targetwindowy, %config%, window position, targetwindowy
  78. IniRead, relative, %config%, options, relative , 0
  79. IniRead, Resist1, %config%, options,Resist1 , 0
  80. IniRead, Resist2, %config%, options,Resist2 , 0
  81. Iniread, dropshadow, %config%,options,dropshadow
  82. Iniread, Fontstylefont, %config%, options, Fontstylefont
  83. Iniread, Fontstylesize, %config%, options, Fontstylesize
  84. if (Resist1= 0 and Resist3=0)
  85. AllResist:=2
  86. If (Resist2=0 and Resist3=0)
  87. AllResist:=1
  88. If (Resist1=0 and Resist2=0)
  89. AllResist:=3
  90. Hotkey, ~LButton, daoc, off
  91. Hotkey, %start%, start, on
  92. Hotkey, %exit%, escape, on
  93. Hotkey, %configkey%, config, on
  94. OnMessage(0x03, "MsgMonitor")
  95. OnMessage(0x201, "WM_LBUTTONDOWN")
  96. If !pToken := Gdip_Startup()
  97. ExitApp
  98.  
  99. Width:=800, height:=800
  100. Gui, 3: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
  101. Gui, 3: Show, NA
  102. hwnd1 := WinExist()
  103. hbm := CreateDIBSection(Width, Height)
  104. hdc := CreateCompatibleDC()
  105. obm := SelectObject(hdc, hbm)
  106. G := Gdip_GraphicsFromHDC(hdc)
  107. Gdip_SetSmoothingMode(G, 4)
  108. if (dropshadow=0)
  109. {
  110. pBrush := Gdip_BrushCreateSolid(0x590000)
  111. Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
  112. Gdip_DeleteBrush(pBrush)
  113. }
  114. Font = %Fontstylefont%
  115. If !Gdip_FontFamilyCreate(Font)
  116. {
  117. msgbox Font not installed setting to Arial
  118. IniWrite, Arial, %config%, options, Fontstylefont
  119. Iniread, Fontstylefont, %config%, options, Fontstylefont
  120. Font = %Fontstylefont%
  121. Gdip_FontFamilyCreate(Font)
  122. }
  123. Gui,1: +e0x20 +AlwaysOnTop +LastFound -SysMenu
  124. Gui,1: Color, ffffff, ffffff
  125. Gui,1: Font, Normal c1e91bb
  126. Gui,1: Add, Groupbox, x7 y7 h65 w160, [Scout] Quickstart
  127. Gui,1: Font, Normal s8 c000000, Verdana
  128. Gui 1: Add,Text, x15 y24 BackgroundTrans vtext4 GuiMove w200,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  129. Gui,1: show, %main% w173 h78 , DAoC Scout
  130. return
  131.  
  132. ;--- Start key pushed
  133. start:
  134. gui,1: hide
  135. ;gui,3:show
  136. Hotkey, ~LButton, toggle
  137.  
  138. IniRead, chatlogkey, %config%, Keys, chatlogkey
  139. Iniread, targetwindowx, %config%, window position, targetwindowx
  140. Iniread, targetwindowy, %config%, window position, targetwindowy
  141. options3=s%Fontstylesize%
  142. ifwinexist,ahk_exe game.dll
  143. {
  144. winactivate
  145. winwaitactive, %title%
  146. }
  147. else
  148. winwaitactive, %title%
  149.  
  150. return
  151.  
  152. daoc:
  153. if winactive("ahk_exe game.dll")
  154. {
  155. gui,3:show, NA
  156. if (dropshadow=1)
  157. {
  158. hbm := CreateDIBSection(Width, Height)
  159. hdc := CreateCompatibleDC()
  160. obm := SelectObject(hdc, hbm)
  161. G := Gdip_GraphicsFromHDC(hdc)
  162. Gdip_SetSmoothingMode(G, 4)
  163. pBrush := Gdip_BrushCreateSolid(0x00000000)
  164. Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
  165. }
  166. counter++
  167. if (x!=1)
  168. send {%chatlogkey%}
  169. sleep 500
  170. send {%chatlogkey%}
  171. lastChar := FindName(chatlog)
  172.  
  173. ; --- Parse Herald
  174. document:= ComObjCreate("HTMLfile")
  175. page1:=get("https://herald.playphoenix.online/c/"+lastChar)
  176.  
  177. lines := StrSplit(page1, "`n")
  178. columns := []
  179. for index, value in lines
  180. columns.Insert(StrSplit(value, "`t"))
  181.  
  182. unfName := columns[49][1]
  183. unfGuild := columns[51][1]
  184. unfClass := columns[53][1]
  185. unfLevel := columns[57][1]
  186. unfRankLevel := columns[61][1]
  187. unfRace := columns[65][1]
  188. unfRankName := columns[67][1]
  189.  
  190. charName := RegExReplace(unfName,"\x20{2,}"," ")""
  191. unfGuild1 := RegExReplace(unfGuild,"<.*?>")
  192. unfGuild2 := RegExReplace(unfGuild1,"(&lt)")
  193. unfGuild3 := RegExReplace(unfGuild2,"(&gt)")
  194. charGuild := RegExReplace(unfGuild3,"\x20{2,}"," ")""
  195. charClass := RegExReplace(unfClass,"\x20{2,}"," ")""
  196. charLevel := RegExReplace(unfLevel,"\x20{2,}"," ")""
  197. unfRankLevel1 := RegExReplace(unfRankLevel,"\x20{2,}"," ")""
  198. charRankLevel := RegExReplace(unfRankLevel1,"ealm Rank ","")
  199. charRace := RegExReplace(unfRace,"\x20{2,}"," ")""
  200. charRankName := RegExReplace(unfRankName,"\x20{2,}"," ")""
  201.  
  202. StringTrimLeft, charName, charName, 1
  203. StringTrimLeft, charClass, charClass, 1
  204. StringTrimLeft, charLevel, charLevel, 1
  205. StringTrimLeft, charRankLevel, charRankLevel, 1
  206. StringTrimLeft, charRace, charRace, 1
  207. StringTrimLeft, charRankName, charRankName, 1
  208. StringTrimRight, charGuild, charGuild, 1
  209.  
  210. if (relative=1)
  211. gosub GetColor
  212. else
  213. targetColor:="cFFFFFFFF"
  214.  
  215. If (dropshadow=0)
  216. {
  217. TTG:="Gdip_TextToGraphics"
  218. options2:=
  219. }
  220. if (dropshadow=1)
  221. {
  222. TTG:="Gdip_TextToGraphics2"
  223. options2:="ow1 ocFF000000"
  224. }
  225.  
  226. if (dropshadow=1)
  227. {
  228. hbm := CreateDIBSection(Width, Height)
  229. hdc := CreateCompatibleDC()
  230. obm := SelectObject(hdc, hbm)
  231. G := Gdip_GraphicsFromHDC(hdc)
  232. Gdip_SetSmoothingMode(G, 4)
  233. pBrush := Gdip_BrushCreateSolid(0x00000000)
  234. Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
  235. }
  236.  
  237. if (dropshadow=0)
  238. {
  239. G := Gdip_GraphicsFromHDC(hdc)
  240. Gdip_SetCompositingMode(G, 1)
  241. pBrush := Gdip_BrushCreateSolid(0x00000000) ; fully transparent brush 'eraser'
  242. Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
  243. Gdip_DeleteBrush(pBrush)
  244. Gdip_SetCompositingMode(G, 0)
  245. Gdip_SetSmoothingMode(G, 4)
  246. pBrush := Gdip_BrushCreateSolid(0x00000000)
  247. Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
  248. Gdip_DeleteBrush(pBrush)
  249. }
  250. nameLength := StrLen(charName)
  251. guildLength:=StrLen(charGuild)
  252. IfnotInString, page1, %PH%
  253. {
  254.  
  255. List = %charName%|<charGuild>|%charLevel%|%charClass% + %charRace%
  256. Longest:=0
  257. Loop, Parse, List, |
  258. {
  259. FontName:=Fontstylefont
  260. Size:=Fontstylesize
  261. T := MeasureText(a_loopfield, "" . Size, FontName)
  262. If (T.W > Longest)
  263. Longest:=T.W
  264. }
  265. Longest:=Longest+(Fontstylesize*3.5)
  266.  
  267. Font:=Fontstylefont
  268.  
  269. y:=0
  270. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  271. %TTG%(G, charName , Options , Font, Width, Height)
  272.  
  273.  
  274. y:=Fontstylesize
  275. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  276. %TTG%(G, "<" charGuild ">" , Options , Font, Width, Height)
  277.  
  278.  
  279. y:=Fontstylesize*2
  280. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  281. %TTG%(G, charLevel " " charRankLevel , Options , Font, Width, Height)
  282.  
  283.  
  284.  
  285. y:=Fontstylesize*3
  286. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  287. %TTG%(G,charRace " " charClass, Options , Font, Width, Height)
  288.  
  289.  
  290. gosub getresist
  291. if (AllResist=1)
  292. {
  293.  
  294. y:=Fontstylesize*4.2
  295. x:=-Fontstylesize*4
  296. Color:=resistances.Thrust.2
  297. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  298. %TTG%(G, "Thrust", Options , Font, Width, Height)
  299.  
  300.  
  301. y:=Fontstylesize*4.2
  302. Color:=resistances.Crush.2
  303. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  304. %TTG%(G, "Crush", Options, Font, Width, Height)
  305.  
  306. Longest2:=Fontstylesize*4
  307. y:=Fontstylesize*4.2
  308. Color:=resistances.Slash.2
  309. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  310. %TTG%(G, "Slash", Options, Font, Width, Height)
  311.  
  312. }
  313.  
  314. if (AllResist=2)
  315. {
  316. y:=Fontstylesize*4
  317. x:=-Fontstylesize*4
  318. Color:=resistances.Thrust.2
  319. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  320. %TTG%(G, "Thrust", Options , Font, Width, Height)
  321.  
  322.  
  323. y:=Fontstylesize*5
  324. Color:=resistances.Crush.2
  325. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  326. %TTG%(G, "Crush", Options, Font, Width, Height)
  327.  
  328. y:=Fontstylesize*6
  329. Color:=resistances.Slash.2
  330. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  331. %TTG%(G, "Slash", Options, Font, Width, Height)
  332.  
  333. ;these need to be fixed visually
  334.  
  335.  
  336. y:=Fontstylesize*4
  337. Color:=resistances.Heat.2
  338. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  339. %TTG%(G, "Heat",Options , Font, Width, Height)
  340.  
  341. y:=Fontstylesize*5
  342. Color:=resistances.Cold.2
  343. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  344. %TTG%(G, "Cold", Options , Font, Width, Height)
  345.  
  346. y:=Fontstylesize*6
  347. Color:=resistances.Matter.2
  348. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  349. %TTG%(G, "Matter", Options , Font, Width, Height)
  350. Longest2:=0
  351.  
  352. Longest2:=Fontstylesize*4
  353. y:=Fontstylesize*4
  354. Color:=resistances.Energy.2
  355. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  356. %TTG%(G, "Energy", Options , Font, Width, Height)
  357.  
  358. y:=Fontstylesize*5
  359. Color:=resistances.Spirit.2
  360. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  361. %TTG%(G, "Spirit", Options , Font, Width, Height)
  362.  
  363. y:=Fontstylesize*6
  364. Color:=resistances.Body.2
  365. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  366. %TTG%(G, "Body", Options , Font, Width, Height)
  367. Longest2:=0
  368. }
  369.  
  370. if (AllResist=3)
  371. {
  372. }
  373.  
  374. UpdateLayeredWindow(hwnd1, hdc, targetwindowx,targetwindowy, Width, Height)
  375. }
  376.  
  377.  
  378. if (dropshadow=1)
  379. {
  380. SelectObject(hdc, obm)
  381. DeleteObject(hbm)
  382. DeleteDC(hdc)
  383. Gdip_DeleteGraphics(G)
  384. hbm := CreateDIBSection(Width, Height)
  385. hdc := CreateCompatibleDC()
  386. obm := SelectObject(hdc, hbm)
  387. G := Gdip_GraphicsFromHDC(hdc)
  388. Gdip_SetSmoothingMode(G, 4)
  389. pBrush := Gdip_BrushCreateSolid(0x00000000)
  390. Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
  391. }
  392. return
  393. }
  394. return
  395.  
  396.  
  397. ;--------------------------------------------
  398.  
  399.  
  400. ;--------------------------------------config gui 2
  401. config:
  402. IniRead, start, %config%, Keys, start
  403. IniRead, exit, %config%, Keys, exit
  404. IniRead, configkey, %config%, Keys, configkey
  405. IniRead, chatlogkey, %config%, Keys, chatlogkey
  406. IniRead, chatLog, %config%, chatlog, file
  407. IniRead, main, %config%, window position, main
  408. IniRead, relative, %config%, options, relative , 0
  409. IniRead, Resist1, %config%, options, Resist1
  410. IniRead, Resist2, %config%, options, Resist2
  411. Iniread, dropshadow, %config%,options,dropshadow
  412. Iniread, Fontstylefont, %config%, options, Fontstylefont
  413. Iniread, Fontstylesize, %config%, options, Fontstylesize
  414. Hotkey, ~LButton, daoc, off
  415. Hotkey, %start%, start, off
  416. Hotkey, %exit%, escape, off
  417. Hotkey, %configkey%, config, off
  418. gui,3:hide
  419. gui,1: hide
  420. Gui,2: +e0x20 +LastFound
  421. Gui,2: Add, Tab3, x0 y5 w619 h341 -wrap, Configuration| FAQ
  422. Gui,2: Font, Normal c1e91bb
  423. Gui,2: Add, Groupbox, x7 y32 w606 h95, [Scout] Instructions
  424. Gui,2: Font,
  425. 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).
  426. Gui,2: Add, Text, x16 y+5, 2) Select the directory where your chat.log file is located. Typically this would be in:
  427. Gui,2: Add, Text, x30 y+5, C:\Users\USERNAME\Documents\Electronic Arts\Dark Age of Camelot
  428. 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.
  429. Gui,2: Font, Normal c1e91bb
  430. Gui,2: Add, Groupbox, x7 y+13 w143 h120, [Scout] Keybinds
  431. Gui,2: Font,
  432. Gui,2: Add, Text, x61 y155, Start Script
  433. Gui,2: Add, Text, x61 y+10, Chatlog (F1-F12)
  434. Gui,2: Add, Text, x61 y+10, Configurations
  435. Gui,2: Add, Text, x61 y+10, Exit
  436. Gui,2: Font, Normal c1e91bb
  437. Gui,2: Add, Groupbox, x159 y131 w164 h120, [Scout] Options
  438. Gui,2: Font,
  439. Gui,2: Add, Checkbox, x165 y155 Checked%relative%, Use relative realm colors
  440. Gui,2: Font, Normal c1e91bb
  441. Gui,2: Add, Text, x311 y155, ?
  442. Gui,2: Font,
  443. Gui,2: Add, Radio, x165 y+10 gCheck vResist1, Show melee resistances
  444. Gui,2: Add, Radio, x165 y+10 gCheck vResist2, Show all resistances
  445. Gui,2: Add, Radio, x165 y+10 gCheck vResist3, No resists
  446. Gui,2: Font, Normal c1e91bb
  447. Gui,2: Add, Text, x311 y178,?
  448. Gui,2: Font,
  449. Gui,2: Font, Normal c1e91bb
  450. Gui,2: Add, Text, x311 y201,?
  451. Gui,2: Font,
  452. Gui,2: Font, Normal c1e91bb
  453. Gui,2: Add, Text, x311 y224,?
  454. Gui,2: Font,
  455. Gui,2: Add, Text, x307 y156 h14 w1 0x11
  456. Gui,2: Add, Text, x307 y179 h14 w1 0x11
  457. Gui,2: Add, Text, x307 y202 h14 w1 0x11
  458. Gui,2: Add, Text, x307 y225 h14 w1 0x11
  459. Gui,2: Add, Hotkey, x16 y152 w40 h19 vstart, %start%
  460. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vchatlogkey gchatlogged, %chatlogkey%
  461. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vconfigkey, %configkey%
  462. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vexit, %exit%
  463. Gui,2: Font, Normal c1e91bb
  464. Gui,2: Add, Groupbox, x332 y131 w281 h120, [Scout] Fontstyle
  465. Gui,2: Font
  466. Gui,2: Add, DropDownList, x338 y151 w100 vFontstylefont, Arial|Segoe UI|Trebuchet MS|Tahoma|Verdana|Overpass|-----------------------|Noto Sans UI|Bariol|Gotham|Noto Sans UI|Ubuntu Mono
  467. Gui,2: Add, DropDownList, x338 y+2 w100 vFontstylesize, 12|13|14|15|16|17|18|19|20|21|22|23|24
  468. Gui,2: Add, Text, x442 y155, Fontname
  469. Gui,2: Add, Text, x442 y+10, Fontsize
  470. Gui,2: Add, Checkbox, x338 y+10 vdropshadow, Font with dropshadow
  471. Gui,2: Font, Normal c1e91bb
  472. Gui,2: Add, Groupbox, x7 y255 w606 h56, [Scout] Chatlog Directory
  473. Gui,2: Font,
  474. Gui,2: Add, Edit, x14 y276 w400 h19 +ReadOnly vChatlogLoc,%Chatlog%
  475. Gui,2: Add, Button, x416 y275 w20 h21 gchatlog, ...
  476. Gui,2: Add, Button, x7 y+22 w64 h19 gbuttonsave, Save
  477. Gui,2: Show, w619 h342 Center, DAoC Scout - Configuration
  478. Gui,2: Tab, 2
  479. Gui,2: Font, Normal c1e91bb
  480. Gui,2: Add, Groupbox, x7 y32 w606 h85, [Scout] About
  481. Gui,2: Font,
  482. 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.
  483. Gui,2: Add, Text, x16 y+5, The script is programmed in Autohotkey by Bysan and Teehehe with inspiration from Lerox.
  484. Gui,2: Font, Normal c1e91bb
  485. Gui,2: Add, Groupbox, x7 y122 w606 h59, [Scout] Contact
  486. Gui,2: Font,
  487. Gui,2: Add, Text, x16 y141, Errors and questions can be reported at:
  488. Gui,2: Add, Link, x25 y+5 cBlue BackgroundTrans, <a href="https://discord.gg/TqX3b3G">- Discord</a>
  489. SetTimer, ToolTip
  490. var_Static9 = Target info color based on realm color. ; Put this at the top along with any others you want to try.
  491. var_Static10 = Shows Crush/Thrust/Slash resistances.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
  492. var_Static11 = Shows Crush/Thrust/Slash in addition to caster type vulnerabilities.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
  493. var_Static12 = Shows no resists.
  494. GuiControl,2: , Button5, %Resist1%
  495. GuiControl,2: , Button6, %Resist2%
  496. GuiControl,2: , Button7, %dropshadow%
  497. GuiControl,2: ChooseString, Fontstylefont, %Fontstylefont%
  498. GuiControl,2: ChooseString, Fontstylesize, %Fontstylesize%
  499. options3=s%Fontstylesize%
  500. ToolTip:
  501. MouseGetPos, , , id, control
  502. WinGetTitle, title, ahk_id %id%
  503. if title = DAoC Scout - Configuration
  504. {
  505. tmpVar := var_%control%
  506. ToolTip, %tmpVar%
  507. }
  508. return
  509. Return
  510.  
  511. ;-------------------------------------web function
  512.  
  513. get(URL){
  514. ComObjError(false)
  515. r:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
  516. r.Open("GET", URL, true),r.Send(),r.WaitForResponse()
  517. return r.ResponseText
  518. }
  519. ;----------------------------------------------
  520.  
  521. ;--------------------------------------------readchatlog for target line
  522. FileReadLineFromBottom(chatLog, Offset)
  523. {
  524. FileRead f1, % chatLog
  525. StringReplace f1, f1, `n, `n, UseErrorLevel
  526. FileReadLine Line, % chatLog, ErrorLevel + 1 - Offset
  527. Filedelete, % chatLog
  528. if RegExMatch(Line, "You target \[(.*)\]\.", Output)
  529. Return Output1
  530. }
  531.  
  532. FindName(cLog)
  533. {
  534. Loop, Read, % cLog
  535. line_count := A_Index
  536. Loop,
  537. {
  538. lineIndex := (line_count-A_Index+1)
  539. FileReadLine, string, %cLog%, %lineIndex%
  540. if RegExMatch(string, "You target \[(.*)\]\.", Output)
  541. Return Output1
  542. if lineIndex = 0
  543. Break
  544. }
  545. }
  546. ----------------------------------------
  547.  
  548. Check:
  549. gui, submit, nohide
  550. if (Resist1= 0 and Resist3=0)
  551. AllResist:=2
  552. If (Resist2=0 and Resist3=0)
  553. AllResist:=1
  554. If (Resist1=0 and Resist2=0)
  555. AllResist:=3
  556. Return
  557.  
  558. ;---------------------------------------gui stuff
  559. uiMove:
  560. PostMessage, 0xA1, 2,,, A
  561. Return
  562.  
  563. ;--- Tray2
  564. Quit:
  565. ExitApp
  566. Console:
  567. ListLines
  568. Return
  569. OpenPayPal:
  570. Run "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TMRB3RCMXPGBN&source=url"
  571. Return
  572. AboutClose:
  573. DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0x90000)
  574. Gui, About:Cancel
  575. Return
  576.  
  577.  
  578. ;----------------------------------exit
  579. escape:
  580. exitapp
  581. return
  582.  
  583.  
  584. ;--------------------------close config window
  585. 2GuiClose:
  586. gui, 2:destroy
  587. GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  588. gui, 1:show
  589. Hotkey, %start%, start, on
  590. Hotkey, %exit%, escape, on
  591. Hotkey, %configkey%, config, on
  592. return
  593.  
  594. ;-------------------------folder select
  595. chatlog:
  596. Gui,2: +OwnDialogs
  597. fileselectfolder, folder
  598. folder:= RegExReplace(Folder, "\\$")
  599. chatlog = %folder%\%file%
  600. Iniwrite, %chatlog%, %config%, chatlog, file
  601. GuiControl, , ChatlogLoc, %chatLog%
  602. return
  603.  
  604.  
  605. ;--------------------------------------save button
  606. buttonsave:
  607. GuiControlGet, start, 2:
  608. GuiControlGet, exit, 2:
  609. GuiControlGet, configkey, 2:
  610. GuiControlGet, chatlogkey, 2:
  611. GuiControlGet, relative, 2:
  612. GuiControlGet, Resist1, 2:
  613. GuiControlGet, Resist2, 2:
  614. GuiControlGet, dropshadow, 2:
  615. GuiControlget, Fontstylefont, 2:
  616. GuiControlget, Fontstylesize, 2:
  617. ;saves keys from gui to ini
  618.  
  619. ;--------------------------checks for duplicate hotkey
  620. Keylist := [start, exit, configkey, chatlogkey]
  621. Keys :={}
  622.  
  623. For each, key in keylist
  624. {
  625. If !(keys.haskey(key))
  626. Keys[key] := 1
  627. Else
  628. {
  629. Msgbox Error! Make sure the keys are unique!
  630. Return
  631. }
  632. }
  633.  
  634. ;-----------------------------------------
  635. Iniwrite, %start%, %config%, Keys, start
  636. Iniwrite, %exit%, %config%, Keys, exit
  637. Iniwrite, %configkey%, %config%, Keys, configkey
  638. Iniwrite, %chatlogkey%, %config%, Keys, chatlogkey
  639. IniWrite, %relative%, %config%, options, relative
  640. IniWrite, %Resist1%, %config%, options, Resist1
  641. IniWrite, %Resist2%, %config%, options, Resist2
  642. IniWrite, %dropshadow%, %config%, options, dropshadow
  643. IniWrite, %Fontstylefont%, %config%, options, Fontstylefont
  644. Iniwrite, %Fontstylesize%, %config%, options, Fontstylesize
  645.  
  646. gui, 2:destroy
  647. ;------------------------------------------read ini file and assign keys
  648. IniRead, start, %config%, Keys, start
  649. IniRead, exit, %config%, Keys, exit
  650. IniRead, configkey, %config%, Keys, configkey
  651. IniRead, chatlogkey, %config%, Keys, chatlogkey
  652. IniRead, relative, %config%, options, relative
  653. IniRead, Resist1, %config%, options, Resist1
  654. IniRead, Resist2, %config%, options, Resist2
  655. iniread, dropshadow, %config%,options, dropshadow
  656. Iniread, Fontstylefont, %config%, options, Fontstylefont
  657. Iniread, Fontstylesize, %config%, options, Fontstylesize
  658. options3=s%Fontstylesize%
  659. ;-----------------------------------------------
  660. GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  661. gui,1:show
  662. Hotkey, %start%, start, on
  663. Hotkey, %exit%, escape, on
  664. Hotkey, %configkey%, config, on
  665. return
  666.  
  667. ;------------------------chatlog key must be a function key possible other keys add to list must be wrapped in to work {F1}
  668. ;{ins}{del} etc... https://www.autohotkey.com/docs/commands/Send.htm
  669. chatlogged:
  670.  
  671. GuiControlGet chatlogkey, 2:
  672. keylist2:=["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]
  673. if !Contains(keylist2, chatlogkey)
  674. msgbox Please enter a function key F1-F12.
  675.  
  676. Contains(obj, chatlogkey) {
  677. for i, val in obj {
  678. if(val = chatlogkey) {
  679. return true
  680. }
  681. }
  682. }
  683. return
  684.  
  685.  
  686. GetColor:
  687. alblist:=["Briton","Highlander","Avalonian","Saracen","Inconnu","Half Ogre"]
  688. hiblist:=["Lurikeen","Celt","Sylvan","Firbolg","Elf","Shar"]
  689. midlist:=["Troll","Dwarf","Kobold","Norseman","Valkyn","Frostalf"]
  690. Error:=["Error"]
  691. if Contains(alblist, charRace)
  692. targetColor = cFFd60000
  693. else if Contains(hiblist, charRace)
  694. targetColor = cFF37d600
  695. else if Contains(midlist, charRace)
  696. targetColor = cFF0056d6
  697. else
  698. targetColor=cFFb80af2
  699. Return
  700.  
  701.  
  702. WM_LBUTTONDOWN()
  703. {
  704. PostMessage, 0xA1, 2
  705. }
  706.  
  707.  
  708.  
  709. MsgMonitor(wParam, lParam)
  710. {
  711. X := lParam & 0xFFFF
  712. Y := lParam >> 16
  713. if (oX!=X)||(oY!=Y)
  714. {
  715. if (A_Gui=1)
  716. iniwrite, x%X% y%Y%,%config%,window position,main
  717. if (A_Gui=2)
  718. iniwrite, x%X% y%Y%,%config%,window position,config
  719. if (A_Gui=3)
  720. {
  721. if (x!=32768)
  722. {
  723. iniwrite, %X%,%config%,window position,targetwindowx
  724. iniwrite, %Y%,%config%,window position,targetwindowy
  725. }
  726. }
  727. oX:=%X%
  728. oY:=%Y%
  729. }
  730. IniRead, targetwindowx, %config%, window position, targetwindowx
  731. IniRead, targetwindowy, %config%, window position, targetwindowy
  732. }
  733.  
  734. GetResist:
  735. class:=["Armsman","Paladin","Cleric","Mercenary","Minstrel","Scout","Friar","Infiltrator","Theurgist","Wizard","Cabalist","Sorcerer","Necromancer","Reaver","Champion","Druid","Hero","Warden","Bard","Blademaster","Ranger","Nightshade","Animist","Enchanter","Healer","Shaman","Skald","Thane","Warrior","Berserker","Hunter","Shadowblade","Savage","Bonedancer","Runemaster","Spiritmaster"]
  736. ;alb
  737. if (charClass="Armsman")||(charClass="Paladin")||(charClass="Armswoman")
  738. 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"]}
  739. if (charClass="Cleric")||(charClass="Mercenary")||(charClass="Minstrel")||(charClass="Reaver")
  740. 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"]}
  741. if (charClass="Scout")
  742. 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"]}
  743.  
  744. if (charClass="Friar")||(charClass="Infiltrator")
  745. 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"]}
  746.  
  747. if (charClass="Theurgist")||(charClass="Wizard")||(charClass="Cabalist")||(charClass="Sorcerer")||(charClass="Necromancer")
  748. 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"]}
  749. ;hib
  750. if (charClass="Champion")||(charClass="Druid")||(charClass="Hero")||(charClass="Warden")
  751. 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"]}
  752. if (charClass="Bard")||(charClass="Blademaster")||(charClass="Ranger")
  753. 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"]}
  754. if (charClass="Nightshade")
  755. 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"]}
  756. if (charClass="Animist")||(charClass="Enchanter")||(charClass="Mentalist")||(charClass="Eldritch")||(charClass="Valewalker")
  757. 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"]}
  758. ;mid
  759. if(charClass="Healer")||(charClass="Shaman")||(charClass="Skald")||(charClass="Thane")||(charClass="Warrior")
  760. 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"]}
  761. if (charClass="Berserker")||(charClass="Hunter")||(charClass="Savage")
  762. 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"]}
  763. if (charClass="Shadowblade")
  764. 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"]}
  765. if (charClass="Bonedancer")||(charClass="Runemaster")||(charClass="Spiritmaster")
  766. 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"]}
  767.  
  768.  
  769. return
  770.  
  771. About:
  772. IfNotEqual, FirstTimeA, No
  773. {
  774. Gui, About:-Caption +Border +LastFound
  775. WinGet GUI_ID, ID
  776. Gui, About:Color, ffffff, ffffff
  777. Gui, About:Font, S10 c1e91bb Bold,verdana
  778. Gui, About:Add, Text, x185 y27 w170 h20, DAoC Scout
  779. Gui, About:Font, S10 CDefault Normal, Verdana
  780. Gui, About:Add, Text, x185 y+3 w270, A Dark Age of Camelot tool that`nlooks up a targets information.
  781. Gui, About:Add, Text, x183 y+5 w248
  782. Gui, About:Font, S7 CDefault normal, Verdana
  783. Gui, About:Add, Text, x185 y92 w410 h73,
  784. (LTrim
  785. The script reads your chat.log to find your
  786. current target, looks the name up on the Phoenix
  787. Herald and returns the essential information.
  788. All information used by the script is publicly
  789. available, and does not read or modify any
  790. game files except for the chat.log.
  791. )
  792. Gui, About:Add, Text, x183 y+4 w248
  793. Gui, About:Add, Text, x16 y174 w410 h24,
  794. (LTrim
  795. The script is programmed by Bysan and Teehehe in AHK. For feedback, bug reports and additional information, please visit:
  796. )
  797. Gui, About:Add, Link, x25 y+5 cBlue BackgroundTrans, <a href="https://discord.gg/TqX3b3G">- Discord</a>
  798. Gui, About:Add, Button, 0x8000 x362 y+1 w70 h21 gAboutClose, Close
  799. Gui, About:Add, Picture, x17 y17 w150 h150, %A_ScriptDir%\Resources\LookupImg.png
  800.  
  801. FirstTimeA = No
  802. }
  803.  
  804. height := 240
  805. width := 435
  806. Gui, About:Show, Hide h%height% w%width%, DAoC Scout
  807. DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0xa0000)
  808. return
  809.  
  810. MeasureText(Str, FontOpts = "", FontName = "") {
  811. Static DT_FLAGS := 0x0520 ; DT_SINGLELINE = 0x20, DT_NOCLIP = 0x0100, DT_CALCRECT = 0x0400
  812. Static WM_GETFONT := 0x31
  813. Size := {}
  814. Gui, New
  815. If (FontOpts <> "") || (FontName <> "")
  816. Gui, Font, %FontOpts%, %FontName%
  817. Gui, Add, Text, hwndHWND
  818. SendMessage, WM_GETFONT, 0, 0, , ahk_id %HWND%
  819. HFONT := ErrorLevel
  820. HDC := DllCall("User32.dll\GetDC", "Ptr", HWND, "Ptr")
  821. DllCall("Gdi32.dll\SelectObject", "Ptr", HDC, "Ptr", HFONT)
  822. VarSetCapacity(RECT, 16, 0)
  823. DllCall("User32.dll\DrawText", "Ptr", HDC, "Str", Str, "Int", -1, "Ptr", &RECT, "UInt", DT_FLAGS)
  824. DllCall("User32.dll\ReleaseDC", "Ptr", HWND, "Ptr", HDC)
  825. Gui, Destroy
  826. Size.W := NumGet(RECT, 8, "Int")
  827. Size.H := NumGet(RECT, 12, "Int")
  828. Return Size
  829. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement