• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN Using external libraries in scripts

Status
Not open for further replies.

mgi

Donor
is awesome!
Insider
Hi all,

Does anyone know if it's possible to import external libraries (such as a socket library) into scripts?

My use case is that I want to set up a script which sends events out to external clients (and services requests from those clients, such as play sound). This will give me more flexibility when interacting with other external systems (eg. LiFX bulbs, Minecraft servers, and so on).
 

mxschmitt

Moderator
Staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
not possible, and will never be integrated :)
 

mxschmitt

Moderator
Staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
"at least" are you serious? A script could so have access to the filesystem... This would be a a very big security problem. This will definitely never implemented.
 

mgi

Donor
is awesome!
Insider
It's not a security problem in my use case. And I'd appreciate a little less attitude, I'm only asking what's possible with the current implementation.
 

Ofir Gal

Member
You can read a spefic html files from /sinusbotDir/data/cache by doing that, im using it to store my small players db with json files:
PHP:
function updatePlayers()
    {
        sinusbot.http({method: 'GET', url: 'http://127.0.0.1:9301/cache/players/faceitStats.html' }, httpDBCallback);
    }

    function httpDBCallback(error, respone)
    {
        if(respone == undefined)
        {
            setTimeout(updatePlayers, 5 * 1000);
            return;
        }

        var content = respone.data
        players = JSON.parse(respone.data);
        players = players.players

        sinusbot.log("----------- Faceit Stats Players Loaded -----------")
    }
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Added support for basic tcp sockets yesterday. If stable enough, it will make it into the next release but has to be enabled in specifically in the config.ini and possibly in the webinterface as well.
 
Status
Not open for further replies.
Top