mIRC Home    About    Download    Register    News    Help

Print Thread
#15295 14/03/03 04:26 PM
Joined: Dec 2002
Posts: 68
P
Babel fish
OP Offline
Babel fish
P
Joined: Dec 2002
Posts: 68
I have a dialog and it is filled with text from a txt file. I am wondering how I can wrap this so you don't have to scroll to the side. I looked at $wrap but I did not understand it. Please help. Thanks.

#15296 14/03/03 04:28 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
It the text in the dialogue itself or an edit box? Since you mention scrolling I will (cautiously) predict an edit box. Try the 'multi' style.

#15297 14/03/03 04:34 PM
Joined: Dec 2002
Posts: 68
P
Babel fish
OP Offline
Babel fish
P
Joined: Dec 2002
Posts: 68
Yes it is an edit box. But mutli will make it so you still have to scroll to the side to read it all (since thats how its like in the .txt). I could just edit the .txt file so it wont (since the info in there wont change), but I will be using a lot of these, so it'll be easier if there is a way to do it in mIRC.

Also removing the horizontal bar will just remove the text after that.

Here is my editbox:

edit "", 11, 0 38 135 164, tab 9 read multi return vsbar

Last edited by phrozenfire; 14/03/03 04:47 PM.
#15298 14/03/03 04:47 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
I just tried $wrap and all it does it restrict it further, same with the "limit N" style. I don't think $wrap is for dialogues in any case. I guess I will wait along with you to hear other suggestions. I've been wanting much the same thing you want for the topic changer in my channel central dialgue for a while and it would be a worthwhile improvement.

#15299 14/03/03 04:54 PM
Joined: Mar 2003
Posts: 23
N
Ameglian cow
Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 23
Code:
 
 dialog nick {
  title "mIRC"
  size -1 -1 300 200
  option dbu

  edit $read(abcd.txt) ,1, 0 0 150 150, style (multi, vsbar, autovs)
  button ,2, 12 12 12 12,hide,ok
}
 


Contents of abcd.txt

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

no problem with it ... it auto wrap it


blushcoolcrazy frownlaughmadshockedsmile:tongue:wink
#15300 14/03/03 04:59 PM
Joined: Dec 2002
Posts: 68
P
Babel fish
OP Offline
Babel fish
P
Joined: Dec 2002
Posts: 68
Problem is that I have one editbox, and they choose from a dropdown combo box what displays in the editbox. Each item in the dropdown combo box is a different .txt file.

#15301 14/03/03 05:05 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Good stuff, damn thing was right under my nose too. I was working with autohs instead. Much appreicated.

I won't paste my channel central script here though, it's 2300 lines worth. grin

#15302 14/03/03 05:11 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Code:
if ($did(yourdialog,id).sel == 1) {
  did -a yourdialog id Text file 1
}
if ($did(yourdialog,id).sel == 2) {
  did -a yourdialog id Text file 2
}
if ($did(yourdialog,id).sel == 3) {
  did -a yourdialog id Text file 3
}

#15303 14/03/03 05:34 PM
Joined: Mar 2003
Posts: 23
N
Ameglian cow
Offline
Ameglian cow
N
Joined: Mar 2003
Posts: 23
Code:
  
dialog nick {
  title "mIRC"
  size -1 -1 300 200
  option dbu

  edit "" ,1, 0 0 150 150, style (multi, vsbar, autovs)
  combo 2, 200 10 50 20, style (sort,drop)
  button ,99, 12 12 12 12,hide,ok


}
on 1:dialog:nick:init:0: {
  did -a nick 2 abcd
  did -a nick 2 efgh
}

on 1:DIALOG:nick:sclick:2:{
  if ($did(2).seltext == abcd) { $filledit(abcd.txt) }
  elseif ($did(2).seltext == efgh) { $filledit(efgh.txt) }
}
alias filledit {
  var %x = 1
  while (%x <= $lines($1)) {
    if (%x=1) { did -ar nick 1 $read($1,%x) }
    else { did -a nick 1 $read($1,%x) }
    inc %x
  }
}

confused try it tell me results


blushcoolcrazy frownlaughmadshockedsmile:tongue:wink
#15304 14/03/03 07:03 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
2300 lines for a channel central script? Does it cook too?


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#15305 15/03/03 01:05 AM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Not quite though it does have heaps of oper stuff in it.

#15306 15/03/03 09:12 AM
Joined: Jan 2003
Posts: 38
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
$wrap works fine for me in dialogs, but i dont know about editboxes (if i think i know what it is wink )

$wrap(text, font, [font]size, width(pixels), [word,] N)
Returns Nth line in text wrapped to the specified width in pixels.

//echo -a $wrap(hejhoppjaheterkalle,arial,9,30,[1/0,]1)
echos: "hejhop"

and if you switch the last number (red)
//echo -a $wrap(hejhoppjaheterkalle,arial,9,30,[1/0,]2)
it echos the next line: "pjahet"
and so on...

//echo -a $wrap(hejhoppjaheterkalle,arial,9,30,[1/0,]3)
echos: "erkalle"

The [1/0] is for wrapping at whole words, since i dont have any in my text (hejhoppjaheterkalle) it isnt needed but you can add it anyway, default is 1, wrap at whole words, but it works bothways in my example
I think i got it to echo all the lines at once one time, dont remember how though. anyways..

gl with your scripting, this wont help very much, i just gave you an example smile


Link Copied to Clipboard