PDA

View Full Version : Basic mIRC Scripting


thegameroom
05-19-2011, 03:09 PM
Hello, I will teach you some simple scripts and other things with mIRC

What is mIRC?

mIRC is a client that is used to make "bots". They are used for Justin.tv and other things that allow IRC. The "bot" will be able to say and perform certain things on certain commands.

Everything in this tutorial is added to the, Remote Tab in mIRC

Basic Scripts

Your basic script will start like this: on *:TEXT:This command will have your "bot" do an action on a certain text.

So let's have our "bot" say "Hello I'm MetsBot" when the user types, "MetsBot"

Here is the code we would use: on *:TEXT:MetsBot:#: { $msg $chan Hello I'm Metsbot }Now, every script where to "bot" says something when a user says a certain thing you MUST start it like this: { $msg $chan The $msg starts the message and the $chan is for the IRC channel.

Now, let's make a script that greets EVERY user when they join the IRC channel.

The code will look like this: on *:JOIN:#:{ $msg $chan $nick Has Joined }as you can see we started the code with { $msg $chan Now, $nick will automatically place the users, "nickname" wherever $nick is.

How to Make a Script with Variables

This one is pretty basic, use this code: on *:TEXT:!kiss*:#: {
msg $chan $nick Pukers Up and Kisses $2- } You have to start it like this: on *:TEXT:!kiss*:#: { $msg $chan Here the $2- is whatever you put in place of the * So for example if you put, "!kiss Mets08123" the bot would say, "(your nickname) Puckers Up and Kissed Mets08123"


This is your basics of easy scripts.

More Advanced Scripts

Sometimes having the Join script gets the chat a little flooded, so we will create a script in which you will be able to disable it by saying, "!joinoff"

Here is the code to turn it off: on *:TEXT:!joinoff:#: { /disable #group1 } { $msg $chan Join Notices Turned OFF } Here is the code to turn it on: on *:TEXT:!joinon:#: { /enable #group1 } { $msg $chan Join Notices Turned ON } Now we have to set up the "Group" as you can see in this code the group is named #group1, here is how you would set it up:

#group1 on
on *:JOIN:#:{ $msg $chan $nick Has Joined }
#group1 end

In between #group1 on and #group1 end you will put the script you would want to disable/enable.

Your can change the #group1 to #group2, #group3 and so on for other things you want to disable/enable.

MAKE SURE THIS GOES AFTER THE DISABLE/ENABLE SCRIPTS!

How to Make it So ONLY moderators of the channel can do the command

