lua request
28 replies05.07.12 12:25:23 pm
i wanted to make that but couldnt find how to,lemme show you what im trying to make
(i just dont know how im gonna call that threat so i wrote lua request to title)
Player wrote something
his writing > goes to table or etc i cant know how you gonna do that>txt file>lua which reads what is in txt file >it shows up his writings 1 sec later
just dont tell me that why you want that meaningless thing,if i can get lua which is something like that im gonna make something...
(i just dont know how im gonna call that threat so i wrote lua request to title)
Player wrote something
his writing > goes to table or etc i cant know how you gonna do that>txt file>lua which reads what is in txt file >it shows up his writings 1 sec later
just dont tell me that why you want that meaningless thing,if i can get lua which is something like that im gonna make something...
Dafuq? I think you used translator...
Thing of you are talking about is useless.
Thing of you are talking about is useless.
Trust me, I'm an engineer |
DC approved
Super extra mod for CS2D (64), yeah!



ok ok i already knew you guys would think this is useless but i'll tell you what im gonna do,im gonna make general chat for 5 servers... so i'll need that piece of code that will write Players writings to txt and other server's piece of code that will read it and show up in that server get it?
We never said it was useless, I was already planning to make this. Problem is, I do not know how the Lua will open a file in a completely different CS2D folder.
If you want it you need all 5 servers on the same machine (easiest method). BTW, it's quite easy.
@
Yates: Did you read "ReadMe.txt" file?
-sys PATH (Use alternative "sys"-folder for settings)
-path PATH (Use alternative working directory)**
@

-sys PATH (Use alternative "sys"-folder for settings)
-path PATH (Use alternative working directory)**
edited 1×, last 05.07.12 01:09:59 pm
Trust me, I'm an engineer |
DC approved
Super extra mod for CS2D (64), yeah!



just can anyone write code that will write player's writings to txt file and the other code which shows up his writings?
and im still loooking for code,btw @
Yates: why your mode is idiot?


just can anyone write code that will write player's writings to txt file and the other code which shows up his writings?
Still not understanding what your saying, use proper english.
edited 1×, last 05.07.12 01:25:01 pm

and im still loooking for code
I will try and make one for the both of us, you can edit if it even gets completed


btw @
Yates: why your mode is idiot?

Well, it would make more sense to call the mode "Asshole" instead as only me and eXploits have it. But I posted in a random thread "Inb4 anyone cares" and got this mode.

'Sill not understanding what your saying, use proper english.
When a player says something it gets written down in a text file and then it gets read so it can be used in the chat on many servers.
Correct me if I'm wrong, HeaDHunTeR.
@
Jynxxx:
look i'll tell you step by step
Player joined to game
Player wrote something
LUA:save what he written to asd.txt
Lua:load what he written to asd.txt
Lua:shows up what he written to asd.txt
@
Yates: totally right...
btw would it make server laggy?,but fu** it we would see that when script is done...

look i'll tell you step by step
Player joined to game
Player wrote something
LUA:save what he written to asd.txt
Lua:load what he written to asd.txt
Lua:shows up what he written to asd.txt
@

btw would it make server laggy?,but fu** it we would see that when script is done...
edited 2×, last 05.07.12 01:29:51 pm
@
loldlold123: It's easy, 'cause he's an idiot, but it doesn't mean he's an idiot in real life. I want to meet
Yates
.
Wait, I'm working with script for you. Easiest way is to run all 5 servers from the same directory. (same pc/server)



Wait, I'm working with script for you. Easiest way is to run all 5 servers from the same directory. (same pc/server)
Trust me, I'm an engineer |
DC approved
Super extra mod for CS2D (64), yeah!



So let me get this straight, he wants a lua that saves the text in which the player says in the server to a .txt file then opens it up into another server?
Example:
Player: Hello.
Saving to servertxt.txt file.
Opening text file in all servers.
Player from Server #1 says: Hello.
Something like this?
Example:
Player: Hello.
Saving to servertxt.txt file.
Opening text file in all servers.
Player from Server #1 says: Hello.
Something like this?
You most likely want to make a shared chat between different servers, as
Jynxxx said.
Receiving module:
Writing module:
I can't really come up with a better solution at the moment, if someone can - please do share.

Receiving module:
Code:
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
addhook("say","savetext")
function savetext(id,t)
local f=assert(io.open("/root/cs2d/chat.txt","r")) --change the address, just a placeholder
local txt=f:read()
f:close()
f=assert(io.open("/root/cs2d/chat.txt","w"))
f:write("["..game("sv_name").."] "..player(id,"name")..": "..t.."\n"..txt)
f:close()
f=nil
txt=nil
end
function savetext(id,t)
local f=assert(io.open("/root/cs2d/chat.txt","r")) --change the address, just a placeholder
local txt=f:read()
f:close()
f=assert(io.open("/root/cs2d/chat.txt","w"))
f:write("["..game("sv_name").."] "..player(id,"name")..": "..t.."\n"..txt)
f:close()
f=nil
txt=nil
end
Writing module:
Code:
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
lastline=""
addhook("second","parsemessages")
function parsemessages()
local f=assert(io.open("/root/cs2d/chat.txt"))
local txt=f:read("*line")
if txt~=lastline then
msg(txt)
lastline=txt
end
end
addhook("second","parsemessages")
function parsemessages()
local f=assert(io.open("/root/cs2d/chat.txt"))
local txt=f:read("*line")
if txt~=lastline then
msg(txt)
lastline=txt
end
end
I can't really come up with a better solution at the moment, if someone can - please do share.
I code, therefore I exist.
@
EngiN33R: It's a reason why I PMed you, I don't have any better idea.

Trust me, I'm an engineer |
DC approved
Super extra mod for CS2D (64), yeah!


