mIRC Homepage
Posted By: Kirie Rookie needs help with easy script >>; - 04/07/06 11:27 PM
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 ^^;
Posted By: RusselB Re: Rookie needs help with easy script >>; - 04/07/06 11:37 PM
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.
Posted By: Kirie Re: Rookie needs help with easy script >>; - 04/07/06 11:42 PM
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 =/
Posted By: RusselB Re: Rookie needs help with easy script >>; - 05/07/06 12:02 AM
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!
  }
}
 
Posted By: Kirie Re: Rookie needs help with easy script >>; - 05/07/06 12:18 AM
Hm, it does seem to work. But only the other person sees my reply? Can't it be shown in public? =/
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
© mIRC Discussion Forums