The following should work for all networks.
on
@*JOIN:#:{ mode $chan +v $nick }
the text events are like this:
on [color:red]@[/color]*:TEXT:*:#:{
if ((http://* iswm $1-) [color:blue]||[/color] (www.* iswm $1-)) { .mode +b $address($nick,3) [color:orange]|[/color] .kick $chan $nick Banned. Do not advertise websites in $chan }
if (($1 == lo) [color:blue]||[/color] ($1 == hello) [color:blue]||[/color] ($1 == lo all) [color:blue]||[/color] ($1 == hi)) { msg $chan HI $nick $+ ! }
}
@ - means it will only do the commands if you are oped (remove
@ if you want the script to attempt it at all times)
|| - Using abc, then: if ((a = a) or (b == b) or (c == c)) { do this }
So if either one of them is correct, it works. You could always do each one individually like Kazz shows above.
| - this is only used in the actions part of the script to keep text in less lines.
The example above could have been written as:
on [color:red]@[/color]*:TEXT:*:#:{
if ((http://* iswm $1-) [color:blue]||[/color] (www.* iswm $1-)) {
.mode +b $address($nick,3)
.kick $chan $nick Banned. Do not advertise websites in $chan
}
if (($1 == lo) [color:blue]||[/color] ($1 == hello) [color:blue]||[/color] ($1 == lo all) [color:blue]||[/color] ($1 == hi)) { msg $chan HI $nick $+ ! }
}
From the help file (/help Aliases):
For multiple commands you should use a | character (the shifted character usually under the \ key). So to write an alias that kicks and bans someone:
/dkb /kick # $1 | /mode # +b $1
If you want to reply with different messages, then use:
on [color:red]@[/color]*:TEXT:*:#:{
if (http://* iswm $1-) {
.mode +b $address($nick,3)
.kick $chan $nick Banned. Do not advertise in $chan
}
if (www.* iswm $1-) {
.kick $chan $nick Banned. Do not advertise in $chan
}
}
if (($1 == lo) { msg $chan lo $nick $+ ! }
if ($1 == hello) { msg $chan Hello $nick $+ ! }
if ($1 == lo all) { msg $chan Hi $nick }
if ($1 == hi) { msg $chan Hi $nick $+ ! }
}
This time, the different actions are:
[edit] Had to replace this as it looked all messed up!
| TEXT | |
|Starts With | Is | Actions |
|------------|--------|----------------------|
| http:// | |Ban + Kick |
| www. | |Kick |
| | lo |Reply "lo <nick>!" |
| | hello |Reply "Hello <nick>!" |
| | lo all |Reply "Hi <nick>" |
| | hi |Reply "Hi <Nick>!" |
[/edit]REMEMBER:You cannot have two of the same events in the same script file.
e.g. you cannot have two
on *:TEXT:*:#:{} or
on *:JOIN:#:{} events in the same file
Hope the above helps you in some way!