mIRC Home    About    Download    Register    News    Help

Print Thread
Rookie needs help with easy script >>; #152714 04/07/06 11:27 PM
Joined: Jul 2006
Posts: 4
K
Kirie Offline OP
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Jul 2006
Posts: 4
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.
Re: Rookie needs help with easy script >>; #152715 04/07/06 11:37 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: Rookie needs help with easy script >>; #152716 04/07/06 11:42 PM
Joined: Jul 2006
Posts: 4
K
Kirie Offline OP
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Jul 2006
Posts: 4
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.
Re: Rookie needs help with easy script >>; #152717 05/07/06 12:02 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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!
  }
}
 

Re: Rookie needs help with easy script >>; #152718 05/07/06 12:18 AM
Joined: Jul 2006
Posts: 4
K
Kirie Offline OP
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Jul 2006
Posts: 4
Hm, it does seem to work. But only the other person sees my reply? Can't it be shown in public? =/

Re: Rookie needs help with easy script >>; #152719 05/07/06 01:10 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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