mIRC Home    About    Download    Register    News    Help

Print Thread
#107901 14/01/05 02:51 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
Regards to the post about wrap a few threads below, i'm now having problems with the same thing slightly modified, i want a wrap alias that i can add to anything (see below)

Code:
alias _wrap {
  haltdef
  var %i = 1
  while ($wrap($2-,ProFontWindows, 6,475, 0, %i)) {
    echo $1 $ifmatch
    inc %i
  }
} 
on ^1:NOTICE:*:?:{ 
  if (DCC Send isin $1-) || (DCC chat isin $1-) { halt }
_wrap $active 00- $+ 11 $+ $nick $+ 00(14 $+ $replace($address,@,11@14,.,11.14,-,11-14) $+ 00)-15 $1-
  halt
}
 

that's just an example of what i thought would work, but it doesn't
frown
any help would be great.

#107902 14/01/05 03:53 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
remove the haltdef in _wrap
(not that that should stop it, its just not needed)

also might want to add to _wrap

Code:
alias _wrap {
  if ($1-2 == Status Window) { tokenize 32 -s $3- }
  elseif ($1-2 ==  Message Window) { tokenize 32 -d $3- }
  var %i = 1
  while ($wrap($2-,ProFontWindows, 6,475, 0, %i)) {
    echo $1 $ifmatch
    inc %i
  }
} 


Last edited by DaveC; 14/01/05 04:11 PM.
#107903 14/01/05 04:05 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
Yeah i just noticed that, but it's still not actually wrapping the text

#107904 14/01/05 04:14 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Sorry i just edited my reply see above ^^^
try changing the 475 to a smaller number like 50, and see if that wraps, then increase it slowly tell its the right size u want, thats 475 pixels remeber.

#107905 14/01/05 04:25 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
Ok, i took a pic, i've played with the '475' but as you see, makes no odds lol, i hate wrap..

:tongue:

Click This

#107906 14/01/05 04:47 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
that is wrapped
Else the sssss would go as far across the screen as the top ones.

are you trying to make the following appearence?

Code:
suchand such   : tessssssssssssssss
                 ssssssssssssssssss
                 ssssssssssssssssss
                 sssssssst


(hope that comes out right on your screen) basicly a text on the left of the first line then etxt on the right of it
but ever following line is spaces and text on the right, inline with the 1st lines right hand side text?

#107907 14/01/05 04:50 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
ya like that

Code:
notice      : Marantz  tessssssssssssssss
            : ssssssssssssssssss
            : ssssssssssssssssss
            : sssssssst   


i just thought that consider in use $str($chr(160),23) all the time, that a universal wrap alias was possible for notices/snotices and all things like that

Last edited by ztnaraM; 14/01/05 04:53 PM.
#107908 14/01/05 06:28 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I wrote this for you (and myself)

you DONT call it as a alias ie /_wrap u call it as an identifier
but u can put it on a line of its own since it doesnt return anything ie:
$_wrap($active,$nick said :,300,$1-)

I tried it a few times, the text stays pretty well in line, but with fonts with differnt character sizes you can never always stay in line.

Code:
;
; $_wrap(window,fixedtext,wraptextsize,text)
; window       = the window its to display in
; fixedtext    = the text for the lefthand side on 1st line
; wraptextsize = the pixel width of the wrapping text
; text         = the text to wrap on the righthand side
;
alias _wrap {
  var %window = $iif($window($1),$1,$active)
  var %fixedtext = $2
  var %textsize = $iif($calc($3 * 1) <= 0,100,$calc($3 * 1))
  var %i = 1 
  while ($wrap($4-,$window(%window).font,$window(%window).fontsize,%textsize,0,%i)) { 
    echo $iif(%window != Status Window,$iif(%window != Message Window,%window,-d),-s) %fixedtext [ $ifmatch ]
    if (%i == 1) {
      var %width = $calc($width(%fixedtext,$window(%window).font,$window(%window).fontsize,0,1) + 2)
      var %fixedtext = $wrap($str($chr(160),800),$window(%window).font,$window(%window).fontsize,%width,0,1)
    }
    inc %i 
  } 
} 


oh it goes a bit dodgy if you dont have a FIXEDTEXT, but then if u dont u shouldnt be using this.


edit/added this bit so you could see how it works...
Code:
on ^1:NOTICE:*:?:{ 
  if (DCC Send isin $1-) || (DCC chat isin $1-) { halt }
  $_wrap($active,NOTICE 00- $+ 11 $+ $nick $+ 00(14 $+ $replace($address,@,11@14,.,11.14,-,11-14) $+ 00)-15 ,475,$1-)
  halt
}

Last edited by DaveC; 14/01/05 06:39 PM.
#107909 14/01/05 07:00 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
lol magic, i didn't see you had edited it, but already got it working, and it works perfectly it's damn sweet, i can rest now until i come across a new problem, cheers DaveC wink


Link Copied to Clipboard