To create new wiki account, please join us on #znc at freenode and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Difference between revisions of "Perform"

From ZNC
Jump to: navigation, search
m (Show where the .registry files are stored / simply it.)
(Restore perform from archive.org - 2016/10/21)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:perform}}
 
{{DISPLAYTITLE:perform}}
 
{{Core Module | version = 0.047}}
 
{{Core Module | version = 0.047}}
This module is used to perform one or more user-specified commands when connecting to the IRC network.
 
  
Loading the module as a user will cause it to perform on all networks. Loading a network will cause it to only work on that network.
+
This module is used to perform one or more user-specified commands when connecting ZNC to the IRC network. It can be loaded as a user module or a network module.
 
 
Depending on how the perform module is loaded, the commands are stored:
 
 
 
  user:    ~/.znc/users/$user/moddata/perform/.registry
 
  network: ~/.znc/users/$user/networks/$network/moddata/perform/.registry
 
  
 +
* If the module is loaded as a '''user module''', it will perform the command(s) on all network(s) the user has.
 +
* If the module is loaded as a '''network module''', it will perform the command(s) only on that specific network.
  
 
== Usage ==
 
== Usage ==
  
 
{{Module arguments
 
{{Module arguments
| type = network}}
+
| type = network}}
  
 
=== Commands ===
 
=== Commands ===
The perform list is automatically saved on changes.
 
  
An example:
+
; <code>Add <command></code>
  /msg *perform add msg X@Channels.undernet.org LOGIN <username> <password>
+
: Adds perform command to be sent to the server on connect
  /msg *perform add msg Q@CServe.quakenet.org :AUTH <username> <password>
+
 
  /msg *perform add mode %nick% +X
+
; <code>Del <number></code>
 +
: Delete a perform command
 +
 
 +
; <code>Execute</code>
 +
: Send the perform commands to the server now
 +
 
 +
; <code>Help <?search></code>
 +
: Generate this help output, optionally search for word/prase in this output.
 +
 
 +
; <code>List</code>
 +
: List the perform commands
 +
 
 +
; <code>Swap <number> <number></code>
 +
: Swap two perform commands (to change the order in which commands are sent)
 +
 
 +
=== Examples ===
 +
 
 +
The perform list is automatically saved on changes. See [[ExpandString]] for a list of available variables (e.g. <code>%nick%</code>)
 +
 
 +
==== Identifying to services ====
 +
 
 +
