FlexHub Forum

How to change MOTD, rules, FAQ (using !addcmd)

Offline LadyStardust

  • *****
  • 257
  • aka Puma
How to change MOTD, rules, FAQ (using !addcmd)
« on: January 26, 2011, 19:32:37 »
How to change MOTD, rules, FAQ?

Under !sethelp command you can find commands that will allow you to add and modify texts that can be spammed in your hub.

Code: [Select]
!addcmd <name> [-o<options>] [-p<profilelevel>] [-m<max profilelevel>] [-u<use profilelevel>] [-t<time>] [-h"<helptext>"] "<text>" Add new textcommand
!delcmd <name> Delete a textcommand
!modcmd <name> [-o<options>] [-p<profilelevel>] [-m<max profilelevel>] [-u<use profilelevel>] [-t<time>] [-h"<helptext>"] "<text>" Modify a textcommand
!showcmd List all textcommands
!showcmd <name> Show a specific textcommand
   
Type in hub window: !addcmd -h to see detailed help how to add a trigger command.

   
Code: [Select]
!addcmd <name> [-o<options>] [-p<profilelevel>] [-m<max profilelevel>] [-u<use profilelevel>] [-t<time>] [-h"<helptext>"] "<text>"

<options> A number created by adding the values of the following options:

0 Output to mainchat (default)
1 Display text in PM instead of mainchat
2 Show text to all (when this is used, you can use -p and -m to limit output to certain profilelevels)
4 Show text when user logged in (welcome messages/rightclicks)
8 Don't allow the command to be activated in mainchat (useful in combination with 4)
16 Do not create an item in !help for this command (forced when 8 is used)
32 Do not create a rightclick item for this command (forced when 8 is used)
64 Text should be send in raw format instead of mainchat/pm (useful to send custom rightclicks)
128 Only send to ADC user(s)
256 Only send to NMDC user(s)

<profilelevel> (for use with option 2) A number in the range from -1 (User) to 10 (Hubowner) that is the lowest profile that will see the command output (default is -1)
<max profilelevel> (for use with option 2) A number in the range from -1 (User) to 10 (Hubowner) that is the highest profile that will see the command output (default is level 10)
<use profilelevel> A number in the range from -1 (User) to 10 (Hubowner) that is the lowest profile that can use the command (default is -1)
<time> (for use with option 2) Time in seconds between broadcasts, or use m for minutes, h for hours

<helptext> Helptext to show in !help and display in rightclick usercommands
<text> Text to send, must be the last parameter on the line

      
      
Some commands has been added to the hub by default. MOTD +rules +faq already exist in your hub, to modify it you can use !modcmd command.
First of all - to list all existing commands type !showcmd. If it is MOTD that you want to change type:
!showcmd welcome to check details of your MOTD:

Code: [Select]
Settings for textcommand: welcome
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Profilelevel: -1

Options: 44
* Show text when user logged in
* Doesn't allow the command to be activated in mainchat
* Doesn't create a rightclick item for this command

The "welcome" message was created with: !addcmd welcome -p-1 -o44 "motd_text"
Where 44 is a combination of three options with number 32, 8 and 4.

Use !modcmd <name> [-o<options>] [-p<profilelevel>] [-m<max profilelevel>] [-u<use profilelevel>] [-t<time>] [-h"<helptext>"] "<text>" to modify your textcommand.
If command already exists you dont need to specify all the options, just those you want to change, so:
e.g. !modcmd welcome "new_new_motd_goes_here"
Remember to put content of your message in " ".

Variables that can be used in your hub are listed here: http://flexhub.org/wiki/index.php/Variables

To delete any of the commands just use !delcmd <command name>
« Last Edit: July 08, 2011, 20:33:00 by LadyStardust »
Best regards,
LS

Offline LadyStardust

  • *****
  • 257
  • aka Puma
