mIRC Home    About    Download    Register    News    Help

Print Thread
#184011 24/08/07 02:37 PM
Joined: Aug 2007
Posts: 7
M
myryy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Aug 2007
Posts: 7
excuse my bad english first...
i've a problem with copy/paste from firefox.
e.g. numbers:
33 43 5 0
mirc doesn't display the spaces between the
numbers...look's like 334550.
how to solve this problem?
thx.

FF v 2.0.0.6
mirc v 6.3


Last edited by myryy; 24/08/07 03:46 PM.
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
It works fine here, it's probably the page you're copying it from. If I copy those numbers from your post and paste into mIRC 6.3, it works fine.

Regards,


Mentality/Chris
Joined: Aug 2007
Posts: 7
M
myryy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Aug 2007
Posts: 7
yes you're right. maybe the informations lost.
please try this:
Code:
33	43	5 

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The numbers in your example are not devided by space aka $chr(32) or hardspace aka $chr(160), but by tab stop aka $chr(9).
If you are sending tab chars to a channel window, the tabs get stripped optically.
If you copy-paste the "apparently corrupted" code again out of the the channel window, and paste it e.g. to your editbox or another app like word, you'll see the text is still intact.

Compare these two cases (run them in the editbox of a channel):
Code:
//var %text = $+(33,$chr(9),43,$chr(9),5) | echo -a %text

Code:
//var %text = $+(33,$chr(9),43,$chr(9),5) | window @test | echo @test %text

The only sollution I can think of would be to use a custom script for "paste management". A script could replace $chr(9) or consecutive $chr(32) of text in your clipboard with hard spaces, maybe this one is is capable of doing: click

Heres a simple example how you might code your own paste script...
Code:
menu channel,query {
  $iif((!$cb),$style(2)) msg clipboard content to $active $iif(($cb(1)),$+([lines,$chr(58) $cb(0),])) : {
    var %nr = 1
    ; for each line of clipboard content, replace each TAB char with three hardspaces
    while ($cb(%nr)) { msg $active $replace($v1,$chr(9),$str($chr(160),3)) | inc %nr }
  }
}

Last edited by Horstl; 24/08/07 04:56 PM.
Joined: Aug 2007
Posts: 7
M
myryy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Aug 2007
Posts: 7
well, the text is still intact...in the editbox it is correct.
also in the channel-log it´s correct with spaces between the numbers.
my problem is following, other people often send me such numbers as shown in my example with tabs and now i have to copy the text out of the channel window to my editbox to get the correct view.

i´m not good a irc coding but i think i need a script, which converts my tabs into normal spaces...any idea?


Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
If you receive the numbers-and-tab-messages in a channel, imho the easiest sollution would not be to replace the tabs with spaces and halt the display of the default text (this could cause trouble with other on text scripts like 'themes' etc), but to give you simply a second, additional output.
Copy-Paste (*grin*) this piece of code to your remotes:
Code:
on $*:text:/	/:*: {
  echo -r $target $+($chr(3),$colour(info)) $nick sent text with $+(tabs:,$chr(15)) $replace($1-,$chr(9),$chr(32))
}
Is that sufficient? smile

Last edited by Horstl; 24/08/07 05:51 PM.
Joined: Aug 2007
Posts: 7
M
myryy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Aug 2007
Posts: 7
thank you for the idea, but it doesn't work.
i put it into my remote, but no effect. cry

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
- Make sure you added it to a blank new remote file (so no other 'on text' event in this file can interfer).
- Add a ^-char in front of the dollar sign in the first line (so it's processed more early, compared to on-text-events without that prefix):
on ^$*:text:

Still no echo if someone sends you a message (a line of text in a channel or query) that contains tabs?

- Open your scripts editor again, and in file order, move the scriptfile to the top (menu file > order)

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Just a point... $target for a query message is not the sender, but the receiver.

Replace "$target" there with "$iif(#,#,$nick)" wink

Also the matchtext can be \t which is more obvious.
on $*:text:/\t/:*:{

Joined: Aug 2007
Posts: 7
M
myryy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Aug 2007
Posts: 7
yes it´s working...is it possibly that it also change my inputs?

Last edited by myryy; 26/08/07 12:11 PM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
It's always possible. The question is: how easy would it be to implement smile (This issue is related to my proposal not to modify existing "on text" events in this case, but add a plain new one).

The event definition for inputs is "on input", there might be multiple on no input events in your current mIRC loaded.

In theory, you can have dozens of "on text" or "on input" events loaded, and - if they were set up properly - without any mutural disturbance.
Regarding these two events, problems might arise if more than one such event is set up to:
- modify the display of incoming text, e.g. "visual themes" or "away logs" (on text events)
- modify the content of text before you are sending the text to the server, and in addition maybe modify the local display of the text sent, e.g. "acronym managers", "nick completers", and again: "themes" (on input events)

In both cases, the default (unmodified) incoming text or the default text you entered in the editbox is "halted", thus only the modified text will be sent, or displayed.
Any further script that wants to modify-and-halt text on it's own could:
- result in a doubled display / doubled sending of the text (sometimes called "fnord")
- prevent the other event(s) from being processed
- not trigger at all
(... depending on how the new and old event(s) are set up with respect to "halting")

Therefore - if there exists an event with the characteristics described above - it's not sufficient to add a new "on input" event with the purpose to replace tabs with spaces, but you'd need to alter the respective on input event. If there is none, it would be quite easy to achieve.

To find all input events in your mIRC:
- open your scripts editor (alt-R)
- go to the "remote" tab
- start a search (ctrl-f) for the term ":input:" (without quotation marks, having checked "search all files in this section)

How many input events do you find? If you find some (and the code is not that extensive) please paste the code, so we'd have a look at it smile
If you have no such on input event, this will do the job:
Code:
; typing text (or pasting from clipboard)
on *:input:*: {
  ; text is not a /command; input text contains tabs; window is a channel or query; sending the line with "enter" not "ctrl-enter"  
  if ((/* !iswm $1) && ($regex($1-,/\t/)) && ($istok(channel query,$window($active).type,32)) && (!$ctrlenter)) { 
    ; send the text with all the tabs replaced by hardspace
    msg $active $replace($1-,$chr(9),$chr(160))
    ; halt the "original" (non-replaced) text
    halt
  }
}




Joined: Aug 2007
Posts: 7
M
myryy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Aug 2007
Posts: 7
yes it works...thank you so much Horstl for your help.
This problem with tabs is only with the newer versions of mirc...

Joined: Aug 2007
Posts: 7
M
myryy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Aug 2007
Posts: 7
i found a new point. if i change the font to ProFontWindows, there´s no problem!


Link Copied to Clipboard