Welcome

User: Pass:   register


Description

CTCP stands for Client-To-Client-Protocol which is a special type of communication between IRC Clients. By creating CTCP events, you can make your mIRC react to commands or requests from other users. CTCP events use the format:

Format

ctcp <level>:<matchtext>:<*|#|?>:<commands>

Identifier Information

  • The level is the access level required to access this event, the matchtext is the actual CTCP being sent, the *#? specify whether to react to any message, to channel messages, or to private messages respectively, and the commands are the commands that will be performed if this event triggers successfully.

Points to Note

  • You can't prevent the standard version reply from being sent.

Examples

  • A Basic CTCP event
ctcp 1:help:*:/msg $nick help yourself!

The above ctcp event would react to a /ctcp yournick help message either in a channel or private message. Since it has access level 1, this means that any user can access it because 1 is the lowest access level.


  • Changing a standard CTCP reply
ctcp 1:ping:?:/notice $nick Ouch! | /halt

This will react to the standard ping CTCP and will reply with "Ouch!". The /halt at the end of the line prevents the standard ping reply from being sent. If you don't use the /halt, the standard reply to PING will be sent.

ctcp 1:time:?:/notice $nick The time here is around $time | /halt

This will react to the standard time CTCP and will reply with the above message. Again, the /halt prevents the standard time reply from being sent.


  • Wildcards and Variables
ctcp 1:*help*:#:/notice $nick I can see that you need some help

By using the * and ? wildcard characters, you can match any incoming text. So if a user sends you a ctcp which has the word help in it anywhere, the above notice will be sent.

ctcp 1:%password:?:/notice $nick Your access has been authorized

By using Variables in the matchtext section, you can change the value of %password whenever you want without having to change the event definition. So if you set %password to the value "moo" and someone sends you a "moo" ctcp, it will match %variable and the notice will the above message will be sent.


  • Controlling your mIRC remotely
100:*!khaled@mirc.com
ctcp 100:quit:?:/notice $nick Okay boss, I'm quitting... see you later! | /quit

The above definition shows how you can give yourself a high access level to access the quit event, and you can tell your mIRC to quit IRC from another IRC Client.

ctcp 100:send:?:/dcc send $nick $1-

This definition allows you to ask your mIRC to send you whatever file you specify to the IRC Client you're using from another location, for example by using the ctcp /ctcp yournick send homework.txt.

  • Giving Op status to a friend
=5:*!khaled@mirc.com
ctcp 5:opme:?:/mode $2 +o $nick
ctcp 5:inviteme:?:/invite $nick $2

These definitions would allow the above level 5 user to send you the ctcp /ctcp yournick opme #mIRC and if you are on an Op on channel #mIRC, the above script would automatically Op him. The user can also send you the ctcp /ctcp yournick inviteme #mIRC, and you would invite him to channel #mIRC.


Ideas for the Mind

  • Create custom replies or actions based on a CTCP.
  • Handy for a bot that you could control remotely.

Related Events






© 1996-2010 hdesk.org and dalnethelpdesk.com