mIRC Home    About    Download    Register    News    Help

Print Thread
#70924 10/02/04 01:11 PM
Joined: Feb 2004
Posts: 5
T
tekno Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Feb 2004
Posts: 5
It wanted to know as I can divide a phrase. I have one picwin of 550pixels,I want if the text passes of those pixels made a jump of line. I have proven with $mid

Set %txt $mid($1->, 1, 300)
Set %txt1 $mid($1->, 300, 640)
Set %txt2 $mid($1->, 640, 960)

but does not keep the variables well. anyone can help me ?..

#70925 10/02/04 02:42 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
$1-> is an invalid argument. Try using $1-. A variable defined using set will not unset on its own. If after the code is executed the variable is not in your variables list, and you did not manually unset it (or via the script), it was never there to begin with.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#70926 10/02/04 03:46 PM
Joined: Feb 2004
Posts: 5
T
tekno Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Feb 2004
Posts: 5
$1-> is a mistake sorry..
the point is i don't know how to divide the text

#70927 10/02/04 04:28 PM
Joined: Dec 2002
Posts: 29
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 29
i don't know exactly what you mean, but try this one

set %txt $mid($1-, 1, 300)
set %txt1 $mid($1-, 300, 340)
set %txt2 $mid($1-, 640, 960)
etc...

set %txt1 $mid($1-, 300, 340) <== why 340? because 300 add 340 equal 640 wink
hope i can help you with it, if not, please explain it what you're doing to do with


Charlie
#70928 10/02/04 09:22 PM
Joined: Feb 2004
Posts: 5
T
tekno Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Feb 2004
Posts: 5
okey, let's see..

i have a picwin (553x40px) and i redirected my notices to this window, the problem is if the text of the notice is longer than 553px.. and well, i don't know how divider the text for do the jump of line..

#70929 11/02/04 12:48 AM
Joined: Dec 2002
Posts: 332
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
you mean you want to wrap the text ? around to a new line if it is to long such
as it keeps going like this ?

#70930 11/02/04 03:18 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
/help $wrap

#70931 11/02/04 06:55 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Your original $mid statements are correct - they chop the text up into bits. If the variables are not saved, this is not an error with $mid.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#70932 11/02/04 10:56 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
sorry for my previous short reply ie:

/help $wrap

Set %txtline1 $wrap($1-, FONTNAMEHERE, FONTSIZEHERE, 530,1,1)
Set %txtline2 $wrap($1-, FONTNAMEHERE, FONTSIZEHERE, 530,1,2)
Set %txtline3 $wrap($1-, FONTNAMEHERE, FONTSIZEHERE, 530,1,3)

FONTNAME & SIZE well these are pretty clear, as for the rest...
I used 530 (width of the text) above as you said the picwin is 550, so i thought a small indenting would be what ya wanted, if not take it up to 550. The ,1 following the 530 means break at word boundries, if its not wanted set it to 0, for charcter boundries., the last value is what line of the text you want.

#70933 11/02/04 04:03 PM
Joined: Feb 2004
Posts: 5
T
tekno Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Feb 2004
Posts: 5
this is what i have..
alias blah {
var %i 1
while ($wrap($1-,dungeon,9,530,0) >= %i) {
var %txt $wrap($1-,dungeon,9,530,%i)
drawtext -pbr @bottombar $rgb(0,0,0) $rgb(218,230,231) dungeon 9 406 40 - $asctime(HH:nn) - %txt
actualiza_noticias

inc %i
}
}
mirc say: * Invalid format: $wrap on var %txt $wrap($1-,dungeon,9,530,%i) wtf ?
the same it happens if I put drawtext -pbrc @bottombar $rgb(0,0,0) $rgb(218,230,231) dungeon 9 406 40 - $asctime(HH:nn) - $wrap($1-,dungeon,9,530,%i)

Last edited by tekno; 11/02/04 04:12 PM.
#70934 12/02/04 12:53 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
two problems.

(1) you dropped one of the fields in the $wrap command out.
$wrap(text, font, size, width, [word,] N)
The [word,] field, the help says its optional, but i suggest to leave it in, as removing it has caused me troubles when getting ,0 (number of lines) and ,1 (1st line),.
I always include the [word,] value being 0, or 1,

(2) and this is your main problem..
var %txt $wrap($1-,dungeon,9,530,%i)
replace with
var %txt = $wrap($1-,dungeon,9,530,%i)


Link Copied to Clipboard