Crashing: SetPlayerStatus($iStatus)

11/24/2018 13:24 lasse1993#1
Anyone know whats the problem with the function SetPlayerStatus($iStatus)?

When i use it my game crashes. GetPlayerStatus() does not work either. Always returning 0 even when im online.

Code:
Func Trash ()
Out(GetPlayerStatus())
If GetPlayerStatus() <> 0 Then
   SetPlayerStatus(0)
   EndIf
Sleep (5000)

EndFunc
Code:
#Region Online Status
 ;~ Description: Change online status. 0 = Offline, 1 = Online, 2 = Do not disturb, 3 = Away
 Func SetPlayerStatus($iStatus)
    If (($iStatus >= 0 And $iStatus <= 3) And (GetPlayerStatus() <> $iStatus)) Then
        DllStructSetData($mChangeStatus, 2, $iStatus)

        Enqueue($mChangeStatusPtr, 8)
        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>SetPlayerStatus

Func GetPlayerStatus()
       Return MemoryRead($mCurrentStatus)
 EndFunc   ;==>GetPlayerStatus
#EndRegion Online Status
11/24/2018 14:48 DerMoench14#2
Quote:
Originally Posted by lasse1993 View Post
Anyone know whats the problem with the function SetPlayerStatus($iStatus)?

When i use it my game crashes. GetPlayerStatus() does not work either. Always returning 0 even when im online.

Code:
Func Trash ()
Out(GetPlayerStatus())
If GetPlayerStatus() <> 0 Then
   SetPlayerStatus(0)
   EndIf
Sleep (5000)

EndFunc
Code:
#Region Online Status
 ;~ Description: Change online status. 0 = Offline, 1 = Online, 2 = Do not disturb, 3 = Away
 Func SetPlayerStatus($iStatus)
    If (($iStatus >= 0 And $iStatus <= 3) And (GetPlayerStatus() <> $iStatus)) Then
        DllStructSetData($mChangeStatus, 2, $iStatus)

        Enqueue($mChangeStatusPtr, 8)
        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>SetPlayerStatus

Func GetPlayerStatus()
       Return MemoryRead($mCurrentStatus)
 EndFunc   ;==>GetPlayerStatus
#EndRegion Online Status
It's the low-level-stuff that changed in the past:
Code:
$mCurrentStatus = MemoryRead(GetScannedAddress('ScanChangeStatusFunction', 0x6A))

SetValue('ChangeStatusFunction', '0x' & Hex(GetScannedAddress("ScanChangeStatusFunction", 0x4A), 8))

_('ScanChangeStatusFunction:')
AddPattern('8D56088D4E3050')

*inside CreateCommands()*
	_('CommandChangeStatus:')
	_('mov ecx,dword[eax+4]')
	_('call ChangeStatusFunction')
	_('ljmp CommandReturn')
11/24/2018 17:12 lasse1993#3
Hmmm i replaced the old code with your code as a result i get an error

Code:
***\GWA2.au3 (333) : ==> Unable to parse line.: 
$mCurrentStatus = MemoryRead(GetScannedAddress('ScanChangeStatusFunction', 6A)) 
$mCurrentStatus = MemoryRead(GetScannedAddress('ScanChangeStatusFunction', ^ ERROR

GWA2.au3 (384) : ==> Unable to parse line.: 
SetValue('ChangeStatusFunction', '0x' & Hex(GetScannedAddress("ScanChangeStatusFunction", 4A), 8)) 
SetValue('ChangeStatusFunction', '0x' & Hex(GetScannedAddress("ScanChangeStatusFunction", ^ ERROR
11/24/2018 18:05 DerMoench14#4
Yeah, because i'm dumb ^^
Changed the code, try it now.
11/24/2018 18:51 lasse1993#5
No Error anymore but crashing when i try to change status.
If i check Playerstatus its still 0 all the time :feelsbadman:

You mind sharing your GWA2.au3?
11/24/2018 19:45 DerMoench14#6
I don't have a public version of GWA2/gwAPI.
If you'll post your version here i'll have a look on it.
11/24/2018 22:16 lasse1993#7
Sure here you go :))
11/25/2018 10:37 0Μ3#8
an easy one for u..

Code:
Local $mCurrentStatus
Local $mChangeStatus = DllStructCreate('ptr;dword')

Local $mChangeStatusPtr = DllStructGetPtr($mChangeStatus)
$mCurrentStatus = MemoryRead(GetScannedAddress('ScanChangeStatusFunction', -3))

SetValue('ChangeStatusFunction', '0x' & Hex(GetScannedAddress("ScanChangeStatusFunction", 12), 8))

DllStructSetData($mChangeStatus, 1, GetValue('CommandChangeStatus'))

_('ScanChangeStatusFunction:')
	AddPattern('C390909090909090909090568BF183FE04')

#Region  Status
 ;~Change online status. 0 = Offline, 1 = Online, 2 = Do not disturb, 3 = Away
 Func SetPlayerStatus($aStatus)
    If ($aStatus >= 0 And $aStatus <= 3) And GetPlayerStatus() <> $aStatus Then
        DllStructSetData($mChangeStatus, 2, $aStatus)
        Enqueue($mChangeStatusPtr, 8)
        Return True
    Else
        Return False
    EndIf
EndFunc   ;==>SetPlayerStatus

Func GetPlayerStatus()
       Return MemoryRead($mCurrentStatus)
 EndFunc   ;==>GetPlayerStatus
#EndRegion  Status

_('CommandChangeStatus:')
	_('mov ecx,dword[eax+4]')
	_('call ChangeStatusFunction')
	_('ljmp CommandReturn')
11/26/2018 02:26 lasse1993#9
:feelsbadman:

I got an error again....

ChangeStatusFunction not provided :/

Edit: I'm willing to pay 250e for a working fix !
11/27/2018 21:59 lasse1993#10
Oh my god. I was so hyped and hoped to have finally a fix.

But then.....

Edit:

Alright. I dont know why. Or how. But i just copied everything from hand again in an older GWA2 file out of yours. Now it works. Thanks mate!

PM me for ectos if you want :))))
<3