mIRC Homepage

$input in remote events

Posted By: Soul_Eater

$input in remote events - 06/03/04 12:25 AM

Make $input work in remote events for the love of God
Posted By: Raccoon

Re: $input in remote events - 06/03/04 12:49 AM

On *:TEXT:*:*: msg $nick $input(Say something back,e)

Now consider what would happen if such a script were possible. mIRC would have to completely halt all operations until you Say Something Back. What happens if an $input appears when you're away from the keyboard? mIRC would have to stop dead in its tracks and wait for your return.

- Raccoon
Posted By: Soul_Eater

Re: $input in remote events - 06/03/04 01:03 AM

so make it so $input windows can appear without halting all operations....
Posted By: Raccoon

Re: $input in remote events - 06/03/04 01:22 AM

That's rather impossible wouldn't you say?

On ^*:TEXT:*:*: {
  echo $chan $input(Something something,e)
  HALTDEF
}

Now, what do you suppose should be displayed in every channel and query window while that input dialog is waiting for your attention? Suppose you're afk for 7 days... should 7 days of text stack up in a queue of some sort?

There is simply no way for $input to be used inside of an event. Not without every event executing in its own thread space... but it is unlikely mIRC will ever use that type of multi-threading.

- Raccoon
Posted By: qwerty

Re: $input in remote events - 06/03/04 01:29 AM

Code:
.timer 1 0 echo -a $!input(blah)
The workaround is too easy to justify the amount of effort needed to implement what you want.
Posted By: Soul_Eater

Re: $input in remote events - 06/03/04 03:34 AM

yeah but i dont liker timers and creating excess aliases like
alias stupidinput { var %x $input(blah) }
then

on *:sockread:{
sockread %sockread
.timera -m 1 1 stupidinput
}

way too much hassle.

on *:sockread;{
sockread %sockread
var %x $input(blah)
}

better.
Posted By: starbucks_mafia

Re: $input in remote events - 06/03/04 04:03 AM

As qwerty just showed, there's no need for any aliases, The $input can be put directly in the timer provided you prevent evaluation using ! or $eval(, 0). And there's also no need for a millisecond or high-res timer, simply use 0 for the delay and the timer will trigger immediately after the event. No effort at all really.
Posted By: Raccoon

Re: $input in remote events - 06/03/04 04:08 AM

It should also be noted that all timers cease to work until $input is responsed.
Posted By: Soul_Eater

Re: $input in remote events - 06/03/04 06:06 AM

if I want what $input returns, an alias is necessary.
Posted By: DaveC

Re: $input in remote events - 06/03/04 08:42 AM

Quote:
if I want what $input returns, an alias is necessary.


Why is it necessary?
You can store the input in the timer command.
Posted By: Soul_Eater

Re: $input in remote events - 08/03/04 02:14 AM

oh really?

How would I be able to do
if ($input(1)) { }

with a timer alias:

alias inpt { var %x $input(1) }
.timer -m 1 0 inpt

???
Posted By: DaveC

Re: $input in remote events - 08/03/04 04:05 AM

.timer -m 1 0 if ($input(1)) $({,0) $(},0)
Posted By: Soul_Eater

Re: $input in remote events - 08/03/04 09:09 PM

nope. that gives you "* $input: cannot use in an event (line 50, muc.txt)"

It has to be an alias
Posted By: Raccoon

Re: $input in remote events - 08/03/04 10:53 PM

I think he meant

.timer 1 0 if $!input(1) { code }

The -m and $({,0)'s are unnecessary.
Posted By: Soul_Eater

Re: $input in remote events - 09/03/04 01:52 AM

i know, I did exactly what youre talking about Rac
Posted By: DaveC

Re: $input in remote events - 09/03/04 06:40 AM

Quote:

nope. that gives you "* $input: cannot use in an event (line 50, muc.txt)"

It has to be an alias


Well you did something wrong or changed something, i note you didnt show me your code line that errored.

Quote:

I think he meant

.timer 1 0 if $!input(1) { code }

The -m and $({,0)'s are unnecessary.


I duplicated the ($input(1)) as per the original, as the indentifier is enclosed in brackets with no spaces the timer event does not evaluate it at the timer creation so i didnt need a !, if i had spaced it out to " ( $input(1) ) " or removed the encompassing brackets i would have needed !
The -m was also in the original example so i duplicated it into mine, its not needed but doesnt hurt either.
Lastly the $({,0} was deliberate so more than one command can be entered into the conditional if


Quote:

i know, I did exactly what youre talking about Rac


Pffffffft so you did alter the code.


Here is my code to show it in an event...

on *:text:!triggertext*:#channelname:{
.timer -m 1 0 if ($input(1)) $({,0) set %ok $true $(|,0) echo -a OK NOW TRUE $(},0)
set %ok $false
}

I suggest this also to monitor it,
/timer 0 1 echo -a $time --- %ok ---
© 2020 mIRC Discussion Forums