Deprecated: Use of "parent" in callables is deprecated in /var/www/html/forum/src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php on line 431
  • 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.

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

Aloikn

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

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