Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #singleinstance, force
- SetTitleMatchMode,2
- DetectHiddenWindows, On
- #noenv
- #include %A_ScriptDir%\Resources\Gdip_All.ahk
- #include %A_ScriptDir%\Resources\Gdip_Ext.ahk
- SetWorkingDir %A_ScriptDir%
- CoordMode, Mouse, Screen
- Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
- #Persistent ; Stay open in background
- counter:=0
- ; --- Global variables
- global chatlogkey, start, widthList, exit, configkey,config, title,gui3_x,gui3_y, newpos, charName,vText, charRace,targetwindowx, targetwindowy
- toggle:=1
- title:=Dark Age of Camelot
- PH:="<h1>Phoenix Herald</h1>"
- config:="config.ini"
- file2=\Electronic Arts\Dark Age of Camelot\
- file=chat.log
- cLog := file2 file
- ; --- Tray
- Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
- Menu, Tray, NoStandard
- Menu, Tray, Tip, DAoC Scout
- Menu, Tray, Add, Run, start
- Menu, Tray, Add, Config, config
- Menu, Tray, Add ; Separator
- Menu, Tray, Add, About, About
- Menu, Tray, Add, Donate, OpenPayPal
- Menu, Tray, Add ; Separator
- Menu, Tray, Add,Quit,Quit
- Menu, Tray, Icon, Run, %A_ScriptDir%\Resources\Lookup.ico
- Menu, Tray, Icon, Config, %A_ScriptDir%\Resources\Config.ico
- ;--- Check for configini and creates if not one
- ifnotexist,%config%
- {
- msgbox Could not find config file generating new one
- IniWrite, F2, %config% ,Keys, start
- IniWrite,Escape, %config% ,Keys, exit
- IniWrite, F3, %config% ,Keys, configkey
- IniWrite, F4, %config% ,Keys, chatlogkey
- iniwrite, x0 y0,%config%,window position,main
- iniwrite, 1,%config%,window position,targetwindowx
- iniwrite, 1,%config%,window position,targetwindowy
- IniWrite, %A_MyDocuments%%file2%%file%,%config%, chatlog, file
- IniWrite, 1, %config%, options, relative
- IniWrite, 1, %config%, options, Resist1
- IniWrite, 0, %config%, options, Resist2
- IniWrite, 0, %config%, options, dropshadow
- IniWrite, Arial, %config%, options, Fontstylefont
- IniWrite, 16, %config%, options, Fontstylesize
- Iniwrite, 0, %config%, options, dropshadow
- While ! FileExist( config )
- {
- Sleep 250
- }
- gosub config
- }
- if (Resist1= 0 and Resist3=0)
- AllResist:=2
- If (Resist2=0 and Resist3=0)
- AllResist:=1
- If (Resist1=0 and Resist2=0)
- AllResist:=3
- ;--- Read ini file and assign keys
- IniRead, start, %config%, Keys, start
- IniRead, exit, %config%, Keys, exit
- IniRead, configkey, %config%, Keys, configkey
- IniRead, chatlogkey, %config%, Keys, chatlogkey
- IniRead, chatLog, %config%, chatlog, file
- IniRead, main, %config%, window position, main
- IniRead, targetwindowx, %config%, window position, targetwindowx
- IniRead, targetwindowy, %config%, window position, targetwindowy
- IniRead, relative, %config%, options, relative , 0
- IniRead, Resist1, %config%, options,Resist1 , 0
- IniRead, Resist2, %config%, options,Resist2 , 0
- Iniread, dropshadow, %config%,options,dropshadow
- Iniread, Fontstylefont, %config%, options, Fontstylefont
- Iniread, Fontstylesize, %config%, options, Fontstylesize
- if (Resist1= 0 and Resist3=0)
- AllResist:=2
- If (Resist2=0 and Resist3=0)
- AllResist:=1
- If (Resist1=0 and Resist2=0)
- AllResist:=3
- Hotkey, ~LButton, daoc, off
- Hotkey, %start%, start, on
- Hotkey, %exit%, escape, on
- Hotkey, %configkey%, config, on
- OnMessage(0x03, "MsgMonitor")
- OnMessage(0x201, "WM_LBUTTONDOWN")
- If !pToken := Gdip_Startup()
- ExitApp
- Width:=800, height:=800
- Gui, 3: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
- Gui, 3: Show, NA
- hwnd1 := WinExist()
- hbm := CreateDIBSection(Width, Height)
- hdc := CreateCompatibleDC()
- obm := SelectObject(hdc, hbm)
- G := Gdip_GraphicsFromHDC(hdc)
- Gdip_SetSmoothingMode(G, 4)
- if (dropshadow=0)
- {
- pBrush := Gdip_BrushCreateSolid(0x590000)
- Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
- Gdip_DeleteBrush(pBrush)
- }
- Font = %Fontstylefont%
- If !Gdip_FontFamilyCreate(Font)
- {
- msgbox Font not installed setting to Arial
- IniWrite, Arial, %config%, options, Fontstylefont
- Iniread, Fontstylefont, %config%, options, Fontstylefont
- Font = %Fontstylefont%
- Gdip_FontFamilyCreate(Font)
- }
- Gui,1: +e0x20 +AlwaysOnTop +LastFound -SysMenu
- Gui,1: Color, ffffff, ffffff
- Gui,1: Font, Normal c1e91bb
- Gui,1: Add, Groupbox, x7 y7 h65 w160, [Scout] Quickstart
- Gui,1: Font, Normal s8 c000000, Verdana
- Gui 1: Add,Text, x15 y24 BackgroundTrans vtext4 GuiMove w200,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
- Gui,1: show, %main% w173 h78 , DAoC Scout
- return
- ;--- Start key pushed
- start:
- gui,1: hide
- ;gui,3:show
- Hotkey, ~LButton, toggle
- IniRead, chatlogkey, %config%, Keys, chatlogkey
- Iniread, targetwindowx, %config%, window position, targetwindowx
- Iniread, targetwindowy, %config%, window position, targetwindowy
- options3=s%Fontstylesize%
- ifwinexist,ahk_exe game.dll
- {
- winactivate
- winwaitactive, %title%
- }
- else
- winwaitactive, %title%
- return
- daoc:
- if winactive("ahk_exe game.dll")
- {
- gui,3:show, NA
- if (dropshadow=1)
- {
- hbm := CreateDIBSection(Width, Height)
- hdc := CreateCompatibleDC()
- obm := SelectObject(hdc, hbm)
- G := Gdip_GraphicsFromHDC(hdc)
- Gdip_SetSmoothingMode(G, 4)
- pBrush := Gdip_BrushCreateSolid(0x00000000)
- Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
- }
- counter++
- if (x!=1)
- send {%chatlogkey%}
- sleep 500
- send {%chatlogkey%}
- lastChar := FindName(chatlog)
- ; --- Parse Herald
- document:= ComObjCreate("HTMLfile")
- page1:=get("https://herald.playphoenix.online/c/"+lastChar)
- lines := StrSplit(page1, "`n")
- columns := []
- for index, value in lines
- columns.Insert(StrSplit(value, "`t"))
- unfName := columns[49][1]
- unfGuild := columns[51][1]
- unfClass := columns[53][1]
- unfLevel := columns[57][1]
- unfRankLevel := columns[61][1]
- unfRace := columns[65][1]
- unfRankName := columns[67][1]
- charName := RegExReplace(unfName,"\x20{2,}"," ")""
- unfGuild1 := RegExReplace(unfGuild,"<.*?>")
- unfGuild2 := RegExReplace(unfGuild1,"(<)")
- unfGuild3 := RegExReplace(unfGuild2,"(>)")
- charGuild := RegExReplace(unfGuild3,"\x20{2,}"," ")""
- charClass := RegExReplace(unfClass,"\x20{2,}"," ")""
- charLevel := RegExReplace(unfLevel,"\x20{2,}"," ")""
- unfRankLevel1 := RegExReplace(unfRankLevel,"\x20{2,}"," ")""
- charRankLevel := RegExReplace(unfRankLevel1,"ealm Rank ","")
- charRace := RegExReplace(unfRace,"\x20{2,}"," ")""
- charRankName := RegExReplace(unfRankName,"\x20{2,}"," ")""
- StringTrimLeft, charName, charName, 1
- StringTrimLeft, charClass, charClass, 1
- StringTrimLeft, charLevel, charLevel, 1
- StringTrimLeft, charRankLevel, charRankLevel, 1
- StringTrimLeft, charRace, charRace, 1
- StringTrimLeft, charRankName, charRankName, 1
- StringTrimRight, charGuild, charGuild, 1
- if (relative=1)
- gosub GetColor
- else
- targetColor:="cFFFFFFFF"
- If (dropshadow=0)
- {
- TTG:="Gdip_TextToGraphics"
- options2:=
- }
- if (dropshadow=1)
- {
- TTG:="Gdip_TextToGraphics2"
- options2:="ow1 ocFF000000"
- }
- if (dropshadow=1)
- {
- hbm := CreateDIBSection(Width, Height)
- hdc := CreateCompatibleDC()
- obm := SelectObject(hdc, hbm)
- G := Gdip_GraphicsFromHDC(hdc)
- Gdip_SetSmoothingMode(G, 4)
- pBrush := Gdip_BrushCreateSolid(0x00000000)
- Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
- }
- if (dropshadow=0)
- {
- G := Gdip_GraphicsFromHDC(hdc)
- Gdip_SetCompositingMode(G, 1)
- pBrush := Gdip_BrushCreateSolid(0x00000000) ; fully transparent brush 'eraser'
- Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
- Gdip_DeleteBrush(pBrush)
- Gdip_SetCompositingMode(G, 0)
- Gdip_SetSmoothingMode(G, 4)
- pBrush := Gdip_BrushCreateSolid(0x00000000)
- Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
- Gdip_DeleteBrush(pBrush)
- }
- nameLength := StrLen(charName)
- guildLength:=StrLen(charGuild)
- IfnotInString, page1, %PH%
- {
- List = %charName%|<charGuild>|%charLevel%|%charClass% + %charRace%
- Longest:=0
- Loop, Parse, List, |
- {
- FontName:=Fontstylefont
- Size:=Fontstylesize
- T := MeasureText(a_loopfield, "" . Size, FontName)
- If (T.W > Longest)
- Longest:=T.W
- }
- Longest:=Longest+(Fontstylesize*3.5)
- Font:=Fontstylefont
- y:=0
- Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charName , Options , Font, Width, Height)
- y:=Fontstylesize
- Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, "<" charGuild ">" , Options , Font, Width, Height)
- y:=Fontstylesize*2
- Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charLevel " " charRankLevel , Options , Font, Width, Height)
- y:=Fontstylesize*3
- Options = x0 y%y% w90p Centre Bold %targetColor% %options2% r4 %options3%
- %TTG%(G,charRace " " charClass, Options , Font, Width, Height)
- gosub getresist
- if (AllResist=1)
- {
- y:=Fontstylesize*4.2
- x:=-Fontstylesize*4
- Color:=resistances.Thrust.2
- Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Thrust", Options , Font, Width, Height)
- y:=Fontstylesize*4.2
- Color:=resistances.Crush.2
- Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Crush", Options, Font, Width, Height)
- Longest2:=Fontstylesize*4
- y:=Fontstylesize*4.2
- Color:=resistances.Slash.2
- Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Slash", Options, Font, Width, Height)
- }
- if (AllResist=2)
- {
- y:=Fontstylesize*4
- x:=-Fontstylesize*4
- Color:=resistances.Thrust.2
- Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Thrust", Options , Font, Width, Height)
- y:=Fontstylesize*5
- Color:=resistances.Crush.2
- Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Crush", Options, Font, Width, Height)
- y:=Fontstylesize*6
- Color:=resistances.Slash.2
- Options = x%x% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Slash", Options, Font, Width, Height)
- ;these need to be fixed visually
- y:=Fontstylesize*4
- Color:=resistances.Heat.2
- Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Heat",Options , Font, Width, Height)
- y:=Fontstylesize*5
- Color:=resistances.Cold.2
- Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Cold", Options , Font, Width, Height)
- y:=Fontstylesize*6
- Color:=resistances.Matter.2
- Options = x0 y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Matter", Options , Font, Width, Height)
- Longest2:=0
- Longest2:=Fontstylesize*4
- y:=Fontstylesize*4
- Color:=resistances.Energy.2
- Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Energy", Options , Font, Width, Height)
- y:=Fontstylesize*5
- Color:=resistances.Spirit.2
- Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Spirit", Options , Font, Width, Height)
- y:=Fontstylesize*6
- Color:=resistances.Body.2
- Options = x%Longest2% y%y% w90p Centre Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Body", Options , Font, Width, Height)
- Longest2:=0
- }
- if (AllResist=3)
- {
- }
- UpdateLayeredWindow(hwnd1, hdc, targetwindowx,targetwindowy, Width, Height)
- }
- if (dropshadow=1)
- {
- SelectObject(hdc, obm)
- DeleteObject(hbm)
- DeleteDC(hdc)
- Gdip_DeleteGraphics(G)
- hbm := CreateDIBSection(Width, Height)
- hdc := CreateCompatibleDC()
- obm := SelectObject(hdc, hbm)
- G := Gdip_GraphicsFromHDC(hdc)
- Gdip_SetSmoothingMode(G, 4)
- pBrush := Gdip_BrushCreateSolid(0x00000000)
- Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20)
- }
- return
- }
- return
- ;--------------------------------------------
- ;--------------------------------------config gui 2
- config:
- IniRead, start, %config%, Keys, start
- IniRead, exit, %config%, Keys, exit
- IniRead, configkey, %config%, Keys, configkey
- IniRead, chatlogkey, %config%, Keys, chatlogkey
- IniRead, chatLog, %config%, chatlog, file
- IniRead, main, %config%, window position, main
- IniRead, relative, %config%, options, relative , 0
- IniRead, Resist1, %config%, options, Resist1
- IniRead, Resist2, %config%, options, Resist2
- Iniread, dropshadow, %config%,options,dropshadow
- Iniread, Fontstylefont, %config%, options, Fontstylefont
- Iniread, Fontstylesize, %config%, options, Fontstylesize
- Hotkey, ~LButton, daoc, off
- Hotkey, %start%, start, off
- Hotkey, %exit%, escape, off
- Hotkey, %configkey%, config, off
- gui,3:hide
- gui,1: hide
- Gui,2: +e0x20 +LastFound
- Gui,2: Add, Tab3, x0 y5 w619 h341 -wrap, Configuration| FAQ
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Groupbox, x7 y32 w606 h95, [Scout] Instructions
- Gui,2: Font,
- 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).
- Gui,2: Add, Text, x16 y+5, 2) Select the directory where your chat.log file is located. Typically this would be in:
- Gui,2: Add, Text, x30 y+5, C:\Users\USERNAME\Documents\Electronic Arts\Dark Age of Camelot
- 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.
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Groupbox, x7 y+13 w143 h120, [Scout] Keybinds
- Gui,2: Font,
- Gui,2: Add, Text, x61 y155, Start Script
- Gui,2: Add, Text, x61 y+10, Chatlog (F1-F12)
- Gui,2: Add, Text, x61 y+10, Configurations
- Gui,2: Add, Text, x61 y+10, Exit
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Groupbox, x159 y131 w164 h120, [Scout] Options
- Gui,2: Font,
- Gui,2: Add, Checkbox, x165 y155 Checked%relative%, Use relative realm colors
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Text, x311 y155, ?
- Gui,2: Font,
- Gui,2: Add, Radio, x165 y+10 gCheck vResist1, Show melee resistances
- Gui,2: Add, Radio, x165 y+10 gCheck vResist2, Show all resistances
- Gui,2: Add, Radio, x165 y+10 gCheck vResist3, No resists
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Text, x311 y178,?
- Gui,2: Font,
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Text, x311 y201,?
- Gui,2: Font,
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Text, x311 y224,?
- Gui,2: Font,
- Gui,2: Add, Text, x307 y156 h14 w1 0x11
- Gui,2: Add, Text, x307 y179 h14 w1 0x11
- Gui,2: Add, Text, x307 y202 h14 w1 0x11
- Gui,2: Add, Text, x307 y225 h14 w1 0x11
- Gui,2: Add, Hotkey, x16 y152 w40 h19 vstart, %start%
- Gui,2: Add, Hotkey, x16 y+4 w40 h19 vchatlogkey gchatlogged, %chatlogkey%
- Gui,2: Add, Hotkey, x16 y+4 w40 h19 vconfigkey, %configkey%
- Gui,2: Add, Hotkey, x16 y+4 w40 h19 vexit, %exit%
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Groupbox, x332 y131 w281 h120, [Scout] Fontstyle
- Gui,2: Font
- 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
- Gui,2: Add, DropDownList, x338 y+2 w100 vFontstylesize, 12|13|14|15|16|17|18|19|20|21|22|23|24
- Gui,2: Add, Text, x442 y155, Fontname
- Gui,2: Add, Text, x442 y+10, Fontsize
- Gui,2: Add, Checkbox, x338 y+10 vdropshadow, Font with dropshadow
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Groupbox, x7 y255 w606 h56, [Scout] Chatlog Directory
- Gui,2: Font,
- Gui,2: Add, Edit, x14 y276 w400 h19 +ReadOnly vChatlogLoc,%Chatlog%
- Gui,2: Add, Button, x416 y275 w20 h21 gchatlog, ...
- Gui,2: Add, Button, x7 y+22 w64 h19 gbuttonsave, Save
- Gui,2: Show, w619 h342 Center, DAoC Scout - Configuration
- Gui,2: Tab, 2
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Groupbox, x7 y32 w606 h85, [Scout] About
- Gui,2: Font,
- 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.
- Gui,2: Add, Text, x16 y+5, The script is programmed in Autohotkey by Bysan and Teehehe with inspiration from Lerox.
- Gui,2: Font, Normal c1e91bb
- Gui,2: Add, Groupbox, x7 y122 w606 h59, [Scout] Contact
- Gui,2: Font,
- Gui,2: Add, Text, x16 y141, Errors and questions can be reported at:
- Gui,2: Add, Link, x25 y+5 cBlue BackgroundTrans, <a href="https://discord.gg/TqX3b3G">- Discord</a>
- SetTimer, ToolTip
- var_Static9 = Target info color based on realm color. ; Put this at the top along with any others you want to try.
- var_Static10 = Shows Crush/Thrust/Slash resistances.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
- var_Static11 = Shows Crush/Thrust/Slash in addition to caster type vulnerabilities.`nGreen = Vulnerable`nRed = Resistant`nWhite = Neutral
- var_Static12 = Shows no resists.
- GuiControl,2: , Button5, %Resist1%
- GuiControl,2: , Button6, %Resist2%
- GuiControl,2: , Button7, %dropshadow%
- GuiControl,2: ChooseString, Fontstylefont, %Fontstylefont%
- GuiControl,2: ChooseString, Fontstylesize, %Fontstylesize%
- options3=s%Fontstylesize%
- ToolTip:
- MouseGetPos, , , id, control
- WinGetTitle, title, ahk_id %id%
- if title = DAoC Scout - Configuration
- {
- tmpVar := var_%control%
- ToolTip, %tmpVar%
- }
- return
- Return
- ;-------------------------------------web function
- get(URL){
- ComObjError(false)
- r:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
- r.Open("GET", URL, true),r.Send(),r.WaitForResponse()
- return r.ResponseText
- }
- ;----------------------------------------------
- ;--------------------------------------------readchatlog for target line
- FileReadLineFromBottom(chatLog, Offset)
- {
- FileRead f1, % chatLog
- StringReplace f1, f1, `n, `n, UseErrorLevel
- FileReadLine Line, % chatLog, ErrorLevel + 1 - Offset
- Filedelete, % chatLog
- if RegExMatch(Line, "You target \[(.*)\]\.", Output)
- Return Output1
- }
- FindName(cLog)
- {
- Loop, Read, % cLog
- line_count := A_Index
- Loop,
- {
- lineIndex := (line_count-A_Index+1)
- FileReadLine, string, %cLog%, %lineIndex%
- if RegExMatch(string, "You target \[(.*)\]\.", Output)
- Return Output1
- if lineIndex = 0
- Break
- }
- }
- ----------------------------------------
- Check:
- gui, submit, nohide
- if (Resist1= 0 and Resist3=0)
- AllResist:=2
- If (Resist2=0 and Resist3=0)
- AllResist:=1
- If (Resist1=0 and Resist2=0)
- AllResist:=3
- Return
- ;---------------------------------------gui stuff
- uiMove:
- PostMessage, 0xA1, 2,,, A
- Return
- ;--- Tray2
- Quit:
- ExitApp
- Console:
- ListLines
- Return
- OpenPayPal:
- Run "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TMRB3RCMXPGBN&source=url"
- Return
- AboutClose:
- DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0x90000)
- Gui, About:Cancel
- Return
- ;----------------------------------exit
- escape:
- exitapp
- return
- ;--------------------------close config window
- 2GuiClose:
- gui, 2:destroy
- GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
- gui, 1:show
- Hotkey, %start%, start, on
- Hotkey, %exit%, escape, on
- Hotkey, %configkey%, config, on
- return
- ;-------------------------folder select
- chatlog:
- Gui,2: +OwnDialogs
- fileselectfolder, folder
- folder:= RegExReplace(Folder, "\\$")
- chatlog = %folder%\%file%
- Iniwrite, %chatlog%, %config%, chatlog, file
- GuiControl, , ChatlogLoc, %chatLog%
- return
- ;--------------------------------------save button
- buttonsave:
- GuiControlGet, start, 2:
- GuiControlGet, exit, 2:
- GuiControlGet, configkey, 2:
- GuiControlGet, chatlogkey, 2:
- GuiControlGet, relative, 2:
- GuiControlGet, Resist1, 2:
- GuiControlGet, Resist2, 2:
- GuiControlGet, dropshadow, 2:
- GuiControlget, Fontstylefont, 2:
- GuiControlget, Fontstylesize, 2:
- ;saves keys from gui to ini
- ;--------------------------checks for duplicate hotkey
- Keylist := [start, exit, configkey, chatlogkey]
- Keys :={}
- For each, key in keylist
- {
- If !(keys.haskey(key))
- Keys[key] := 1
- Else
- {
- Msgbox Error! Make sure the keys are unique!
- Return
- }
- }
- ;-----------------------------------------
- Iniwrite, %start%, %config%, Keys, start
- Iniwrite, %exit%, %config%, Keys, exit
- Iniwrite, %configkey%, %config%, Keys, configkey
- Iniwrite, %chatlogkey%, %config%, Keys, chatlogkey
- IniWrite, %relative%, %config%, options, relative
- IniWrite, %Resist1%, %config%, options, Resist1
- IniWrite, %Resist2%, %config%, options, Resist2
- IniWrite, %dropshadow%, %config%, options, dropshadow
- IniWrite, %Fontstylefont%, %config%, options, Fontstylefont
- Iniwrite, %Fontstylesize%, %config%, options, Fontstylesize
- gui, 2:destroy
- ;------------------------------------------read ini file and assign keys
- IniRead, start, %config%, Keys, start
- IniRead, exit, %config%, Keys, exit
- IniRead, configkey, %config%, Keys, configkey
- IniRead, chatlogkey, %config%, Keys, chatlogkey
- IniRead, relative, %config%, options, relative
- IniRead, Resist1, %config%, options, Resist1
- IniRead, Resist2, %config%, options, Resist2
- iniread, dropshadow, %config%,options, dropshadow
- Iniread, Fontstylefont, %config%, options, Fontstylefont
- Iniread, Fontstylesize, %config%, options, Fontstylesize
- options3=s%Fontstylesize%
- ;-----------------------------------------------
- GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
- gui,1:show
- Hotkey, %start%, start, on
- Hotkey, %exit%, escape, on
- Hotkey, %configkey%, config, on
- return
- ;------------------------chatlog key must be a function key possible other keys add to list must be wrapped in to work {F1}
- ;{ins}{del} etc... https://www.autohotkey.com/docs/commands/Send.htm
- chatlogged:
- GuiControlGet chatlogkey, 2:
- keylist2:=["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]
- if !Contains(keylist2, chatlogkey)
- msgbox Please enter a function key F1-F12.
- Contains(obj, chatlogkey) {
- for i, val in obj {
- if(val = chatlogkey) {
- return true
- }
- }
- }
- return
- GetColor:
- alblist:=["Briton","Highlander","Avalonian","Saracen","Inconnu","Half Ogre"]
- hiblist:=["Lurikeen","Celt","Sylvan","Firbolg","Elf","Shar"]
- midlist:=["Troll","Dwarf","Kobold","Norseman","Valkyn","Frostalf"]
- Error:=["Error"]
- if Contains(alblist, charRace)
- targetColor = cFFd60000
- else if Contains(hiblist, charRace)
- targetColor = cFF37d600
- else if Contains(midlist, charRace)
- targetColor = cFF0056d6
- else
- targetColor=cFFb80af2
- Return
- WM_LBUTTONDOWN()
- {
- PostMessage, 0xA1, 2
- }
- MsgMonitor(wParam, lParam)
- {
- X := lParam & 0xFFFF
- Y := lParam >> 16
- if (oX!=X)||(oY!=Y)
- {
- if (A_Gui=1)
- iniwrite, x%X% y%Y%,%config%,window position,main
- if (A_Gui=2)
- iniwrite, x%X% y%Y%,%config%,window position,config
- if (A_Gui=3)
- {
- if (x!=32768)
- {
- iniwrite, %X%,%config%,window position,targetwindowx
- iniwrite, %Y%,%config%,window position,targetwindowy
- }
- }
- oX:=%X%
- oY:=%Y%
- }
- IniRead, targetwindowx, %config%, window position, targetwindowx
- IniRead, targetwindowy, %config%, window position, targetwindowy
- }
- GetResist:
- 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"]
- ;alb
- if (charClass="Armsman")||(charClass="Paladin")||(charClass="Armswoman")
- 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"]}
- if (charClass="Cleric")||(charClass="Mercenary")||(charClass="Minstrel")||(charClass="Reaver")
- 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"]}
- if (charClass="Scout")
- 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"]}
- if (charClass="Friar")||(charClass="Infiltrator")
- 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"]}
- if (charClass="Theurgist")||(charClass="Wizard")||(charClass="Cabalist")||(charClass="Sorcerer")||(charClass="Necromancer")
- 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"]}
- ;hib
- if (charClass="Champion")||(charClass="Druid")||(charClass="Hero")||(charClass="Warden")
- 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"]}
- if (charClass="Bard")||(charClass="Blademaster")||(charClass="Ranger")
- 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"]}
- if (charClass="Nightshade")
- 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"]}
- if (charClass="Animist")||(charClass="Enchanter")||(charClass="Mentalist")||(charClass="Eldritch")||(charClass="Valewalker")
- 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"]}
- ;mid
- if(charClass="Healer")||(charClass="Shaman")||(charClass="Skald")||(charClass="Thane")||(charClass="Warrior")
- 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"]}
- if (charClass="Berserker")||(charClass="Hunter")||(charClass="Savage")
- 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"]}
- if (charClass="Shadowblade")
- 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"]}
- if (charClass="Bonedancer")||(charClass="Runemaster")||(charClass="Spiritmaster")
- 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"]}
- return
- About:
- IfNotEqual, FirstTimeA, No
- {
- Gui, About:-Caption +Border +LastFound
- WinGet GUI_ID, ID
- Gui, About:Color, ffffff, ffffff
- Gui, About:Font, S10 c1e91bb Bold,verdana
- Gui, About:Add, Text, x185 y27 w170 h20, DAoC Scout
- Gui, About:Font, S10 CDefault Normal, Verdana
- Gui, About:Add, Text, x185 y+3 w270, A Dark Age of Camelot tool that`nlooks up a targets information.
- Gui, About:Add, Text, x183 y+5 w248
- Gui, About:Font, S7 CDefault normal, Verdana
- Gui, About:Add, Text, x185 y92 w410 h73,
- (LTrim
- The script reads your chat.log to find your
- current target, looks the name up on the Phoenix
- Herald and returns the essential information.
- All information used by the script is publicly
- available, and does not read or modify any
- game files except for the chat.log.
- )
- Gui, About:Add, Text, x183 y+4 w248
- Gui, About:Add, Text, x16 y174 w410 h24,
- (LTrim
- The script is programmed by Bysan and Teehehe in AHK. For feedback, bug reports and additional information, please visit:
- )
- Gui, About:Add, Link, x25 y+5 cBlue BackgroundTrans, <a href="https://discord.gg/TqX3b3G">- Discord</a>
- Gui, About:Add, Button, 0x8000 x362 y+1 w70 h21 gAboutClose, Close
- Gui, About:Add, Picture, x17 y17 w150 h150, %A_ScriptDir%\Resources\LookupImg.png
- FirstTimeA = No
- }
- height := 240
- width := 435
- Gui, About:Show, Hide h%height% w%width%, DAoC Scout
- DllCall("AnimateWindow",UInt,GUI_ID,UInt,750,UInt,0xa0000)
- return
- MeasureText(Str, FontOpts = "", FontName = "") {
- Static DT_FLAGS := 0x0520 ; DT_SINGLELINE = 0x20, DT_NOCLIP = 0x0100, DT_CALCRECT = 0x0400
- Static WM_GETFONT := 0x31
- Size := {}
- Gui, New
- If (FontOpts <> "") || (FontName <> "")
- Gui, Font, %FontOpts%, %FontName%
- Gui, Add, Text, hwndHWND
- SendMessage, WM_GETFONT, 0, 0, , ahk_id %HWND%
- HFONT := ErrorLevel
- HDC := DllCall("User32.dll\GetDC", "Ptr", HWND, "Ptr")
- DllCall("Gdi32.dll\SelectObject", "Ptr", HDC, "Ptr", HFONT)
- VarSetCapacity(RECT, 16, 0)
- DllCall("User32.dll\DrawText", "Ptr", HDC, "Str", Str, "Int", -1, "Ptr", &RECT, "UInt", DT_FLAGS)
- DllCall("User32.dll\ReleaseDC", "Ptr", HWND, "Ptr", HDC)
- Gui, Destroy
- Size.W := NumGet(RECT, 8, "Int")
- Size.H := NumGet(RECT, 12, "Int")
- Return Size
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement