Posted 07 November 2013 - 09:39 AM
Hi every one, i'm back (maybe some people remember me with my unfinished NUP … think i'll do all comments if ever someone want to finish it).
I'm on a new project, and as every time, i wanna use function that i dunno how to do (i love challenge). My project: "Box!" Using a wireless_modem/chat_box turtle, wanna do an sarcastic assistant ^^. But after a day of reshearch i didnt find how to split a string in many parts.
What i wanna do:
when i say: "@Box! Ca roule?" (trans:"@Box! What's up?"). I want to split the string in 2 parts:
"@Box!" and "Ca roule?".
why? to avoid spam from Box! to be able to give many differents orders (like @Box.maths @Box.wifi @Box.goTroll etc …)
But … after a huge amount of try, i've to admit that i really don't know how to do that.
i tried (not my only try, but they were worst than this one):
but for i = 1, it will return message, not the 1st letter =$
anyone help? =)
I'm on a new project, and as every time, i wanna use function that i dunno how to do (i love challenge). My project: "Box!" Using a wireless_modem/chat_box turtle, wanna do an sarcastic assistant ^^. But after a day of reshearch i didnt find how to split a string in many parts.
What i wanna do:
when i say: "@Box! Ca roule?" (trans:"@Box! What's up?"). I want to split the string in 2 parts:
"@Box!" and "Ca roule?".
why? to avoid spam from Box! to be able to give many differents orders (like @Box.maths @Box.wifi @Box.goTroll etc …)
But … after a huge amount of try, i've to admit that i really don't know how to do that.
i tried (not my only try, but they were worst than this one):
local message = {tostring(message)}
for i = #message , 4 do
ID = ID..tostring(message[i])
print(" "..ID)
end
but for i = 1, it will return message, not the 1st letter =$
anyone help? =)