Function Library |
Abdeltif « Citoyen » 1388004720000
| 0 | ||
Safwanrockz a dit : It's the same as table.remove ... What do you mean by removing a value ? removing an element in a table is removing it value too :p |
Shamousey « Consul » 1388014320000
| 0 | ||
Abdeltif a dit : table.remove requires you to find the key that you want to remove from the table, Saf's function does that automatically so you only have to know the value you want to remove. |
Yteizz 1388014680000
| | ||
[Modéré par Shamousey, raison : Requested.] |
Safwanrockz « Censeur » 1388058840000
| 0 | ||
Abdeltif a dit : Moreover, table.remove requires the <b>position</b>(intentional bold tags) of the element/value you want to delete, unlike table.remove. Example: table.remove a dit : table.delete a dit : |
Abdeltif « Citoyen » 1388061180000
| 0 | ||
Safwanrockz a dit : Oh, you mean it will check the element not the value ? :o This is useful for such as "messgeEn = Help" or something like that in tables :) |
Woebegone « Citoyen » 1388783340000
| 0 | ||
How can you make buttons with text of it? And how can you make the button on a specifec place on a map? |
Abdeltif « Citoyen » 1388784600000
| 0 | ||
Juliantwofan a dit : Script request is the right place for it, go there and ask for it :) (pss, it uses text areas and areaCall backs) |
Woebegone « Citoyen » 1388785260000
| 0 | ||
Abdeltif a dit : Oooh Okay. I'll quote it .3. |
Safwanrockz « Censeur » 1390493040000
| 0 | ||
Made a hexadecimal to decimal converter with Lua, I know you can simply do tonumber("FF", 16), but I felt like making it anyway. a dit : |
Shamousey « Consul » 1390494060000
| 0 | ||
Safwanrockz a dit : string.format("%X",255) tonumber("FF",16) These two things are much smaller and go both ways! ;) Even though you did point out the tonumber one. |
Safwanrockz « Censeur » 1390494420000
| 0 | ||
Oh yep, I forgot about the string.format one, which turns hexadecimal to decimal if used with %X. |
Kmlcan « Citoyen » 1391025900000
| 0 | ||
An important function. Shuffles a table. (Requires table.copy) a dit : |
Evilsantah « Citoyen » 1391082840000
| 0 | ||
Shamousey a dit : This function has collisions when different keys point to the same value in table t. Meaning you might lose data so be careful with that. Shamousey a dit : This function already exists in the LUA table library. Kmlcan a dit : It's worth mentioning that you need a non-associative table for this (keys 1..n). Also, there is a more efficient algorithm to do so. Just look it up on Google. |
Saahar « Citoyen » 1429884120000
| 0 | ||
Sorry to bump this thread but I think the translation method could be improved ^^'. translate method improved a dit : Dernière modification le 1429885260000 |
Shamousey « Consul » 1429884780000
| 0 | ||
It could also be updated to make use of tfm.get.room.playerList[name].community, which was added to the API late last year and would give more specific results for people playing in international rooms. Translation Function a dit : |
Saahar « Citoyen » 1429885020000
| 0 | ||
Shamousey a dit : Ah ! Nice to see people that use ternaries conditions. I ignored that we can get the user language, i'm newer in here ^^ |
Neonstrayzer « Citoyen » 1429903440000
| 0 | ||
table.unpack is now usable without function.
tfm.exec.addShamanObject(table.unpack(object)) And shamans.insert isn't true. It must be table.insert(shamans,name) Dernière modification le 1429904040000 |
Shamousey « Consul » 1429913820000
| 0 | ||
My mistake about the shamans.insert, not sure how I missed that one when I made this thread xD I also added a note next to table.unpack, but kept the function definition there for legacy. |
0 | ||
string.title returns a copy of the string in which first letter of the word is capitalized. (eShkatIon returns Eshkation, +ESHKATion returns +Eshkation) Script a dit : |