• Log in or sign up for an account here: https://www.sythe.org/login

Intro to IRC Scripting

Sacro

Gunny - 168gr SMK Shooter
Joined
Jul 31, 2008
Sythe Gold
0
Messages
1,983
Location
The other side of the bullet.
Intro to IRC Scripting
This is a very basic intro to IRC scripting. I personally have created scripts over 10,000 lines of text. This is a small dose to possibly show people their next hobby. The 3 major parts of IRC scripting are:

Aliases
Popups
Remotes




Aliases:
Aliases are, in my oppinion, the easiest/best way learn IRC scripting. They can save alot of time when you need it. Let's start with something simple. For example, those who use SytheIRC and register, will be messaged every login to identify themselves as the owner of the nickname being used, to avoid typing a line of text every time you sign on, you can do a script. This will not only save time, but will conceal your password. Open up your aliases by clicking Tools->Script Editor->Then the "alias" tab. Put this on a open line of text.

/id /msg nickserv identify PASSWORD
}

The first word on a line in aliases is always treated as a new command. Anything after that is what the command does. So, /id is the new command, and /msg nickserv identify YourPassword is what it does. Followed by a "}" to end that script.

Popups:
Popup menu definitions use the format menu item:commands, so Help Me!:/join #help would take you to #help the same as if you had typed /join #help. To start a menu, put whatever you want the menu to say at the top of the page. This is the easiest, you can rearrange it later as you please. To create a submenu, use a "." fullstop. To make more submenus, use "..", "...", etc. In my oppinion this is a waste of time, but i feel it needed anyway.


Remotes:
I think remotes are the most useful, and can be the most complicated scripts used on IRC. But this doesnt mean that all of them are hard.

Remote Script's just mean that they use triggers to run the script, this means that unlike Alias's, you can use multiple triggers, Ban, Join, Part, Text, Input, Highlight etc.

First lets try a simple onjoin message.

on *:JOIN:#mychan:/msg $chan Hi $nick $+ , welcome to $chan $+
}

Now on a join to your channel, your bot will message them a greeting of "Hi whoever, welcome to #mychan"


*Note* This is a very Generic Join script



IDENTIFIERS:

A identifier is something that identifies a variable in a script. Here are some common ones:

$me - used when you want the bot to do something to itself
$nick - $nick is whoever triggered script.
$chan - channel in which script was triggered
$2, $3,- second, third, etc word in command (ex. !kick loser scans for a $2, find that $2 = loser, and kicks it)
$null - when referring to a variable that doesn't exist
$$? - used in popups to create options

This is only a beginner guide, if you would like to learn more about scripting, feel free to message me on ZypurIRC, and SytheIRC. (Irc.zypur.com and Irc.sythe.org)
 
Intro to IRC Scripting
...Into mIRC scripting ._.
 
Intro to IRC Scripting
Good guide, but a couple of things...

I don't see the point of the bracket at the end of your scripts. If you check it, you get a bracket mismatch.

To clarify $me, $me identifies whatever nickname you are using at the moment. Do //echo $me and it should return your current nickname.

And you forgot $1 and $<number>-
 
Intro to IRC Scripting
Good guide, but a couple of things...

I don't see the point of the bracket at the end of your scripts. If you check it, you get a bracket mismatch.

To clarify $me, $me identifies whatever nickname you are using at the moment. Do //echo $me and it should return your current nickname.

And you forgot $1 and $<number>-

