mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
/mline and /swline #35522 10/07/03 10:18 PM
Joined: Dec 2002
Posts: 339
D
Doomstars Offline OP
Fjord artisan
OP Offline
Fjord artisan
D
Joined: Dec 2002
Posts: 339
/mline would work like /iline, except it would move an existing line. Like /mline @test 1 4 would insert line 1 to slot 4.

/swine would be like /mline except it would switch lines 1 and 4 around.

Re: /mline and /swline #35523 10/07/03 10:19 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
imho thats too easy to script to require new commands.

Re: /mline and /swline #35524 10/07/03 10:44 PM
Joined: Dec 2002
Posts: 339
D
Doomstars Offline OP
Fjord artisan
OP Offline
Fjord artisan
D
Joined: Dec 2002
Posts: 339
It's still a suggestion.

Re: /mline and /swline #35525 10/07/03 11:08 PM
Joined: Dec 2002
Posts: 2,985
Watchdog Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
So is /cline but it was added to mIRC.

Re: /mline and /swline #35526 10/07/03 11:25 PM
Joined: Jun 2003
Posts: 195
N
Narusegawa_Naru Offline
Vogon poet
Offline
Vogon poet
N
Joined: Jun 2003
Posts: 195
Nice idea but in addition to that i think all window and drawing commands should work on all windows. i.e /draw* for channels etc..

as for the scripting part maybe the easy things are best left to scripting i mean if we simply add everything what would the scripter do? but lately ive started scripting again and i could definately use these.

Allow me to add one more. an identifier

$maxchr

it will return the maximum number of characters a window can display before wrapping using the givin windows font and size etc.. This can be scripted and ive done it but i think its a bit slow. Unless someone has a faster way id sure be happy to use it smile


Have Fun smile
Re: /mline and /swline #35527 10/07/03 11:29 PM
Joined: Dec 2002
Posts: 2,985
Watchdog Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Agreed. grin

Re: /mline and /swline #35528 11/07/03 05:08 AM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
The problem with a $maxchr identifier is that it couldn't accommodate non-fixed-width fonts. Though I don't suppose that should stop it from being added.

You may have done this already, but I use $width to check if a string will fit in a window.

$width(%string,$window($active).font,$window($active).fontsize,$iif($window($active).fontbold,1,0),1)

With a little use of $window($active).dx, I suppose you could figure out many characters will fit based on the average width. (hmm, maybe...)

Code:
; $MaxChr([window],[sample-string-to-take-avgerage-width-from])
; (both parameters optional)
ALIAS MaxChr {
  var %wnd = $iif($1,$1,$active)
  var %avgtext = $iif($2,$2,W)
  var %avgwidth = $width(%avgtext,$window(%wnd).font,  $&
      $window(%wnd).fontsize,$iif($window(%wnd).fontbold,1,0),1)
  var %avgwidth = $calc(%avgwidth / $len(%avgtext))
  var %wndwidth = $calc($window(%wnd).dw - 3)
  return $calc(%wndwidth / %avgwidth)
}

Note, if you're using a fixed width font, you don't need to supply a sample string for $2 to calculate an average width against. And since W is the widest character in a variable width font, you can safely say that the result is the MAX possible characters. I also subtract 3 from $window.dw because there appears to be a margin of 3 pixels.

Sorry if this is off topic, but it seemed like a handy alias after reading your post.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: /mline and /swline #35529 11/07/03 02:58 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Umm cline could NOT have been scripted. Please show me how exactly you would have colored nicks in a channel nicklist without /cline (and no dlls of course)?

Re: /mline and /swline #35530 11/07/03 03:28 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
using color codes?


new username: tidy_trax
Re: /mline and /swline #35531 11/07/03 03:28 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I also subtract 3 from $window.dw because there appears to be a margin of 3 pixels.

This is not a static number, its value depends on the setting in Options > Display > Options > Visual styles > Frame style
It is never 3 either. The numbers of pixels for each setting are the following:
No frame: 0
Thin frame: 1
Thick frame: 2
Bevel frame: 1

In short, this number is $replace($readini($mircini,styles,thin),3,1)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: /mline and /swline #35532 11/07/03 03:45 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
And since when can you use color codes in nicknames?

Re: /mline and /swline #35533 11/07/03 04:01 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i dont know it was just a suggestion :tongue:


new username: tidy_trax
Re: /mline and /swline #35534 11/07/03 06:17 PM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
strike this one up to one of the useless helpful things uve said "I dont know it was just a suggestion"

yep ur quite helpful there today


D3m0nnet.com
Re: /mline and /swline #35535 11/07/03 06:41 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
why do you always feel the need to argue with me, even if i say something helpfull....


new username: tidy_trax
Re: /mline and /swline #35536 12/07/03 12:47 PM
Joined: Jun 2003
Posts: 130
O
obsessed Offline
Vogon poet
Offline
Vogon poet
O
Joined: Jun 2003
Posts: 130
I think he means coloured text in a custom window list.


If only women came with popup menus and online help.
Re: /mline and /swline #35537 12/07/03 01:32 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i know but i dont use custom windows but considerin watchdog said it would of been easy to script that would be the way it could be done.


new username: tidy_trax
Re: /mline and /swline #35538 12/07/03 02:11 PM
Joined: Dec 2002
Posts: 2,985
Watchdog Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Please show me how exactly you would have colored nicks in a channel nicklist without /cline

I didn't say you could colour a nicklist without /cline. I said that the /cline function has been put in mIRC. I am sure that you realise that mIRC comes with the ability to colourcode nicks according to about 20-odd events such as channel mode prefix, ignore list, protect list, what your hostname is, etc etc. Without this function you use /cline to colour the nicks and I have to say right now that the built-in function is both more user-friendly and far more reliable and adaptable than any nicklist colouring script ever was.

The "it's scriptable so I don't want it added" is just a babyish attitude. Quite a number of things that operated in the past with very simple scripting are now part of mirc.exe. I don't understand why this causes offence to some people.

Re: /mline and /swline #35539 12/07/03 04:51 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well /cline existed long before the nick coloring feature, so that really doesn't say much of anything.

I said that the /swline and /mline could be easily scripted (3-4 lines of code), you're response was that /cline could be easily scripted as well, but it was added. Then when I ask you how to script such a thing you tell me it can't be scripted. So what exactly is your point?

My problem isn't that it can be scripted, it's that it is easy to script. Why should a 3-4 line script be built into mIRC? I can understand if it were several hundred lines of code, but this isn't, it is something that should take 5 mins to script.

Re: /mline and /swline #35540 12/07/03 06:16 PM
Joined: Dec 2002
Posts: 2,985
Watchdog Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Okay, paste here exactly where I said "/cline can't be scripted". If you can't then you have just wasted the last three minutes. I'm not repeating myself for a third time.

For the record I have written full scripts with the /cline function before nicklist colouring was added, so it is simply a statement I would never make.

Re: /mline and /swline #35541 12/07/03 06:20 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
" didn't say you could colour a nicklist without /cline"

If you can't color a nicklist without /cline then you can't script /cline! /cline lets you color nicklists. You admit it is NOT possible to write a script to do that, therefore it is NOT possible to script /cline. You can make something similar to it, but not a command that does the exact same things.

Page 1 of 2 1 2