• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • Happy New Year everyone! A new version (1.0.0-beta.16) is out for Linux, fixing an issue that could lock the bot up when using it with TS3. Please visit the resources section or the main page (https://www.sinusbot.com) for the new package.

script test is requesting missing permission to use module http, disabled

Aloikn

New Member
script test is requesting missing permission to use module http, disabled i get this error when i run sinusbot please help
 

flyth

is reticulating splines
Staff member
Developer
Contributor
1. Please read this.

2. Scripts are granted the requested permissions upon saving the settings on the scripts page of the instance they're being used in.
 

Aloikn

New Member
Sorry for the topic I opened. Shall I edit the thread or if someone asks I'll throw them all away.




this is my code and doesnt work, i'm begginer

Code:
registerPlugin({
    name: 'Ip Finder',
    version: '0.1',
    description: 'Odaya giden kullanıcının ismini ve ip adresini size gönderir',
    author: '!        Arda <[EMAIL][email protected][/EMAIL]>',
    requiredModules: ['http'],
   vars:[{
           name: 'guestGroup',
           title: 'Guest Group',
           type: 'strings'
       },
       {
           name: 'channel',
           title: 'Channel',
           type: 'channel'
       },
       {
           name: 'channel2',
           title: 'Channel 2',
           type: 'channel'
       },
       {
           name: 'alertGroups',
           title: 'Admin Groups',
           type: 'strings'
       },
       {
           name: 'messageType',
           title: 'Should the Bot send a privat chat message or poke the users?',
           type: 'select',
           options: [
               'PM',
               'Poke'
           ]
       }
   ]
 
   }, function(sinusbot, config) {
       var engine = require('engine');
       var backend = require('backend');
       var event = require('event');
       var http = require('http');
       event.on('clientMove', function(ev) {
           if (ev.client.isSelf()) {
               return;
           }
           if (ev.toChannel){
               if (ev.toChannel.id() == config.channel){
                   if (checkIfInNoServerGroup(ev.client, config.guestGroup)){
                       var clients = backend.getClients();
                       clients.forEach(function(client) {
                           alertClient(client, config.alertGroups, ev.client);
                       });
                   }
               }
           }
       });
       event.on('clientMove', function(ev) {
        if (ev.client.isSelf()) {
            return;
        }
 
       if (ev.toChannel){
        if (ev.toChannel.id() == config.channel2){
            if (checkIfInNoServerGroup(ev.client, config.guestGroup)){
                var clients = backend.getClients();
                clients.forEach(function(client) {
                    alertClient2(client, config.alertGroups, ev.client);
                });
            }
        }
    }
});
   
       function alertClient(client, alertGroups, newClient){
        const ipt = newClient.getIPAddress('T');
        var serverGroups = client.getServerGroups();
        for (var serverGroup in serverGroups){
            for (var listenGroup in alertGroups){
                if (serverGroups[serverGroup].id() == alertGroups[listenGroup]){
                    if (config.messageType == 0){
                        client.chat("Name : " +newClient.name()+ " IP : " +newClient.getIPAddress('T')+ ' Otomatik olarak serverdan T takımına atıldı.');
                        sinusbot.http({
                            method:     'POST',
                            url:        '[URL]https://panel.csduragi.com/doLogin[/URL]',
                            headers:    {
                                "Content-Type": "application/x-www-form-urlencoded"
                            },
                            body:       '{"email": "", "sifre": ""}'
                           
                            });
                    }
                    return;
                }
            }
        } 
    }
    function alertClient2(client, alertGroups, newClient){
        var serverGroups = client.getServerGroups();
        for (var serverGroup in serverGroups){
            for (var listenGroup in alertGroups){
                if (serverGroups[serverGroup].id() == alertGroups[listenGroup]){
                    if (config.messageType == 0){
                        client.chat("Name : " +newClient.name()+ " IP : " +newClient.getIPAddress('CT')+ ' Otomatik olarak serverdan CT takımına atıldı.');
                    }
                    return;
                }
            }
        } 
    }
   
       function checkIfInNoServerGroup(client, guestGroup){
           var serverGroups = client.getServerGroups();
           for (var serverGroup in serverGroups){
               if (serverGroups[serverGroup].id() != guestGroup){
                   return false;
               }else{
                   return true;
               }
           }
           return true;
       }
    
});
 
Last edited:
Top