×

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
  • Tribus
  • /
  • Marzyciele
  • /
  • Publiczne
  • /
  • [LUA] Pomocnik wydarzenia plemiennego (Tribe Event Helper)
[LUA] Pomocnik wydarzenia plemiennego (Tribe Event Helper)
Klipus
« Citoyen »
Membre
1773167160000
    • Klipus#0000
    • Profil
    • Derniers messages
    • Tribu
#1
  0
  • LUA
Pomocnik wydarzenia plemiennego to mały skrypt Lua, stworzony w celu usprawnienia organizacji wydarzeń w chatce plemiennej.
Udostępnia on dedykowane okno, w którym pojawiają się wiadomości umieszczane tam przez organizatorów wydarzenia.

Nazwy użytkowników (wraz z #hasztagiem) organizatorów wydarzenia należy wpisać na początku skryptu do tabeli ADMINS_NAMES.

Jak korzystać?
  • Aby umieścić wiadomość w okienku, trzeba ją poprzedzić ! (wykrzyknikiem). Wiadomość pojawi się na zwykłym czacie, oraz w dedykowanym okienku.
  • Poprzedzenie wiadomości !! (dwoma wykrzyknikami) spowoduje, że w okienku zostanie ona wyświetlona pogrubioną czcionką, oraz zostanie odtworzony dźwięk powiadomienia dla wszystkich graczy.
  • Użycie komend !cls lub !clear spowoduje wyczyszczenie okienka wiadomości.

Tribe Event Helper is a small Lua script, created to help in hosting a tribe house events.
Script makes a dedicated window, where an event hosts can publish important messages.

Usernames (including #hashtags) of an event hosts should be written at the beginning of the script, to a table ADMINS_NAMES.

How to use?
  • Messages prefixed with ! (one exclamation mark) will be printed in a normal chat and in separate pop-up window.
  • Messages prefixed with !! (two exclamation marks) will be printed in bold, and a notification sound will be played for all players in a room.
  • !clear or !cls chat commands can be used to clear a messages in a pop-up window.
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
-- Tribe event helper by Klipus#0000 (C) 2026
--
-- How to use?
-- 1. Add your nickname#hashtag to a list ADMINS_NAMES (line 10). You can add more than one nickname to the list.
-- 2. Messages prefixed with ! will be printed in a separate pop-up window.
-- 3. Messages prefixed with !! will be printed in bold, and a notification sound will be played for all players in a room.
-- 4. Only players from the ADMINS_NAMES list can send messages to a pop-up window.
-- 5. !clear or !cls chat commands can be used to clear a messages in a pop-up window.

-- Enter nicknames of tribe event admins here
ADMINS_NAMES={"Klipus#0000"}
--ADMINS_NAMES={"Klipus#0000"} -- Example of single admin
--ADMINS_NAMES={"Klipus#0000", "Mesmera#0015"} -- Example of multiple admins

-- Parameters for a chat window
messageWindowX=600
messageWindowY=28
messageWindowWidth=200
messageWindowHeight=100
messageWindowOpacity=0.9

-- DO NOT MODIFY ANYTHING BELOW THIS LINE



chatBuffer=""
function eventChatCommand(playerName, command)
local isPlayerAllowed=false
for i, adminName in ipairs(ADMINS_NAMES) do
if playerName==adminName then
isPlayerAllowed=true
end
end

if isPlayerAllowed==true then
if command=="cls" or command=="clear" or command=="CLS" or command=="CLEAR" then
-- !cls
-- !clear
chatBuffer=""
else
if string.sub(command, 1, 1)=="!" then
-- !!urgent message
tfm.exec.playSound("transformice/son/victoire.mp3", 100, nil, nil, nil)
formattedMessage=string.sub(command, 2)
messageLine="<b>"..string.format("<V>[%s]</V> <FC>[%s]</FC> %s<br>", os.date("%H:%M"), playerName, formattedMessage).."</b>"
else
-- !message
formattedMessage=command
messageLine=string.format("<V>[%s]</V> <FC>[%s]</FC> %s<br>", os.date("%H:%M"), playerName, formattedMessage)
end

-- Add message to a top of buffer
chatBuffer=messageLine..chatBuffer
end
end
end

function eventLoop()
-- Update pop-up window
ui.addTextArea(1,
chatBuffer,
playerName,
messageWindowX, messageWindowY,
messageWindowWidth, messageWindowHeight,
0x324650, 0x324650,
messageWindowOpacity, true)
end

system.disableChatCommandDisplay("cls", true)
system.disableChatCommandDisplay("clear", true)

for i, playerName in ipairs(ADMINS_NAMES) do
-- Nickname colors for event admins
tfm.exec.setNameColor(playerName, 0xFF8547)

-- Quick instruction manual
ui.addPopup(0, 0, "Tribe Event Helper by Klipus#0000<BR><BR>How to use?<BR><li>Messages prefixed with ! will be printed in a separate pop-up window.</li><li>Messages prefixed with !! will be printed in bold, and a notification sound will be played for all players in a room.</li><li>!clear or !cls chat commands can be used to clear a messages in a pop-up window.</li>", playerName, 250, 100, 300, true)
end

Dernière modification le 1773175740000
  • Tribus
  • /
  • Marzyciele
  • /
  • Publiczne
  • /
  • [LUA] Pomocnik wydarzenia plemiennego (Tribe Event Helper)
© Atelier801 2018

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

Version 1.27