mIRC Home    About    Download    Register    News    Help

Print Thread
#253768 04/07/15 09:02 PM
Joined: Jul 2015
Posts: 1
U
UNNGH Offline OP
Mostly harmless
OP Offline
Mostly harmless
U
Joined: Jul 2015
Posts: 1
Hi there, i am new to running bots and i dont really know how to do what i want. So what I would like is a script that goes:

on join:(to the joining person) {Welcome to Mychannel Rules: x y z}
on join:(to joining person) {Please prove you are a person, type this in: (generated code)}

if (code = correct){
pass
}else{
kick reason: wrong code
}

if (one of of mod/admin = joins){
on join:(to everyone) {[MOD]Admin HAS JOINED}
}

every 5 minutes: say to everyone {It is hh:mm:ss am/pm, there are x people online "any other info"}

There is more but i want to see if someone will help.




Last edited by UNNGH; 04/07/15 09:02 PM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
In mSL, you can't have brackets touching code.

Type /help : to read about certain events and identifiers.
Code:
on *:join:#: { 
set %Captcha $rand(1,9999999)
notice $nick Hey there! Please prove that you are a person by typing %Captcha
}

on *:notice:*:#: { 
if ($istok(%CaptchaList,$nick,32)) { check_words $chan $nick $1- }
}
on *:text:*:#: {
if ($istok(%CaptchaList,$nick,32)) { check_words $chan $nick $1- }
}

alias -l check_words {
if ($3 == %Captcha) { notice $2 Correct! }
else { 
notice $nick WRONG! 
kick $1 $2
}
}


You can't check if the user is an op on the join event without using a timer. Instead of relying on this, you can try using the on op event. /help on op

Regarding the last one, it's a simple timer. You can try setting up an alias that has the message you want and call that alias every 5 minutes. /help timers


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
No need for a timer.

on OP/DEOP

The on OP and on DEOP events trigger when a user on a channel is opped or deopped.

Format: on <level>:OP:<#[,#]>:<commands>
Example: on 1:OP:#mirc,#irchelp:/msg $opnick Please do not abuse your Op status

Generally the op event happens immediately after the join.

Quote:
on *:join:#: {


There is no need for a space between the colon and the left bracket...

Quote:
on *:join:#:{


Works just fine.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
If you read the first post you'd see that he was requesting different responses whether or not an user who joined was an op or not. I also mentioned the on op event in my previous post as a more reliable version of checking for ops than adding to a variable and starting a timer to check if user is an op 2 seconds later, did you even read my post? I'm also aware that :#: { can be written :#:{, but this is the only part in mSL where a squiggly bracket is allowed to touch code and I try to stay consistent; thus I use :#: {. If you also look at the first post, he made several occurences of squiggly brackets touching code where they can't, hence I mentioned it.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard