mIRC Home    About    Download    Register    News    Help

Print Thread
Can You Make A Command Like This? #258316 24/06/16 08:03 PM
Joined: Jun 2016
Posts: 9
T
Tuna Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2016
Posts: 9
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?

Last edited by Tuna; 24/06/16 08:04 PM.
Re: Can You Make A Command Like This? [Re: Tuna] #258318 24/06/16 10:29 PM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
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.

Re: Can You Make A Command Like This? [Re: Fonic_Artes] #258320 24/06/16 10:44 PM
Joined: Jun 2016
Posts: 9
T
Tuna Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2016
Posts: 9
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?

Re: Can You Make A Command Like This? [Re: Tuna] #258321 24/06/16 10:53 PM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
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.

Re: Can You Make A Command Like This? [Re: Fonic_Artes] #258322 24/06/16 10:59 PM
Joined: Jun 2016
Posts: 9
T
Tuna Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2016
Posts: 9
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.

Re: Can You Make A Command Like This? [Re: Tuna] #258327 25/06/16 07:20 AM
Joined: Sep 2013
Posts: 28
EggFriedCheese Offline
Ameglian cow
Offline
Ameglian cow
Joined: Sep 2013
Posts: 28
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.

Last edited by EggFriedCheese; 25/06/16 07:20 AM.

Twitch Live-Streamer - Current Games:
FF7
D&D (DM)
www.twitch.tv/eggfriedcheese
Re: Can You Make A Command Like This? [Re: EggFriedCheese] #258337 25/06/16 08:33 PM
Joined: Jun 2016
Posts: 9
T
Tuna Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Jun 2016
Posts: 9
The 2nd script worked! Thank you so much!