IRCPlus.nl

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