Dustein, the brackets in script's, part them for future ones. Ex.
off *:INVITE:#: {
if ($chan(0) >= 30) {
notice $nick $c2($nick,I am currently full, please try again later.)
halt
}
if ($readini(botinfo.ini,n,kicks,$chan) < 5) || ($readini(botinfo.ini,n,kicks,$chan) == $null) {
msg #rawr $+($chr(3),07,$nick,$chr(3)) has invited me to $+($chr(3),07,$chan,$chr(3)) $+ .
join $chan
.timer 1 2 msg $chan Hi, I'm7 $me $+ , I've been invited by $nick $+ . If I'm kicked 5 times this channel will be blacklisted, kicks left: $+($chr(3),07,$iif($readini(botinfo.ini,n,kicks,$chan),$calc(5 - $v1),5),/5,$chr(3),.) To remove me type $+($chr(3),07,!part $me,$chr(3)) - If you find any errors with the scripts please contact Sacro in #rawr on SwiftIRC
ignore -iu300 $iif($address($nick,2),$v1,$nick)
}
else {
notice $nick You can not invite me because your channel is blacklisted, join #rawr to get this appealed.
ignore -iu300 $iif($address($nick,2),$v1,$nick)
}
}
on *:PART:#: {
if ($nick != ($ me)) {
if ($nick($chan,0) < 1) {
part $chan You need at least one other person to keep me.
}
}
if ($nick == ($ me)) {
msg #rawr I have just parted $+($chr(3),07,$chan,$chr(3),.)
}
}

This as you can see, allows both Invite and Part triggers to be used, as no brackets seperating, would make the Part trigger disabled.

And about ($ me), Yes this returns your current nickname, but it also works in the place of different settings, the reason //echo ($ me) returns your nickname, is because that is the current "you".
 
Intro to IRC Scripting
Do you ever get some kind of problem where in your remotes the } didn't really end it? So basically when you run a script all the scripts below it go off :p. Pretty funny but I have that problem sometimes.
 
Intro to IRC Scripting
Do you ever get some kind of problem where in your remotes the } didn't really end it? So basically when you run a script all the scripts below it go off :p. Pretty funny but I have that problem sometimes.

I personally have never had that, because i end them, and start again with new triggers. Without that trigger, the next script in the series will not start. Although i can see how it would happen. If you want, post your script and i'll have a look at it Cfrey =)
 
Intro to IRC Scripting
I'll have to post it later when I move and get my computer back. Anyways I'll show you what it looked like

On *Join* blah blah blah
}
On *Text* blah blah blah this is indented
}
On *Text* blah blah blah this one is indented too

To fix it I had to add like

}}
}

at the end of my thing to fix it. It was really weird.
 
Intro to IRC Scripting
I'll have to post it later when I move and get my computer back. Anyways I'll show you what it looked like

On *Join* blah blah blah
}
On *Text* blah blah blah this is indented
}
On *Text* blah blah blah this one is indented too

To fix it I had to add like

}}
}

at the end of my thing to fix it. It was really weird.

This can be caused because your scripts are not properly halted, and react on the same trigger, If you had 2 text triggers for "blah" they would both coincidentally go off at that trigger.
 
Intro to IRC Scripting
no no the blah blah blah crap was just the rest of the script they were both had different kind of triggers like !kill, !say !stats, !etc.

I'll have to post the script later to show you.
 
Intro to IRC Scripting
Thanks for the guide.

Never really had a clue about IRC bots/scripts etc.. This'll really give me a boost, cheers.
 
Intro to IRC Scripting
Thanks for the guide.

Never really had a clue about IRC bots/scripts etc.. This'll really give me a boost, cheers.
Your welcome, if you need some help, just send me a /query.
 
Intro to IRC Scripting
mSL :)

I used to be good at this also TCL when i had an eggdrop bot.
 
Intro to IRC Scripting
I am beast at script anyone needs any help pm me
 
Intro to IRC Scripting
I am beast at script anyone needs any help pm me
I am also a beast with MSL, more so then you I'm guessing, please don't spam my threads for post count.
 
Intro to IRC Scripting
With grammar like that, k0pwner. You obviously don't know any mSL apart from hawkee.com <_<
 
Intro to IRC Scripting
Dustein, the brackets in script's, part them for future ones. Ex.
off *:INVITE:#: {
if ($chan(0) >= 30) {
notice $nick $c2($nick,I am currently full, please try again later.)
halt
}

Hey I like that but I wonder why it is off instead of on. That's because the script are turned off?
 
Intro to IRC Scripting
Hey I like that but I wonder why it is off instead of on. That's because the script are turned off?

For the moment yes, i have that trigger turned off. Because I am not currently using bot-tags ([AA] etc.) I see no reason to limit channels.
 
Runescape Gamblingrunescape gambling
Back
Top