mIRC Home    About    Download    Register    News    Help

Print Thread
#249996 28/12/14 02:03 PM
Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Hi, First of all If say something stupid-- Forgive me, I am new to scripting and new to mIRC, So I am trying to create a custom TWITCH bot.

Now I have used nightbot before, And I can't figure one command out, On nightbot the command was !splat = @user@ has splatted @touser@ with sticky glue, I can figure out the $nick, But when I try and get the @touser@ I believe it would be $$2 however when I put that nothing happens, This is my current command it looks a little odd since I have been experimenting

on *:TEXT:splat:#: { msg $chan $nick has splatted $$2 with sticky glue
}

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
on *:text:!splat &:#: { msg # $nick has splatted $2 with sticky glue }
on *:text:!slap &:#: { msg # $nick has slapped $2 with a large trout }


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Thanks it really helps, But how do I make it non case sensitive (Not just for this command).

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
It isn't.

Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
So how would I get a Multi Text one -- IE on text kappa

/timeout $nick 1
<Ukzbot>: I don't like that command very much!

Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
What I mean is, I personally don't like the emoticon Kappa, So i have it set to timeout the kappa for one second, Which it does, HOWEVER, It doesn't do the second part of text though it is a different part ie

on *:TEXT:Kappa:#: { msg $chan timeout $nick 1} <---- This text is completed.

on *:TEXT::Kappa:#: {msg $chan Now now, I don't like that emoticon!
} <---- This text NOT completed.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
on *:text:*kappa*:#: { 
msg # timeout $nick 1
msg # Now now, I don't like that emoticon! 
}

Since they both match the exact same text you can't have them in the same file like that. If you want two matches of the exact same text, or all text, you need to have 2 different files. You can click "file > new" to create a new file.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Thanks laugh

Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
How would I make a Admin only command so it checks for +0 mode?

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
if ($nick isop #<channel>) {


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
It seems it's not working--

This is what I have / Need it to function as

on *:TEXT:!test:#: if ($nick isop #kryptonica) { Hi
}

Joined: Sep 2014
Posts: 52
Babel fish
Offline
Babel fish
Joined: Sep 2014
Posts: 52
on *:TEXT:!test:#: {
if ($nick isop #kryptonica) { msg $chan Hi }
}

Last edited by paper0rplastic; 01/01/15 07:09 PM.
Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Thanks, but I have one last question, how would I get it to do an if command

IE on *:TEXT:!1out &:#: {
if ($nick isop #kryptonica) { msg $chan /unban $2 }
msg # $2 has been timed out for 1 minute.
}

Say a moderator has tried to timeout a moderator, How would I get it so that this will say 'msg # $2 is a moderator and can only be timed out by the owner'

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
msg # $iif($2 isop #,$2 is a moderator and can only be timed out by the owner,$2 has been timed out for 1 minute.)

Joined: Dec 2014
Posts: 68
M
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
How would I get it to say that if it wasn't a mod at all, "Sorry, &nick You don't have permission to use this command."

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You're pretty much free to do whatever you want in mIRC's dynamic language, as long as you understand it. You should read the help files of " /help if then else " and " /help on text "

Here are some basic syntaxes for you to follow
Code:
on *:text:!test*:#: { 
;Starting with a simple message
msg # $nick initiated a test

;Is the user an op in the channel? Do this
if ($nick isop #) msg # $nick is an op
;Is the user not an op? Do this
else { 
msg # $nick is not an op
msg # Hehe, not even an op *laughs*
}

;Did the user write something after !test? Do this
if ($2) msg # $nick also mentioned $2- message
;Not? Do this
elseif (!$2) msg # $nick did not mention anything in his message

;Ending with a simple message
msg # K, this has been a simple test brought to you by $me $+ .
}


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

Link Copied to Clipboard