Advertisement
Guest User

Untitled

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