Ich muss dich leider verbessern.
HTML Code:
; transfer to different area / portal
; $toID specifies area we want to travel to
; $timeout is the time in sec after we exit with an error
Func TransferArea($toID, $timeout = 20)
; wait until transfer has started
$cnt = 0
While Not ((_memoryread($memmap,$hprocess)) = 2)
Sleep(200)
$cnt +=1
if $cnt > 5*$timeout Then
ConsoleWrite("TransferArea: transfer timeout exceeded")
Exit
EndIf
WEnd
;wait until new area has been reached
$cnt = 0
While (_memoryread($memmap,$hprocess)) <> $toID
Sleep(200)
$cnt +=1
if $cnt > 5*$timeout Then
ConsoleWrite(StringFormat("TransferArea: area ID: %d timeout exceeded", $toID))
Exit
EndIf
WEnd
RndSleep(4000)
;wait until course has been stabilized
$cnt = 0
While _memoryread($memcourse,$hprocess,'float') > 2*$pi
Sleep(200)
$cnt +=1
if $cnt > 5*$timeout Then
ConsoleWrite("TransferArea: course timeout exceeded")
Exit
EndIf
WEnd
EndFunc
; $toID specifies area we want to travel to
While (_memoryread($memmap,$hprocess)) <> $toID
Das würde nahezu nie den booleschn Wert True ergeben, denn $toID hat den Wert von einem Area und die Adresse, welche ausgelesen wird, kann nur den Wert 0,1,2 annehehmen.