You would use this code: on *:TEXT:clear:#: { if ($nick isop $chan) { msg $chan /clear }
else { $msg $chan $nick You Can Not Clear the Chat! }
}You would have to start the script like so: { if ($nick isop $chan) { $msg $chan The { if ($nick isop $chan) will check to see if the user is a moderator in the channel.
For the, else { $msg $chan , you will put what your "bot" will say if the user is NOT a moderator.


I hope this will teach you a thing or two about basic mIRC scripting! If you have ANY questions just reply to the thread and I will try and help you out the best I can!

carlitosbahia
05-19-2011, 04:44 PM
I would not recommend the use of the JOIN to greet people in bots for popular channels , if a lot of people is joining at the start of the cast jtv chat could think the bot is spamming and the bot could end with a automatic 24 hours ban :)

Itaku
05-19-2011, 04:45 PM
Excellent guide here.

It's also helpful to know if you use /help <insert anything here> and it will open up a help dialog with almost everything there is about mIRC Scripting, very in depth help system they have.

thegameroom
05-19-2011, 05:07 PM
I would not recommend the use of the JOIN to greet people in bots for popular channels , if a lot of people is joining at the start of the cast jtv chat could think the bot is spamming and the bot could end with a automatic 24 hours ban :)

But, you can disable it freely with the script provided in the about tutorial :P

Jerseymatt
05-26-2011, 05:55 PM
Where do we go online to start making one of these bots =D

thegameroom
05-26-2011, 05:56 PM
Where do we go online to start making one of these bots =D

well you can't do it anymore on JTV :'( You have to be whitelisted and they are no longer accepting anymore people :'(

Jerseymatt
05-26-2011, 06:07 PM
...................so is there a point in even making one anymore? :(

thegameroom
05-26-2011, 06:09 PM
...................so is there a point in even making one anymore? :(

nope :( Maybe they will one day allow more users to be accepted, until then you will have to use the bot on a different website like JTV or just in a regular IRC Channel

carlitosbahia
05-26-2011, 07:12 PM
well you can't do it anymore on JTV :'( You have to be whitelisted and they are no longer accepting anymore people :'(

justin removed the need of the whilelist , so now anyone can use irc on jtv , the only difference now is that if you was not whitelisted at that time , then you can join up to 5 channels at the same time , if you are one of the "old" whitelisted irc users you can join all the chats you want at the same time

that was december 2010 , actually :) http://community.justin.tv/forums/showthread.php?t=5198

PS :
something i just saw about the code

on *:TEXT:!joinon:#: { /enable #group1 } { $msg $chan Join Notices Turned ON }
that only executes the first part (enable #group1) , you should do it like this

on *:TEXT:!joinon:#: { /enable #group1
$msg $chan Join Notices Turned ON }
or , if you want the 2 commands in one line
on *:TEXT:!joinon:#: { /enable #group1 │ $msg $chan Join Notices Turned ON }
or
on *:TEXT:!joinon:#: /enable #group1 | $msg $chan Join Notices Turned ON
if all commands fit in one line you dont need the { }

thegameroom
05-27-2011, 04:17 PM
justin removed the need of the whilelist , so now anyone can use irc on jtv , the only difference now is that if you was not whitelisted at that time , then you can join up to 5 channels at the same time , if you are one of the "old" whitelisted irc users you can join all the chats you want at the same time

that was december 2010 , actually :) http://community.justin.tv/forums/showthread.php?t=5198

PS :
something i just saw about the code


that only executes the first part (enable #group1) , you should do it like this


or , if you want the 2 commands in one line

or

if all commands fit in one line you dont need the { }

It all does the same thing ;)

Thanks for telling me about the whitelist I had no clue that anyone could do it now :)

DM613
08-17-2011, 09:22 PM
It's also helpful to know if you use /help <insert anything here> and it will open up a help dialog with almost everything there is about mIRC Scripting, very in depth help system they have.
Reply With Quote

power_of_bot
08-21-2011, 10:55 AM
so where can i go to start make a bot from scratch? Do i make the bot on notepad or something first or do i go to a certain site? If site what is the best site? if not will the bot have to run off my computer all the time?

carlitosbahia
08-21-2011, 11:40 AM
so where can i go to start make a bot from scratch? Do i make the bot on notepad or something first or do i go to a certain site? If site what is the best site? if not will the bot have to run off my computer all the time?


The most common and easier type of mirc bot works with msl (mirc scripting language) , a set of internal functions
You type the code using these functions inside mirc , it has a space called script editor (alt-R and you see it) and save the script files (*.mrc) , you could also type the code in notepad but this way is better
The bot needs to be running on your pc all the time you want it present in the channel/s , is just a copy of mirc running ; if you use also mirc to chat using other username you can have more than one instance of mirc running http://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/233027/page/1#Post233027

tutorials
http://www.mediafire.com/file/cnjm2makzqj/mIRC_Scripting_Primer.pdf (here you have almost all you need to start from scratch)
http://www.zigwap.com/mirc/
http://www.hawkee.com/phpBB2/viewforum.php?f=22&sid=852fa2facc40cce92fa7464b4a2d57d5

Debugging 8usefull if something is not working)
http://www.kthx.net/ftb/

power_of_bot
08-21-2011, 01:56 PM
tutorials
http://www.mediafire.com/file/cnjm2makzqj/mIRC_Scripting_Primer.pdf (here you have almost all you need to start from scratch)
http://www.zigwap.com/mirc/
http://www.hawkee.com/phpBB2/viewforum.php?f=22&sid=852fa2facc40cce92fa7464b4a2d57d5

Debugging 8usefull if something is not working)
http://www.kthx.net/ftb/

Thx thats a big help, now i need to know the jtv info for the IRC Server so i can connect to it or should i wait til i finsh making a bot?

carlitosbahia
08-21-2011, 02:36 PM
you can connect right now to chat if you want , even if you don't have any command working yet , plus the only way to test your commands is using other user to type them and the bot connected at the same time to check the reply/action

New IRC Server Changes (http://community.justin.tv/forums/showthread.php?t=5198)
Using mIRC on JTV the friendly way (http://community.justin.tv/forums/showthread.php?t=8532)

power_of_bot
09-08-2011, 09:40 AM
Thank carlitosbahia and everyone for you help i learn and built the chat bot of my dreams in under a week thanks to your help and i a m so happy.

Now i am facing a small problem i have my chat bot in two channels but when i set !topic for one channel it is exactly the same for the other channel.

i want the to be able to have diffrent values for topic how do i do this?

carlitosbahia
09-08-2011, 10:06 AM
Thank carlitosbahia and everyone for you help i learn and built the chat bot of my dreams in under a week thanks to your help and i a m so happy.

Now i am facing a small problem i have my chat bot in two channels but when i set !topic for one channel it is exactly the same for the other channel.

i want the to be able to have diffrent values for topic how do i do this?

If you are still using the same script try replacing (everywhere, when you write them and when you read them)
%topic_msg (same with the other %topic_mod etc variables)
with $+(%topic_msg_,$chan)
that way you should add the channel in the variable name saving one variable for each channel
not tested, just typed here :)

power_of_bot
09-08-2011, 11:05 AM
If you are still using the same script try replacing (everywhere, when you write them and when you read them)
%topic_msg (same with the other %topic_mod etc variables)
with $+(%topic_msg_,$chan)
that way you should add the channel in the variable name saving one variable for each channel
not tested, just typed here :)

nope doesn't seem to work ‹﴾͡๏̯͡๏﴿›
A "/set: invalid parameters (line 3, remote.ini)" message pop up in mirc

on *:text: !topic *:#: {
if ( $2 !== $null ) && ( $nick isop $chan ) {
set -n $+(%topic_msg_,$chan) $2- | set $+(%topic_mod_,$chan) $nick | set $+(%topic_start_,$chan) $ctime
msg $chan $nick --> New topic : $qt($+(%topic_msg_,$chan)) , has been set.
}
if ( $nick !isop $chan ) {
msg $chan Sorry $nick , only mods can use this command :P }
}

on *:text:!topic:#: {
if ( $+(%topic_msg_,$chan) !== $+(%topic_nomsg_,$chan) ) {
set $+(%topic_secs_,$chan) $calc( $ctime - $+(%topic_start_,$chan) )
set $+(%topic_time_,$chan) $duration( $+(%topic_secs_,$chan) , 2 )
msg # topic : $+(%topic_msg_,$chan) (set by $+(%topic_mod_,$chan) $+(%topic_time_,$chan) ago)
}
if ( $+(%topic_msg_,$chan) == $+(%topic_nomsg_,$chan) ) {
msg $chan topic : $nick , $+(%topic_nomsg_,$chan) ?
}
}

on *:text: !cleartopic:#: {
if ( $nick isop $chan ) {
set -n $+(%topic_msg_,$chan) $+(%topic_nomsg_,$chan)
msg $chan The topic has been cleared.
}
if ( $nick !isop $chan ) { msg $chan Sorry $nick , only mods can use this command :P }
}

power_of_bot
09-08-2011, 06:59 PM
never mind i got another way of doing it. thx again carlitosbahia for your help.

carlitosbahia
09-08-2011, 08:20 PM
never mind i got another way of doing it. thx again carlitosbahia for your help.

no problem
for all that is mirc that forum is the best, people is fast to answer :)

MrXBob
11-04-2011, 03:20 AM
I've had my bot running for over a year now but I've never been able to figure out how to make it use /me commands.

Anyone know how to do it? Google has been useless - loads of things saying to use 'action' or 'act' or even 'notice' instead of the standard 'msg'.. none of which have worked.

Here is an example I'm trying:

on *:TEXT:!example:#:{ msg # This is the example }

User types !example and the bot says "This is the example"
I want the bot to actually say "/me This is the example"

carlitosbahia
11-04-2011, 09:31 AM
I've had my bot running for over a year now but I've never been able to figure out how to make it use /me commands.

Anyone know how to do it? Google has been useless - loads of things saying to use 'action' or 'act' or even 'notice' instead of the standard 'msg'.. none of which have worked.

Here is an example I'm trying:

on *:TEXT:!example:#:{ msg # This is the example }

User types !example and the bot says "This is the example"
I want the bot to actually say "/me This is the example"

hi
just use /describe instead of /msg to replicate the jtv /me
actually the /me works but only for a user(no bot) typing into chat, but for scripts you need to use the /describe (or describe)

MrXBob
11-07-2011, 01:42 PM
Thank you! Finally got it working :)

bill12780
01-21-2012, 12:46 PM
Hello everyone,

Sorry to resurrect an older thread. But this is the right topic my question falls under.

I am trying to write some customer scripts for the channel that I MOD in but I just can't figure out what I am doing wrong.

I am running MIRC and I can get to the channel and chat with out any problems.

In the Remote window of the script editor I have:
on *:TEXT:!rabbit:#:{ msg # Rabbits! }

Now this works in MY channel when I sign in as a different user other than the one that has the script in it.

(As a side note...its very slow in the jtv channel to respond...but is instant in MIRC....any what to speed this up in the channel??)

But it does NOT work in the channel I mod in...

how do I make it so the script works in the channel that I mod in?

Is there something that the Host needs to do to allow my to do these things??

Any advise is always welcome..has I am pretty new to "this" kind of scripting...

Thanks to all!
Bill12780

carlitosbahia
01-21-2012, 06:23 PM
In the Remote window of the script editor I have:
on *:TEXT:!rabbit:#:{ msg # Rabbits! }

the format of the script is the right one, no issues there

Now this works in MY channel when I sign in as a different user other than the one that has the script in it.

(As a side note...its very slow in the jtv channel to respond...but is instant in MIRC....any what to speed this up in the channel??)

that is the right way the commands works when other user types them, and no the bot, that is why you save them in the remote section
if you want to execute some command from the same bot check the alias or popout sections (changes just a bit the way you code there)
a alias doing the same thing would look like
/rabbit {
msg # Rabbits!
}to run that command from the bot you type /rabbit (include the / )

nothing to do about the time the message from the bot takes to appear in the web chat that is just the flash chat being slow :(

bill12780
01-25-2012, 12:47 PM
Thanks...that cleared a couple of things up for me...

This is FUN! Learning all kinds of new stuff..

thanks again!
bill12780

belair577
04-06-2012, 08:01 PM
i have a few games and user stats areas of my bot that i need roughed out so the scores file works. i just dont understand it or have the time to learn to understand it.

selosa
04-09-2012, 01:44 PM
Hello, I will teach you some simple scripts and other things with mIRC

What is mIRC?

mIRC is a client that is used to make "bots". They are used for Justin.tv and other things that allow IRC. The "bot" will be able to say and perform certain things on certain commands.

Everything in this tutorial is added to the, Remote Tab in mIRC

Basic Scripts

Your basic script will start like this: on *:TEXT:This command will have your "bot" do an action on a certain text.

So let's have our "bot" say "Hello I'm MetsBot" when the user types, "MetsBot"

Here is the code we would use: on *:TEXT:MetsBot:#: { $msg $chan Hello I'm Metsbot }Now, every script where to "bot" says something when a user says a certain thing you MUST start it like this: { $msg $chan The $msg starts the message and the $chan is for the IRC channel.

Now, let's make a script that greets EVERY user when they join the IRC channel.

The code will look like this: on *:JOIN:#:{ $msg $chan $nick Has Joined }as you can see we started the code with { $msg $chan Now, $nick will automatically place the users, "nickname" wherever $nick is.

How to Make a Script with Variables

This one is pretty basic, use this code: on *:TEXT:!kiss*:#: {
msg $chan $nick Pukers Up and Kisses $2- } You have to start it like this: on *:TEXT:!kiss*:#: { $msg $chan Here the $2- is whatever you put in place of the * So for example if you put, "!kiss Mets08123" the bot would say, "(your nickname) Puckers Up and Kissed Mets08123"


This is your basics of easy scripts.

More Advanced Scripts

Sometimes having the Join script gets the chat a little flooded, so we will create a script in which you will be able to disable it by saying, "!joinoff"

Here is the code to turn it off: on *:TEXT:!joinoff:#: { /disable #group1 } { $msg $chan Join Notices Turned OFF } Here is the code to turn it on: on *:TEXT:!joinon:#: { /enable #group1 } { $msg $chan Join Notices Turned ON } Now we have to set up the "Group" as you can see in this code the group is named #group1, here is how you would set it up:

#group1 on
on *:JOIN:#:{ $msg $chan $nick Has Joined }
#group1 end

In between #group1 on and #group1 end you will put the script you would want to disable/enable.

Your can change the #group1 to #group2, #group3 and so on for other things you want to disable/enable.

MAKE SURE THIS GOES AFTER THE DISABLE/ENABLE SCRIPTS!

How to Make it So ONLY moderators of the channel can do the command

You would use this code: on *:TEXT:clear:#: { if ($nick isop $chan) { msg $chan /clear }
else { $msg $chan $nick You Can Not Clear the Chat! }
}You would have to start the script like so: { if ($nick isop $chan) { $msg $chan The { if ($nick isop $chan) will check to see if the user is a moderator in the channel.
For the, else { $msg $chan , you will put what your "bot" will say if the user is NOT a moderator.


I hope this will teach you a thing or two about basic mIRC scripting! If you have ANY questions just reply to the thread and I will try and help you out the best I can!

hi! is there any way I can make some codes only available to certain users or chatters? i have tried replacing the isop with an actual jtv username, and it didnt worked.

like for example, i would want this command only available for jtv user A, B and C.
on *:TEXT:!kiss*:#: { describe $chan $nick Puckers Up and Kisses $2- }

Any idea? :)

selosa
04-09-2012, 02:21 PM
I already got it working! Yey!

on *:TEXT:!kiss*:#: { if ($nick == A) { describe $chan $nick Puckers Up and Kisses $2- }
else if ($nick == B) { describe $chan $nick Puckers Up and Kisses $2- }
else { describe $chan $nick You Can Not Use This Command! }
}

OR the shorter way

on *:TEXT:!kiss*:#: { if (($nick == A) || ($nick == B)) { describe $chan $nick Puckers Up and Kisses $2- }
else { describe $chan $nick Sorry, You Can Not Use This Command! :P }
}


I have no idea this is gonna be so much fun to learn! :)

carlitosbahia
04-09-2012, 02:37 PM
you could use something like

on *:TEXT:!kiss*:#: {
if ( $nick == nameofuserA ) describe $chan $nick Puckers Up and Kisses $2-
if ( $nick == nameofuserB ) describe $chan $nick Puckers Up and Kisses $2-
if ( $nick == nameofuserC ) describe $chan $nick Puckers Up and Kisses $2-
}

or

!kiss*:#: {
if ( ( $nick == nameofuserA ) || ( $nick == nameofuserB ) || ( $nick == nameofuserC ) ) describe $chan $nick Puckers Up and Kisses $2-
}

|| is the mirc's OR ( && is AND )




ooops, multitasking so was too late :)

selosa
04-09-2012, 03:05 PM
you could use something like

on *:TEXT:!kiss*:#: {
if ( $nick == nameofuserA ) describe $chan $nick Puckers Up and Kisses $2-
if ( $nick == nameofuserB ) describe $chan $nick Puckers Up and Kisses $2-
if ( $nick == nameofuserC ) describe $chan $nick Puckers Up and Kisses $2-
}

or

!kiss*:#: {
if ( ( $nick == nameofuserA ) || ( $nick == nameofuserB ) || ( $nick == nameofuserC ) ) describe $chan $nick Puckers Up and Kisses $2-
}

|| is the mirc's OR ( && is AND )




ooops, multitasking so was too late :)

thanks carlitos! :)

I have another question, I have two windows of mirc opened, one for me and one for the bot. Everytime I save my bot.ini file, a pop up msg always opens up in the mirc window wherein the normal userid is logged in, it says file 'bot' has changed, reload from disk? And I always select no.

Is there a way to open just one mirc and have two window tabs in it, one for normal user with no remote script loaded and one for the bot with the bot script loaded without messing up the whole application?.

carlitosbahia
04-09-2012, 03:19 PM
what i do is run 2 mirc instances one for my name and other for a bot, then you can have two sets of files (ini files, scripts, configurations, etc) http://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/233027/page/1#Post233027

if what you are doing is already that, just be sure to configure to save the files for each one in a separate place so you don't overwrite them

selosa
04-09-2012, 03:34 PM
what i do is run 2 mirc instances one for my name and other for a bot, then you can have two sets of files (ini files, scripts, configurations, etc) http://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/233027/page/1#Post233027

if what you are doing is already that, just be sure to configure to save the files for each one in a separate place so you don't overwrite them

thanks so much carlitos! :)

belair577
04-16-2012, 06:44 PM
http://godsnotwheregodsnot.blogspot.com/2012/02/how-to-write-mirc-games-scores-file.html
i cannot seem to got this to work to work as a line count script any ideas?

selosa
06-08-2012, 09:27 AM
How to Make it So ONLY moderators of the channel can do the command

