mIRC Home    About    Download    Register    News    Help

Print Thread
$input in remote events #73944 06/03/04 12:25 AM
Joined: Mar 2003
Posts: 187
S
Soul_Eater Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
Make $input work in remote events for the love of God

Re: $input in remote events #73945 06/03/04 12:49 AM
Joined: Feb 2003
Posts: 2,702
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,702
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: $input in remote events #73946 06/03/04 01:03 AM
Joined: Mar 2003
Posts: 187
S
Soul_Eater Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
so make it so $input windows can appear without halting all operations....

Re: $input in remote events #73947 06/03/04 01:22 AM
Joined: Feb 2003
Posts: 2,702
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,702
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: $input in remote events #73948 06/03/04 01:29 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: $input in remote events #73949 06/03/04 03:34 AM
Joined: Mar 2003
Posts: 187
S
Soul_Eater Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
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.

Re: $input in remote events #73950 06/03/04 04:03 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: $input in remote events #73951 06/03/04 04:08 AM
Joined: Feb 2003
Posts: 2,702
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,702
It should also be noted that all timers cease to work until $input is responsed.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: $input in remote events #73952 06/03/04 06:06 AM
Joined: Mar 2003
Posts: 187
S
Soul_Eater Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
if I want what $input returns, an alias is necessary.

Re: $input in remote events #73953 06/03/04 08:42 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
if I want what $input returns, an alias is necessary.


Why is it necessary?
You can store the input in the timer command.

Re: $input in remote events #73954 08/03/04 02:14 AM
Joined: Mar 2003
Posts: 187
S
Soul_Eater Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
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

???

Re: $input in remote events #73955 08/03/04 04:05 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
.timer -m 1 0 if ($input(1)) $({,0) $(},0)

Re: $input in remote events #73956 08/03/04 09:09 PM
Joined: Mar 2003
Posts: 187
S
Soul_Eater Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
nope. that gives you "* $input: cannot use in an event (line 50, muc.txt)"

It has to be an alias

Re: $input in remote events #73957 08/03/04 10:53 PM
Joined: Feb 2003
Posts: 2,702
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,702
I think he meant

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

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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: $input in remote events #73958 09/03/04 01:52 AM
Joined: Mar 2003
Posts: 187
S
Soul_Eater Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Mar 2003
Posts: 187
i know, I did exactly what youre talking about Rac

Re: $input in remote events #73959 09/03/04 06:40 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 ---