Re: How to change MOTD, rules, FAQ (using !addcmd)
« Reply #1 on: June 19, 2011, 18:04:10 »
And some more examples:

If you would like to have mainchat history going just after your MOTD, you can make it with !addcmd too:
!addcmd welcomehistory -o4 -p-1 -m10 -u-1 "
%[history]"


This an example of how to make an advert of your network hubs.
When someone will type +network command then advertisment will be displayed to everyone in the hub (as we specified from profile -1 to 10 - even if max profile level was not specified). If you want to decide about profiles who can see the command output then option 2 must be used (show text to all) - otherwise -p and -m will be ignored.

e.g. !addcmd network -o50 -p-1 -m10 -u10 "

Welcome to  FlexHub Network™

Please visit other hubs from out network:

dchub://flexhub1.com:2323
dchub://flexhub2.com:4545
dchub://flexhubo3.com:9898"


To see details of newly added command you can check by typing !showcmd network Command can be only executed by 10 (Hubowner) but will be displayed to everyone in the hub.

Option 50 is a summary of 2+16+32 =50, so feature of this command are:

2        Show text to all
16        Do not create an item in !help for this command (forced when 8 is used)
32        Do not create a rightclick item for this command

e.g. !showcmd network

       Settings for textcommand: network
       ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
       Profilelevel:        From -1 to 10 (that will see the output of the command)
       Use level:                10 and higher (that will be able to use the command)
       Timer:                Disabled
       Options:                50
                       * Show text to all
                       * Doesn't create an item in !help for this command
                       * Doesn't create a rightclick item for this command

       Text:

Welcome to  FlexHub Network™

Please visit other hubs from out network:

dchub://flexhub1.com:2323
dchub://flexhub2.com:4545
dchub://flexhubo3.com:9898

To make and advert to display a message to everyone to PM that will be triggered manually see combination below:

      e.g. !addcmd clients -o1 -u-1 -h"Clients allowed"
"`°º¤¤º°`                Welcome to  Network™        `°º¤¤º°`

List of clients allowed in this hub:
¤ DC++
¤ StrongDC++
¤ ApexDC++ "


Option 1 has been used:

1        Display text in PM instead of mainchat

Remember that this command you will be found under your right click menu, and in !help in "Trigger Commands" section (as you didn't specify otherwise). Help text displayed next to the command will be: "Clients allowed in our hub" and everyone will be able to use/trigger it (we didn't inclue option 2 - show to all, so you can not specify to who command will be displayed) - executed command will be displayed only to the person who used it - not to everyone.
If you want a message to be shown on PM to users when they login in to your hub and not triggered by a command, then use option 13.

Option 13 is a combination: 1+4+8 has been used:

1        Display text in PM instead of mainchat
4        Show text when user logged in
8        Don't allow the command to be activated in mainchat (useful in combination with 4)                        

If you would like to create advert message that will appear in main chat from time to time (on a timer), you need to specify -t <time>.

As an example:
      e.g. !addcmd regmeinfo -o10 -p-1 -m1 -t1h "

If you would like to register type in mainchat +regme <password>"


Option 10 tells us that conbination: 2+8 has been used:

2        Show text to all
8        Don't allow the command to be activated in mainchat

In this case command will display to everyone up to level 1 in main chat every 1 hour, can't be executed manually and won't show in !help or under right click menu.
                  
You can also create "welcome messages" so every login to your hub will be announced in main chat. Here you specify which profile level login will be announced in main chat.

Option 14 will be used: 2+4+8

2        Show text to all
4        Show text when user logged in (welcome messages/rightclicks)
8        Don't allow the command to be activated in mainchat (useful in combination with 4)                        

       e.g. !addcmd login -o14 -p-1 -m10 -u5 "Please give a big welcome to the operator %[user_name]! =)"

Every person login in to your hub with profile 5 and higher will be announced in main chat.
« Last Edit: June 26, 2011, 18:56:33 by LadyStardust »
Best regards,
LS