#MIRC @ Dalnet

MIRC Client Help Forum

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Dalnet Services Help Popups
Mon Oct 24, 2011 7:16 am by HorseC

» DCC Problem Checking Script
Fri Sep 30, 2011 11:43 pm by Rukbat

» general question
Fri Sep 30, 2011 5:25 am by Rukbat

» Banned by dal.net
Sat Aug 13, 2011 11:25 pm by HorseC

» "MISHBOX" tutorials on mirc scripting.
Tue Aug 02, 2011 7:16 am by HorseC

» A very good guide to mIRC Scripting
Tue Aug 02, 2011 7:08 am by HorseC

» Dialog tool for DALnet services
Mon Aug 01, 2011 7:53 am by HorseC

» Scripting Class Level 2 Class 4
Sat Jul 30, 2011 1:01 am by HorseC

» Scripting Class Level 2 Class 3
Sat Jul 30, 2011 12:49 am by HorseC

Gallery


Statistics
We have 32 registered users
The newest registered user is boed1

Our users have posted a total of 38 messages in 36 subjects

You are not connected. Please login or register

Scripting Class Level 2 Class 4

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Scripting Class Level 2 Class 4 on Sat Jul 30, 2011 1:01 am

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.

View user profile http://www.mirc.org

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum