global Positions_O := []
global PositionCount := 0
if(FileExist("Positions.ini")){
IniRead, PositionCount_Rout, Positions.ini, Information, Count
PositionCount := PositionCount_Rout
Loop, %PositionCount%
{
IniRead, TEXT_%A_Index%, Positions.ini, Position_%A_Index%, Text
IniRead, XPOS_%A_Index%, Positions.ini, Position_%A_Index%, X
IniRead, YPOS_%A_Index%, Positions.ini, Position_%A_Index%, Y
IniRead, ZPOS_%A_Index%, Positions.ini, Position_%A_Index%, Z
Positions_O.Push(Object("Text", TEXT_%A_Index%, "Position", A_Index, "XPOS", XPOS_%A_Index%, "YPOS", YPOS_%A_Index%, "ZPOS", ZPOS_%A_Index%))
createPositionText(TEXT_%A_Index%, A_Index, XPOS_%A_Index%, YPOS_%A_Index%, ZPOS_%A_Index%)
}
SetTimer, Update, 500
} else {
IniWrite, 0, Positions.ini, Information, Count
SetTimer, Update, 500
}
addPosition(Text, XPOS, YPOS, ZPOS){
PositionCount++
addchatmessage(-1, "coundding: " PositionCount)
IniWrite, %Text%, Positions.ini, Position_%PositionCount%, Text
IniWrite, %PositionCount%, Positions.ini, Information, Count
IniWrite, %XPOS%, Positions.ini, Position_%PositionCount%, X
IniWrite, %YPOS%, Positions.ini, Position_%PositionCount%, Y
IniWrite, %ZPOS%, Positions.ini, Position_%PositionCount%, Z
Positions_O.Push(Object("Text", Text, "Position", PositionCount, "XPOS", XPOS, "YPOS", YPOS, "ZPOS", ZPOS))
createPositionText(Text, PositionCount, XPOS, YPOS, ZPOS)
return
}
createPositionText(Text, Count, XPOS, YPOS, ZPOS){
WTS := worldToScreen(XPOS, YPOS, ZPOS)
px1 := WTS[1] / (1920 / 800)
px2 := WTS[2] / (1080 / 600)
Position_Text_%Count% := TextCreate("Geneva", 7, 1, 0, px1, px2, 0xFFFFFFFF, "", 1, 1)
TextSetString(Position_Text_%Count%, Text)
}
Update:
for i, o in Positions_O {
Position_Count := o.Position
addchatmessage(-1, o.Text " Count: " Position_Count)
WTS := worldToScreen(o.XPOS, o.YPOS, o.ZPOS)
px1 := WTS[1] / (1920 / 800)
px2 := WTS[2] / (1080 / 600)
TextSetPos(Position_Text_%Position_Count%, px1, px2)
}
return
/*
Numpad0::
;addchatmessage(-1, PositionCount)
addPosition("asd", 1786.3899, -1885.8046, 13.3940)
return
*/
Alles anzeigen