Jump to content

TSRemote.dll


Recommended Posts

Basicially I'm using this script to scan the TS for joining and leaving member. After some minutes I always get this error message:

"Sie Anweisung in "0x01576f84" (this adress is of course different every time) verweist auf Speicher in 0x00000000". Der Vorgang "written" konnte nicht auf dem Speicher durchgeführt werden."

So the operation at 0x01576f84 points to 0x00000000 and becuase of this the programm crashes. If there are any ideas what could cause this and how it could be solved are welcomed.

#include <array.au3>

Dim $joined = 0, $left = 0, $firstrun = 1
While 1
    $oldplayer = TSPlayer()
    Sleep(10)
    $newplayer = TSPlayer()
    If $firstrun Then $oldplayer = $newplayer
    If UBound($oldplayer) > UBound($newplayer) Then
        For $i = 1 to UBound($oldplayer) - 1
            If _ArraySearch($newplayer, $oldplayer[$i]) = -1 Then  $left = 1
        Next
    ElseIf  UBound($newplayer) > UBound($oldplayer) Then
        For $i = 1 to UBound($newplayer) - 1
            If _ArraySearch($oldplayer, $newplayer[$i]) = -1 Then $joined = 1
        next    
    EndIf
    If $joined Then
        ToolTip($joined & " joined", @DesktopWidth , @DesktopHeight - 47 , Default ,Default , 4)
        Sleep(5000)
        ToolTip("")
        $joined = 0
    ElseIf  $left Then
        ToolTip($left & " left", @DesktopWidth , @DesktopHeight - 47 , Default ,Default , 4)
        Sleep(5000)
        ToolTip("")
        $left = 0
    EndIf   
    $oldplayer = 0
    $newplayer = 0
    Dim $oldplayer[1], $newplayer[1], $firstrun = 0
WEnd    
        
Func TSPlayer()
    Dim $dll = 0, $array = 0, $record = 0, $Playerlist[1], $player = 0
    $dll = DllOpen("C:\Programme\Teamspeak2_RC2\client_sdk\TSRemote.dll")
    $array = DllStructCreate("byte[52100]")  
    $record = DllStructCreate("int")
    DllStructSetData($record, 1, 1024)
    DllCall($dll, "int", "tsrGetPlayers", "ptr", DllStructGetPtr($array), "ptr", DllStructGetPtr($record))
    Dim $Playerlist[DllStructGetData($record, 1)]
    For $i = 0 to DllStructGetData($record, 1) - 1
        $player = DllStructCreate("int;int;char[30];int;int;int", DllStructGetPtr($array) + (50 * $i))
        $Playerlist[$i] = DllStructGetData($player, 3)       
    Next
    DllClose($dll)
    return $Playerlist
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...