mIRC Home    About    Download    Register    News    Help

Topic Options
#220280 - 09/04/10 11:51 PM I cant type my own sctipts
lassyakjedi Offline
Ameglian cow

Registered: 09/04/10
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.

Top
#220282 - 09/04/10 11:55 PM Re: I cant type my own sctipts [Re: lassyakjedi]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#220284 - 10/04/10 12:00 AM Re: I cant type my own sctipts [Re: Riamus2]
lassyakjedi Offline
Ameglian cow

Registered: 09/04/10
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


Edited by lassyakjedi (10/04/10 12:12 AM)

Top
#220286 - 10/04/10 02:26 AM Re: I cant type my own sctipts [Re: lassyakjedi]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.
}
}

Top
#220300 - 10/04/10 02:50 PM Re: I cant type my own sctipts [Re: lassyakjedi]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#220305 - 10/04/10 04:54 PM Re: I cant type my own sctipts [Re: Riamus2]
lassyakjedi Offline
Ameglian cow

Registered: 09/04/10
Posts: 24
That worked:)
Thanks a lot Riamus2. i dint think of a timer

Top