mIRC Homepage
Posted By: Tuna Can You Make A Command Like This? - 24/06/16 08:03 PM
My goal is to make a command where the input would be:
!cake NICKNAME
and the outcome would be:
"/me pegs NICKNAME in the face with a chocolate cake"

Is there a way I could set it to work with any of the nicknames in the room, instead of pre-setting the command with a nickname?
Posted By: Fonic_Artes Re: Can You Make A Command Like This? - 24/06/16 10:29 PM
Yeah, it's pretty easy.
/help $1 should be the right thing.

As for the code, if you're not going for display names, primarily with Twitch.

Code:
on *:TEXT:!cake*:#: {
if (%flood.cake) { halt }
set -u5 %flood.cake On
msg # /me - $nick pegs $2 in the face with a chocolate cake.
}


I added a 5 second global flood protection to be safe as well.
Posted By: Tuna Re: Can You Make A Command Like This? - 24/06/16 10:44 PM
Originally Posted By: Fonic_Artes
Yeah, it's pretty easy.
/help $1 should be the right thing.

As for the code, if you're not going for display names, primarily with Twitch.

Code:
on *:TEXT:!cake*:#: {
if (%flood.cake) { halt }
set -u5 %flood.cake On
msg # /me - $nick pegs $2 in the face with a chocolate cake.
}


I added a 5 second global flood protection to be safe as well.


I put in the command and it worked, but not how I was expecting. I'm using mIRC as a bot on another chat room, so the output of the command ended up as:
Astral: /me - Tuna pegs NAME in the face with a chocolate cake
I edited the script so it ended up without the "/me -" in the message itself, but it still isn't quite what I'm looking for. I'm trying to get the command to be:
"Astral pegs NAME [blah blah blah]" just in the /me format

Any tips on how to fix this?
Posted By: Fonic_Artes Re: Can You Make A Command Like This? - 24/06/16 10:53 PM
Ah, so that's my fault then.

Code:
on *:TEXT:!cake*:#fonic_artes: {
if (%flood.cake) { halt }
set -u5 %flood.cake On
describe # pegs $2 in the face with a chocolate cake.
} 


This should work, though I'm only able to test it with Twitch since that's all I really use mIRC for myself.
Posted By: Tuna Re: Can You Make A Command Like This? - 24/06/16 10:59 PM
Originally Posted By: Fonic_Artes
Ah, so that's my fault then.

Code:
on *:TEXT:!cake*:#fonic_artes: {
if (%flood.cake) { halt }
set -u5 %flood.cake On
describe # pegs $2 in the face with a chocolate cake.
} 


This should work, though I'm only able to test it with Twitch since that's all I really use mIRC for myself.


I tried it, and the command won't work at all now. There's no response from the bot.
Posted By: EggFriedCheese Re: Can You Make A Command Like This? - 25/06/16 07:20 AM
The command that you have is now right. If you want to do it on just names, you could change it slightly to:

Quote:
on *:TEXT:!cake *:#fonic_artes: {
if (%flood.cake) { halt }
set -u5 %flood.cake On
describe # pegs $$2 in the face with a chocolate cake.
}


Or you could try this code as well, which is what I have coded into my bot:

Quote:
on *:TEXT:!cake *:#: {
if (!$var($+(%,delay.cake.,$network,.,#)).value) { | describe # pegs $$2 in the face with a chocolate cake. | set -u5 $+(%,delay.cake.,$network,.,#) 1 } }


The bottom one also has the 5s flood protection.
Posted By: Tuna Re: Can You Make A Command Like This? - 25/06/16 08:33 PM
The 2nd script worked! Thank you so much!
© mIRC Discussion Forums