Skip to content

Commit

Permalink
OS Build and OS Version
Browse files Browse the repository at this point in the history
  • Loading branch information
boludoz committed Apr 29, 2022
1 parent e96af19 commit 3d4135a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 11 deletions.
3 changes: 1 addition & 2 deletions COCBot/GUI/MBR GUI Control Bottom.au3
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Func Initiate()
SetLogCentered(" " & $g_sBotTitle & " Powered by MyBot.run ", "~", $COLOR_DEBUG)

Local $Compiled = @ScriptName & (@Compiled ? " Executable" : " Script")
Local $iFixV = String((@OSVersion = "WIN_10" And @OSBuild >= "22000") ? ("WIN_11") : (@OSVersion))
SetLog($Compiled & " running on " & $iFixV & " " & @OSServicePack & " " & @OSArch)
SetLog($Compiled & " running on " & _OSVersion() & " " & @OSServicePack & " " & @OSArch)
If Not $g_bSearchMode Then
SetLogCentered(" Bot Start ", Default, $COLOR_SUCCESS)
Else
Expand Down
29 changes: 28 additions & 1 deletion COCBot/Team__AiO__MOD++/functions/Mod's/ModFuncs.au3
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,31 @@ Func ForegroundFixer($sPackage = Default)
AndroidAdbSendShellCommand("am start -W -n " & $g_sAndroidGamePackage & "/" & $g_sAndroidGameClass, 60000)
EndIf
EndFunc ;==>ForegroundFixer
; #ce
; #ce
Func _OSVersion()
Static $s_iTrueOSVersion = 0
If $s_iTrueOSVersion > 0 Then
Return $s_iTrueOSVersion
EndIf

$s_iTrueOSVersion = @OSVersion

Local $sCurrentBuildNumber = RegRead($g_sHKLM & "\SOFTWARE" & $g_sWow6432Node & "\Microsoft\Windows NT\CurrentVersion\", "ProductName")
If @error Then $sCurrentBuildNumber = ""

If ("WIN_10" = @OSVersion Or StringInStr($sCurrentBuildNumber, "Windows 10") > 0) And (_OSBuild() >= "22000" And _OSBuild() <= "32000") Then
$s_iTrueOSVersion = "WIN_11"
EndIf

Return $s_iTrueOSVersion
EndFunc ;==>_OSVersion

Func _OSBuild()
Static $s_iTrueOSBuild = 0
If $s_iTrueOSBuild > 0 Then
Return $s_iTrueOSBuild
EndIf
$s_iTrueOSBuild = RegRead($g_sHKLM & "\SOFTWARE" & $g_sWow6432Node & "\Microsoft\Windows NT\CurrentVersion\", "CurrentBuildNumber")
If @error Or Number($s_iTrueOSBuild) = 0 Then $s_iTrueOSBuild = @OSBuild
Return SetError(0, 0, $s_iTrueOSBuild)
EndFunc ;==>_OSBuild
2 changes: 1 addition & 1 deletion COCBot/functions/Android/AndroidMEmu.au3
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Func GetMEmuBackgroundMode()
Local $iOpenGL = $g_iAndroidBackgroundModeOpenGL
; hack for super strange Windows Fall Creator Update with OpenGL and DirectX problems
; doesn't have this issue with OSBuild : 17134
If @OSBuild >= 16299 And @OSBuild < 17134 Then
If _OSBuild() >= 16299 And _OSBuild() < 17134 Then
SetDebugLog("DirectX/OpenGL Fix applied for Windows Build 16299")
$iDirectX = $g_iAndroidBackgroundModeOpenGL
$iOpenGL = $g_iAndroidBackgroundModeDirectX
Expand Down
2 changes: 1 addition & 1 deletion COCBot/functions/Android/AndroidNox.au3
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Func GetNoxBackgroundMode()
Local $iOpenGL = $g_iAndroidBackgroundModeOpenGL
; hack for super strange Windows Fall Creator Update with OpenGL and DirectX problems
; doesn't have this issue with OSBuild : 17134
If @OSBuild >= 16299 And @OSBuild < 17134 Then
If _OSBuild() >= 16299 And _OSBuild() < 17134 Then
SetDebugLog("DirectX/OpenGL Fix applied for Windows Build 16299")
$iDirectX = $g_iAndroidBackgroundModeOpenGL
$iOpenGL = $g_iAndroidBackgroundModeDirectX
Expand Down
2 changes: 1 addition & 1 deletion COCBot/functions/Main Screen/RemoveGhostTrayIcons.au3
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ Func _FindTrayToolbarWindow($iWin = 1)
If @error Then Return -1
$hWnd = DllCall("user32.dll", "hwnd", "FindWindowEx", "hwnd", $hWnd[0], "hwnd", 0, "str", "TrayNotifyWnd", "ptr", 0)
If @error Then Return -1
If @OSVersion <> "WIN_2000" Then
If _OSVersion() <> "WIN_2000" Then
$hWnd = DllCall("user32.dll", "hwnd", "FindWindowEx", "hwnd", $hWnd[0], "hwnd", 0, "str", "SysPager", "ptr", 0)
If @error Then Return -1
EndIf
Expand Down
5 changes: 2 additions & 3 deletions COCBot/functions/Other/CreateLogFile.au3
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ Func CreateLogFile()
SetDebugLog("@WorkingDir: " & @WorkingDir)
SetDebugLog("@AutoItPID: " & @AutoItPID)
SetDebugLog("@OSArch: " & @OSArch)
Local $iFixV = String((@OSVersion = "WIN_10" And @OSBuild >= "22000") ? ("WIN_11") : (@OSVersion))
SetDebugLog("@OSVersion: " & $iFixV)
SetDebugLog("@OSBuild: " & @OSBuild)
SetDebugLog("@OSVersion: " & _OSVersion())
SetDebugLog("@OSBuild: " & _OSBuild())
SetDebugLog("@OSServicePack: " & @OSServicePack)
SetDebugLog("Primary Display: " & @DesktopWidth & " x " & @DesktopHeight & " - " & @DesktopDepth & "bit")

Expand Down
3 changes: 1 addition & 2 deletions MyBot.run.au3
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,7 @@ Func FinalInitialization(Const $sAI)
EndIf

If $g_bAndroidShieldEnabled = False Then
Local $iFixV = String((@OSVersion = "WIN_10" And @OSBuild >= "22000") ? ("WIN_11") : (@OSVersion))
SetLog(GetTranslatedFileIni("MBR GUI Design - Loading", "Msg_Android_instance_05", "Android Shield not available for %s", $iFixV), $COLOR_ACTION)
SetLog(GetTranslatedFileIni("MBR GUI Design - Loading", "Msg_Android_instance_05", "Android Shield not available for %s", _OSVersion()), $COLOR_ACTION)
EndIf

DisableProcessWindowsGhosting()
Expand Down

0 comments on commit 3d4135a

Please sign in to comment.