#MIRC @ Dalnet
Would you like to react to this message? Create an account in a few clicks or log in to continue.
#MIRC @ Dalnet

MIRC Client Help Forum

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Dalnet Services Help Popups
Scripting Class Level 1 Class 3 EmptyMon Oct 24, 2011 7:16 am by HorseC

» DCC Problem Checking Script
Scripting Class Level 1 Class 3 EmptyFri Sep 30, 2011 11:43 pm by Rukbat

» general question
Scripting Class Level 1 Class 3 EmptyFri Sep 30, 2011 5:25 am by Rukbat

» Banned by dal.net
Scripting Class Level 1 Class 3 EmptySat Aug 13, 2011 11:25 pm by HorseC

» "MISHBOX" tutorials on mirc scripting.
Scripting Class Level 1 Class 3 EmptyTue Aug 02, 2011 7:16 am by HorseC

» A very good guide to mIRC Scripting
Scripting Class Level 1 Class 3 EmptyTue Aug 02, 2011 7:08 am by HorseC

» Dialog tool for DALnet services
Scripting Class Level 1 Class 3 EmptyMon Aug 01, 2011 7:53 am by HorseC

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

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

Gallery


Scripting Class Level 1 Class 3 Empty
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 1 Class 3

Go down  Message [Page 1 of 1]

1Scripting Class Level 1 Class 3 Empty Scripting Class Level 1 Class 3 Fri Jul 29, 2011 2:07 am

HorseC

HorseC

Scripting Class Level 1 Class 3

Hello, and welcome to Script-School
Level 1 Class Number 3. At this time,
please make sure you are logging this
class. ( /log on ). Also make
sure you are in #script-lab.

Remote:

The Remote allows you to create scripts
that react to IRC Server events, such as
when a user joins a channel or sends you
a message. This area is the most complex
and a powerful part of mIRC.

The remote consists of THREE distinct sections:

1. The Users sections, where user addresses with
assigned access levels are listed. Users can
be assigned one or more levels. These access
levels dictate which events a user will be able
to access.

2. The Variables section, where the
current active variables are listed.

3. The Scripts section, where the
scripts that you create are listed.
You can load multiple scripts which
work independently of each other.
This means that a single IRC Server
event can trigger events in one or
more scripts. Scripts consist of
EVENTS, which can only be triggered
by users who have the required access
levels.

The area that we will be working in today
is the Scripts area. This is where you
will add and work on the scripts in todays
class.

There are lots of different events, but
today we will concentrate on only four
events. We will cover the other events
in later classes. The four events
we will cover in todays class are:

on JOIN

on PART

on KICK

on TEXT

Lets get started with: on JOIN processing

Format on <level>:JOIN:<#[,#>:<Commands>

Example 1 on 1:join:#:/msg $chan welcome $nick

This example will welcome anyone who joins any
channel you are on.
Example 2 on 1:join:#mirc:/msg $chan welcome $nick

This example will welcome anyone who enters only #mirc

At this time, please add the following example to
your remote. I will test it, by parting and
rejoining the lab channel in just a moment.

on 1:join:#script-lab:/msg $chan Hello $nick

Now, please change $chan to $nick in this example.

The difference is that this example will not send
the welcome to the channel, but instead will send
the greeting to me via a message.

on 1:join:#script-lab:/msg $nick Hello $nick

What we wrote are "AUTO GREETS". The are generally
frowned on by the IRC Community because they
are impersonal. I recommend that you check
first with the channel operators, before you run an
autogreet in their channel.

Please remove the examples we
placed in your remote at this time.

- on PART -

Format on <level>:PART:<#channel>:<commands>

Example 1: on 1:PART:#:msg $chan Hey $nick just left!

This will send a msg to the channel anytime
anyone leaves any channel.

Example 2: on 1:PART:#:msg $nick Bye $nick

This example will send a msg to the nick who
left any channel.

Ok, now please add Example 2 to your
remote, I will test it in just a moment.

- on KICK -

Format on <level>:KICK:<#channel>:<command>

Example on 1:KICK:#:/msg $chan $knick was just Kicked!

Please add that example to your
Script, and we will test it.

Lets take a 5 minute break at this time!
If you have any questions, please ask them,
otherwize, get a drink, use the restroom or
take a quick smoke as needed Smile

The last part of todays class, is the
more complex event. If you noticed,
the first three events used basically
the same Format (also called SYNTAX).
The next event is a little different,
but this is one of the more useful events.

- on TEXT -

Format:

on <level>:TEXT:<match text>:<location>:<command>

The MATCH TEXT is the word, or words
that the script will look for, to trigger
the commands. The Match Text can
be a wildcard string.
* = matches any text
Text = matches any text if it contains ONLY this word
Text* = matches if text starts with this word
*Text = matches if text ends with this word
*Text* = matches if text contains this word anywhere

The Location is WHERE the script will
look for the trigger word.
? - for any private message
# - for any channel message
#mirc - for any messages in #mirc
* - for any channel or private messages

Add this example to your remote,

on 1:TEXT:test:#:msg $chan That worked $nick

I will test this in the lab

Now, lets modify that example...

on 1:TEXT:test*:#:/msg $chan $nick said $parms

As you noticed, when the word test
started the text it worked fine,
but.. if I had test in the middle,
it did not trigger. That example shows
you how to trigger your remote if the
MATCH TEXT is the first word in the text.

That example also made use of 12$parms.(parmeters)
Now, lets modify that example again,

on 1:TEXT:*test*:#:/msg $chan $nick said The Magic Word!

This example looks for the MATCH TEXT
anywhere in the text.

Please delete the example we
were working on at this time.

Lets try that again Smile
Now, please add this example

on 1:TEXT:Hello*Question/msg $nick Hi $nick

The difference in this example, is that it
looks for the MATCH TEXT in your
privates messages, instead of on the channel.

If you wanted the command to look in both
your private messages and the channel messages,
you would use * for location.

At this time I am opening the class to questions.
If you have any questions, or comments.. Now is
the time. If not, we will see you all next time!
Please note, It is VERY important for you to attend
all the classes. The next few weeks we will be
going over some very important material, please
try to attend all classes, and be on time. These
classes are fast paced and will cover alot of material.
see you next week! Smile

http://www.mirc.org

Back to top  Message [Page 1 of 1]

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