You would use this code: on *:TEXT:clear:#: { if ($nick isop $chan) { msg $chan /clear }
else { $msg $chan $nick You Can Not Clear the Chat! }
}You would have to start the script like so: { if ($nick isop $chan) { $msg $chan The { if ($nick isop $chan) will check to see if the user is a moderator in the channel.
For the, else { $msg $chan , you will put what your "bot" will say if the user is NOT a moderator.


I hope this will teach you a thing or two about basic mIRC scripting! If you have ANY questions just reply to the thread and I will try and help you out the best I can!

Hello!

I have this command for clearing the chat and banning/unbanning a viewer.

on *:TEXT:!clear*:#: { if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) { msg $chan /clear }
else { describe $chan $nick Sorry, You cannot clear the chat! :P }
}

on *:TEXT:!ban*:#: { if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) { msg $chan /ban $2- }
else { describe $chan $nick Sorry, You're not allowed to use this command! :P }
}

on *:TEXT:!unban*:#: { if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) { msg $chan /unban $2- }
else { describe $chan $nick Sorry, You're not allowed to use this command! :P }
}


I wanna ask how to make the bot sends a message after the chat has been cleared or after a viewer has been banned/unbanned? Like for example sending a message to the channel that the viewer has been already unbanned from the chatroom :)

Thanks in advance! :D

carlitosbahia
06-08-2012, 09:53 AM
on *:TEXT:!clear:#: {
if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) {
msg $chan /clear
msg $chan chat was cleared by $nick
}
else describe $chan $nick Sorry, You cannot clear the chat! :P
}

on *:TEXT:!ban*:#: {
if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) {
msg $chan /ban $2
msg $chan $2 was banned by $nick
}
else describe $chan $nick Sorry, You're not allowed to use this command! :P
msg $chan $2 was banned by $nick
}

on *:TEXT:!unban*:#: {
if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) {
msg $chan /unban $2
msg $chan $2 was unbanned by $nick
}
else describe $chan $nick Sorry, You're not allowed to use this command! :P
} $nick is the user/mod clearing the chat, banning/unbanning, $2 is the banned /unbanned user, yu can choose what and how to show
just remember to add the msg $chan inside the first if so that only shows in chat if the person can run that command


couple of things i would change if i use that for myself:
1)you don't rellay need the * after the clear, just !clear should be ok, why you need that to work also for !clear kjhglkhkljdfhjkl ? :)
2) the $2- after the ban and unban means you could have more than one string, but since jtv names are just one single string you don't need it, or you could try (and fail) a non exixtent user ( !ban john doe )

selosa
06-08-2012, 11:55 AM
[CODE]couple of things i would change if i use that for myself:
1)you don't rellay need the * after the clear, just !clear should be ok, why you need that to work also for !clear kjhglkhkljdfhjkl ? :)
2) the $2- after the ban and unban means you could have more than one string, but since jtv names are just one single string you don't need it, or you could try (and fail) a non exixtent user ( !ban john doe )

ahh, that explains the * and the - sign after the $2. thanks carlitos! ;)

I tested the codes. All was working good except for one thing. The $nick part doesn't shows up in the chat.


on *:TEXT:!clear:#: { if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) { { msg $chan /clear } { describe $chan Chat was cleared by $nick. } }
else { describe $chan $nick Sorry, You cannot clear the chat! :P }
}

on *:TEXT:!ban*:#: { if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) { { msg $chan /ban $2 } { describe $chan $2 was banned by $nick. } }
else { describe $chan $nick Sorry, You're not allowed to use this command! :P }
}

on *:TEXT:!unban*:#: { if (($nick == name1) || ($nick == name2) || ($nick isop $chan)) { { msg $chan /unban $2 } { describe $chan $2 was unbanned by $nick. } }
else { describe $chan $nick Sorry, You're not allowed to use this command! :P }
}


Oppps! Already figured it out, it should have space between $nick and the period. That's why it didn't recognize the $nick the first few tries I did, stupid me LOL :D

Thanks a lot Carlitos! You, thegameroom and everyone in this thread have been a great help ;)

selosa
08-06-2012, 02:43 PM
Hi Guys! It's me again, I've tried searching online but failed to get one so here I am again asking help from you :)

Basically, I wanna know how to add on my current bot script a line that automatically unban a certain user whenever he/she gets banned/timed out either by my channel bot using the !ban command or other mods using the normal way of banning/t.o in browsers.

