Hello and welcome to Level 2 Class 4
of the Script-School Program.
Todays class will seem shorter than normal...
however....
At the end of this class,
we will take a look at the
scripts you wrote from last
weeks assignment.
Today we are going to take a look
at CTCP. CTCP is Client to Client
Protocal. This is a special communication
between IRC Clients. By creating CTCP
events, you can make your mIRC react to
commands or requests from other users.
CTCP events go in the REMOTE Section
of your mIRC.
CTCP events use the format:
ctcp <level>:<matchtext>:<*|#|?>:<commands>
Ok.. Please add this to your remote
ctcp 1:test:*: {
echo 4 -a $nick just tested me!
notice $nick Ok.. the test worked!
}
Ok... I will test this for you...
To test this.. I type /ctcp <your nick> test
Now.. lets modify the reply to the CTCP time reply
ctcp 1:time:*: {
notice $nick Time for you to get a watch!
halt
}
Now.. lets work with CTCP replys...
The on CTCPREPLY event triggers when a user
sends a standard ctcp reply to a ctcp that you initiated.
Format: on <level>:CTCPREPLY:<matchtext>:<commands>
now.. add this to your remote.. and test it
(to test it.. you have to ping someone else)
on 1:ctcpreply:ping*: echo 5 -a $1-
now.. you get back something funny... its
their nick.. and alot of numbers..
Those numbers are the time in seconds
from the Jan 1 1970!
To find out the ping.. you need to take
your current time ( $ctime )and subtract
the time that was sent to you..
This is how I did it..
on 1:ctcpreply:ping*: {
set %delay $2
set %time $ctime
echo 4 -a $nick $duration( $+ $calc( %time - %delay ) $+ )
}
$duration(N)
Returns the specified number of seconds
in a week/day/hour/minute/second format.
0,0.
Try this //echo 4 $duration(1001)
You should see this -> 16mins 41secs
In other words.. 16 minutes and 41 seconds
has 1001 seconds total.
OK.. thats it for today.. at this time..
hand in your assignments from last week..
and we can talk about them.. this means
send it to one of the ops.. however!!!
read this first!!!
IMPORTANT!
Make sure to name your .mrc file <yournick>.ini
If you have any questions bout the
project.. feel free to ask an op.
of the Script-School Program.
Todays class will seem shorter than normal...
however....
At the end of this class,
we will take a look at the
scripts you wrote from last
weeks assignment.
Today we are going to take a look
at CTCP. CTCP is Client to Client
Protocal. This is a special communication
between IRC Clients. By creating CTCP
events, you can make your mIRC react to
commands or requests from other users.
CTCP events go in the REMOTE Section
of your mIRC.
CTCP events use the format:
ctcp <level>:<matchtext>:<*|#|?>:<commands>
Ok.. Please add this to your remote
ctcp 1:test:*: {
echo 4 -a $nick just tested me!
notice $nick Ok.. the test worked!
}
Ok... I will test this for you...
To test this.. I type /ctcp <your nick> test
Now.. lets modify the reply to the CTCP time reply
ctcp 1:time:*: {
notice $nick Time for you to get a watch!
halt
}
Now.. lets work with CTCP replys...
The on CTCPREPLY event triggers when a user
sends a standard ctcp reply to a ctcp that you initiated.
Format: on <level>:CTCPREPLY:<matchtext>:<commands>
now.. add this to your remote.. and test it
(to test it.. you have to ping someone else)
on 1:ctcpreply:ping*: echo 5 -a $1-
now.. you get back something funny... its
their nick.. and alot of numbers..
Those numbers are the time in seconds
from the Jan 1 1970!
To find out the ping.. you need to take
your current time ( $ctime )and subtract
the time that was sent to you..
This is how I did it..
on 1:ctcpreply:ping*: {
set %delay $2
set %time $ctime
echo 4 -a $nick $duration( $+ $calc( %time - %delay ) $+ )
}
$duration(N)
Returns the specified number of seconds
in a week/day/hour/minute/second format.
0,0.
Try this //echo 4 $duration(1001)
You should see this -> 16mins 41secs
In other words.. 16 minutes and 41 seconds
has 1001 seconds total.
OK.. thats it for today.. at this time..
hand in your assignments from last week..
and we can talk about them.. this means
send it to one of the ops.. however!!!
read this first!!!
IMPORTANT!
Make sure to name your .mrc file <yournick>.ini
If you have any questions bout the
project.. feel free to ask an op.