Hello,
I am pretty new to javaScript and any kind of programming and just started some tutorials, because i wanna learn how to write own scripts.
At the moment i am trying to write a script that does the following:
registerPlugin({
name: 'Gaming channel Search member information',
version: '1.0',
description: 'Messages clients of one specific Servergroup, for example a gaming Group named Cs:Go, if a user joins a specific channel, for example searching cs mates',
author: 'Blooder',
vars: [
{
name: 'Channel',
indent: 1,
title: 'Select the specific Channel, in which when a user joins all clients of a certain group get a message',
type: 'channel'
},
{
name: 'ServerGroup',
indent: 3
title: 'Server group IDs that will get messaged if a user joines the choosen channel',
type: 'strings'
},
{
name: 'msg',
indent: 1
title: 'The message that should be sent to all online users of a specific Group',
type: 'multiline'
},
{
name: 'type',
indent: 2
title: 'Message-Type',
type: 'select'
options: [
'Private chat',
'Poke'
},
{
name: 'playWithUser',
indent: 2,
title: 'The command that the user needs to reply if he wants to play with the user searching for mates',
placeholder: 'Default: !play',
type: 'string'
},
]
}, function(sinusbot, config) {
var event = require('event');
var engine = require('engine');
var store = require('store');
var backend = require('backend');
Now i want to insert an if case. Which says:
I am pretty new to javaScript and any kind of programming and just started some tutorials, because i wanna learn how to write own scripts.
At the moment i am trying to write a script that does the following:
- If a user joins a specific channel ( for expample searching for Cs:Go mates) the bot will automatically send a Message to all online Users with the Server Group Cs:Go ! I want to make multiline where everybody can insert his own message.
- Lets say the message we choose says : "Do you want to play with "User(%n --> name of client who joined the channel) Cs:Go? If so please reply with !p(<-- the command we have defined for choosing to play with a user.)
- When somebody replys the bot with !p the user searching for mates will automaticly get moved into the channel of the perosn who replyed with !p
registerPlugin({
name: 'Gaming channel Search member information',
version: '1.0',
description: 'Messages clients of one specific Servergroup, for example a gaming Group named Cs:Go, if a user joins a specific channel, for example searching cs mates',
author: 'Blooder',
vars: [
{
name: 'Channel',
indent: 1,
title: 'Select the specific Channel, in which when a user joins all clients of a certain group get a message',
type: 'channel'
},
{
name: 'ServerGroup',
indent: 3
title: 'Server group IDs that will get messaged if a user joines the choosen channel',
type: 'strings'
},
{
name: 'msg',
indent: 1
title: 'The message that should be sent to all online users of a specific Group',
type: 'multiline'
},
{
name: 'type',
indent: 2
title: 'Message-Type',
type: 'select'
options: [
'Private chat',
'Poke'
},
{
name: 'playWithUser',
indent: 2,
title: 'The command that the user needs to reply if he wants to play with the user searching for mates',
placeholder: 'Default: !play',
type: 'string'
},
]
}, function(sinusbot, config) {
var event = require('event');
var engine = require('engine');
var store = require('store');
var backend = require('backend');
Now i want to insert an if case. Which says:
- If a user joins the channel which was selected in var(channel) a msg will be sent to all online Members of the group selected in var(ServerGroup)