mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Script Question #166933 17/12/06 02:18 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
I'm thinking that there's a remote event that I can't find, or anything else, that triggers when you hit any key, this is kind of hard to explain...so, i'll try my best:
I'm have the editbox of a channel active and I hit the letter 'e' on the keyboard, and, it goes into the editbox, it would echo 'whatever'.
hope anyone who reads this understands, please let me know if you don't understand, i'll be glad to try and be more specific and even have to get screenshots if I have to.
Thanks!

Last edited by Kurdish_Assass1n; 17/12/06 02:18 AM.

-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #166935 17/12/06 02:53 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
only thing that occurs to me, is the ON INPUT event. If this isn't what you're thinking of, please clarify, and (if possible) get screenshots of what you're trying to do.

Re: Script Question [Re: RusselB] #166936 17/12/06 03:05 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok, lets say I just typed the letter 'H' and the number '1' came up. The 1 and the H are just examples i'm using, so, like..the first letter i hit, it will perform a command, like echo.
Example:

Last edited by Kurdish_Assass1n; 17/12/06 04:18 AM.

-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #166938 17/12/06 04:40 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Here is an examle for you.

Code:
on *:input:*: {
  if ($1 == e) {
    echo -a $2-
    halt
  }
}


If you type: e $calc(5+5)
It will echo in your active window: 10

In other words, it saves you from typing //echo -a

Of course, you could just make an /e alias, but that does mean you have to type / as well.

Anyhow, I think you had more in mind than just saving some typing, so just use this example to get you where you want.


Invision Support
#Invision on irc.irchighway.net
Re: Script Question [Re: Riamus2] #166939 17/12/06 04:46 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok, basically, this is what i'm trying to do, this is why i'm wanting to know if this is possible..If anyone here has been on MSN , AOL, or Yahoo Messenger, you'll know what i'm talking about. I have this client that this Program uses, called XBConnect, and, what i'm trying to do like, when I hit any letter, it will say 'Nick is typing a message'. so, I'm not looking for something that count's my letters or anything, i'm just wanting to know if someone is typing something.
Basically, i'm trying to make the '......is typing a message' thing that MSN has.


-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #166940 17/12/06 05:10 AM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
You'd have to script (or otherwise implement) some kind of behind-the-scenes communication between the clients so that whenever you were typing, your script would send a message to the other person, in a format that both parties would use so that the other script knew someone was typing. I'm not sure the best way to go about that. You could use a special CTCP action when you're typing, but that would most likely flood.

Re: Script Question [Re: bwr30060] #166942 17/12/06 06:08 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
I know how I would do this, i already have it all planned, except for the first part, i don't know any part of scripting that does what i'm wanting it to do. where it performs a command the first time you hit a key. sort of like KEYDOWN


-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #166957 17/12/06 04:22 PM
Joined: Sep 2003
Posts: 156
B
bleach Offline
Vogon poet
Offline
Vogon poet
B
Joined: Sep 2003
Posts: 156
/help on keydown

türkçe biliyormusun

Re: Script Question [Re: bleach] #166958 17/12/06 04:25 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
I need this to work for a PM (Private Message) and not a custom window. Please help if you can. Thanks again.


-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #166959 17/12/06 04:27 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Well, like you know, KEYDOWN is for custom windows. If you want it from the editbox, I'd probably suggest a timer that checks $editbox($active) every second for text.


Invision Support
#Invision on irc.irchighway.net
Re: Script Question [Re: Riamus2] #166966 17/12/06 05:28 PM
Joined: Sep 2003
Posts: 156
B
bleach Offline
Vogon poet
Offline
Vogon poet
B
Joined: Sep 2003
Posts: 156
yea your right. good idea.. he have to check editboxes every milisecs.

Re: Script Question [Re: bleach] #167038 18/12/06 11:35 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
thanks Riamus2, I'll try that. smile


-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #167151 20/12/06 05:12 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok, this is what I have come up with, I have used echo for right now so I could test it, what's happening is I don't want to keep on sending messages to the other person saying 'Typing-Message: $true/$false' because I might get killed for flooding. so, is there a way to make this happen only once

Code:
on *:ACTIVE:?: {
  if (*!*@XBConnect.com* iswm $address($active,2)) {
    ;Since it's going to be for Team-XBC ^^
    timercheck -m $+(100,$str(00,6)) 430 check
  }
}
on *:ACTIVE:#: {
  if ($timer(check)) { timercheck off }
  if ($timer(msg)) { timermsg off }
}
alias check {
  if ($len($editbox($active)) == 1) { echo -ag Typing-Message $true }
  ; This stops on two, which is good. ^^
  if ($len($editbox($active)) < 1) { echo -ag Typing-Message: $false }
  ; THis doesn't stop on 0, which is bad ^^
}


Examples:




-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #167165 20/12/06 10:13 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Set a variable and check it before sending the text.
Code:
alias check {
  if ($len($editbox($active)) >= 1) {
    if (%Typing != $true) {
      echo -ag Typing-Message $true
    }
    set -u15 %Typing $true
  }
  else {
    if (%Typing) {
      echo -ag Typing-Message: $false
      unset %Typing
    }
  }
}


This will only display $true once and only $false once. As a note, the way you had the $true part, if you typed 2 letters before it checked, it wouldn't display $true because it wouldn't be == 1.

Note: Although it shouldn't be needed, I put -u15 to unset the %Typing variable just to prevent possible problems. It should unset automatically anyhow, but I like being thorough. smile


Invision Support
#Invision on irc.irchighway.net
Re: Script Question [Re: Riamus2] #167177 20/12/06 11:38 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok Riamus2, thanks :D, I'll try it..Always coming to my rescue :P, lol


-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #167232 21/12/06 06:08 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok, thanks Riamus2, what you gave me worked perfectly. I have found another problem though :|

Code:
alias check {
  if ($left($1-,1) != $chr(47)) {
    if ($len($editbox($active)) >= 1) {
      if (%Typing != $true) {
        .msg $active Typing-Message: $true
      }
      set -u15 %Typing $true
    }
    else {
      if (%Typing) {
        .msg $active Typing-Message: $false
        unset %Typing
      }
    }
  }
}

I added the second line..
if ($left($1-,1) != $chr(47)) {
but, it acts like the if statement is true, which it isn't, CHR 47 = / I don't want it to say i'm typing a message if I'm using / at the beginning.


-Kurdish_Assass1n
Re: Script Question [Re: Kurdish_Assass1n] #167253 21/12/06 09:34 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
What is the value of $1- ?

Looking at the rest of the code, the only value I can see being used is the result from $editbox($active). Unless you are sending some value when you call /check, $1- will be $null which is indeed != $chr(47).

-genius_at_work

Re: Script Question [Re: genius_at_work] #167261 21/12/06 11:05 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Originally Posted By: genius_at_work
What is the value of $1- ?

Looking at the rest of the code, the only value I can see being used is the result from $editbox($active). Unless you are sending some value when you call /check, $1- will be $null which is indeed != $chr(47).


Yeah, use this:
if ($left($editbox($active),1) != $chr(47)) {


Invision Support
#Invision on irc.irchighway.net
Re: Script Question [Re: Riamus2] #167263 21/12/06 11:08 PM
Joined: Oct 2003
Posts: 313
S
Sais Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
I would go further:
Code:
var %text = $editbox($active)
if ($len(%text) >= 1) && ($left(%text,1) != $chr(47)) {


Note that I reversed the conditions, too.

Also looked like there was a space missing between one of the ) { pairs (in the OP).

Last edited by Sais; 21/12/06 11:20 PM.

Sais
Re: Script Question [Re: Riamus2] #167264 21/12/06 11:11 PM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok, got it working, thanks guys. But, I found yet another problem with my script, I'm almost done with it though.

Code:
Code:
on ^*:TEXT:*:?: {
  if (Typing-message: $false == $1-2) {
    mtitle $titlebar
    echo -a Testing
    haltdef
  }
  if (Typing-message: $true == $1-2) {
    mtitle $titlebar ------------------------------- $active Is Typing A Message. --------
    echo -a Testing-1
    haltdef
  }
}

ok, it does every command here, the haltdef, the echo -a Testing[-1], but, it does not do the mtitle part, but, when I use it just normally type it, it works, so, the alias 'mtitle' isn't messed up, but, it's not working for some reason, why is that?
Also, sorry for making so many posts/threads on this topic.


-------------------------------------------

Full Code Just In Case:
Code:
on *:ACTIVE:?: {
  if (*!*@XBConnect.com* iswm $address($active,2)) {
    .timercheck -m $+(100,$str(00,6)) 430 check
  }
}
on *:ACTIVE:#: {
  if ($timer(check)) { .timercheck off }
}
alias check {
  if ($left($editbox($active),1) != $chr(47)) {
    if ($len($editbox($active)) >= 1) {
      if (%Typing != $true) {
        .msg $active Typing-Message: $true
      }
      set -u15 %Typing $true
    }
    else {
      if (%Typing) {
        .msg $active Typing-Message: $false
        unset %Typing
      }
    }
  }
}

on ^*:TEXT:*:?: {
  if (Typing-message: $false == $1-2) {
    mtitle $titlebar
    echo -a Testing
    haltdef
  }
  if (Typing-message: $true == $1-2) {
    mtitle $titlebar ------------------------------- $active Is Typing A Message. --------
    echo -a Testing-1
    haltdef
  }
}

alias mtitle { dll " $+ $scriptdirmtitle.dll $+ " mtitle $1- }
alias mtitlebar { return $dll( " $+ $scriptdirmtitle.dll $+ " , mtbar , 0 ) }
alias mChan { if ($1 ischan) { mSet $1 Channel: -[ $+ $1 $+ ]- Population: -[ $+ $nick($1,0) $+ ]- Modes: -[ $+ $iif( $chan($1).mode , $chan($1).mode , n/a ) $+ ]- Topic: -[ $+ $iif( $chan($1).topic , $ifmatch , none) $+ ]- } }
alias mSet { if ($1 ischan) { dll " $+ $scriptdirmtitle.dll $+ " mchan $window($1).hwnd $strip($2-) } }

alias mtabout { dll " $+ $scriptdirmtitle.dll $+ " mtabout }
on :*:load: {
  if ($version < 5.9) { echo $colour(info) -s *** mtitle cannot be used, you need mIRC 5.9 or higher | unload -rs $script | return }
  echo $colour(info) -s *** mtitle v1.3 by Kintar0 
  echo $colour(info) -s *** mtitle successfully loaded...
  .timer 1 1 mtabout
}


-Kurdish_Assass1n
Page 1 of 2 1 2