×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] Chat Messages!
[Script] Chat Messages!
Mousechris
« Censeur »
1382814180000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  0
A short story on what this is about!

As many of you may know LUA chat messages were removed due to people creating fake messages and abusing them.

Lately, I've been going in and out everywhere in every LUA script trying to make a new way to make chat messages with LUA coding. I was told it was impossible, etc, but I never gave up! I have found a way to put chat messages in a [url=]safe[/url] way where fake chat messages cannot be used, or would require a lot of effort to do.
There is another way that only the LUA coder can see messages but this could be easily abused so that method will [url=]NOT[/url] be shared!

http://i.imgur.com/4vSFf.png

http://i.imgur.com/GZKayHm.png
The Script!

a dit :
for i,command in ipairs({"t","r"}) do system.
disableChatCommandDisplay(command,true)
end
function eventChatCommand(name,command)
if command:sub(1,1)=="r" then tfm.exec.setUIMapName("<V>[•] <N>"..command:sub(3))
end
if command:sub(1,1)=="t" then tfm.exec.setUIShamanName("<V>[•] <N>"..command:sub(3))
end
end

Extra code providing extra space by 'Jordynl'!

a dit :
for i,command in ipairs({"t"}) do system.
disableChatCommandDisplay(command,true)
end

function eventChatCommand(name,command)
if command:sub(1,1)=="t" then
tfm.exec.setUIMapName("<V>[•] <N>"..command:sub(3).."\n")
end
end

This is what it should look like


http://i.imgur.com/zo5n7Mr.png?1
Type !r [Text here] to type in the Mapcode box. and !t [Text here] to type in the Shaman area box! Make note that you have limmited space!

You can change the "[•]" to whatever you wish, for example, I could put [Anonymous] because the person typing the text is anonymous or unknown to the people seeing the chat.


http://i.imgur.com/4vSFf.png
I'm still trying to improve this chat based script, if you have any suggestions, please tell me about them here.
Jordy
« Consul »
1382814180000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#2
  0
You could also put a TextArea under the topbar. ;P

Nice guide tho.
Mousechris
« Censeur »
1382814300000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Jordynl a dit :
You could also put a TextArea under the topbar. ;P

Nice guide tho.

ya but that's no fun especially since you can't highlight it :P

but thanks I've been working hard on it
Jordy
« Consul »
1382814720000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#4
  0
I have a tip though.

a dit :

for i,command in ipairs({"t","r"}) do system.
disableChatCommandDisplay(command,true)
end

function eventChatCommand(name,command)
if command:sub(1,1)=="t" then
tfm.exec.setUIMapName("<V>[•] <N>"..command:sub(3).."/n")
end
end

Look at the "\n" ;)
Mousechris
« Censeur »
1382814840000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  0
I got an error with that script

[•] Init Error : transformice.lua:143: [string "transformice.lua"]:7: 'end' expected (to close 'function' at line 4)
Jordy
« Consul »
1382814840000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#6
  0
Mousechris a dit :
I got an error with that script

[•] Init Error : transformice.lua:143: [string "transformice.lua"]:7: 'end' expected (to close 'function' at line 4)

Oops. Fixed. :D
Mousechris
« Censeur »
1382814960000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Jordynl a dit :
Oops. Fixed. :D

Ok it works but all it did was give me "[•] testing/n " in the map code area
Jordy
« Consul »
1382815200000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Mousechris a dit :
Ok it works but all it did was give me "[•] testing/n " in the map code area

Meh. Replace "/n" with "\n" .

Today I don't have my day ;;

So this will be the code:

a dit :

for i,command in ipairs({"t","r"}) do system.
disableChatCommandDisplay(command,true)
end

function eventChatCommand(name,command)
if command:sub(1,1)=="t" then
tfm.exec.setUIMapName("<V>[•] <N>"..command:sub(3).."\n")
end
end

