mIRC Home    About    Download    Register    News    Help

Print Thread
on input: send a command #4263 31/12/02 06:41 PM
Joined: Dec 2002
Posts: 26
F
FireBrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
I wish a typed string to then call an existing remote.

sort of
on 1:INPUT:#:<word1>: /set <%word2 1>

so if I type 'word1' the remote will then perform the task which 'word2' requests.

The /set %word2 1 remote works correctly.

I'm missing something obvious here frown


Re: on input: send a command #4264 31/12/02 06:57 PM
Joined: Dec 2002
Posts: 144
D
Dana Offline
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
I don't really understand your question.

Is the variable %word2 composed of a command? And you want the script to execute the command whenever you type in "word1"?

If so, try:

On *:INPUT:#: if (word1 == $1-) { %word2 }

I suspect that's not necessarily what you want though .. so please clarify. smile


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
Re: on input: send a command #4265 31/12/02 08:39 PM
Joined: Dec 2002
Posts: 26
F
FireBrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
The word1 is a constant.
Always the same word.

If i type that word into the message line, I want that word to be the cause for sent the command /set %word2 1

I don't want word1 to be sent to the channel.
it's like it's a password that when it's types causes an event to be performed automatically.

Re: on input: send a command #4266 31/12/02 10:01 PM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Not sure I understand what you want, either .. but here's my guess:
Code:

on *:INPUT:#:pass:{
  set $+(%,$2) $3-
  halt
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: on input: send a command #4267 31/12/02 10:32 PM
Joined: Dec 2002
Posts: 26
F
FireBrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Dec 2002
Posts: 26
I'm making this too hard on you guys.
Let me try to exlain it this way.

I already have a working script that is called alpha.
When I type /set %alpha 1
The script performs it's job.

I want to make it easier/quicker for me to type
So ...
I need the codet that interprets 'alpha' as being the same as if I had typed /set %alpha 1

basically I want the single word 'alpha' to be shorthand for /set %alqha 1
and of course it as to run.

I'm really sorry to take up your time I'm just starting to learn the scripting lanquage.

Re: on input: send a command #4268 31/12/02 11:31 PM
Joined: Dec 2002
Posts: 144
D
Dana Offline
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
Sounds to me like you want an alias.
Code:
alias alpha { set %alpha 1 }

Or if you just want to enter the command anywhere and not have it display..
Code:
On *:INPUT:#: if ($1- == alpha) { set %alpha 1 | halt }


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke