62 lines
1.6 KiB
AutoIt
62 lines
1.6 KiB
AutoIt
;; SMAC XML APi
|
|
Func _GetStatusFromSMACb($steamid)
|
|
Global $oXML = ObjCreate("Microsoft.XMLHTTP")
|
|
$oXML.Open("GET", "http://api.smacbans.com/xml/getbanninfo_multiple/" & $steamid & "/", 0)
|
|
$oXML.Send
|
|
|
|
Global $sFile = _TempFile(@TempDir, '~', '.xml')
|
|
FileWrite($sFile, $oXML.responseText)
|
|
|
|
If _XMLFileOpen($sFile) Then
|
|
Global $pStatus = _XMLGetValue('/isbanned/singleBan/status')
|
|
EndIf
|
|
|
|
If $pStatus[1] = "Y" Then
|
|
Local $bReason = _XMLGetValue('/isbanned/singleBan/reason')
|
|
Local $bNick = _XMLGetValue('/isbanned/singleBan/nickname')
|
|
Local $bTime = _XMLGetValue('/isbanned/singleBan/banTime')
|
|
EndIf
|
|
|
|
FileDelete($sFile)
|
|
|
|
|
|
If $pStatus[1] = "Y" Then
|
|
Local $oStatus = "SteamID is Banned"
|
|
MsgBox(64, "INFO", "Status: " & $oStatus & @LF & "Nick: " & $bNick[1] & @LF & "Reason: " & $bReason[1] & @LF & "Time: " & $bTime[1])
|
|
Else
|
|
Local $oStatus = "SteamID is not banned"
|
|
MsgBox(64, "INFO", "Status: " & $oStatus)
|
|
EndIf
|
|
|
|
EndFunc
|
|
|
|
|
|
|
|
|
|
;; SteamID Convert
|
|
Dim Const $COMM_ID_START = 76561197960265728
|
|
|
|
Func _CommunityIDToSteamID($sComID)
|
|
$sComID = Number($sComID)
|
|
|
|
$a = ($sComID - $COMM_ID_START) / 2
|
|
$b = Floor($a)
|
|
$c = Round( Mod($a,Floor($a)) )
|
|
|
|
Return "STEAM_0:" & String( $c ) & ":" & String( $b )
|
|
EndFunc
|
|
|
|
Func _SteamIDToCommunityID($sSteamID)
|
|
Local $sResult, $expl, $serverid, $accountid
|
|
|
|
$expl = StringSplit($sSteamID,":")
|
|
|
|
if ( UBound($expl) == 4 ) Then
|
|
$serverid = Number($expl[2])
|
|
$accountid = Number($expl[3])
|
|
|
|
$sResult = ( $accountid * 2 ) + $COMM_ID_START + $serverid
|
|
EndIf
|
|
|
|
Return $sResult
|
|
EndFunc |