mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: * $input: cannot use in an event [Re: westor] #230273 03/03/11 02:32 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
What isn't working with it? Does it pop up the $input?

As for your update script, you should do this instead...

Code:
on *:sockclose:mysock: {
  .timer 1 1 CheckUpdate
}
alias CheckUpdate {
  if ($input(Do you want to update?,y)) {
    ; whatever commands to do the update
  }
  else {
    ; whatever commands if you don't want the update
  }
}


* You can, of course, rename the alias and adjust the input text.

Last edited by Riamus2; 03/03/11 03:34 PM.

Invision Support
#Invision on irc.irchighway.net
Re: * $input: cannot use in an event [Re: Riamus2] #230276 03/03/11 02:42 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
I tryied but return the same error * $input cannot use in an event

Re: * $input: cannot use in an event [Re: westor] #230277 03/03/11 02:44 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Yeah using an alias would be much better.

I personally have a dialog for my updates. I have a list with checkboxes for each file. When the update is finished it removes the updated files from the list so you can check more updates or close the dialog.

Re: * $input: cannot use in an event [Re: westor] #230278 03/03/11 02:44 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
See the edit. I missed a character. That should work now. I can't test right now.


Invision Support
#Invision on irc.irchighway.net
Re: * $input: cannot use in an event [Re: DJ_Sol] #230279 03/03/11 02:47 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Yeah, a real dialog is a very good option. $input is useful for really minor things, but using a real dialog gives you far greater control and customization. And dialogs can be used anywhere. $input halts everything that follows it, which is why it cannot be used in an event. Dialogs don't halt anything, so they can be used in events without a problem.


Invision Support
#Invision on irc.irchighway.net
Re: * $input: cannot use in an event [Re: Riamus2] #230282 03/03/11 02:54 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Any way i will change it with a dialog option, the code still not working! the input does not opening to select yes or no!

Re: * $input: cannot use in an event [Re: Riamus2] #230286 03/03/11 03:16 PM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
Sat wrote an article that highlights the difference between these types of events:

http://www.xise.nl/mirc/wiki/doku.php?id=critical_events

there are cases where it is much more convenient to circumvent mIRC's detection of $input in a 'critical' event (and it is actually possible to do so in mIRC script) but this isn't one of those cases :P using a split second timer to call an alias containing the appropriate segment of code is easy here.


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Re: * $input: cannot use in an event [Re: westor] #230288 03/03/11 03:20 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
If you really want to use $input just use a timer for the alias.

on *:sockclose:mysock: {
timer -m 1 500 CheckUpdate
}

Re: * $input: cannot use in an event [Re: DJ_Sol] #230293 03/03/11 03:34 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Yeah, I forgot the timer. Oops. wink


Invision Support
#Invision on irc.irchighway.net
Re: * $input: cannot use in an event [Re: Riamus2] #230295 03/03/11 04:26 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Any way i have change my code removing the update confirmation whistle

Re: * $input: cannot use in an event [Re: westor] #230296 03/03/11 04:27 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Thanks all for the help!

Page 2 of 2 1 2