mIRC Home    About    Download    Register    News    Help

Print Thread
#52942 08/10/03 04:01 PM
Joined: Jul 2003
Posts: 27
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2003
Posts: 27
I was just wanting to know if someone could show an example using $wrap....i was wantingto use it in my events if possaible instead of -i ,i was trying for a effect like.

[10:55] <nick> -| im testing here dont you see so
| dont bug me ok?

...something to that affect...any help appreciated welll its not showing right in my post but going with "aligned" "|"s

#52943 08/10/03 09:16 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
From your example, I think you want to split up the line you send to a channel into two seperate lines? Or is what you showed just the echo in your own window and do you send it to the channel normally?

The first is not possible, the second is, by simply using two echo statements. Tghe example below will also wrap your lines, but again, ONLY in an echo to yourself. you cannot send the wrapped lines to the channel the way you described.

sample:
Code:
alias showwrap {
  [color:green]; setting a line for testing[/color]
  var %text = This is just another basic example I whipped up by reading the helpfile
  var %x = 0
  [color:green]; ACK. Call 9-1-1. I actually used a goto loop. In this example, I find it easier than a while loop :)[/color]
  :displayline
  [color:green]; variable to track the wrapped-line-number[/color]
  inc %x
  [color:green]; if the wrapped-line-to-be actually has any text in it....[/color]
  if ($wrap(%text, verdana, 12, 100, %x)) {
    [color:green]; use this line to echo the wrapped text to yourself[/color]
    echo -a $ifmatch
    [color:green]; and/or this one to send to the channel[/color]
    .msg $active $ifmatch
    goto displayline
  }
}


output of the echo -a $ifmatch
Code:
This is just
another basic
example I
whipped up by
reading the
helpfile


output of the .msg $active $ifmatch
Code:
[23:16] &lt;@LocutusofBorg&gt; This is just
[23:16] &lt;@LocutusofBorg&gt; another basic
[23:16] &lt;@LocutusofBorg&gt; example I
[23:16] &lt;@LocutusofBorg&gt; whipped up by
[23:16] &lt;@LocutusofBorg&gt; reading the
[23:16] &lt;@LocutusofBorg&gt; helpfile


Note that sending to the channel can easily cause to trigger flood protection scripts by both channel ops and your IRC server !


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#52944 08/10/03 10:40 PM
Joined: Jul 2003
Posts: 27
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2003
Posts: 27
Yea i just want to use it for my echo...however im trying to only show my nick once if theres over 1 line from me
Code:
  


on *:input:*: {
if ($left($1,1) == /) { return }
if ($active == Status Window) { halt }
if ($len($me) <= 15) { var %:me = $+($me,$str(ÿ,$calc(15 - $len($me)))) }
if ($len($me) > 15) { var %:me = $+($left($me,12),...) }
.raw privmsg $active : $+ $1-
var %text = $1-
var %x = 0
:displayline
inc %x
if ($wrap(%text,tahoma,9,$calc($calc($window($active).dw -20) / 2), %x)) {
if (%x <= 1) { echo -at $+(5,%:me,15-) $ifmatch }
else { echo -a $+(5,$str(ÿ,23),15-) $ifmatch }
goto displayline
}
halt
}


but im only getting...

[17:29] |3|acK_Kn|G||Tÿ- 1
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-

now if i just use the: echo -at $+(5,%:me,15-) $ifmatch
i get....

[17:31] |3|acK_Kn|G||Tÿ- This is just another basic example I whipped up by
[17:31] |3|acK_Kn|G||Tÿ- reading the helpfile

#52945 09/10/03 12:06 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Why not just use /echo -iN

For Active window
echo $+(-ai,$calc($len($me) +3) <,$me,>) $1-
For Status window
echo $+(-si,$calc($len($me) +3) <,$me,>) $1-
For a channel/query window
echo $+(-i,$calc($len($me) +3) <#channel/nick> <,$me,>) $1-


Change the $calc() to include how you display nicks and timestamp etc. "$+(-i,$calc($len($me $timestamp)) +3)" .. or whatever...

#52946 09/10/03 12:28 AM
Joined: Jul 2003
Posts: 27
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2003
Posts: 27
cause -iN will throw the whole $wrap effect off ....i already tryed it

#52947 09/10/03 01:09 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Simulating your echoed example above, in a narrow window 353 pix wide..
//echo -hai $+ $calc($len([17:31] |3|acK_Kn|G||Tÿ-) +1) [17:31] |3|acK_Kn|G||Tÿ- This is just another basic example I whipped up by reading the helpfile
(The h switch was simply to allow easy copy/paste grin)
Code:
[17:31] |3|acK_Kn|G||Tÿ- This is just 
                         another basic 
                         example I whipped 
                         up by reading the 
                         helpfile

#52948 09/10/03 01:18 AM
Joined: Jul 2003
Posts: 27
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2003
Posts: 27
lol i know how to use -iN tho but im not worried about that now....just showing the nick and timestamp once for each input

#52949 09/10/03 08:14 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Too bad /echo -i is limited to only 25 characters..


* cold edits his posts 24/7
#52950 09/10/03 08:16 PM
Joined: Jul 2003
Posts: 27
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2003
Posts: 27
I know it sucks -iN is limited...the effect im after if like this...

[15:14] |3|acK_Kn|G||T - This is just another basic example I whipped up by
- reading the helpfile This is just another basic
- example I whipped up by reading the helpfile

with it equally spaced for the timestamp and the length of the nick but im getting it where my name is showing for each line

#52951 10/10/03 12:14 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
If you really need $wrap() for that, you'd have to check in your loop if the incremented variable (%i or whatever) is (not) 1.. if it is, you'd show your nick; if it's not, you'd use ctrl codes to create multiple spaces (like "ctrl+k ctrl+k ctrl+k" for 2 consecutive spaces, or "ctrl+uctrl+u ctrl+uctrl+u ctrl+uctrl+u" if you want to preserve any previous colour you used in the line), of course depending on your nick size, using $str() or any possible better method ($regsub() maybe?).


* cold edits his posts 24/7
#52952 10/10/03 12:17 AM
Joined: Jul 2003
Posts: 27
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2003
Posts: 27
its kewl i got it all to work now the way i want..thanks for the help all


Link Copied to Clipboard