Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Commit

Permalink
Update from TradeMacro
Browse files Browse the repository at this point in the history
  • Loading branch information
aRTy42 committed Jan 8, 2019
1 parent 0d765c9 commit 1df6c71
Show file tree
Hide file tree
Showing 20 changed files with 4,160 additions and 419 deletions.
27 changes: 19 additions & 8 deletions Run_ItemInfo.ahk
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
; #####################################################################################################################
; # This script checks if the right AHK version is installed and runs the ItemInfo merge script.
; #####################################################################################################################
#Include *i %A_ScriptDir%\resources\Version.txt

FileRead versionFile, %A_ScriptDir%\resources\Version.txt
versionFilePath := A_ScriptDir "\resources\Version.txt"
FileRead, versionFile, %versionFilePath%
error := ErrorLevel
If (not StrLen(AHKVersionRequired) or error) {

If (not StrLen(versionFile) or error) {
If (RegExMatch(A_ScriptDir, "i)\.zip$")) {
MsgBox, 16, PoE-ItemInfo - Critical error, % "You are trying to run PoE-ItemInfo from inside a zip-archive, please unzip the whole folder. `n`nClosing script..."
ExitApp
} Else {
MsgBox, 16, PoE-ItemInfo - Critical error, % "Script couldn't read file """ A_ScriptDir "\resources\VersionTrade.txt"". `n`nClosing script..."
If (FileExist(versionFilePath)) {
MsgBox, 16, PoE-ItemInfo - Critical error, % "Script couldn't find the file """ A_ScriptDir "\resources\VersionTrade.txt"". `n`nClosing script..."
} Else {
MsgBox, 16, PoE-ItemInfo - Critical error, % "Script couldn't read/access the file """ A_ScriptDir "\resources\VersionTrade.txt"". `n`nClosing script..."
}
ExitApp
}
}
Else {
RegExMatch(versionFile, "i)ReleaseVersion.*?:=.*?""(.*?)""", relV)
ReleaseVersion := relV1
RegExMatch(versionFile, "i)AHKVersionRequired.*?:=.*?""(.*?)""", reqV)
AHKVersionRequired := reqV1
}

MsgWrongAHKVersion := "AutoHotkey v" . AHKVersionRequired . " or later is needed to run this script. It is important not to run version 2.x. `n`nYou are using AutoHotkey v" . A_AhkVersion . " (installed at: " . A_AhkPath . ")`n`nPlease go to http://ahkscript.org to download the most recent version."
If (A_AhkVersion < AHKVersionRequired or A_AhkVersion >= "2.0.00.00")
{
MsgBox, 16, Wrong AutoHotkey Version, % AHKVersionRequired
MsgWrongAHKVersion := "AutoHotkey v" . AHKVersionRequired . " or later is needed to run this script. It is important not to run version 2.x. or 1.0. `n`nYou are using AutoHotkey v" . A_AhkVersion . " (installed at: " . A_AhkPath . ")`n`nPlease go to http://ahkscript.org to download the most recent version."
If (A_AhkVersion < AHKVersionRequired or A_AhkVersion >= "2.0.00.00" or A_AhkVersion < "1.1.00.00")
{
MsgBox, 16, Wrong AutoHotkey Version, % MsgWrongAHKVersion
ExitApp
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Class_Console.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class console
}
show(GuiName:="")
{ ListLines,Off
Gui,% (GuiName?GuiName:this.name) ":Show"
Gui,% (GuiName?GuiName:this.name) ":Show", NA
ListLines,On
}
timeSinceLastCall(id:=1,reset:="")
Expand Down
75 changes: 75 additions & 0 deletions lib/IEComObjectTestCall.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#SingleInstance, force

userFolderPath = %1%

; don't use the fallback if it was completed successfully once
;
global Fallback := True
global wb1 :=
global wb2 :=
If (FileExist(userFolderPath "\IEComObjectCall.txt")) {
Fallback := False
}

url := "https://poe-trademacro.github.io/userCount/index.html"
Try {
wb1 := ComObjCreate("InternetExplorer.Application")
wb1.Visible := False
wb1.Navigate(url)
IELoad(wb1, loaded, userFolderPath)
} Catch error {
If (Fallback) {
Try {
wb2 := ComObjCreate("InternetExplorer.Application")
wb2.Visible := True
wb2.Navigate(url)
IELoad(wb2, loaded, userFolderPath, true)
} Catch e {
CleanIE()
}
}
}

CleanIE() {
Try {
wb1.Quit
wb2.Quit
} Catch e {

}
ExitApp
}

IELoad(wb, ByRef loaded = false, path = "", visible = false) ;You need to send the IE handle to the function unless you define it as global.
{
i := 0
If !wb ;If wb is not a valid pointer then quit
Return False
Loop
{
Sleep,100
Try {
loaded := wb.Document.getElementById("loaded").innerHTML = "Loaded." ? true : false
} catch e {

}
Try {
ready := wb.Document.Readystate
} catch a {

}
i++
}
Until ((ready = "Complete" and loaded or i = 2000))

If (loaded and not FileExist(path "\IEComObjectCall.txt")) {
FileAppend, true, %path%\IEComObjectCall.txt
Fallback := False
CleanIE()
}
If (not Fallback or (Fallback and not visible)) {
CleanIE()
}

Return True
}
1 change: 1 addition & 0 deletions lib/PoEScripts_AdvancedToolTip.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit 1df6c71

Please sign in to comment.