Originally Posted by
Svenskpopis
Originally Posted by
Ash Katchup
Originally Posted by
Svenskpopis
btw even if i declare the battlelist END it still gives overflow:P
What about post your code here?
I used the Battlelist_End in Visual Basic 6 and it worked pretty good...
You got the name out? it's the code above just updated adresses (taken from tapi)
Edit: Keyen night, your script is for vb.net right? im all on old fashion 6.0
EDIT:
here is my codes
Code:
Public Const Battlelist_Begin = &H635F70
Public Const Battlelist_End = &H63FF9C
Public Const Dist_Char = 164 '8.53
Public Const Dist_Name = 4 '8.53
Public BattleList_Array(Battlelist_Begin To (Battlelist_Begin + (147 * Dist_Char))) As Long ' also tested Battlelist_Begin To Battlelist_End nothing also changing 147 to 250 but gets overflow
Dim TmpN As Long
For TmpN = LBound(BattleList_Array) To UBound(BattleList_Array) Step Dist_Char
If Memory_ReadLong(Tibia_Hwnd, PlayerID) = Memory_ReadLong(Tibia_Hwnd, TmpN) Then
If Left(Memory_ReadLong(Tibia_Hwnd, TmpN + Dist_Name), 1) = "0" Then
MsgBox "FAIL", vbOKOnly + vbCritical, "Error"
Else
playername = Memory_ReadString(Tibia_Hwnd, TmpN + Dist_Name)
End If
Exit For
End If
Next TmpN
250 * 164 = Overflow
190 * 164 = OK
Code:
Public Function ReadMyName
Dim I As Long
Dim Address As Long
Dim MyID As Long
Dim CreatureID As Long
Address = BattleListAddress ' get the begin of battle list
MyID = ReadLong(PlayerID) ' get the player id
For I = 0 To 250 Step 1 ' the loop to read all battle
CreatureID = ReadLong(Address) ' get creature id in battle list
If CreatureID = MyID Then ' if my id equal creature id then
ReadMyName = ReadString(Address + 4)'read the name
exit function
End If
Address = Address + 164 ' the step to read next
Next I
End Function
Ps:I think this will work.