mIRC Homepage
Posted By: lassyakjedi I cant type my own sctipts - 09/04/10 10:51 PM
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.
Posted By: Riamus2 Re: I cant type my own sctipts - 09/04/10 10:55 PM
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.
  }
}
Posted By: lassyakjedi Re: I cant type my own sctipts - 09/04/10 11:00 PM
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
Posted By: Tomao Re: I cant type my own sctipts - 10/04/10 01:26 AM
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.
}
}
Posted By: Riamus2 Re: I cant type my own sctipts - 10/04/10 01:50 PM
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.
Posted By: lassyakjedi Re: I cant type my own sctipts - 10/04/10 03:54 PM
That worked:)
Thanks a lot Riamus2. i dint think of a timer
© mIRC Discussion Forums