Advertisement
Guest User

Untitled

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