mIRC Home    About    Download    Register    News    Help

Print Thread
#186980 29/09/07 06:18 PM
Joined: Aug 2007
Posts: 48
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Aug 2007
Posts: 48
on *:text:*:#:{
if ($2) {
if ($nick isin $chan } {
if ($1 == !smack) me smacks $2 across the head

Last edited by EnglishExpress; 29/09/07 06:26 PM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
A number of things:
  • You're missing all your closing braces (although hopefully that's just a copying issue).
  • You're using isin where you should be using ison. isin is for checking the presence of text within a larger peice of text, ison checks that a nickname is on a channel.
  • You're using a closing brace in the second if condition instead of a closing parenthesis.

Code:
on *:text:*:#:{
  if ($2) {
    if ($nick ison $chan) {
      if ($1 == !smack) me smacks $2 across the head
    }
  }
}


And although this isn't technically a bug in the code, you're checking that the person who said the text is on the channel. Although that's valid (in case the channel has mode -n), I suspect you want to check that the person being 'smacked' is on the channel, in which case you should replace $nick with $2.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
In addition to what starbucks said, you can't use /me in a script like that. Replace "me smacks $2 across the head" with "describe $chan smacks $2 across the head"

Last edited by deegee; 29/09/07 11:47 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Make that "describe" smile


Invision Support
#Invision on irc.irchighway.net
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Good catch smile

Joined: Aug 2007
Posts: 48
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Aug 2007
Posts: 48
Lol yeah, I already replaced it, once I got my answer, I remembered the only thing I left out in my original code was "$chan" after describe, d'uh me lol

Joined: Aug 2007
Posts: 48
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Aug 2007
Posts: 48
Hey, thanks for fixing the code for me, was just wondering, what do I have to do for the code to work for me and others? like if I type the command.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Two options
1) Put the code on another client that's connected (aka a bot)
2) Add an ON INPUT event


Link Copied to Clipboard