Public Function StringCoords(X As Variant, Z As Variant) As String
Z = Val(Z) / 1000
X = Val(X) / 1000
Dim TMPx As String, TMPz As String
If Z < 0 Then TMPz = -Z Else TMPz = Z
If X > 0 Then TMPx = X Else TMPx = -X
SplitIt (TMPz)
TMPz = strPart1
SplitIt (TMPx)
TMPx = strPart1
If Z < 0 Then TMPz = TMPz & "S" Else TMPz = TMPz & "N"
If X > 0 Then TMPx = TMPx & "W" Else TMPx = TMPx & "E"
If InStr(TMPz, "S") Then
TMPz = Val(TMPz) + 1
TMPz = TMPz & "S"
End If
If TMPz = "0S" Then
TMPz = "0N"
End If
If InStr(TMPx, "E") Then
TMPx = Val(TMPx) + 1
TMPx = TMPx & "E"
End If
If TMPz = "0E" Then
TMPz = "0W"
End If
StringCoords = TMPz & "-" & TMPx
'StringCoords = Replace(StringCoords, ".00", "")
End Function
Public Function SplitIt(strText As String)
If InStr(strText, ",") Then
Dim SplitPoint As Integer
SplitPoint = InStr(strText, ",")
strPart1 = Left(strText, SplitPoint - 1)
strPart2 = Right(strText, Len(strText) - SplitPoint)
Else
strPart1 = "0"
strPart2 = "0"
End If
End Function
Dim coords As String
coords = StringCoords(SDK.aw_int(AW_AVATAR_X), SDK.aw_int(AW_AVATAR_Z))
Dim avatarname As String
avatarname = SDK.aw_string(AW_AVATAR_NAME)
coords = Replace(coords, "[", "")
coords = Replace(coords, "]", "")
MsgBox (coords)
If InStr(SDK.aw_string(AW_AVATAR_NAME), Chr(34)) Then
avatarname = Replace(avatarname, Chr(34), "$$")
End If
If ReadIniValue("bot.ini", "features", "enabled") = "1" Then
If Not ReadIniValue("cells.ini", coords, "owner") = "" Then
Dim cellowner As String
cellowner = ReadIniValue("cells.ini", coords, "owner")
MsgBox (coords)