Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance, Force
- #NoEnv
- #MaxHotkeysPerInterval 99000000
- #HotkeyInterval 99000000
- #KeyHistory 0
- #Persistent ; Stay open in background
- #Include %A_ScriptDir%\Resources\Gdip_All.ahk
- #Include %A_ScriptDir%\Resources\Gdip_Ext.ahk
- ListLines Off
- Process, Priority, , A
- SetBatchLines, -1
- SetKeyDelay, -1, -1
- SetMouseDelay, -1
- SetDefaultMouseSpeed, 0
- SetWinDelay, -1
- SetControlDelay, -1
- SendMode Input
- SetTitleMatchMode,2
- DetectHiddenWindows, On
- SetWorkingDir %A_ScriptDir%
- CoordMode, Mouse, Screen
- Menu, Tray, Icon, %A_ScriptDir%\Resources\Lookup.ico
- ; --- Global Variables
- global chatlogkey, start, exit, configkey, config, title, targetwindowx, targetwindowy, prog, Version_Number, changeLog, Update_URL
- toggle:=1
- config:="config.ini"
- PH:="<h1>Phoenix Herald</h1>"
- file2=\Electronic Arts\Dark Age of Camelot\
- file=chat.log
- iniFile=%A_ScriptDir%\config.ini
- Version_Number := 1.0 ;The script's version number
- Update_URL := "https://dcscout.000webhostapp.com/DAoCScout/Version.ini"
- changeLog := get("https://dcscout.000webhostapp.com/DAoCScout/changelog.txt")
- ;--- 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, Check for Update, Update
- 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.ini. 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, 0, %config%, OPTIONS, Resist1
- IniWrite, 0, %config%, OPTIONS, Resist2
- IniWrite, 1, %config%, OPTIONS, Resist3
- IniWrite, 1, %config%, OPTIONS, dropshadow
- IniWrite, Arial, %config%, OPTIONS, Fontstylefont
- IniWrite, 16, %config%, OPTIONS, Fontstylesize
- IniWrite, 1, %config%, OPTIONS, boldhighlight
- Gosub config
- }
- ;--- 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, Resist3, %config%, OPTIONS,Resist3 , 0
- IniRead, dropshadow, %config%,OPTIONS,dropshadow
- IniRead, Fontstylefont, %config%, OPTIONS, Fontstylefont
- IniRead, Fontstylesize, %config%, OPTIONS, Fontstylesize
- Loop, Read, %iniFile%
- {
- checkExist := InStr(A_LoopReadLine,"boldhighlight")-1
- }
- if checkExist != 0
- IniWrite, 1, %config%, OPTIONS, boldhighlight
- IniRead, boldhighlight, %config%, OPTIONS, boldhighlight
- FileGetSize, filesize, %chatLog%
- oldsize:=filesize
- 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, off
- 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 w200,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
- gui,1: hide
- Update()
- Return
- ;updater stuff
- Update(){
- If winactive("DAoC Scout - Configuration")
- return
- else{
- Gui,ProgressBar: -Caption +Border +AlwaysOnTop
- Gui,ProgressBar: Margin, 5,5
- Gui,ProgressBar: Add, Picture, x1 y5, Resources\Scout.png
- Gui,ProgressBar: Add, Progress, x4 w337 h20 BackgroundC9C9C9 c001216 vProg -Smooth, 50
- Gui,ProgressBar: Font, c001216 s9 Normal, Verdana
- Gui,ProgressBar: Add, Text, x0 y+5 w310 +Center vProgText BackgroundTrans
- Gui,ProgressBar: Show
- global ProgText, Prog
- GuiControl,ProgressBar:, Prog, 0 ; ProgressBar!
- GuiControl,ProgressBar:, ProgText, Checking for updates... ; Infotext in the Progressbar
- Sleep 50
- Random, p, 1, 10
- GuiControl,ProgressBar:, Prog, %p%
- Sleep 100
- Version_Number = %Version_Number% ;The script's version number
- changeLog = %changeLog%
- Random, p, 11, 35
- GuiControl,ProgressBar:, Prog, %p%
- Sleep 100
- Update_URL = %Update_URL%
- Random,Filler,10000000,99999999
- Version_File := A_Temp . "\" . Filler . ".ini"
- Random, p, 36, 55
- GuiControl,ProgressBar:, Prog, %p%
- Sleep 100
- UrlDownloadToFile,%Update_URL%,%Version_File%
- IniRead,Version,%Version_File%,Info,Version
- Random, p, 60, 85
- GuiControl,ProgressBar:, Prog, %p%
- FileDelete,%Version_File%
- GuiControl,ProgressBar:, ProgText, Loading functions... ;
- sleep 100
- GuiControl,ProgressBar:, Prog, 99
- sleep 100
- Gui,ProgressBar: Destroy
- If (Version > Version_Number)
- {
- Gui,1: Hide
- Gui,Update: +AlwaysOnTop
- Gui,Update: Color, ffffff, ffffff
- Gui,Update: Add, GroupBox, w430 h90 cGreen, Update available!
- Gui,Update: Add, Text, x20 y30, Installed version:
- Gui,Update: Add, Text, x20 y+2, Latest version:
- If (Version > Version_Number)
- {
- currversColor := "cRed"
- newversColor := "cGreen"
- }
- If (Version <= Version_Number)
- {
- currversColor := "cBlack"
- newversColor := "cBlack"
- }
- Gui,Update: Add, Text, x110 y30 %currversColor%, %Version_Number%
- Gui,Update: Add, Text, x110 y+2 %newversColor%, %Version%
- Gui,Update: Font, Underline
- Gui,Update: Add, Text, x20 y68 gOpenZip c0066cc, Download ZIP
- Gui,Update: Font
- Gui,Update: Add, Button, x107 y63 gButtonCheckForUpdates, Update
- Gui,Update: Add, Picture, x199 y33 w112 h19, %A_ScriptDir%\Resources\discordLogo.png
- Gui,Update: Font, Underline
- Gui,Update: Add, Text, x200 y61 gOpenDiscord c0066cc, bysanUI/Scout Discord
- Gui,Update: Font
- Gui,Update: Add, Text, x321 y32 h45 0x11
- Gui,Update: Add, Picture, x332 y33 w96 h21, %A_ScriptDir%\Resources\paypalLogo.png
- Gui,Update: Font, Underline
- Gui,Update: Add, Text, x331 y61 gOpenPayPal c0066cc, Support DAoC-Scout
- Gui,Update: Font
- Gui,Update: Add, Edit, x10 ReadOnly w430 h238 BackgroundTrans, %changeLog%
- Gui,Update: Add, Button, x403 y348 gUpdateClose, Close
- Gui,Update: Show, w450 h380 xCenter yCenter, DAoC-Scout Update
- Return
- }
- else
- {
- hotkey, %start%, on
- Gui,1: Show, %main% w173 h78 , DAoC Scout
- return
- }
- }
- Return
- }
- ;--- Start key pushed
- start:
- Gui,1: hide
- ;gui,3:show
- Hotkey, ~LButton, toggle
- options3=s%Fontstylesize%
- Ifwinexist,ahk_exe game.dll
- {
- winactivate
- winwaitactive, ahk_exe game.dll
- }
- else
- winwaitactive, ahk_exe game.dll
- return
- daoc:
- If winactive("ahk_exe game.dll")
- {
- Gui,3:Show, NA
- Send {%chatlogkey%}
- While A_TimeSinceThisHotkey < 350
- {
- If A_TimeSinceThisHotkey>=350
- Break
- }
- Send {%chatlogkey%}
- While A_TimeSinceThisHotkey < 400
- {
- If A_TimeSinceThisHotkey>=400
- Break
- }
- g:=0
- While (filesize=oldsize)
- {
- g++
- FileGetSize, filesize, %chatLog%
- If (filesize != oldsize)
- Break
- If (g>=30)
- break
- }
- oldsize:=filesize
- 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,}"," ")""
- charLevel2 := RegExReplace(unfLevel,"\x20{2,}"," ")""
- charLevel := RegExReplace(charLevel2,"Level ")
- charLevel := "Lvl"+charLevel
- 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, 0
- 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)
- Gdip_DeleteBrush(pBrush)
- }
- 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%
- {
- Font:=Fontstylefont
- FontSizes := [options3]
- ; Measure Text Width
- For Each, Size in FontSizes {
- T := MeasureText(charName, "s" . Size, Fontstylefont)
- XW0 := T.W
- }
- For Each, Size in FontSizes {
- T := MeasureText(charRace, "s" . Size, Fontstylefont)
- XW1 := T.W
- }
- For Each, Size in FontSizes {
- T := MeasureText(charClass, "s" . Size, Fontstylefont)
- XW2 := T.W
- }
- For Each, Size in FontSizes {
- T := MeasureText(charLevel, "s" . Size, Fontstylefont)
- XW3 := T.W
- }
- For Each, Size in FontSizes {
- T := MeasureText(charRankLevel, "s" . Size, Fontstylefont)
- XW4 := T.W
- }
- ; Define gap width
- if (Fontstylefont = "Tahoma")
- {
- xwI := 1.3
- }
- else if (Fontstylefont = "Verdana")
- {
- xwI := 1.5
- }
- else if ((Fontstylefont = "Arial") or (Fontstylefont = "Trebuchet MS") or (Fontstylefont = "Ubuntu Mono"))
- {
- xwI := 1.6
- }
- else if ((Fontstylefont = "Segoe UI") or (Fontstylefont = "Bariol") or (Fontstylefont = "Montserrat"))
- {
- xwI := 1.9
- }
- else if ((Fontstylefont = "Noto Sans UI") or (Fontstylefont = "Overpass"))
- {
- xwI := 2.2
- }
- else if (Fontstylefont = "Gotham")
- {
- xwI := 2.9
- }
- else
- {
- xwI := 100.5
- }
- Fontsize_x := 17
- ; Placement
- XW1_1 := (XW1/2)-(0.5*Fontstylesize)
- if (XW1 > XW2)
- XW2_2 := (Fontstylesize/xwI)+(((XW2/2)+(0.5*Fontstylesize))-((XW2+XW1)*0.1008))
- else if (XW1 <= XW2)
- XW2_2 := (Fontstylesize/xwI)+((XW2/2)+(0.5*Fontstylesize)-((XW2+XW1)*0.1008))
- XW3_1 := (XW3/2)-(0.5*Fontstylesize)
- if (XW3 > XW4)
- XW4_2 := (Fontstylesize/xwI)+(((XW4/2)+(0.5*Fontstylesize))-((XW4+XW3)*0.1008))
- else if (XW3 <= XW4)
- XW4_2 := (Fontstylesize/xwI)+((XW4/2)+(0.5*Fontstylesize)-((XW4+XW3)*0.1008))
- X1_0 := (XWI/2)-(0.5*Fontstylesize)
- y:=0
- Options = x%X1_0% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charName , Options , Font, Width, Height)
- If (unfGuild == " </h2>")
- {
- y:=Fontstylesize
- if boldhighlight=1
- Options = x-%XW4_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- else
- Options = x-%XW4_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
- %TTG%(G, charLevel, Options , Font, Width, Height)
- Options = x%XW3_1% y%y% w90p Center %targetColor% %options2% r4 %options3%
- %TTG%(G, charRankLevel , Options , Font, Width, Height)
- y:=Fontstylesize*2.05
- if boldhighlight=1
- Options = x-%XW2_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
- else
- Options = x-%XW2_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charRace, Options , Font, Width, Height)
- Options = x%XW1_1% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charClass, Options , Font, Width, Height)
- }
- Else
- {
- y:=Fontstylesize
- if boldhighlight=1
- Options = x%X1_0% y%y% w90p Center %targetColor% %options2% r4 %options3%
- else
- Options = x%X1_0% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, "<" charGuild ">" , Options , Font, Width, Height)
- y:=Fontstylesize*2.05
- if boldhighlight=1
- Options = x-%XW4_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
- else
- Options = x-%XW4_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charLevel, Options , Font, Width, Height)
- Options = x%XW3_1% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charRankLevel , Options , Font, Width, Height)
- y:=Fontstylesize*3.05
- if (boldhighlight=1)
- Options = x-%XW2_2% y%y% w90p Center %targetColor% %options2% r4 %options3%
- else
- Options = x-%XW2_2% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charRace, Options , Font, Width, Height)
- Options = x%XW1_1% y%y% w90p Center Bold %targetColor% %options2% r4 %options3%
- %TTG%(G, charClass, Options , Font, Width, Height)
- }
- gosub getresist
- If (Resist1=1)
- If (unfGuild == " </h2>")
- {
- y:=Fontstylesize*3.2
- x:=-Fontstylesize*4
- Color:=resistances.Thrust.2
- Options = x%x% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Thrust", Options , Font, Width, Height)
- y:=Fontstylesize*3.2
- Color:=resistances.Crush.2
- Options = x0 y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Crush", Options, Font, Width, Height)
- Longest2:=Fontstylesize*4
- y:=Fontstylesize*3.2
- Color:=resistances.Slash.2
- Options = x%Longest2% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Slash", Options, Font, Width, Height)
- }
- Else
- {
- y:=Fontstylesize*4.2
- x:=-Fontstylesize*4
- Color:=resistances.Thrust.2
- Options = x%x% y%y% w90p Center 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 Center 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 Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Slash", Options, Font, Width, Height)
- }
- If (Resist2=1)
- If (unfGuild == " </h2>")
- {
- y:=Fontstylesize*3
- x:=-Fontstylesize*4
- Color:=resistances.Thrust.2
- Options = x%x% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Thrust", Options , Font, Width, Height)
- y:=Fontstylesize*4
- Color:=resistances.Crush.2
- Options = x%x% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Crush", Options, Font, Width, Height)
- y:=Fontstylesize*5
- Color:=resistances.Slash.2
- Options = x%x% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Slash", Options, Font, Width, Height)
- y:=Fontstylesize*3
- Color:=resistances.Heat.2
- Options = x0 y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Heat",Options , Font, Width, Height)
- y:=Fontstylesize*4
- Color:=resistances.Cold.2
- Options = x0 y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Cold", Options , Font, Width, Height)
- y:=Fontstylesize*5
- Color:=resistances.Matter.2
- Options = x0 y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Matter", Options , Font, Width, Height)
- Longest2:=Fontstylesize*4
- y:=Fontstylesize*3
- Color:=resistances.Energy.2
- Options = x%Longest2% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Energy", Options , Font, Width, Height)
- y:=Fontstylesize*4
- Color:=resistances.Spirit.2
- Options = x%Longest2% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Spirit", Options , Font, Width, Height)
- y:=Fontstylesize*5
- Color:=resistances.Body.2
- Options = x%Longest2% y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Body", Options , Font, Width, Height)
- }
- Else
- {
- y:=Fontstylesize*4
- x:=-Fontstylesize*4
- Color:=resistances.Thrust.2
- Options = x%x% y%y% w90p Center 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 Center 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 Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Slash", Options, Font, Width, Height)
- y:=Fontstylesize*4
- Color:=resistances.Heat.2
- Options = x0 y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Heat",Options , Font, Width, Height)
- y:=Fontstylesize*5
- Color:=resistances.Cold.2
- Options = x0 y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Cold", Options , Font, Width, Height)
- y:=Fontstylesize*6
- Color:=resistances.Matter.2
- Options = x0 y%y% w90p Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Matter", Options , Font, Width, Height)
- Longest2:=Fontstylesize*4
- y:=Fontstylesize*4
- Color:=resistances.Energy.2
- Options = x%Longest2% y%y% w90p Center 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 Center 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 Center Bold %Color% %options2% r4 %options3%
- %TTG%(G, "Body", Options , Font, Width, Height)
- }
- UpdateLayeredWindow(hwnd1, hdc, targetwindowx,targetwindowy, Width, Height)
- }
- If (filesize>40000)
- {
- Filedelete, % chatLog
- FileAppend , , chatLog
- FileGetSize, filesize, %chatLog%
- oldsize:=filesize
- }
- ;clearing variables to free memory
- unfName :=
- unfGuild :=
- unfClass :=
- unfLevel :=
- unfRankLevel :=
- unfRace :=
- unfRankName :=
- charName :=
- unfGuild1 :=
- unfGuild2 :=
- unfGuild3 :=
- charGuild :=
- charClass :=
- charLevel :=
- unfRankLevel1 :=
- charRankLevel :=
- charRace :=
- charRankName :=
- lines:=
- resistances:=
- columns :=
- ; end clearing
- 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, Resist3, %config%, options,Resist3 , 0
- IniRead, dropshadow, %config%,options,dropshadow
- IniRead, Fontstylefont, %config%, options, Fontstylefont
- IniRead, Fontstylesize, %config%, options, Fontstylesize
- IniRead, boldhighlight, %config%, OPTIONS, boldhighlight
- 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|-----------------------|Bariol|Gotham|Montserrat|Noto Sans UI|Overpass|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: Add, Checkbox, x338 y+10 vboldhighlight, Bold highlights
- 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: Font, underline
- Gui,2: Add, Text, x25 y+5 gOpenDiscord c0066cc,- Discord
- Gui,2: Font
- 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, %Resist3%
- GuiControl,2: , Button9, %dropshadow%
- GuiControl,2: , Button10, %boldhighlight%
- 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
- ;-------------------------------------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
- FindName(chatLog){
- Loop, Read, % chatLog
- line_count := A_Index
- Loop, 30
- {
- lineIndex := (line_count-A_Index+1)
- FileReadLine, string, %chatLog%, %lineIndex%
- If RegExMatch(string, "You target \[(.*)\]\.", Output)
- Return Output1
- If lineIndex = 0
- Return
- }
- }
- ----------------------------------------
- Check:
- gui, submit, nohide
- Return
- Quit:
- ExitApp
- OpenPayPal:
- Run "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TMRB3RCMXPGBN&source=url"
- Return
- OpenDiscord:
- Run "https://discord.gg/cARRWM3"
- Return
- OpenZIP:
- Run "https://dcscout.000webhostapp.com/DAoCScout/DAoCScout.zip"
- 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, %main% w173 h78 , DAoC Scout
- Hotkey, %start%, start, on
- Hotkey, %exit%, escape, on
- Hotkey, %configkey%, config, on
- Return
- ;-------------------------folder select
- chatlog:
- Gui,2: +OwnDialogs
- fileselectfolder, folder
- folder:= RegExReplace(Folder, "\\$")
- 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, Resist3, 2:
- GuiControlGet, dropshadow, 2:
- GuiControlget, boldhighlight, 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, %Resist3%, %config%, OPTIONS, Resist3
- IniWrite, %dropshadow%, %config%, OPTIONS, dropshadow
- IniWrite, %Fontstylefont%, %config%, OPTIONS, Fontstylefont
- IniWrite, %Fontstylesize%, %config%, OPTIONS, Fontstylesize
- IniWrite, %boldhighlight%, %config%, OPTIONS, boldhighlight
- 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, Resist3, %config%, OPTIONS, Resist3
- IniRead, dropshadow, %config%,OPTIONS, dropshadow
- IniRead, boldhighlight, %config%,OPTIONS, boldhighlight
- IniRead, Fontstylefont, %config%, OPTIONS, Fontstylefont
- IniRead, Fontstylesize, %config%, OPTIONS, Fontstylesize
- options3=s%Fontstylesize%
- 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)
- }
- ;-----------------------------------------------
- GuiControl,1: , text4,%start% - Start Script`n%configkey% - Configurations/FAQ`n%exit% - Exit
- Gui,1: Show, %main% w173 h78 , DAoC Scout
- 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
- }
- Return
- UpdateClose:
- Gui, Update: Destroy
- Gui,1: show, %main% w173 h78 , DAoC Scout
- hotkey, %start%, on
- Return
- ButtonCheckForUpdates:
- Check_ForUpdate(1, 1, "", "")
- GetResist:
- ;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")||(charClass="Sorceress")
- 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="Heroine")||(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")||(charClass="Enchantress")
- 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: Font, underline
- Gui, About: Add, Text, x25 y+5 gOpenDiscord c0066cc,- Discord
- Gui, About: Font
- 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
- Check_ForUpdate(_ReplaceCurrentScript = 1, _SuppressMsgBox = 0, _CallbackFunction = "", ByRef _Information = ""){
- Retry_Count := 3 ;Retry count for If/when anything goes wrong
- Random,Filler,10000000,99999999
- Version_File := A_Temp . "\" . Filler . ".ini"
- , Temp_FileName := A_Temp . "\" . Filler . ".tmp"
- , VBS_FileName := A_Temp . "\" . Filler . ".vbs"
- Loop,% Retry_Count
- {
- _Information := ""
- UrlDownloadToFile,%Update_URL%,%Version_File%
- IniRead,Version,%Version_File%,Info,Version,N/A
- If (Version = "N/A"){
- FileDelete,%Version_File%
- If (A_Index = Retry_Count)
- _Information .= "The version info file doesn't have a ""Version"" key in the ""Info"" section or the file can't be downloaded."
- Else
- Sleep,500
- Continue
- }
- If (Version > Version_Number){
- If (_SuppressMsgBox != 1 and _SuppressMsgBox != 3){
- MsgBox,0x4,New version available,There is a new version of %Script_Name% available.`nCurrent version: %Version_Number%`nNew version: %Version%`n`nWould you like to download it now?
- IfMsgBox,Yes
- MsgBox_Result := 1
- }
- If (_SuppressMsgBox or MsgBox_Result){
- IniRead,URL,%Version_File%,Info,URL,N/A
- If (URL = "N/A")
- _Information .= "The version info file doesn't have a valid URL key."
- Else {
- SplitPath,URL,,,Extension
- If (Extension = "ahk" And A_AHKPath = "")
- _Information .= "The new version of the script is an .ahk filetype and you do not have AutoHotKey installed on this computer.`r`nReplacing the current script is not supported."
- Else If (Extension != "exe" And Extension != "ahk")
- _Information .= "The new file to download is not an .EXE or an .AHK file type. Replacing the current script is not supported."
- Else {
- IniRead,MD5,%Version_File%,Info,MD5,N/A
- Loop,% Retry_Count
- {
- UrlDownloadToFile,%URL%,%Temp_FileName%
- IfExist,%Temp_FileName%
- {
- If (MD5 = "N/A"){
- _Information .= "The version info file doesn't have a valid MD5 key."
- , Success := True
- Break
- } Else {
- Ptr := A_PtrSize ? "Ptr" : "UInt"
- , H := DllCall("CreateFile",Ptr,&Temp_FileName,"UInt",0x80000000,"UInt",3,"UInt",0,"UInt",3,"UInt",0,"UInt",0)
- , DllCall("GetFileSizeEx",Ptr,H,"Int64*",FileSize)
- , FileSize := FileSize = -1 ? 0 : FileSize
- If (FileSize != 0){
- VarSetCapacity(Data,FileSize,0)
- , DllCall("ReadFile",Ptr,H,Ptr,&Data,"UInt",FileSize,"UInt",0,"UInt",0)
- , DllCall("CloseHandle",Ptr,H)
- , VarSetCapacity(MD5_CTX,104,0)
- , DllCall("advapi32\MD5Init",Ptr,&MD5_CTX)
- , DllCall("advapi32\MD5Update",Ptr,&MD5_CTX,Ptr,&Data,"UInt",FileSize)
- , DllCall("advapi32\MD5Final",Ptr,&MD5_CTX)
- FileMD5 := ""
- Loop % StrLen(Hex:="123456789ABCDEF0")
- N := NumGet(MD5_CTX,87+A_Index,"Char"), FileMD5 .= SubStr(Hex,N>>4,1) . SubStr(Hex,N&15,1)
- VarSetCapacity(Data,FileSize,0)
- , VarSetCapacity(Data,0)
- If (FileMD5 != MD5){
- FileDelete,%Temp_FileName%
- If (A_Index = Retry_Count)
- _Information .= "The MD5 hash of the downloaded file does not match the MD5 hash in the version info file."
- Else
- Sleep,500
- Continue
- } Else
- Success := True
- } Else {
- DllCall("CloseHandle",Ptr,H)
- Success := True
- }
- }
- } Else {
- If (A_Index = Retry_Count)
- _Information .= "Unable to download the latest version of the file from " . URL . "."
- Else
- Sleep,500
- Continue
- }
- }
- }
- }
- }
- } Else
- _Information .= "No update was found."
- FileDelete,%Version_File%
- Break
- }
- If (_ReplaceCurrentScript And Success){
- SplitPath,URL,,,Extension
- Process,Exist
- MyPID := ErrorLevel
- VBS_P1 =
- (LTrim Join`r`n
- On Error Resume Next
- Set objShell = CreateObject("WScript.Shell")
- objShell.Run "TaskKill /F /PID %MyPID%", 0, 1
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- )
- If (A_IsCompiled){
- SplitPath,A_ScriptFullPath,,Dir,,Name
- VBS_P2 =
- (LTrim Join`r`n
- Finished = False
- Count = 0
- Do Until (Finished = True Or Count = 5)
- Err.Clear
- objFSO.CopyFile "%Temp_FileName%", "%Dir%\%Name%.%Extension%", True
- If (Err.Number = 0) then
- Finished = True
- objShell.Run """%Dir%\%Name%.%Extension%"""
- Else
- WScript.Sleep(1000)
- Count = Count + 1
- End If
- Loop
- objFSO.DeleteFile "%Temp_FileName%", True
- )
- Return_Val := Temp_FileName
- } Else {
- If (Extension = "ahk"){
- FileMove,%Temp_FileName%,%A_ScriptFullPath%,1
- If (Errorlevel)
- _Information .= "Error (" . Errorlevel . ") unable to replace current script with the latest version."
- Else {
- VBS_P2 =
- (LTrim Join`r`n
- objShell.Run """%A_ScriptFullPath%"""
- )
- Return_Val := A_ScriptFullPath
- }
- } Else If (Extension = "exe"){
- SplitPath,A_ScriptFullPath,,FDirectory,,FName
- FileMove,%Temp_FileName%,%FDirectory%\%FName%.exe,1
- FileDelete,%A_ScriptFullPath%
- VBS_P2 =
- (LTrim Join`r`n
- objShell.Run """%FDirectory%\%FName%.exe"""
- )
- Return_Val := FDirectory . "\" . FName . ".exe"
- } Else {
- FileDelete,%Temp_FileName%
- _Information .= "The downloaded file is not an .EXE or an .AHK file type. Replacing the current script is not supported."
- }
- }
- VBS_P3 =
- (LTrim Join`r`n
- objFSO.DeleteFile "%VBS_FileName%", True
- )
- If (_SuppressMsgBox < 2)
- {
- If (InStr(VBS_P2, "Do Until (Finished = True Or Count = 5)"))
- {
- VBS_P3 .= "`r`nIf (Finished = False) Then"
- VBS_P3 .= "`r`nWScript.Echo ""Update failed."""
- VBS_P3 .= "`r`nElse"
- If (Extension != "exe")
- VBS_P3 .= "`r`nobjFSO.DeleteFile """ A_ScriptFullPath """"
- VBS_P3 .= "`r`nWScript.Echo ""DAoC-Scout has been updated!"""
- VBS_P3 .= "`r`nEnd If"
- } Else
- VBS_P3 .= "`r`nWScript.Echo ""DAoC-Scout has been updated!"""
- }
- FileDelete,%VBS_FileName%
- FileAppend,%VBS_P1%`r`n%VBS_P2%`r`n%VBS_P3%,%VBS_FileName%
- If (_CallbackFunction != ""){
- If (IsFunc(_CallbackFunction))
- %_CallbackFunction%()
- Else
- _Information .= "The callback function is not a valid function name."
- }
- RunWait,%VBS_FileName%,%A_Temp%,VBS_PID
- Sleep,2000
- Process,Close,%VBS_PID%
- _Information := "Error (?) unable to replace current script with the latest version.`r`nPlease make sure your computer supports running .vbs scripts and that the script isn't running in a pipe."
- }
- _Information := _Information = "" ? "None" : _Information
- Return Return_Val
- }
- MeasureText(Str, FontOpts = "", Fontstylefont = "") {
- Static DT_FLAGS := 0x0520 ; DT_SINGLELINE = 0x20, DT_NOCLIP = 0x0100, DT_CALCRECT = 0x0400
- Static WM_GETFONT := 0x31
- Size := {}
- Gui, New
- If (FontOpts <> "") || (Fontstylefont <> "")
- Gui, Font, %FontOpts%, %Fontstylefont%
- 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, W
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement