mIRC Home    About    Download    Register    News    Help

Print Thread
#220280 09/04/10 10:51 PM
Joined: Apr 2010
Posts: 24
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Apr 2010
Posts: 24
hello
i'm new on these forums ...:)
I have written a certain scripts..they all work fine .
Just one problem. they don't work when i type it.When others type , it works perfectly well.

eg:
on *:text:!bash*:#:{
msg $chan $nick bashes $2 with a 4Sledge hammer.
}

the above works well for all others who use it except me frown

please help

P.s-A step by step approach would be appreciated as i have just started learning to code scripts.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can't trigger your own event with on TEXT. You need to use on INPUT. If you want it to work for both you and others, you have to use both.
Code:
on *:input:#: {
  if ($1 == !bash) {
    msg $chan $nick bashes $2 with a 4Sledge hammer.
  }
}


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2010
Posts: 24
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Apr 2010
Posts: 24
is it possible that i use the same script
and change text to input?

like this

on *:input:!bash*:#:{
msg $chan $nick bashes $2 with a 4Sledge hammer.
}


Also when i put ur script in the remote tab somthing funny happened
when i pressed enter

Watch:
[04:37] <Bat|afk> Bat|afk bashes Bat|afk with a 4Sledge hammer.
[04:37] <Bat|afk> !bash Bat|afk

the "Bat|afk bashes Bat|afk with a 4Sledge hammer." should come after i type in !bash Bat|afk

Last edited by lassyakjedi; 09/04/10 11:12 PM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You cannot put the command in the match section of an input event. You must use the
Quote:
on *:input:#: {
if ($1 == !bash) {
msg $chan $nick bashes $$2 with a 4Sledge hammer.
}
}

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes, input event messages usually appear before your actual input, but only on your end. They should appear normally for others. You can get around that by using a timer. Normally a timer with 0 seconds is enough, but if not, you can set it to 1 second.

Code:
on *:input:#: {
  if ($1 == !bash && $2) {
    .timer 1 0 msg $chan $nick bashes $2 with a 4Sledge hammer.
  }
}


Just replace the 0 with a 1 if 0 doesn't work for you. And, no, you cannot use the same format for on input. See /help on input . If you could, I'd have done it that way in the first place.


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2010
Posts: 24
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Apr 2010
Posts: 24
That worked:)
Thanks a lot Riamus2. i dint think of a timer


Link Copied to Clipboard