Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.67 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. ; --- Tray
  21. ;Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
  22. ;Menu, Tray, NoStandard
  23. ;Menu, Tray, Tip, DAoC Scout
  24. ;Menu, Tray, Add, Run, start
  25. ;Menu, Tray, Add, Config, config
  26. ;Menu, Tray, Add ; Separator
  27. ;Menu, Tray, Add, About, About
  28. ;Menu, Tray, Add, Donate, OpenPayPal
  29. ;Menu, Tray, Add ; Separator
  30. ;Menu, Tray, Add,Quit,Quit
  31. ;Menu, Tray, Icon, Run, %A_ScriptDir%\Resources\Lookup.ico
  32. ;Menu, Tray, Icon, Config, %A_ScriptDir%\Resources\Config.ico
  33.  
  34.  
  35. ;--- Check for configini and creates if not one
  36. ifnotexist,%config%
  37. {
  38. msgbox Could not find config file generating new one
  39. IniWrite, F2, %config% ,Keys, start
  40. IniWrite,Escape, %config% ,Keys, exit
  41. IniWrite, F3, %config% ,Keys, configkey
  42. IniWrite, F4, %config% ,Keys, chatlogkey
  43. iniwrite, x0 y0,%config%,window position,main
  44. iniwrite, 1,%config%,window position,targetwindowx
  45. iniwrite, 1,%config%,window position,targetwindowy
  46. IniWrite, %A_MyDocuments%%file2%%file%,%config%, chatlog, file
  47. IniWrite, 1, %config%, options, relative
  48. IniWrite, 0, %config%, options, Resist1
  49. IniWrite, 0, %config%, options, Resist2
  50. IniWrite, 1, %config%, options, Resist3
  51. IniWrite, 0, %config%, options, dropshadow
  52. IniWrite, Arial, %config%, options, Fontstylefont
  53. IniWrite, 16, %config%, options, Fontstylesize
  54. Iniwrite, 0, %config%, options, dropshadow
  55. While ! FileExist( config )
  56. {
  57. Sleep 250
  58. }
  59. gosub config
  60. }
  61.  
  62. if (Resist1= 0 and Resist3=0)
  63. AllResist:=2
  64. If (Resist2=0 and Resist3=0)
  65. AllResist:=1
  66. If (Resist1=0 and Resist2=0)
  67. AllResist:=3
  68. ;--- Read ini file and assign keys
  69. IniRead, start, %config%, Keys, start
  70. IniRead, exit, %config%, Keys, exit
  71. IniRead, configkey, %config%, Keys, configkey
  72. IniRead, chatlogkey, %config%, Keys, chatlogkey
  73. IniRead, chatLog, %config%, chatlog, file
  74. IniRead, main, %config%, window position, main
  75. IniRead, targetwindowx, %config%, window position, targetwindowx
  76. IniRead, targetwindowy, %config%, window position, targetwindowy
  77. IniRead, relative, %config%, options, relative , 0
  78. IniRead, Resist1, %config%, options,Resist1 , 0
  79. IniRead, Resist2, %config%, options,Resist2 , 0
  80. IniRead, Resist3, %config%, options,Resist3 , 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. Filedelete, % chatLog
  154. if winactive("ahk_exe game.dll")
  155. {
  156. gui,3:show, NA
  157. if (dropshadow=1)
  158. {
  159. hbm := CreateDIBSection(Width, Height)
  160. hdc := CreateCompatibleDC()
  161. obm := SelectObject(hdc, hbm)
  162. G := Gdip_GraphicsFromHDC(hdc)
  163. Gdip_SetSmoothingMode(G, 4)
  164. pBrush := Gdip_BrushCreateSolid(0x00000000)
  165. Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
  166. }
  167. counter++
  168. if (x!=1)
  169. send {%chatlogkey%}
  170. sleep 500
  171. send {%chatlogkey%}
  172. lastChar := FindName(chatlog)
  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. Font:=Fontstylefont
  256.  
  257. y:=0
  258. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  259. %TTG%(G, charName , Options , Font, Width, Height)
  260.  
  261.  
  262. y:=Fontstylesize
  263. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  264. %TTG%(G, "<" charGuild ">" , Options , Font, Width, Height)
  265.  
  266.  
  267. y:=Fontstylesize*2
  268. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  269. %TTG%(G, charLevel " " charRankLevel , Options , Font, Width, Height)
  270.  
  271.  
  272. y:=Fontstylesize*3
  273. Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
  274. %TTG%(G,charRace " " charClass, Options , Font, Width, Height)
  275.  
  276.  
  277. gosub getresist
  278. if (AllResist=1)
  279. {
  280.  
  281. y:=Fontstylesize*4.2
  282. x:=-Fontstylesize*4
  283. Color:=resistances.Thrust.2
  284. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  285. %TTG%(G, "Thrust", Options , Font, Width, Height)
  286.  
  287.  
  288. y:=Fontstylesize*4.2
  289. Color:=resistances.Crush.2
  290. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  291. %TTG%(G, "Crush", Options, Font, Width, Height)
  292.  
  293. Longest2:=Fontstylesize*4
  294. y:=Fontstylesize*4.2
  295. Color:=resistances.Slash.2
  296. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  297. %TTG%(G, "Slash", Options, Font, Width, Height)
  298.  
  299. }
  300.  
  301. if (AllResist=2)
  302. {
  303. y:=Fontstylesize*4
  304. x:=-Fontstylesize*4
  305. Color:=resistances.Thrust.2
  306. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  307. %TTG%(G, "Thrust", Options , Font, Width, Height)
  308.  
  309.  
  310. y:=Fontstylesize*5
  311. Color:=resistances.Crush.2
  312. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  313. %TTG%(G, "Crush", Options, Font, Width, Height)
  314.  
  315. y:=Fontstylesize*6
  316. Color:=resistances.Slash.2
  317. Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  318. %TTG%(G, "Slash", Options, Font, Width, Height)
  319.  
  320. ;these need to be fixed visually
  321.  
  322.  
  323. y:=Fontstylesize*4
  324. Color:=resistances.Heat.2
  325. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  326. %TTG%(G, "Heat",Options , Font, Width, Height)
  327.  
  328. y:=Fontstylesize*5
  329. Color:=resistances.Cold.2
  330. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  331. %TTG%(G, "Cold", Options , Font, Width, Height)
  332.  
  333. y:=Fontstylesize*6
  334. Color:=resistances.Matter.2
  335. Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  336. %TTG%(G, "Matter", Options , Font, Width, Height)
  337. Longest2:=0
  338.  
  339. Longest2:=Fontstylesize*4
  340. y:=Fontstylesize*4
  341. Color:=resistances.Energy.2
  342. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  343. %TTG%(G, "Energy", Options , Font, Width, Height)
  344.  
  345. y:=Fontstylesize*5
  346. Color:=resistances.Spirit.2
  347. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  348. %TTG%(G, "Spirit", Options , Font, Width, Height)
  349.  
  350. y:=Fontstylesize*6
  351. Color:=resistances.Body.2
  352. Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
  353. %TTG%(G, "Body", Options , Font, Width, Height)
  354. Longest2:=0
  355. }
  356.  
  357. if (AllResist=3)
  358. {
  359. }
  360.  
  361. UpdateLayeredWindow(hwnd1, hdc, targetwindowx,targetwindowy, Width, Height)
  362. }
  363.  
  364.  
  365. if (dropshadow=1)
  366. {
  367. SelectObject(hdc, obm)
  368. DeleteObject(hbm)
  369. DeleteDC(hdc)
  370. Gdip_DeleteGraphics(G)
  371. hbm := CreateDIBSection(Width, Height)
  372. hdc := CreateCompatibleDC()
  373. obm := SelectObject(hdc, hbm)
  374. G := Gdip_GraphicsFromHDC(hdc)
  375. Gdip_SetSmoothingMode(G, 4)
  376. pBrush := Gdip_BrushCreateSolid(0x00000000)
  377. Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
  378. }
  379. return
  380. }
  381. return
  382.  
  383.  
  384. ;--------------------------------------------
  385.  
  386.  
  387. ;--------------------------------------config gui 2
  388. config:
  389. IniRead, start, %config%, Keys, start
  390. IniRead, exit, %config%, Keys, exit
  391. IniRead, configkey, %config%, Keys, configkey
  392. IniRead, chatlogkey, %config%, Keys, chatlogkey
  393. IniRead, chatLog, %config%, chatlog, file
  394. IniRead, main, %config%, window position, main
  395. IniRead, relative, %config%, options, relative , 0
  396. IniRead, Resist1, %config%, options, Resist1
  397. IniRead, Resist2, %config%, options, Resist2
  398. IniRead, Resist3, %config%, options,Resist3 , 0
  399. Iniread, dropshadow, %config%,options,dropshadow
  400. Iniread, Fontstylefont, %config%, options, Fontstylefont
  401. Iniread, Fontstylesize, %config%, options, Fontstylesize
  402. Hotkey, ~LButton, daoc, off
  403. Hotkey, %start%, start, off
  404. Hotkey, %exit%, escape, off
  405. Hotkey, %configkey%, config, off
  406. gui,3:hide
  407. gui,1: hide
  408. Gui,2: +e0x20 +LastFound
  409. Gui,2: Add, Tab3, x0 y5 w619 h341 -wrap, Configuration| FAQ
  410. Gui,2: Font, Normal c1e91bb
  411. Gui,2: Add, Groupbox, x7 y32 w606 h95, [Scout] Instructions
  412. Gui,2: Font,
  413. 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).
  414. Gui,2: Add, Text, x16 y+5, 2) Select the directory where your chat.log file is located. Typically this would be in:
  415. Gui,2: Add, Text, x30 y+5, C:\Users\USERNAME\Documents\Electronic Arts\Dark Age of Camelot
  416. 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.
  417. Gui,2: Font, Normal c1e91bb
  418. Gui,2: Add, Groupbox, x7 y+13 w143 h120, [Scout] Keybinds
  419. Gui,2: Font,
  420. Gui,2: Add, Text, x61 y155, Start Script
  421. Gui,2: Add, Text, x61 y+10, Chatlog (F1-F12)
  422. Gui,2: Add, Text, x61 y+10, Configurations
  423. Gui,2: Add, Text, x61 y+10, Exit
  424. Gui,2: Font, Normal c1e91bb
  425. Gui,2: Add, Groupbox, x159 y131 w164 h120, [Scout] Options
  426. Gui,2: Font,
  427. Gui,2: Add, Checkbox, x165 y155 Checked%relative%, Use relative realm colors
  428. Gui,2: Font, Normal c1e91bb
  429. Gui,2: Add, Text, x311 y155, ?
  430. Gui,2: Font,
  431. Gui,2: Add, Radio, x165 y+10 gCheck vResist1, Show melee resistances
  432. Gui,2: Add, Radio, x165 y+10 gCheck vResist2, Show all resistances
  433. Gui,2: Add, Radio, x165 y+10 gCheck vResist3, No resists
  434. Gui,2: Font, Normal c1e91bb
  435. Gui,2: Add, Text, x311 y178,?
  436. Gui,2: Font,
  437. Gui,2: Font, Normal c1e91bb
  438. Gui,2: Add, Text, x311 y201,?
  439. Gui,2: Font,
  440. Gui,2: Font, Normal c1e91bb
  441. Gui,2: Add, Text, x311 y224,?
  442. Gui,2: Font,
  443. Gui,2: Add, Text, x307 y156 h14 w1 0x11
  444. Gui,2: Add, Text, x307 y179 h14 w1 0x11
  445. Gui,2: Add, Text, x307 y202 h14 w1 0x11
  446. Gui,2: Add, Text, x307 y225 h14 w1 0x11
  447. Gui,2: Add, Hotkey, x16 y152 w40 h19 vstart, %start%
  448. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vchatlogkey gchatlogged, %chatlogkey%
  449. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vconfigkey, %configkey%
  450. Gui,2: Add, Hotkey, x16 y+4 w40 h19 vexit, %exit%
  451. Gui,2: Font, Normal c1e91bb
  452. Gui,2: Add, Groupbox, x332 y131 w281 h120, [Scout] Fontstyle
  453. Gui,2: Font
  454. 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
  455. Gui,2: Add, DropDownList, x338 y+2 w100 vFontstylesize, 12|13|14|15|16|17|18|19|20|21|22|23|24
  456. Gui,2: Add, Text, x442 y155, Fontname
  457. Gui,2: Add, Text, x442 y+10, Fontsize
  458. Gui,2: Add, Checkbox, x338 y+10 vdropshadow, Font with dropshadow
  459. Gui,2: Font, Normal c1e91bb
  460. Gui,2: Add, Groupbox, x7 y255 w606 h56, [Scout] Chatlog Directory
  461. Gui,2: Font,
  462. Gui,2: Add, Edit, x14 y276 w400 h19 +ReadOnly vChatlogLoc,%Chatlog%
  463. Gui,2: Add, Button, x416 y275 w20 h21 gchatlog, ...
  464. Gui,2: Add, Button, x7 y+22 w64 h19 gbuttonsave, Save
  465. Gui,2: Show, w619 h342 Center, DAoC Scout - Configuration
  466. Gui,2: Tab, 2
  467. Gui,2: Font, Normal c1e91bb
  468. Gui,2: Add, Groupbox, x7 y32 w606 h85, [Scout] About
  469. Gui,2: Font,
  470. 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.
  471. Gui,2: Add, Text, x16 y+5, The script is programmed in Autohotkey by Bysan and Teehehe with inspiration from Lerox.
  472. Gui,2: Font, Normal c1e91bb
  473. Gui,2: Add, Groupbox, x7 y122 w606 h59, [Scout] Contact
  474. Gui,2: Font,
  475. Gui,2: Add, Text, x16 y141, Errors and questions can be reported at:
  476. Gui,2: Add, Link, x25 y+5 cBlue BackgroundTrans, <a href="https://discord.gg/TqX3b3G">- Discord</a>
  477. SetTimer, ToolTip
  478. var_Static9 = Target info color based on realm color. ; Put this at the top along with any others you want to try.
  479. var_Static10 = Shows Crush/Thrust/Slash resistances.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
  480. var_Static11 = Shows Crush/Thrust/Slash in addition to caster type vulnerabilities.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
  481. var_Static12 = Shows no resists.
  482. GuiControl,2: , Button5, %Resist1%
  483. GuiControl,2: , Button6, %Resist2%
  484. GuiControl,2: , Button7, %Resist3%
  485. GuiControl,2: , Button9, %dropshadow%
  486. GuiControl,2: ChooseString, Fontstylefont, %Fontstylefont%
  487. GuiControl,2: ChooseString, Fontstylesize, %Fontstylesize%
  488. options3=s%Fontstylesize%
  489. ToolTip:
  490. MouseGetPos, , , id, control
  491. WinGetTitle, title, ahk_id %id%
  492. if title = DAoC Scout - Configuration
  493. {
  494. tmpVar := var_%control%
  495. ToolTip, %tmpVar%
  496. }
  497. return
  498. Return
  499.  
  500. ;-------------------------------------web function
  501.  
  502. get(URL){
  503. ComObjError(false)
  504. r:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
  505. r.Open("GET", URL, true),r.Send(),r.WaitForResponse()
  506. return r.ResponseText
  507. }
  508. ;----------------------------------------------
  509.  
  510. ;--------------------------------------------readchatlog for target line
  511. FindName(chatLog)
  512. {
  513. Loop, Read, % chatLog
  514. line_count := A_Index
  515. Loop, 30
  516. {
  517. lineIndex := (line_count-A_Index+1)
  518. FileReadLine, string, %chatLog%, %lineIndex%
  519. if RegExMatch(string, "You target \[(.*)\]\.", Output)
  520. Return Output1
  521. if lineIndex = 0
  522. Return
  523. }
  524. }
  525. ----------------------------------------
  526.  
  527. Check:
  528. gui, submit, nohide
  529. if (Resist1= 0 and Resist3=0)
  530. AllResist:=2
  531. If (Resist2=0 and Resist3=0)
  532. AllResist:=1
  533. If (Resist1=0 and Resist2=0)
  534. AllResist:=3
  535. Return
  536.  
  537. ;---------------------------------------gui stuff
  538. uiMove:
  539. PostMessage, 0xA1, 2,,, A
  540. Return
  541.  
  542. ;--- Tray2
  543. ;Quit:
  544. ; ExitApp
  545. ;Console:
  546. ;ListLines
  547. ;Return
  548. ;OpenPayPal:
  549. ; Run "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TMRB3RCMXPGBN&source=url"
  550. ;Return
  551. ;AboutClose:
  552. ; DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0x90000)
  553. ; Gui, About:Cancel
  554. ;Return
  555.  
  556.  
  557. ;----------------------------------exit
  558. escape:
  559. exitapp
  560. return
  561.  
  562.  
  563. ;--------------------------close config window
  564. 2GuiClose:
  565. gui, 2:destroy
  566. GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  567. gui, 1:show
  568. Hotkey, %start%, start, on
  569. Hotkey, %exit%, escape, on
  570. Hotkey, %configkey%, config, on
  571. return
  572.  
  573. ;-------------------------folder select
  574. chatlog:
  575. Gui,2: +OwnDialogs
  576. fileselectfolder, folder
  577. folder:= RegExReplace(Folder, "\\$")
  578. chatlog = %folder%\%file%
  579. Iniwrite, %chatlog%, %config%, chatlog, file
  580. GuiControl, , ChatlogLoc, %chatLog%
  581. return
  582.  
  583. ;--------------------------------------save button
  584. buttonsave:
  585. GuiControlGet, start, 2:
  586. GuiControlGet, exit, 2:
  587. GuiControlGet, configkey, 2:
  588. GuiControlGet, chatlogkey, 2:
  589. GuiControlGet, relative, 2:
  590. GuiControlGet, Resist1, 2:
  591. GuiControlGet, Resist2, 2:
  592. GuiControlGet, Resist3, 2:
  593. GuiControlGet, dropshadow, 2:
  594. GuiControlget, Fontstylefont, 2:
  595. GuiControlget, Fontstylesize, 2:
  596. ;saves keys from gui to ini
  597.  
  598. ;--------------------------checks for duplicate hotkey
  599. Keylist := [start, exit, configkey, chatlogkey]
  600. Keys :={}
  601.  
  602. For each, key in keylist
  603. {
  604. If !(keys.haskey(key))
  605. Keys[key] := 1
  606. Else
  607. {
  608. Msgbox Error! Make sure the keys are unique!
  609. Return
  610. }
  611. }
  612.  
  613. ;-----------------------------------------
  614. Iniwrite, %start%, %config%, Keys, start
  615. Iniwrite, %exit%, %config%, Keys, exit
  616. Iniwrite, %configkey%, %config%, Keys, configkey
  617. Iniwrite, %chatlogkey%, %config%, Keys, chatlogkey
  618. IniWrite, %relative%, %config%, options, relative
  619. IniWrite, %Resist1%, %config%, options, Resist1
  620. IniWrite, %Resist2%, %config%, options, Resist2
  621. IniWrite, %Resist3%, %config%, options, Resist3
  622. IniWrite, %dropshadow%, %config%, options, dropshadow
  623. IniWrite, %Fontstylefont%, %config%, options, Fontstylefont
  624. Iniwrite, %Fontstylesize%, %config%, options, Fontstylesize
  625.  
  626. gui, 2:destroy
  627. ;------------------------------------------read ini file and assign keys
  628. IniRead, start, %config%, Keys, start
  629. IniRead, exit, %config%, Keys, exit
  630. IniRead, configkey, %config%, Keys, configkey
  631. IniRead, chatlogkey, %config%, Keys, chatlogkey
  632. IniRead, relative, %config%, options, relative
  633. IniRead, Resist1, %config%, options, Resist1
  634. IniRead, Resist2, %config%, options, Resist2
  635. IniRead, Resist3, %config%, options, Resist3
  636. iniread, dropshadow, %config%,options, dropshadow
  637. Iniread, Fontstylefont, %config%, options, Fontstylefont
  638. Iniread, Fontstylesize, %config%, options, Fontstylesize
  639. options3=s%Fontstylesize%
  640. ;-----------------------------------------------
  641. GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
  642. gui,1:show
  643. Hotkey, %start%, start, on
  644. Hotkey, %exit%, escape, on
  645. Hotkey, %configkey%, config, on
  646. return
  647.  
  648. ;------------------------chatlog key must be a function key possible other keys add to list must be wrapped in to work {F1}
  649. ;{ins}{del} etc... https://www.autohotkey.com/docs/commands/Send.htm
  650. chatlogged:
  651.  
  652. GuiControlGet chatlogkey, 2:
  653. keylist2:=["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]
  654. if !Contains(keylist2, chatlogkey)
  655. msgbox Please enter a function key F1-F12.
  656.  
  657. Contains(obj, chatlogkey) {
  658. for i, val in obj {
  659. if(val = chatlogkey) {
  660. return true
  661. }
  662. }
  663. }
  664. return
  665.  
  666.  
  667. GetColor:
  668. alblist:=["Briton","Highlander","Avalonian","Saracen","Inconnu","Half Ogre"]
  669. hiblist:=["Lurikeen","Celt","Sylvan","Firbolg","Elf","Shar"]
  670. midlist:=["Troll","Dwarf","Kobold","Norseman","Valkyn","Frostalf"]
  671. Error:=["Error"]
  672. if Contains(alblist, charRace)
  673. targetColor = cFFd60000
  674. else if Contains(hiblist, charRace)
  675. targetColor = cFF37d600
  676. else if Contains(midlist, charRace)
  677. targetColor = cFF0056d6
  678. else
  679. targetColor=cFFb80af2
  680. Return
  681.  
  682.  
  683. WM_LBUTTONDOWN()
  684. {
  685. PostMessage, 0xA1, 2
  686. }
  687.  
  688.  
  689.  
  690. MsgMonitor(wParam, lParam)
  691. {
  692. X := lParam & 0xFFFF
  693. Y := lParam >> 16
  694. if (oX!=X)||(oY!=Y)
  695. {
  696. if (A_Gui=1)
  697. iniwrite, x%X% y%Y%,%config%,window position,main
  698. if (A_Gui=2)
  699. iniwrite, x%X% y%Y%,%config%,window position,config
  700. if (A_Gui=3)
  701. {
  702. if (x!=32768)
  703. {
  704. iniwrite, %X%,%config%,window position,targetwindowx
  705. iniwrite, %Y%,%config%,window position,targetwindowy
  706. }
  707. }
  708. oX:=%X%
  709. oY:=%Y%
  710. }
  711. IniRead, targetwindowx, %config%, window position, targetwindowx
  712. IniRead, targetwindowy, %config%, window position, targetwindowy
  713. }
  714.  
  715. GetResist:
  716. 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"]
  717. ;alb
  718. if (charClass="Armsman")||(charClass="Paladin")||(charClass="Armswoman")
  719. 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"]}
  720. if (charClass="Cleric")||(charClass="Mercenary")||(charClass="Minstrel")||(charClass="Reaver")
  721. 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"]}
  722. if (charClass="Scout")
  723. 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"]}
  724.  
  725. if (charClass="Friar")||(charClass="Infiltrator")
  726. 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"]}
  727.  
  728. if (charClass="Theurgist")||(charClass="Wizard")||(charClass="Cabalist")||(charClass="Sorcerer")||(charClass="Necromancer")
  729. 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"]}
  730. ;hib
  731. if (charClass="Champion")||(charClass="Druid")||(charClass="Hero")||(charClass="Warden")
  732. 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"]}
  733. if (charClass="Bard")||(charClass="Blademaster")||(charClass="Ranger")
  734. 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"]}
  735. if (charClass="Nightshade")
  736. 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"]}
  737. if (charClass="Animist")||(charClass="Enchanter")||(charClass="Mentalist")||(charClass="Eldritch")||(charClass="Valewalker")
  738. 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"]}
  739. ;mid
  740. if(charClass="Healer")||(charClass="Shaman")||(charClass="Skald")||(charClass="Thane")||(charClass="Warrior")
  741. 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"]}
  742. if (charClass="Berserker")||(charClass="Hunter")||(charClass="Savage")
  743. 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"]}
  744. if (charClass="Shadowblade")
  745. 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"]}
  746. if (charClass="Bonedancer")||(charClass="Runemaster")||(charClass="Spiritmaster")
  747. 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"]}
  748.  
  749.  
  750. return
  751.  
  752. About:
  753. IfNotEqual, FirstTimeA, No
  754. {
  755. Gui, About:-Caption +Border +LastFound
  756. WinGet GUI_ID, ID
  757. Gui, About:Color, ffffff, ffffff
  758. Gui, About:Font, S10 c1e91bb Bold,verdana
  759. Gui, About:Add, Text, x185 y27 w170 h20, DAoC Scout
  760. Gui, About:Font, S10 CDefault Normal, Verdana
  761. Gui, About:Add, Text, x185 y+3 w270, A Dark Age of Camelot tool that`nlooks up a targets information.
  762. Gui, About:Add, Text, x183 y+5 w248
  763. Gui, About:Font, S7 CDefault normal, Verdana
  764. Gui, About:Add, Text, x185 y92 w410 h73,
  765. (LTrim
  766. The script reads your chat.log to find your
  767. current target, looks the name up on the Phoenix
  768. Herald and returns the essential information.
  769. All information used by the script is publicly
  770. available, and does not read or modify any
  771. game files except for the chat.log.
  772. )
  773. Gui, About:Add, Text, x183 y+4 w248
  774. Gui, About:Add, Text, x16 y174 w410 h24,
  775. (LTrim
  776. The script is programmed by Bysan and Teehehe in AHK. For feedback, bug reports and additional information, please visit:
  777. )
  778. Gui, About:Add, Link, x25 y+5 cBlue BackgroundTrans, <a href="https://discord.gg/TqX3b3G">- Discord</a>
  779. Gui, About:Add, Button, 0x8000 x362 y+1 w70 h21 gAboutClose, Close
  780. Gui, About:Add, Picture, x17 y17 w150 h150, %A_ScriptDir%\Resources\LookupImg.png
  781.  
  782. FirstTimeA = No
  783. }
  784.  
  785. height := 240
  786. width := 435
  787. Gui, About:Show, Hide h%height% w%width%, DAoC Scout
  788. DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0xa0000)
  789. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement