Advanced mIRC Scripting (mSL)
Learn advanced mIRC scripting (mSL), including events, variables, dialogs and automation.
โก Events
Events respond to activity on IRC.
on *:JOIN:#:{
msg $chan Welcome $nick!
}
Runs whenever a user joins the channel.
๐ฆ Variables
Variables store data.
set %naam IRCPlus
echo -a %naam
% = tijdelijk
%naam blijft actief tot restart
๐ Global variables
set -g %bezoekers 0
inc %bezoekers
The value remains available after a restart.
๐ If / Else
if ($nick == Admin) {
msg $chan Welcome, admin!
}
else {
msg $chan Hello $nick
}
โจ๏ธ Custom command
alias groet {
msg $chan Hello $1!
}
Usage: /groet Nick
โฑ๏ธ Timers
.timer1 0 60 msg #IRCx Remember to chat!
Repeats every 60 seconds.
๐ User levels
on @:TEXT:!kick:#:{
kick $chan $1 Abuse
}
@ = alleen ops
% = halfops
+ = voiced
๐๏ธ Hash tables
Store data in a hash table, which can be faster than using many variables.
hmake users 100
hadd users nick1 online
echo -a $hget(users,nick1)
๐ช Dialogs (UI)
dialog test {
title "IRCPlus"
size -1 -1 150 60
button "Click me", 1, 10 10 50 20
}
dialog -m test test
Creates a graphical interface window.
๐ Sockets (API)
sockopen test google.com 80
Useful for web requests and APIs.
๐ค Chat bot
on *:TEXT:!tijd:#:{
msg $chan The time is $time
}
A simple command bot.
๐ซ Flood protect
on *:TEXT:*:#:{
inc -u5 %flood. $+ $nick
if (%flood. $+ $nick > 5) {
kick $chan $nick Flooding
}
}
A basic anti-spam system.
๐ Debugging
echo -a Debug: $nick $1-
Use /debug to view logs.
๐ก Best practices
- Use descriptive variable names.
- Keep scripts modular.
- Use hash tables for larger data sets.
- Test locally before deployment.
IRCPlus advanced mSL scripting guide