mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#166933 - 17/12/06 02:18 AM Script Question
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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!


Edited by Kurdish_Assass1n (17/12/06 02:18 AM)
_________________________
-Kurdish_Assass1n

Top
#166935 - 17/12/06 02:53 AM Re: Script Question [Re: Kurdish_Assass1n]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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.

Top
#166936 - 17/12/06 03:05 AM Re: Script Question [Re: RusselB]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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:


Edited by Kurdish_Assass1n (17/12/06 04:18 AM)
_________________________
-Kurdish_Assass1n

Top
#166938 - 17/12/06 04:40 AM Re: Script Question [Re: Kurdish_Assass1n]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#166939 - 17/12/06 04:46 AM Re: Script Question [Re: Riamus2]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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

Top
#166940 - 17/12/06 05:10 AM Re: Script Question [Re: Kurdish_Assass1n]
bwr30060 Offline
Fjord artisan

Registered: 23/05/05
Posts: 449
Loc: Georgia USA
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.
_________________________
Bears on Patrol Chat

Top
#166942 - 17/12/06 06:08 AM Re: Script Question [Re: bwr30060]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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

Top
#166957 - 17/12/06 04:22 PM Re: Script Question [Re: Kurdish_Assass1n]
bleach Offline
Vogon poet

Registered: 02/09/03
Posts: 156
/help on keydown

türkçe biliyormusun

Top
#166958 - 17/12/06 04:25 PM Re: Script Question [Re: bleach]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
I need this to work for a PM (Private Message) and not a custom window. Please help if you can. Thanks again.
_________________________
-Kurdish_Assass1n

Top
#166959 - 17/12/06 04:27 PM Re: Script Question [Re: Kurdish_Assass1n]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#166966 - 17/12/06 05:28 PM Re: Script Question [Re: Riamus2]
bleach Offline
Vogon poet

Registered: 02/09/03
Posts: 156
yea your right. good idea.. he have to check editboxes every milisecs.

Top
#167038 - 18/12/06 11:35 PM Re: Script Question [Re: bleach]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
thanks Riamus2, I'll try that. smile
_________________________
-Kurdish_Assass1n

Top
#167151 - 20/12/06 05:12 PM Re: Script Question [Re: Kurdish_Assass1n]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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

Top
#167165 - 20/12/06 10:13 PM Re: Script Question [Re: Kurdish_Assass1n]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#167177 - 20/12/06 11:38 PM Re: Script Question [Re: Riamus2]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
ok Riamus2, thanks :D, I'll try it..Always coming to my rescue :P, lol
_________________________
-Kurdish_Assass1n

Top
#167232 - 21/12/06 06:08 PM Re: Script Question [Re: Kurdish_Assass1n]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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

Top
#167253 - 21/12/06 09:34 PM Re: Script Question [Re: Kurdish_Assass1n]
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
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

Top
#167261 - 21/12/06 11:05 PM Re: Script Question [Re: genius_at_work]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#167263 - 21/12/06 11:08 PM Re: Script Question [Re: Riamus2]
Sais Offline
Fjord artisan

Registered: 07/10/03
Posts: 313
Loc: UK
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).


Edited by Sais (21/12/06 11:20 PM)
_________________________
Sais

Top
#167264 - 21/12/06 11:11 PM Re: Script Question [Re: Riamus2]
Kurdish_Assass1n Offline
Fjord artisan

Registered: 11/04/06
Posts: 400
Loc: Nashville, Tennessee
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

Top
Page 1 of 2 1 2 >