I wrote my own scene switching script to get a higher production value while streaming. I also added auto accept when invites pop and an automatic MMR update from the new Dotabuff MMR tracker which is written into a .txt file so I have an automated and updated MMR display on my stream.
To determine the scene state, I use checksums so I do not need to inject anything nor read from the memory directly. The scene switch itself is done by sending the hotkey that I set in my streaming software.
To determine the MMR, I parse the entire HTML body with a regular expression into an array which I later write into a .txt file.
About:
Its written with AutoIT and is kinda "ghetto" coded :D
But I thought it might could help some people.
If you wanna use it feel free too, I might can help you set it up but its more for people who know what they are doing
Important notes:
- Currently coded for 1920x1080 px resulution
- Checksums differ from system to system
- MMR update needs a registered Dotabuff account and maybe even a premium acc on dotabuff.
- Can be used for any streaming software that supports hot keys for scenes.
Code is here:
+ Show Spoiler +
;-------------------------------------------------
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;@ Author: @Ler_GG
;@ Release Date: 25.04.2015
;@ Purpose: Switches between scenes while
;@ streaming. Also supports auto
;@ accept for Matchmaking.
;@ Additionaly, it gets the
;@ current MMR from Dotabuff and
;@ writes it into a .txt so it
;@ can be included on stream.
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------------
;-------------------------------------------
; @@@@@@@ INCLUDES @@@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------
#include <Array.au3>
#include <Constants.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
;-------------------------------------------
; @@@@@@@ CHECKSUMS @@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------
Global $gameCheckSum_HUD_Standard = 520875552
Global $gameCheckSum_HUD_ManaPool = 451971833
Global $loginChecksumEU = 4166368323
Global $GameFoundChecksum = 1781316133
Global $apCheckSum_HUD_Standard = 3735100832
Global $cmCheckSum = 3350032685
;-------------------------------------------
; @@@@@@@ VARIABLES @@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------
Global $bStateLogin = True
Global $bStateGame = True
Global $nresetTimer = 0
Global $oIE
;-------------------------------------------
; @@@@@@@ MAIN @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------
; Initial rating on startup
_getRating()
; Main loop
While 1
; Sleep to lower CPU load.
Sleep(1000)
; Updates MMR every 10 minutes.
$nresetTimer = $nresetTimer + 1
If $nresetTimer = 600 Then
_getRating()
$nresetTimer = 0
EndIf
; Updates neccesary checksums
$currentCheckSum = PixelChecksum(1608, 14, 1713, 31)
$cmCheckS = PixelChecksum(551, 205, 659, 219)
$apCheckS = PixelChecksum(372, 9, 524, 32)
$GameFound = PixelChecksum(640, 410, 660, 430)
; Automatically clicks accept game button.
If $GameFound = $GameFoundChecksum Then
MouseClick("left", 660, 430)
EndIf
; Checks for Main menu
If $currentCheckSum = $loginChecksumEU Or $apCheckS = $apCheckSum_HUD_Standard Or $cmCheckS = $cmCheckSum And $bStateLogin = True Then
Send("{F6}", 0)
Sleep(100)
Send("{F7}", 0)
$bStateLogin = False
$bStateGame = True
EndIf
; Checks if Ingame
$currentCheckSum = PixelChecksum(1687, 9, 1744, 28)
If $currentCheckSum = $gameCheckSum_HUD_Standard And $bStateGame = True Or $currentCheckSum = $gameCheckSum_HUD_ManaPool And $bStateGame = True Then
Send("{F7}", 0)
Sleep(100)
Send("{F6}", 0)
$bStateGame = False
$bStateLogin = True
EndIf
WEnd
;-------------------------------------------
; @@@@@@@ FUNCTIONS @@@@@@@@@@@@@@@@@@@@@@@@
;-------------------------------------------
;-------------------------------------------
; Function: _getRating()
;
; Usage: - Parses html body of Dotabuff
; to determine the actual mmr
; value.
;-------------------------------------------
Func _getRating()
; Opens IE Invisible
$oIE = _IECreate("about:blank", 0, 0)
; Navigates to Dotabuff Profile
_IENavigate($oIE, "http://www.dotabuff.com/players/115909501")
; Returns all digits in the html body with the format 0000 in an array.
; Index 0 is the solo MMR when logged in.
$stringMMR = StringRegExp(_IEBodyReadText($oIE), "\d\d\d\d", 1)
_writeMMRData($stringMMR)
;~ MsgBox(0,"MMR",$stringMMR[0])
; Closes IE
_IEQuit($oIE)
EndFunc ;==>_getRating
;-------------------------------------------
; Function: _writeMMRData()
; Usage:
; - Writes an array into a file.
; Variables:
; - $aData: Array to write into file.
;-------------------------------------------
Func _writeMMRData($aData)
FileOpen("mmr.txt", 2)
FileWrite("mmr.txt", $aData[0])
FileClose("mmr.txt")
EndFunc ;==>_writeMMRData
Pastebin:
pastebin.com
@Ler_GG