|
Joined: Dec 2002
Posts: 295
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 295 |
Hi, was just wondering if it can be done ?
For example, i have some info i have obtained and it's sitting in a list box, is it possible to have a button so that i can either print to my printer OR save the info to a Text file, and then maybe print it out using Notepad.
Thanks ShadowDemon mIRC V6.03
------------------------------ edit (saves on a new post)
Thanks a lot guys for the help, hehe i got it working in the enbd, and have a lovely printed list of the stuff from my list box now.
ShadowDemon
Last edited by shadowdemon; 14/03/03 01:23 PM.
Never argue with an idiot...they'll drag you down to their level and beat you up with experience
|
|
|
|
Joined: Dec 2002
Posts: 212
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 212 |
/filter -if $dname $id print.txt or /savebuf -o $dname $id filename
And all I need now is intellectual intercourse, a soul to dig the hole much deeper
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
And after you do ^that^ you can do /run notepad.exe /p print.txt to print it.
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
I am presuming it is a side listbox in a custom window, if not, I've got it wrong!!!! (again!!)
alias GetListbox {
if ($line($active,0,1) == $null) { halt }
.write -c "Listbox Contents.txt"
[color:green];I have put these into variables so as to reduce code later on (the ---- line)[/color]
var %a Contents of the list box for $active
var %b Saved by $me on $asctime
.write "Listbox Contents.txt" %a
.write "Listbox Contents.txt" %b
.write "Listbox Contents.txt" $str($chr(45),$iif($len(%a) > $len(%b),$len(%a),$len(%b)))
var %i = 1
while %i <= $line($active,0,1) {
.write "Listbox Contents.txt" $line($active,%i,1)
inc %i
}
.run "Listbox Contents.txt"
}
Probably too much code there than needs to be, but thought I'd make it anyway! Hope it's what you want.
Aubs.
|
|
|
|
Joined: Dec 2002
Posts: 295
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 295 |
Ok, Thanks Vasil. But i cant seem to get it to work, sorry My Code
dialog onservinfo {
title "Whois"
size -1 -1 207 173
option dbu
list 6, 3 3 200 150, size vsbar
button "Close...", 1, 5 158 37 12, ok cancel
box "", 2, 3 153 41 19
box "", 3, 44 153 41 19
button "Print...", 4, 46 158 37 12
}
ON *:DIALOG:onservinfo:sclick:4 {
/filter -if $dname $id print.txt
}
And
dialog onservinfo {
title "Whois"
size -1 -1 207 173
option dbu
list 6, 3 3 200 150, size vsbar
button "Close...", 1, 5 158 37 12, ok cancel
box "", 2, 3 153 41 19
box "", 3, 44 153 41 19
button "Print...", 4, 46 158 37 12
}
ON *:DIALOG:onservinfo:sclick:4 {
/savebuf -o $dname $id filename
}
Maybe i'm doing something wrong with the code, but i tried messing around with the $id bits ShadowDemon
Never argue with an idiot...they'll drag you down to their level and beat you up with experience
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
ok, so not only did I get it wrong, but I got it wrong late!!!
Didn't notice the bit about a <button> to print - Obviously means dialog!
Doh! Anyhow, for the script I posted, as collective said, you could use notepad.exe /p <filename> to print it
Never mind!
Aubs.
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
You need to change $dname $id filename
say:
/filter -if onservinfo 4 Print.txt
[edit] or am I wrong? (probably, seem to be now days!) [/edit]
Last edited by Aubs; 14/03/03 01:11 PM.
Aubs.
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
That would be 6, not 4... wrong command syntax anyway (dunno why, not going to read help, too lazy)...use this: dialog onservinfo {
title "Whois"
size -1 -1 207 173
option dbu
list 6, 3 3 200 150, size vsbar
button "Close...", 1, 5 158 37 12, ok cancel
box "", 2, 3 153 41 19
box "", 3, 44 153 41 19
button "Print...", 4, 46 158 37 12
}
ON *:DIALOG:onservinfo:sclick:4 {
savebuf -o $dname 6 print.txt
run notepad.exe /p print.txt
}
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
Oops, my mistake!! tnx Collective God! lol
Aubs.
|
|
|
|
Joined: Dec 2002
Posts: 295
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 295 |
Thanks Aubs My new code is as follows (just the ON Dialog bit) [code ON *:DIALOG:onservinfo:sclick:4 { /filter -if onservinfo 4 Print.txt /run notepad.exe /p print.txt } [/code still not working, keep getting the following error * /filter: invalid parameters (line 131, whoonserver.mrc)
and line 131 is /filter -if onservinfo 4 Print.txt btw Aubs, yes it is for a dialog ShadowDemon
Never argue with an idiot...they'll drag you down to their level and beat you up with experience
|
|
|
|
Joined: Dec 2002
Posts: 295
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 295 |
lol thanks for spotting that Collective,
/me feels like a right fool, forgot the id6
And yes i know the numbers n bits are a little messed up, just cleaning the code up a bit now.
ShadowDemon
Never argue with an idiot...they'll drag you down to their level and beat you up with experience
|
|
|
|
|