mIRC Home    About    Download    Register    News    Help

Print Thread
K
Kirie
Kirie
K
Well, I'm very new to the mIRC scripting world, but I thought I'd start with a fairly simple script. Turns out I don't know how to continue. =P

Code:
on 1:ACTION:*huggles Kirie*:*:{
       if ($nick == Miyu) {
               if ($chan == ?) { msg $nick /describe punches Miyu in the stomach and turns her back against her!
    }
             elseif { msg #nyanko /describe punches Miyu in the stomach and turns her back against her! 
    }
  }

Basically, I want to send an action back to the channel/PM where the action is done. And only if it's done by that certain nick. I'm aware that the elseif statement doesn't work in it's current state. If anyone would be so kind to fix it up and tell me what it means, it'll be greatly appreciated ^^;

Last edited by Kirie; 04/07/06 11:31 PM.
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Code:
 on *:action:*huggles Kirie*:*:{
if ($nick == Miyu) {
.describe $target punches Miyu in the stomach and turns her back against her!
}
}
 

By using $target, it will automatically adjust to the channel or pm that the action was used in, which also allows you to reduce the amount of code, since the reaction was the same whether the action was done in pm or channel.

K
Kirie
Kirie
K
Aha, I see. *notes it* Well, that makes sense. Thanks for your help =)

Edit: Hm. When using it in a channel message, it does nothing. And when used in a PM, it messages myself =/

Last edited by Kirie; 04/07/06 11:49 PM.
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Sorry..it seemed so simple I didn't test my response.
This has been tested
Code:
 on *:action:*huggles Kirie*:*:{
  if ($nick == Miyu) {
    .describe $iif($target == $chan,$v2,$nick) punches Miyu in the stomach and turns her back against her!
  }
}
 

K
Kirie
Kirie
K
Hm, it does seem to work. But only the other person sees my reply? Can't it be shown in public? =/

Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
Simply remove the . from before the describe command. When you prefix a command with a . it makes the command silent to you.

-genius_at_work


Link Copied to Clipboard