Sorry. :(
Mousechris
« Censeur »
1382815320000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  0
OH DAM THAT'S COOL

adding to the OP thanks

also rofl it's ok you made me laugh at least
Safwanrockz
« Censeur »
1382817240000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#10
  0
Nice guide though.
I suggest adding different commands for different text colors.
Theleetcoder
« Citoyen »
1382925420000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
I've made a script for replace tfm.exec.chatMessage here : Click here !!
Pleasedontcopymyname
« Citoyen »
1382926560000
    • Pleasedontcopymyname#0000
    • Profil
    • Derniers messages
    • Tribu
#12
  0
Theleetcoder a dit :
I've made a script for replace tfm.exec.chatMessage here : Click here !!

Script a dit :

--[[ Overload function chatMessage ]]--
--[[ Developed by TheLeetCoder. ]]--
--[[ Free use for your projects ]]--

-- test zone
tfm.exec.newGame("0")
-- test zone

coordX = 25
id = 6301

function tfm.exec.chatMessage(message)
if id == 6301 then
ui.addTextArea(6301, message, nil, 150, 25, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
id = 6302
elseif id == 6302 then
ui.addTextArea(6302, message, nil, 150, 45, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
id = 6303
elseif id == 6303 then
ui.addTextArea(6303, message, nil, 150, 65, 500, 20, 0x1C3C41, 0x1C3C41, 1.2)
id = 6304
elseif id == 6304 then
ui.updateTextArea(6301, message, nil)
id = 6305
elseif id == 6305 then
ui.updateTextArea(6302, message, nil)
id = 6306
elseif id == 6306 then
ui.updateTextArea(6303, message, nil)
id = 6304
end
end

function eventPlayerGetCheese(playerName)
tfm.exec.chatMessage("<font color='#FF00EA'>"..playerName.."</font> just got the cheese !!")
end

function eventEmotePlayed(playerName, idEmote)
tfm.exec.chatMessage("<font color='#FF00EA'>"..playerName.."</font> just used an emote (id: "..idEmote..").")
end

function eventNewGame()
if id ~= 6301 then
ui.removeTextArea(6301)
ui.removeTextArea(6302)
ui.removeTextArea(6303)
id = 6301
end
tfm.exec.chatMessage("A new game has just started !")
end

Fixed errors
Theleetcoder
« Citoyen »
1382927220000
    • Theleetcoder#0000
    • Profil
    • Derniers messages
    • Tribu
#13
  0
Gamercp a dit :
The english version(for anyone who wants it in english):

Thanks for translation. *-*
Daryan
« Citoyen »
1405796880000
    • Daryan#8539
    • Profil
    • Derniers messages
    • Tribu
#14
  0
hi i have a little improve:

you can now see [username]

for i,command in ipairs({"t","r"}) do system.
disableChatCommandDisplay(command,true)
end
function eventChatCommand(name,command)
if command:sub(1,1)=="r" then tfm.exec.setUIMapName("<V> ["..name.."] <N>"..command:sub(3))
end
if command:sub(1,1)=="t" then tfm.exec.setUIShamanName("<V> ["..name.."] <N>"..command:sub(3))
end
end


Mousechris a dit :
A short story on what this is about!

As many of you may know LUA chat messages were removed due to people creating fake messages and abusing them.

Lately, I've been going in and out everywhere in every LUA script trying to make a new way to make chat messages with LUA coding. I was told it was impossible, etc, but I never gave up! I have found a way to put chat messages in a [url=]safe[/url] way where fake chat messages cannot be used, or would require a lot of effort to do.
There is another way that only the LUA coder can see messages but this could be easily abused so that method will [url=]NOT[/url] be shared!

http://i.imgur.com/4vSFf.png

http://i.imgur.com/GZKayHm.png
The Script!

a dit :
for i,command in ipairs({"t","r"}) do system.
disableChatCommandDisplay(command,true)
end
function eventChatCommand(name,command)
if command:sub(1,1)=="r" then tfm.exec.setUIMapName("<V>[•] <N>"..command:sub(3))
end
if command:sub(1,1)=="t" then tfm.exec.setUIShamanName("<V>[•] <N>"..command:sub(3))
end
end

Extra code providing extra space by 'Jordynl'!

a dit :
for i,command in ipairs({"t"}) do system.
disableChatCommandDisplay(command,true)
end

function eventChatCommand(name,command)
if command:sub(1,1)=="t" then
tfm.exec.setUIMapName("<V>[•] <N>"..command:sub(3).."\n")
end
end

This is what it should look like


http://i.imgur.com/zo5n7Mr.png?1
Type !r [Text here] to type in the Mapcode box. and !t [Text here] to type in the Shaman area box! Make note that you have limmited space!

You can change the "[•]" to whatever you wish, for example, I could put [Anonymous] because the person typing the text is anonymous or unknown to the people seeing the chat.


http://i.imgur.com/4vSFf.png
I'm still trying to improve this chat based script, if you have any suggestions, please tell me about them here.

Dernière modification le 1405797120000
Madotsuki
« Censeur »
1478829780000
    • Madotsuki#3095
    • Profil
    • Derniers messages
    • Tribu
#15
  0
Cute lua!~
Admiire_me
« Citoyen »
1594410600000
    • Admiire_me#6770
    • Profil
    • Derniers messages
#16
  0
about "There is another way that only the LUA coder can see messages but this could be easily abused so that method will [url=]NOT[/url] be shared!" it's a public function, the people can't see anything though, you said it above, so what's the abuse? (print("Hello world") function)
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] Chat Messages!
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27