And I have already checked the "do not show links" box on jtv settings but it doesnt seem to work. Links are still displayed on my channel. How will my channel bot do an automatic time out of 5 minutes for whoever post links on my channel?

One more thing, how will a make a set of words return one channel response. For example, I want my bot to return one response to whoever says goodnight, good night, nyt, or nytie in the channel? And even if that word(s) is enclosed in a sentence would still return response from bot? Is this possible?

Thanks in advance guys! :)

jimescfan
11-18-2012, 07:47 AM
I downloaded mIRC (which I have guess I need since it has not been mention on this thread). Now what? When I enter my justin.tv channel name, I do not see my chat. What do I do? Where do I place all these codes? Do I need to do something on justin.tv to activate the bots I create? Some extremely basic information would be very helpful. Thanks

carlitosbahia
11-18-2012, 10:22 AM
I downloaded mIRC (which I have guess I need since it has not been mention on this thread). Now what? When I enter my justin.tv channel name, I do not see my chat. What do I do? Where do I place all these codes? Do I need to do something on justin.tv to activate the bots I create? Some extremely basic information would be very helpful. Thanks


1) what steps are you following to enter your jtv channel name?
how to connect to jtv http://community.justin.tv/forums/showthread.php?t=8532

2) about where to place any code, most codes go into the remotes tab of the script editor (menu tools, script editor or ALT-R), but before start copy/pasting a script from here or anywhere just be sure you use only what you need, just to chat you don't need any script, you need them only if you want to add some funtion to a bot to do something by itself
i would say that first you learn the basics of how to use mirc to chat only, and only then start thinking about a bot and what commands you need (also learning basics of scripting is a good idea other than just copy/paste code that you don't know what is doing)

3) there is nothing that you need to do to "activate" the bots, only limitation right now is that if the account is a new one (newer than the time of the whitelist, if you don't know what that means then your account for sure is not whitelisted) you can only use mirc at jtv at 5 channels at the same time (no total, just at a given time)

jimescfan
11-18-2012, 08:41 PM
Thank you so much. That is what I needed to know... a lot of studying ;)

IN B 4
12-04-2012, 01:46 AM
I want to create a bot that will type something for me automatically.

I want it to type !roll whenever this comes up
<@Smokin_Dice> ["random Name"] "random name" vs "random name" "random numbers" pot. Gl both, type !roll to roll.

I was wondering if colours work and i have a code which i need help wiht.

on *:TEXT:#: {
if ( $nick == Smokin_Dice ) msg $chan !roll BOT WORKS
}

WHAT DO I ADD NEXT TO TEXT, however one of the random names must be "IN_B_4" not the one in brackets. one of the two in " ", thanks mates.

carlitosbahia
12-04-2012, 09:40 AM
hi, not totally sure what you need there

can you type a example of how the chat would look like? what the first user says, then the bot and then the other 2 users
also, with random you mean random one selected from the userlist of the chat of someone choose and type the names?

IN B 4
12-04-2012, 10:39 AM
hi, not totally sure what you need there

can you type a example of how the chat would look like? what the first user says, then the bot and then the other 2 users
also, with random you mean random one selected from the userlist of the chat of someone choose and type the names?

ok.

so someone will use a command to the bot, with two usernames. lets say me and you in this format (!newdd User1 User2 ammount)
!newdd IN_B_4 carlitosbahia 50m

then the bot responds by saying <@Smokin_Dice> ["The person who uses command"] "IN_B_4" vs "carlitosbahia" "50m" pot. Gl both, type !roll to roll.

OR how can you make it a particular word to respond to and not a whole phrase. thanks

carlitosbahia
12-04-2012, 11:06 AM
i see now :)

on *:text:!newdd *:#: {
msg $chan $+([,$nick,]) $2 vs $3 $+($4,m) pot. Gl both, type !roll to roll.
}that shows :


carlitosbahia: !newdd albert robert 80
bot: [carlitosbahia] albert vs robert 80m pot. Gl both, type !roll to roll.

* tells the bot that what you are typing after the command (!newdd) is important too
$nick is the user typing the command
$+(a,b,c) shows abc , just the characters or variables you say there without spaces, or if you use [ $nick ] is going to show [ carlitosbahia ], what you like more
$2 is the first text you type after the command (albert) , $3 the 2nd (robert) and $4 the 3rd (80) ; $1 is the command itself

if you want the bot to respond just to a word and no a phrase just delete the * after the command

