View previous topic :: View next topic |
Author |
Message |
MadSnake Newbie cheater Reputation: 0
Joined: 06 Aug 2013 Posts: 13
|
Posted: Sun Aug 11, 2013 7:12 pm Post subject: Load text from a file in a server |
|
|
Hello ppl, i'm learning lua yet and i rly trying to do this by my self but some times i just got lost in the forum.
My problem is:
In my form (udf9) i have a CEMemo1 w/o any text. My question is, what i need to write in the lua table to load a text from my site to this CEMemo when execute the form?
i have all the socket.http stuff there
http = require("socket.http")
file = http.request("URL/file")
loadstring(file)() <- lost here |
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Aug 12, 2013 3:05 am Post subject: |
|
|
Code: | http = require("socket.http")
text = http.request("URL/file")
UDF9.CEMemo1.Lines[0] = text |
_________________
|
|
Back to top |
|
|
MadSnake Newbie cheater Reputation: 0
Joined: 06 Aug 2013 Posts: 13
|
Posted: Mon Aug 12, 2013 6:48 pm Post subject: |
|
|
mgr.inz.Player wrote: | Code: | http = require("socket.http")
text = http.request("URL/file")
UDF9.CEMemo1.Lines[0] = text |
|
Thank you very much dude, works fine |
|
Back to top |
|
|
MadSnake Newbie cheater Reputation: 0
Joined: 06 Aug 2013 Posts: 13
|
Posted: Wed Aug 14, 2013 12:20 am Post subject: |
|
|
For some reason the old texts still in the memobox. I changes the text in my server but the old ones still in there.... Any clue?
Or some line to clear all the memobox before laod the text from my server?
Thanks ^^ |
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Wed Aug 14, 2013 3:31 am Post subject: |
|
|
You have to use "clear" method:
Code: | http = require("socket.http")
text = http.request("URL/file")
UDF9.CEMemo1.clear()
UDF9.CEMemo1.Lines[0] = text |
_________________
|
|
Back to top |
|
|
MadSnake Newbie cheater Reputation: 0
Joined: 06 Aug 2013 Posts: 13
|
Posted: Thu Aug 15, 2013 12:41 pm Post subject: |
|
|
oh thanks a lot ^^ now i just need to know how to "lock" the memobox to do not be editable i not found the function in form editor |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Thu Aug 15, 2013 1:04 pm Post subject: |
|
|
Tip: It starts with "ReadOnl" _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
MadSnake Newbie cheater Reputation: 0
Joined: 06 Aug 2013 Posts: 13
|
Posted: Thu Aug 15, 2013 1:39 pm Post subject: |
|
|
ooh gotcha ^^
and my last question before i get ban from here to be so annoying lol
i created a form windows with a font (broadway.ttf) and my friend dont have this font, when i generated the exe file i put this font with the lua/mime/socket files together but he cant see the font, the text become with another font.
Any way to put the font in the exe file to my friend can see w/o send the ttf file? |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Fri Aug 16, 2013 4:21 am Post subject: |
|
|
well, you could put the ttf inside the ct file, and then ran extract it to the folder where windows stores it's fonts. (C:\Windows\Fonts)
No idea if you also need to modify the registry
Also, some people might not like it when you start writing files to the windows dir _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|