mIRC Home    About    Download    Register    News    Help

Print Thread
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.
Joined: Jun 2015
Posts: 84
F
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.

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?

Joined: Jun 2015
Posts: 84
F
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.

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.

Joined: Sep 2013
Posts: 61
E
Babel fish
Offline
Babel fish
E
Joined: Sep 2013
Posts: 61
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:
Synth Riders
Beat Saber
www.twitch.tv/eggfriedcheese
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!


Link Copied to Clipboard