Identifying to [http://www.undernet.org Undernet]:
 +
  /msg *perform add PRIVMSG X@Channels.undernet.org :LOGIN <username> <password>
 +
 
 +
Identifying to [http://quakenet.org QuakeNet] (alternatively, use the [[q]] module rather than perform on QuakeNet):
 +
  /msg *perform add PRIVMSG Q@CServe.quakenet.org :AUTH <username> <password>
 +
 
 +
===== NickServ =====
 +
 
 +
{{ambox|text=[[sasl]] is the preferred module for identifying to services, as it identifies you before you are even visible to the network. There is also a [[nickserv|nickserv module]], which identifies you every time NickServ asks for it (not just on connect).}}
 +
 
 +
Identifying to NickServ (see <code>/msg nickserv help identify</code> for the syntax and try <code>/quote nickserv help</code> to see that the NICKSERV command works):
 +
/msg *perform add NICKSERV identify <username> <password>
 +
 
 +
Identifying to NickServ if NICKSERV is not supported:
 +
/msg *perform add PRIVMSG NickServ :identify username password
 +
 
 +
''The difference between <code>/nickserv</code> and <code>PRIVMSG</code> (<code>/msg</code>) is that <code>/nickserv</code> is usually IRCd-side alias that checks that NickServ is a real service—to just a user who has changed their nick to "NickServ." If this is ever the case, <code>/msg</code> would have sent your password to the impostor. The <code>:</code> is important, otherwise everything after <code>identify</code> gets dropped.''
 +
 
 +
===== Bitlbee =====
 +
 
 +
/msg *perform add PRIVMSG &bitlbee :identify <password>
 +
 
 +
You could also replace <code>&bitlbee</code> with <code>root</code>, but that would make root send all connect/disconnect etc. messages in PM causing potentially annoying alerts in your client.
 +
 
 +
==== Setting modes on connect ====
 +
 
 +
''The following modes are fairly common, but check with your IRC network to see if these modes will function as described here, or if they exist at all on that network.''
 +
 
 +
Setting umode +Xx on connect (X or x enables cloaking on some IRCds):
 +
/msg *perform add mode %nick% +Xx
 +
 
 +
Setting umode +w on connect for receiving wallops:
 +
  /msg *perform add mode %nick% +w
 +
 
 +
Setting all three modes on connect:
 +
/msg *perform add mode %nick% +Xxw
 +
 
 +
==== Opering up ====
 +
 
 +
Logging in as IRC operator on connect:
 
  /msg *perform add OPER USER PASSWORD
 
  /msg *perform add OPER USER PASSWORD
/msg *perform del 1
 
/msg *perform list
 
  
See [[ExpandString]] for a list of available variables.
+
==== Idlerpg ====
 +
 
 +
For general idea of what idlerpg is, [http://www.idlerpg.net/ see their homepage.] This example is here, because sometimes [https://github.com/znc/znc/issues/1039 people request a module for it.]
 +
 
 +
/msg *perform add JOIN #idlerpg
 +
/msg *perform add PRIVMSG IDLEBOT :login username password
 +
 
 +
First you tell perform to join the channel and then you login to IDLEBOT. You should be on the channel when IDLEBOT receives the command and if you didn't add the join command you will most likely receive error about not being on the channel. ''Do replace #idlerpg and IDLEBOT with the actual channel and nick of the bot.''
 +
 
 +
==== Listing, removing, or re-ordering commands ====
 +
 
 +
; Listing commands to be executed on connecting:
 +
: <code>/msg *perform list</code>
 +
<*perform> ------
 +
<*perform> Id: 1
 +
<*perform> Perform: PRIVMSG NickServ :GHOST myname mysecretpassword
 +
<*perform> ------
 +
<*perform> Id: 2
 +
<*perform> Perform: mode %nick% +wix
 +
<*perform> Expanded: mode myname +wix
 +
<*perform> ------
 +
<*perform> Id: 3
 +
<*perform> Perform: PRIVMSG IdleBot :LOGIN myuser mysecretpassword
 +
<*perform> ------
 +
<*perform> Id: 4
 +
<*perform> Perform: JOIN #idleRPG
 +
<*perform> ------
 +
 
 +
; Swap position of commands 3 and 4.
 +
: <code>/msg *perform swap 3 4</code>
 +
<*perform> Commands Swapped.
 +
 
 +
; Add a new command.
 +
: <code>/msg *perform add NOTICE %nick% :You’ve logged on.</code>
 +
<*perform> Added!
 +
 
 +
; Delete command in position 5.
 +
: <code>/msg *perform del 5</code>
 +
<*perform> Command Erased.

Latest revision as of 14:41, 21 May 2017


This module is used to perform one or more user-specified commands when connecting ZNC to the IRC network. It can be loaded as a user module or a network module.

  • If the module is loaded as a user module, it will perform the command(s) on all network(s) the user has.
  • If the module is loaded as a network module, it will perform the command(s) only on that specific network.

Usage[edit]

Arguments

This network module takes no arguments.

Read loading modules to learn more about loading modules.

Commands[edit]

Add <command>
Adds perform command to be sent to the server on connect
Del <number>
Delete a perform command
Execute
Send the perform commands to the server now
Help <?search>
Generate this help output, optionally search for word/prase in this output.
List
List the perform commands
Swap <number> <number>
Swap two perform commands (to change the order in which commands are sent)

Examples[edit]

The perform list is automatically saved on changes. See ExpandString for a list of available variables (e.g. %nick%)

Identifying to services[edit]

Identifying to Undernet:

/msg *perform add PRIVMSG X@Channels.undernet.org :LOGIN <username> <password>

Identifying to QuakeNet (alternatively, use the q module rather than perform on QuakeNet):

/msg *perform add PRIVMSG Q@CServe.quakenet.org :AUTH <username> <password>
NickServ[edit]

Identifying to NickServ (see /msg nickserv help identify for the syntax and try /quote nickserv help to see that the NICKSERV command works):

/msg *perform add NICKSERV identify <username> <password>

Identifying to NickServ if NICKSERV is not supported:

/msg *perform add PRIVMSG NickServ :identify username password

The difference between /nickserv and PRIVMSG (/msg) is that /nickserv is usually IRCd-side alias that checks that NickServ is a real service—to just a user who has changed their nick to "NickServ." If this is ever the case, /msg would have sent your password to the impostor. The : is important, otherwise everything after identify gets dropped.

Bitlbee[edit]
/msg *perform add PRIVMSG &bitlbee :identify <password>

You could also replace &bitlbee with root, but that would make root send all connect/disconnect etc. messages in PM causing potentially annoying alerts in your client.

Setting modes on connect[edit]

The following modes are fairly common, but check with your IRC network to see if these modes will function as described here, or if they exist at all on that network.

Setting umode +Xx on connect (X or x enables cloaking on some IRCds):

/msg *perform add mode %nick% +Xx

Setting umode +w on connect for receiving wallops:

/msg *perform add mode %nick% +w

Setting all three modes on connect:

/msg *perform add mode %nick% +Xxw

Opering up[edit]

Logging in as IRC operator on connect:

/msg *perform add OPER USER PASSWORD

Idlerpg[edit]

For general idea of what idlerpg is, see their homepage. This example is here, because sometimes people request a module for it.

/msg *perform add JOIN #idlerpg
/msg *perform add PRIVMSG IDLEBOT :login username password

First you tell perform to join the channel and then you login to IDLEBOT. You should be on the channel when IDLEBOT receives the command and if you didn't add the join command you will most likely receive error about not being on the channel. Do replace #idlerpg and IDLEBOT with the actual channel and nick of the bot.

Listing, removing, or re-ordering commands[edit]

Listing commands to be executed on connecting
/msg *perform list
<*perform> ------
<*perform> Id: 1
<*perform> Perform: PRIVMSG NickServ :GHOST myname mysecretpassword
<*perform> ------
<*perform> Id: 2
<*perform> Perform: mode %nick% +wix
<*perform> Expanded: mode myname +wix
<*perform> ------
<*perform> Id: 3
<*perform> Perform: PRIVMSG IdleBot :LOGIN myuser mysecretpassword
<*perform> ------
<*perform> Id: 4
<*perform> Perform: JOIN #idleRPG
<*perform> ------
Swap position of commands 3 and 4.
/msg *perform swap 3 4
<*perform> Commands Swapped.
Add a new command.
/msg *perform add NOTICE %nick% :You’ve logged on.
<*perform> Added!
Delete command in position 5.
/msg *perform del 5
<*perform> Command Erased.