Hi guys,
this weekend i got totally dragged into experimenting with ATCP and now i'm trying to disassemble a string and use only different parts of it.
the string i want to disassemble:
roomid = "raum/e4fdca13e0ce2426c14221923d632606 Nereid x=32 y=3"
Now i want to split it into following variables:
id = "raum/e4fdca13e0ce2426c14221923d632606"
area = "Nereid"
coordx = "x=32" --> maybe coordx = 32
coordy = "y=3" --> maybe coordy = 3
I tried the following 2 things which both didnt work. Either not usable for my intention or i'm not using it correctly.
Can anyone give me a short example how i can do this and maybe a explanation why my tries didnt suceed?
Edit: i forgot to mention that i only really need area, coordx and coordy
this weekend i got totally dragged into experimenting with ATCP and now i'm trying to disassemble a string and use only different parts of it.
the string i want to disassemble:
roomid = "raum/e4fdca13e0ce2426c14221923d632606 Nereid x=32 y=3"
Now i want to split it into following variables:
id = "raum/e4fdca13e0ce2426c14221923d632606"
area = "Nereid"
coordx = "x=32" --> maybe coordx = 32
coordy = "y=3" --> maybe coordy = 3
I tried the following 2 things which both didnt work. Either not usable for my intention or i'm not using it correctly.
coordx = string.match(roomid, "x\=\d+")
Note(coordx)
--> should search for x=32 in the string?
for id, gegendname, coordx, coordy in string.gmatch(roomid, "(%raum\/\w+) (%w+) (%x\=\d+) (%y\=\d+)") do
Note(id)
Note(gegendname)
Note(coordx)
Note(coordy)
end
--> should disassemble the string completly in pieces?
Can anyone give me a short example how i can do this and maybe a explanation why my tries didnt suceed?
Edit: i forgot to mention that i only really need area, coordx and coordy