mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2003
Posts: 78
M
MauS Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: May 2003
Posts: 78
Subj.

I need to copy clicked nick in the position of the cursor


-= endless in a victory of a yourself =-
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
/clipboard $$1


new username: tidy_trax
Joined: May 2003
Posts: 78
M
MauS Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: May 2003
Posts: 78
That's not what i want


-= endless in a victory of a yourself =-
Joined: Jan 2003
Posts: 108
H
Vogon poet
Offline
Vogon poet
H
Joined: Jan 2003
Posts: 108
In the postion of the cursor?

Joined: May 2003
Posts: 78
M
MauS Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: May 2003
Posts: 78
I mean TO the position of the cursor.

For example: i set cursor to a position (in middle of text) in the editbox. Then i doubleclick a nick and my mouse nicklist action should copy that nick to the position i've set


-= endless in a victory of a yourself =-
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
you can't get the cursor position. If i get what u mean you're saying say you had an edit bot:

[Some text_____]
and you put the cursor where the red bar is
[Some |text_____]
Then you want to put text in that position of the cursor..

You can't. There no $did(id).cursorpos property or anything.


-KingTomato
Joined: Jan 2003
Posts: 25
N
Ameglian cow
Offline
Ameglian cow
N
Joined: Jan 2003
Posts: 25
um .. what's wrong with typing the first letter or two of the nick and hitting tab?


But then again, what do I know ... I'm NoScRiPtR wink
Joined: Dec 2002
Posts: 169
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
$did().selstart works. Using $mid, $did().selstart and $did().selend it should be easy to insert text into an editbox at the cursor position. Example:
Code:
alias inserteditbox {
  var %dname = $$1
  var %id = $$2
  var %itext = $$3-
  var %text = $did(%dname,%id)
  if ($did(%dname,%id).selstart == 0) { did -o %dname %id 1 %itext $+ %text }
  else { did -o %dname %id 1 $mid(%text,1,$did(%dname,%id).selstart) $+ %itext $+ $mid(%text,$calc($did(%dname,%id).selend + 1)) }
}

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Provided that we're talking about dialog editboxes. Even though I read every post in this thread, I couldn't determine that smile


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 169
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
True. I assumed that it was editboxes in dialogs from KingTomato's post :tongue:

For channel nicklists and editboxes I suppose you could get around the issue by using your sendkeys alias to send shift-tab (to go back to the editbox) and then sendkey the nickname. Or you could copy the nick to the clipboard and then sendkey +{TAB}^V (that way you dont have to worry about nicks containing ^{}[])
Code:
alias sendkeys var %a = sendkeys $+ $ticks | .comopen %a WScript.Shell | if !$comerr { .comclose %a $com(%a,SendKeys,3,bstr,$1-) }
alias inserteditbox {
  clipboard $$1
  ; shift tab back to the edit box, ctrl v to paste.  
  sendkeys +{TAB}^V
}
Nick List: /inserteditbox $1

Not pretty but it should work and do what the original poster wanted.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
That's a pretty damn good idea. You don't even need the cursor position this way.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Except that you can't tell if you selected from the Nicklist side-listbox popup, or from the Nicklist nick-appearing-in-channel popup. If you Shift+Tab when clicking a nick in the channel, you'll end up in the side-listbox.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard