mIRC Home    About    Download    Register    News    Help

Print Thread
#231359 14/04/11 07:40 PM
Joined: Dec 2010
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2010
Posts: 13
Can anyone make me a script for, but i dont want it to be just these examples, i want to be able to add different actions like!

<Jiggler> !taco roman
* @Bot launches a delicious taco toward roman.
<Jiggler> !taco roman
* @Bot Gives roman a delicious taco.

and for when the !taco me:
<Jiggler> !taco Bot
* @Bot launches a taco straight up then jumps after it and catches it.
<Jiggler> !taco Bot
* @Bot Eats some tacos

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I made a very detailed script that allows for some really interesting control of that kind of thing and allows for easily adding a wide variety of types of commands and responses. However, it's not entirely ready for public use so I can't give it out at this time.

However, for a very basic setup, that is easy to edit, just do this:

Code:
on *:text:!*:#yourchannel: {
  if ($readini(mycommands.ini,$1)) {
    describe $chan $replace($readini(mycommands.ini,n,$1,$rand(1,$ini(mycommands.ini,$1,0))),#2#,$2)
  }
}


Then, create a file called mycommands.ini and format it like this:

Quote:

[!taco]
1=launches a delicious taco toward #2#
2=gives #2# a delicious taco
[!othercommand]
1=something
2=something else


#2# in the ini refers to word #2. In your example, that is the person's nick. If you need additional words, the $replace() can be updated to change #3# to $3, etc.

This isn't as configurable as is possible, but it's quickly set up and easy to change.

Replace #yourchannel with your channel name. And if you need commands that don't start with !, then remove that from the on text event and just use * instead of !*.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2010
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2010
Posts: 13
Originally Posted By: Riamus2
I made a very detailed script that allows for some really interesting control of that kind of thing and allows for easily adding a wide variety of types of commands and responses. However, it's not entirely ready for public use so I can't give it out at this time.

However, for a very basic setup, that is easy to edit, just do this:

Code:
on *:text:!*:#yourchannel: {
  if ($readini(mycommands.ini,$1)) {
    describe $chan $replace($readini(mycommands.ini,n,$1,$rand(1,$ini(mycommands.ini,$1,0))),#2#,$2)
  }
}


Then, create a file called mycommands.ini and format it like this:

Quote:

[!taco]
1=launches a delicious taco toward #2#
2=gives #2# a delicious taco
[!othercommand]
1=something
2=something else


#2# in the ini refers to word #2. In your example, that is the person's nick. If you need additional words, the $replace() can be updated to change #3# to $3, etc.

This isn't as configurable as is possible, but it's quickly set up and easy to change.

Replace #yourchannel with your channel name. And if you need commands that don't start with !, then remove that from the on text event and just use * instead of !*.



I could not get that to work, i must of been setting it up wrong frown


Got this error

* Invalid parameters: $readini (line 2, Taco.ini)

I put: on *:text:!*:#yourchannel: { part into taco.ini

then i did the other part in mycommands

I did change #yourchannel to the channel btw

Last edited by DJJIGGLER; 14/04/11 08:52 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You put the wrong information into the INI file.
Take a better look at the quote, not the code, used for examples as to how the INI file should be setup.
Simply, it appears that you tried to put the script into the INI file, rather than the responses.


Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
My fault...

Code:
on *:text:!*:#yourchannel: {
  if ($ini(mycommands.ini,$1)) {
    describe $chan $replace($readini(mycommands.ini,n,$1,$rand(1,$ini(mycommands.ini,$1,0))),#2#,$2)
  }
}


And you can rename mycommands.ini to something more appropriate if you like. Just make sure to replace the filename in all locations of the script.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: Riamus2
you can rename mycommands.ini to something more appropriate if you like. Just make sure to replace the filename in all locations of the script.
Why not make a local var for the file name so you only need to change it in one place?
Code:
on *:text:!*:#yourchannel: {
  var %file = mycommands.ini
  if ($ini(%file,$1)) {
    describe $chan $replace($readini(%file,n,$1,$rand(1,$ini(%file,$1,0))),#2#,$2)
  }
}

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Because I didn't bother and it isn't like you're changing it after the first time you type it.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2010
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2010
Posts: 13
I got it working,

but how do i make when they !taco me

it does not say something like /me gives me a taco

when they do !taco me it says /me eats some tacos

get what im saying?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
on *:text:!*:#yourchannel: {
  if ($2 == $me && $ini(mycommands.ini,me,$1)) {
    describe $chan $replace($readini(mycommands.ini,n,me,$1),#2#,$2)
  }
  elseif ($ini(mycommands.ini,$1)) {
    describe $chan $replace($readini(mycommands.ini,n,$1,$rand(1,$ini(mycommands.ini,$1,0))),#2#,$2)
  }
}


Then, include a new section in your mycommands.ini file:

Quote:

[me]
!taco=eats some tacos
!something=does something else
!anothercommand=does another command


This does split the ini file up some, but it's a quick and easy thing to change. Note that it's not set up to do more than one $me response per command, unlike the random responses for the command when the nick isn't yours.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
So this will work with numbers as a cmd then? Remember we have had a scenario where numbers are confusing to $ini()...:P

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The numbers are confusing to $ini when they are used in reference to section and/or items.

As long as the command isn't just a number, they should work fine.

Eg: !1 will work
1 (probably) won't.

Last edited by RusselB; 15/04/11 10:50 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
If left unchanged, numbers won't even trigger the script because "commands" start with an exclamation point. If someone wants to change the script to do other things, then there may be certain changes that will need to be made. But as it is currently written, numbers are not an issue.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Oh ok, just what I've thought. Thanks fellas for reaffirming the answer to my question.


Link Copied to Clipboard