• TeamSpeak has reported a vulnerability in it's client that can potentially lead to RCE. A new version has been released that fixes it. So please update the client in your bot installation as soon as possible as well. Click here for more information.
  • If you need help or want to discuss things, you now can also join us on our Discord Server!

EN [Request] Add to Channel Description

Status
Not open for further replies.

DCha0tiC

Member
Hello Everyone!
I come here to humbly ask for anyone that knows well JavaScript, to help me create a simple Tibia Script.
I'm very beginner coding JS, so i hope i can get any help here :)

The ideia consist on:
1. The Admin on the WebInterface will choose a channel to create a list on the description and set a ServerGroupID for who will have access to the command.

2. The users with determined ServerGroup will have 2 commands : !addhunted "NAME" and !delhunted "NAME"

3. As soon as anyone with access write the command on the channel-chat or Private-Chat, the bot will add/remove the specific name of the channel's description.



I hope that the ideia is clear, i'm trying to code this script, but as i said earlier, i'm very beginner on JS, so it will take me a lot of time and also i would like to get this code to study and mix other ideias.

Thanks all.
 

DCha0tiC

Member
So i tried to do my own script,but it doesn't work.
I hope some1 can help me.

Code:
registerPlugin({
    name: "Tibia Hunted Description List",
    version: "0.3",
    description: "This script should create a Hunted List on the channel's description.",
    author: "Daniel S.R. - DCha0tiC",
    vars: {
            adminUUID: {
            title: "Command admin UUIDs",
            type: "string",
            placeholder: "A comma separated list of Unique IDs of admins to run the commands"
        }, chanId: {
            title: 'Channel for the Hunted List',
            type: 'channel'
        }
    }
}, function(sinusbot, config) {
    sinusbot.on('chat', function(ev) {
        sinusbot.chatPrivate(ev.clientId, 'W00tW00t!'); //Just for test xD
        var adminUUID = [];
        if (config.adminUUID) {
        adminUUID = config.adminUUID.split(",");
        }
        if(ev.msg.lastIndexOf('!addhunted '[,0])){
            var description = ev.msg.substring(10);
            var channelSelect = config.chanId;
            sinusbot.on('channelUpdate', function(ev){
                sinusbot.channelUpdate(channelSelect,{topic: description});
            });
        }
        if(ev.msg.lastIndexOf('!delhunted '[,0])){
            var description = ev.msg.substring(10);
            var channelSelect = config.chanId;
            sinusbot.on('channelUpdate', function(ev){
                sinusbot.channelUpdate(channelSelect,{topic: description});
            });
        }
     });
});
 
Last edited:
Status
Not open for further replies.
Top