How to require "socket.http" from a script? - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 08-12-2019, 06:18 PM   #1
SilentSierra
Member
 
SilentSierra's Avatar
 
Join Date: Oct 2010
Location: Brazil
Posts: 124
Default How to require "socket.http" from a script?

Hi there,

I have this piece of code that basically require a socket HTTP, but I received an error message that's the "require" doesn't exists.

Code:
local http = require("socket.http")
local ltn12 = require("ltn12")
I would like to know how to require this socket in DCS World environment?

PS: From this thread How to create statistics for your server

Best regards.
__________________
MOBO: Asus Z87-K CPU: Intel Core i5 4670K MEM: Corsair Vengeance 16GB DDR3 1600Mhz VGA: Gigabyte GeForce GTX 1070 G1 Gaming SSD: SanDisk Plus 240GB and 480GB MONITOR: Asus VS248H-P @1080p OS: Windows 10 Pro 64bit HOTAS: Saitek X-52 Pro WHEELS: Logitech G27 HT: TrackIR 5 SIMS: Falcon BMS | DCS World | Arma 3 | Assetto Corsa

Last edited by SilentSierra; 08-12-2019 at 06:24 PM.
SilentSierra is offline   Reply With Quote
Old 08-13-2019, 04:41 PM   #2
ElementLT
Member
 
ElementLT's Avatar
 
Join Date: Nov 2016
Location: USA
Posts: 316
Default

have you tried editing your MissionScripting.lua?

Look In
Code:
C:\Program Files\Eagle Dynamics\DCS World\Scripts
Edit MissionScripting.lua and comment out require or what ever else you might need.
Code:
do
	--sanitizeModule('os')
	--sanitizeModule('io')
	--sanitizeModule('lfs')
	--require = nil
	loadlib = nil
end
__________________

Server IP : 136.55.80.214:10308
Join Our Discord : https://discord.gg/5BhQqZC
LIVE MAP & STATS: https://thefraternitysim.com/
System: i7 8700K, 32GG Ram @ 3200, 500gb SSD m.2, X56 Pro HOTAS, Rift S VR, 2080 Ti Black
ElementLT is offline   Reply With Quote
Old 08-13-2019, 10:31 PM   #3
SilentSierra
Member
 
SilentSierra's Avatar
 
Join Date: Oct 2010
Location: Brazil
Posts: 124
Default

Thanks man! You are a genius! I'm a web developer, I don't understand the DCS World script environment.

Now, I can send HTTP request to my Web API and create my statistics user interface like yours.

How do you get the current coordinates of aircrafts and objectives to plot into Google Maps?

Do you use scheduler to update for each minute the coordinates?

How to get the connected players? How to detect if they are loading SRS?

I'm sorry, it's too many questions.

Best regards.
Attached Thumbnails
Click image for larger version

Name:	Screen_190813_192312.png
Views:	20
Size:	1.47 MB
ID:	215433  
__________________
MOBO: Asus Z87-K CPU: Intel Core i5 4670K MEM: Corsair Vengeance 16GB DDR3 1600Mhz VGA: Gigabyte GeForce GTX 1070 G1 Gaming SSD: SanDisk Plus 240GB and 480GB MONITOR: Asus VS248H-P @1080p OS: Windows 10 Pro 64bit HOTAS: Saitek X-52 Pro WHEELS: Logitech G27 HT: TrackIR 5 SIMS: Falcon BMS | DCS World | Arma 3 | Assetto Corsa

Last edited by SilentSierra; 08-13-2019 at 10:36 PM.
SilentSierra is offline   Reply With Quote
Old 08-14-2019, 02:54 PM   #4
ElementLT
Member
 
ElementLT's Avatar
 
Join Date: Nov 2016
Location: USA
Posts: 316
Default

im currently using Moose to compile all my data and using its scheduler feature to keep things updated. You can also use SLMOD which already has some really nice built-in features that will handle stat collection and I believe you can also see who is online.
__________________

Server IP : 136.55.80.214:10308
Join Our Discord : https://discord.gg/5BhQqZC
LIVE MAP & STATS: https://thefraternitysim.com/
System: i7 8700K, 32GG Ram @ 3200, 500gb SSD m.2, X56 Pro HOTAS, Rift S VR, 2080 Ti Black

Last edited by ElementLT; 08-14-2019 at 02:59 PM.
ElementLT is offline   Reply With Quote
Old 08-15-2019, 11:39 AM   #5
SilentSierra
Member
 
SilentSierra's Avatar
 
Join Date: Oct 2010
Location: Brazil
Posts: 124
Default

Yeah, it's too much code to learn how to use.

Thanks, I'll patiently try to read all documentation about it.
__________________
MOBO: Asus Z87-K CPU: Intel Core i5 4670K MEM: Corsair Vengeance 16GB DDR3 1600Mhz VGA: Gigabyte GeForce GTX 1070 G1 Gaming SSD: SanDisk Plus 240GB and 480GB MONITOR: Asus VS248H-P @1080p OS: Windows 10 Pro 64bit HOTAS: Saitek X-52 Pro WHEELS: Logitech G27 HT: TrackIR 5 SIMS: Falcon BMS | DCS World | Arma 3 | Assetto Corsa
SilentSierra is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:24 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.