PDA

View Full Version : GameGuru's Guide to mIRC scripting part 1


GameGuru
30-05-2001, 20:11
In an attempt to bring this forum to life, I shall start giving short tutorials and examples of basic scripting techniques and guide to commands. These tutorials assume you have a basic knowledge of mIRC and IRC itself. If there is anything you don't understand in the tutorial or you wish to make further comment reply to this thread :)

Part 1 - The basics - Aliases

mIRC scripting works on the basis of 5 areas. The first being Aliases, which are explained in this Tutorial, Popups, Remote, Users and Variables.

Aliases form a very simple part of scripting. Aliases, are used primarily as a shortcut to long and tedious commands, or as a way of performing multiple commands in one go. Loading your aliases file in mIRC (by pressing Alt + A or Tools -> Aliases on the Toolbar) You will find some aliases already created for you.

/op /mode # +ooo $$1 $2 $3

Many of you who frequently use mIRC will be aware of the Operator status and giving it to other people. Many of you will use /op <nickname> to give ops to people. However, this would not work if you did not have /op defined as an alias. The standard protocol for IRC is to use /mode # (thats is the current active channel) +o (give the user ops) $$1 (this is an identifier meaning the first parameter you specify, and is required in order for the alias to work) $2 $3 (these are also identifiers refering to parameter 2 and 3, however are optional parameters.)
To create any alias, you must first declare the alias (in the above example it was /op) then you must declare the commands associated with that alias. If you want to create an action alias that automatically allows you to slap someone with a specified object then you could create an alias like this:

/slap /me slaps $$1 with a $$2
This would mean when you type "/slap Paul spade" you would actually do "/me slaps Paul with a spade"

This concludes part 1 of the scripting basics. Part two will explain how to create Popups and use them in the same way as Aliases.

As a way of practice try creating an alias that allows you to ban and then kick a user. You will need to use /mode +b and /kick in your alias, aswell as { } to encase the alias commands.

-[Raven]-
30-05-2001, 21:05
Awww, how sweet :D

Deathwish2000
30-05-2001, 22:15
hmmz, thats nice :)

GameGuru
31-05-2001, 14:09
shurrup :P

Bad-Co
31-05-2001, 21:12
Very l337 Ric :)

Reality
31-05-2001, 21:33
you should put that on a web site too :)

Mister666
01-06-2001, 01:11
Isn't he helpful? :cheese:

GameGuru
01-06-2001, 02:14
Originally posted by Reality
you should put that on a web site too :)
I would if:
A) I could make a website
B) I had time
C) I could be bothered

:E

nj
01-06-2001, 12:57
could some one gice me the link for the IRC and does ir work on the AppleMAc ?

GameGuru
01-06-2001, 16:29
As far as I know, the code I produced will work on mIRC and mIRC alone, which only works in Windows.

However this site here (http://chatting.about.com/internet/chatting/cs/macircclients/) has links to many Mac IRC clients

Ironheart
01-06-2001, 17:35
Ircle is the IRC client of choice for many of my friends who use Macs.

Yes, they're still my friends despite their Mac-useage :E

Skunk
03-06-2001, 19:26
Schweet - I vaguely knew that stuff already but I can't wait for the second installment. If you want them hosted on a website I've got a few I can bung them on for ya ;)

GameGuru
04-06-2001, 08:58
If you've got nothing better to do Skunk I'm more than happy for you to put it up on a site :)

Next installment on Wednesday! :D

LeeLee
05-06-2001, 09:18
Awww, you're sooooo cute GameGuru.

Have you thought about going into teaching? I mean even I understood some of that - well, sort of. :)

GameGuru
05-06-2001, 11:40
It was a possible career, before I actually worked as an assistant teacher after school...

Year 8 pupils are an evil species :(

Nor
05-06-2001, 14:54
Excellent stuff, just found this place, I'll hang about and annoy you Ric ;)

-=SE|Blizzard=-
06-06-2001, 18:14
Can u help me with a scipt?

alias whatever.update.get {
echo -a Getting new version
sockclose getupdate
sockopen getupdate http://www.efter-stormen.com 80
}
on *:sockopen:getupdate:{ if ($sockerr == 0) { sockwrite -n $sockname GET /zynaps/files/test_ $+ %whatever.update $+ .zip } }
on *:sockread:getupdate:{ if ($sockerr == 0) {
; What goes here to remake the zip file?
sockclose $sockname
}
}

%whatever.update = 0.8.0

Thanks for any help

Skunk
10-06-2001, 17:18
What is that scritp meant to do? I can see it atemps to retrive some information over an HTTP socket connection but what is it meant to do with that information afterwards?

GameGuru
10-06-2001, 18:14
I believe what it is attempting to do is download a zip file. The problem is converting the data mIRC receives and creating a zip file from the data it receives at the client end...

I'm not really sure how to do this atm. I would seriously think it possible tho :)