or
on *:text:*word*:#:{
whatever
}that way is going to look for "word" at any place in the message, no need to be the first word

IN B 4
12-04-2012, 11:17 AM
on *:TEXT:$+([,$nick,]) IN_B_4 vs $3 $+($4,m) pot. Gl both, type !roll to roll.
:#: {
if ( $nick == Smokin_Dice ) msg $chan !roll BOT WORKS
}


So right now i got that. that will respond to anyhting that has that outline with my name if smokin_dice says it? or not?


wiat, i got a better idea, how do i make my bot auto type !roll whenever a !newdd is made with my name in it?
so if someone types !newdd IN_B_4 vs *name* 40m, or !newdd *name* vs IN_B_4 40m, it will automatically tpye !roll.
I want it to respond saying !roll whenever someone types my name in a !newdd, how do i do that?
or whenever the bot Smokin_Dice says the name IN_B_4 I TYPE !roll

carlitosbahia
12-04-2012, 05:12 PM
on *:TEXT:$+([,$nick,]) IN_B_4 vs $3 $+($4,m) pot. Gl both, type !roll to roll.
:#: {
if ( $nick == Smokin_Dice ) msg $chan !roll BOT WORKS
} you can't just move the "$+([,$nick,]) $2 vs $3 $+($4,m) pot. Gl both, type !roll to roll." out of there, that is what the bot is going to do, you moved it after the TEXT: that place is for what the bot is "listening" for

read some the mirc help file, its good

on *:text:trigger:#: {
what the bot does
}

on *:text:!newdd *:#: {
if ( $2 = in_b_4 ) || ( $3 = in_b_4) { here do whatever the !roll does if one of the names is you }
elseif msg $chan $+([,$nick,]) $2 vs $3 $+($4,m) pot. Gl both, type !roll to roll.
} if ( $2 = in_b_4 ) || ( $3 = in_b_4) that is how you say if 1st name = in_b_$ OR 2nd name = in_b_4

if typing !roll calls other command, most of the time the same bot can't type it and run it (unless you use a alias, but that is other subject :) )

Rika-chama
04-06-2013, 03:06 PM
Okay, trying to trigger when somebody types a certain text. When a certain nick types ":3c" (w/o quotes), I want to say the following line after "describe"

on *:text:*$chr(58)3c:#channel: {
if ($nick == Person) {
describe $chan stabs Person in the back and twists the knife just to be sure...
}
}

It's not showing up when I test it. Howamidoingitrong?

carlitosbahia
04-07-2013, 09:58 AM
hi, not sure that you can use the : character there, i even tried with $+($chr(58),3c) to concatenate the two parts with no spaces between but still is a no go

i asked at http://www.hawkee.com/phpBB2/viewtopic.php?p=122613#122613 (there are people that knows much more there, they can tell us for sure if that can be done)

carlitosbahia
04-08-2013, 01:11 PM
if all you need is when they type just :3c then
on *:text:$($+($chr(58),3c)):#: {works

but i am ssuming the * at the start means that other words could be before in the message and the * is a wildcard and no the character, then that is not working yet, i am still asking and trying myself

Rika-chama
04-08-2013, 10:52 PM
if all you need is when they type just :3c then
on *:text:$($+($chr(58),3c)):#: {works

but i am ssuming the * at the start means that other words could be before in the message and the * is a wildcard and no the character, then that is not working yet, i am still asking and trying myself

Yes, that's correct. Also, from the other thread, yes, I'd rather not get into regex if I don't have to >_<. I'm not exactly /new/ but I'm not all that proficient, either.

Cheers, mate, and thanks for your time ^__^

carlitosbahia
04-09-2013, 07:39 AM
Yes, that's correct. Also, from the other thread, yes, I'd rather not get into regex if I don't have to >_<. I'm not exactly /new/ but I'm not all that proficient, either.

Cheers, mate, and thanks for your time ^__^

I hate and never tried to learn regex ;)

carlitosbahia
04-10-2013, 11:49 PM
on *:text:$($+(*,$chr(58),3c)):#: {
if ($nick == person ) {
describe $chan stabs Person in the back and twists the knife just to be sure...
}
}

Rika-chama
04-11-2013, 09:26 PM
on *:text:$($+(*,$chr(58),3c)):#: {
if ($nick == person ) {
describe $chan stabs Person in the back and twists the knife just to be sure...
}
}

Awesome! Cheers, mate!