English lua request

28 replies
Goto Page
To the start Previous 1 2 Next To the start
05.07.12 12:25:23 pm
Up
loldlold123
User
Offline Off
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...
05.07.12 12:45:31 pm
Up
Avo
User
Offline Off
Dafuq? I think you used translator...

Thing of you are talking about is useless.
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
05.07.12 12:48:08 pm
Up
Yates
Reviewer
Offline Off
He wants a new chat?
05.07.12 12:58:54 pm
Up
loldlold123
User
Offline Off
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?
05.07.12 01:00:55 pm
Up
Yates
Reviewer
Offline Off
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.
05.07.12 01:02:38 pm
Up
Avo
User
Offline Off
If you want it you need all 5 servers on the same machine (easiest method). BTW, it's quite easy.

@user Yates: Did you read "ReadMe.txt" file?

ReadMe >

-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 | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
05.07.12 01:05:09 pm
Up
Jynxxx
User
Offline Off
So when a player says something in the server it saves it to a text file?
05.07.12 01:06:40 pm
Up
loldlold123
User
Offline Off
just can anyone write code that will write player's writings to txt file and the other code which shows up his writings?
05.07.12 01:12:21 pm
Up
Yates
Reviewer
Offline Off
user Avo has written:
@user Yates: Did you read "ReadMe.txt" file?

Do you read the "Terms of use" when you agree to something? - I don't think so ;P

Thanks, this should help.
05.07.12 01:17:03 pm
Up
loldlold123
User
Offline Off
and im still loooking for code,btw @user Yates: why your mode is idiot?
05.07.12 01:19:48 pm
Up
Jynxxx
User
Offline Off
user loldlold123 has written:
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
05.07.12 01:19:59 pm
Up
Yates
Reviewer
Offline Off
user loldlold123 has written:
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

user loldlold123 has written:
btw @user 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.

user Jynxxx has written:
'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.
05.07.12 01:24:34 pm
Up
loldlold123
User
Offline Off
@user 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


@user Yates: totally right...

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
05.07.12 01:24:50 pm
Up
Avo
User
Offline Off
@user 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 user Yates .
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 | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
05.07.12 01:29:16 pm
Up
Jynxxx
User
Offline Off
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?
05.07.12 01:30:38 pm
Up
loldlold123
User
Offline Off
yes something like that
05.07.12 03:26:12 pm
Up
EngiN33R
Moderator
Offline Off
You most likely want to make a shared chat between different servers, as user Jynxxx said.

Receiving module:
Code:
1
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


Writing module:
Code:
1
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


I can't really come up with a better solution at the moment, if someone can - please do share.
I code, therefore I exist.
05.07.12 03:29:13 pm
Up
dns
User
Offline Off
Guys someone can teach me of lua writing?
IMG:http://img442.imageshack.us/img442/9933/46100129.png
IMG:http://img834.imageshack.us/img834/8072/mapperb.png
05.07.12 03:30:22 pm
Up
Avo
User
Offline Off
@user EngiN33R: It's a reason why I PMed you, I don't have any better idea.
Trust me, I'm an engineer | user DC approved file cs2d Super extra mod for CS2D (64), yeah!
05.07.12 03:35:37 pm
Up
Alistaire
User
Offline Off
He wants multi-server chat. Just don't read OP's post, THIS is his real question.
IMG:http://i.imgur.com/5zhwOTP.png
To the start Previous 1 2 Next To the start