mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
windowfx.dll #159258 15/09/06 05:13 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
//echo -a $dll(windowfx.dll, SetPadding, $(%#test, ) > 60 text)

gives me E_INVALID_WINDOW

but it works if i do like

/window -a @test

then
//echo -a $dll(windowfx.dll, SetPadding, @test > 60 text)

Re: windowfx.dll #159259 15/09/06 05:20 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Do you know what $(%#test,) does? Type

//echo -a $(%#test,)

You should be able to see what's wrong.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159260 15/09/06 05:22 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
%#test is the channel..

on buzzen the channel names are prefixed with %

(what i want to do eventually is put a toolbar on my channel windows)

Last edited by pouncer; 15/09/06 05:22 PM.
Re: windowfx.dll #159261 15/09/06 05:33 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You mean "%#test" is the actual channel name? Or is %#test a variable that holds the channel name?

Nevermind, missed your explanation about buzzen before. In that case, I'm not sure what's wrong. Does it work for 'normal' channels?

Last edited by qwerty; 15/09/06 05:48 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159262 15/09/06 05:38 PM
Joined: Feb 2006
Posts: 164
V
vexed Offline
Vogon poet
Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
That would be %#test as in the channel name, as it's an msn chat clone. smirk

Re: windowfx.dll #159263 15/09/06 07:03 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
ok i joined #mirc on quakenet and did

//echo -a $dll(windowfx.dll, SetPadding, #mirc > 60 text)

it did put the padding on..

so this doesnt work for roomnames prefixed with %

can anyone work out a way around it?

Re: windowfx.dll #159264 15/09/06 07:31 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Looking at the source, it appears that the problem is in the GetHwnd() function, which evaluates "$window(%#test).hwnd", so %#test is considered a variable. Try this:

//echo -a $dll(windowfx.dll, SetPadding, $!(%#test,) > 60 text)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159265 15/09/06 08:31 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
thanls for the reply.

still getting:

E_INVALID_WINDOW

frown

Edit* hang on:

i did this

//echo -a $dll(windowfx.dll, SetPadding, $!($Active,) > 60 text)

and it didnt work:

but when i did

echo -a $dll(windowfx.dll, SetPadding, $!(%#test,) > 60 text)

it worked.. wth?

Last edited by pouncer; 15/09/06 08:33 PM.
Re: windowfx.dll #159266 15/09/06 09:02 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
ok this code isnt working

Code:
on *:join:*: {
  if ($nick == $Me) {
    var %Chan = $Active
    echo -a $dll(dlls/windowfx.dll, SetPadding, $!(%Chan, ) > 28 text)
  }
}


it works if i put $($active, )

but not with the var %chan, anyone fix it?

Re: windowfx.dll #159267 15/09/06 09:34 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Actually both results from your edited part of your previous post are normal. "!" must be used only if you're using the literal channel name. If you're using $active or another identifier/variable that holds the channel name, you must not use "!". In other words, if the channel name begins with "%", use:

$($active,) (or just $!active )
or
$($chan(1),) (or $!chan(1) )
or
$($chan( %i ),) (or $!chan( %i ) ) - notice the spaces around the variable.
but
$!(%#test,)

However, that's not all.

First, using $active in the on JOIN event is not the way to go: if you join channels minimized, $active will not be the channel name from that on JOIN event. This is what $chan and # are for, you should be using those.

Second, there is another problem: $!(%chan,) will definitely not work because %chan is not the literal channel name but a variable, which needs to be evaluated inside the on JOIN event. If you let it evaluate, however, you will run into the same problem you originally had. A universal solution to this problem (apart from modifying the dll source) is something like this:

$!decode( $encode(<identifier/variable>,m) ,m)

The above will always work if the channel name comes from an identifier/variable.

So your code would look like:
Code:
on *:join:*: {
  if ($nick == $me) {
    echo -a $dll(dlls/windowfx.dll, SetPadding, $!decode( $encode($chan,m) ,m) &gt; 28 text)
  }
}
If instead of $chan you were to use a literal channel name and that name begins with "%", you should use what I said before, that is:

$!(%channelname,)

The issue is complicated, unless you have a good grasp of how things are evaluated in each processing stage. If you don't get some of the above though, the parts you must remember are the blue ones.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159268 15/09/06 09:45 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
awesome thanks mate. but lie this:

Code:
on *:DIALOG:CTB.*:init:0: {
  var %wf = dll $+(", dlls/WindowFx.dll, "), %Chan = $Mid($Dname, 5)

  ;adding images
  did -i $dname 1 1 bmpsize 16 16
  did -i $dname 1 1 setimage icon small Icons\AutoJoin.ico
  did -a $dname 1 1 $chr(9) $+ Add to auto join

  ; these work with $active but i tried to get it working with %chan variable above it messes up
  dll dlls/windowfx.dll SetPadding $($active, ) &gt; 28 list
  dll dlls/windowfx.dll SetChild $($active, ) &gt; $Dname
}


i tried this:
dll dlls/windowfx.dll SetPadding $!(%Chan, ) > 28 list
dll dlls/windowfx.dll SetChild $!(%Chan, ) > $Dname
it didnt work though frown

Re: windowfx.dll #159269 15/09/06 09:54 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
As I said, you only have to remember TWO things, the blue stuff; memorize them :tongue:

In your on DIALOG code you have a variable, %Chan, that holds the channel name, so the first blue thing must be used:

dll dlls/windowfx.dll SetPadding $!decode( $encode(%Chan,m) ,m)

This will work always, regardless of what chars the name contains.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159270 15/09/06 10:09 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
but that will only work on 6.2 right?

i keep getting decode locked error

-
* Identifier locked in options dialog: $decode
-

hmm

Last edited by pouncer; 15/09/06 10:14 PM.
Re: windowfx.dll #159271 15/09/06 10:29 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
No, it will work in any version. You just need to unlock $decode() from mIRC Options (Other -> Lock).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159272 15/09/06 10:36 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
ok i just tried it,

dll dlls/windowfx.dll SetPadding $!Decode($Encode(%Chan,m) ,m) > 28 list
dll dlls/windowfx.dll SetChild $!Decode($Encode(%Chan,m) ,m) > $Dname

it messes up even with that :|

only $($Active, ) seems to work for me

Re: windowfx.dll #159273 15/09/06 10:39 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You're not being careful, the inner $encode() must not touch anything else (you have it touching $decode's opening bracket). Use it *exactly* as I wrote it.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159274 15/09/06 10:42 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Quote:
You're not being careful, the inner $encode() must not touch anything else (you have it touching $decode's opening bracket). Use it *exactly* as I wrote it.


ahhh awesome thanks. why the space then? and also ive no idea what the encode/decode is doing lol but works fine thanks.

Re: windowfx.dll #159275 15/09/06 10:57 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
hey qwerty sorry dude, everytime i go on expanding this code i screw up.

what im now doing is:

var %wf = dll $+(", dlls/WindowFx.dll, "), %Chan = $Mid($Dname, 5), %Dec = $!decode( $encode(%Chan,m) ,m)

then i do:

dll dlls/windowfx.dll SetPadding %Dec > 28 list
dll dlls/windowfx.dll SetChild %Dec > $Dname

which works fine.

but on the INIT of the dialog i do this

stats %Dec

alias stats {
echo -a $$1
}

which echos $decode(

it should echo the channel :S

Re: windowfx.dll #159276 15/09/06 11:48 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
First of all, try //echo -a %Dec , just to see what %Dec contains. Looking at the result, you can see that you have to evaluate that $decode( string ,m) to get the channel name back:
Code:
alias stats {
  echo -a [color:green]$([/color]$$1[color:red]-[/color][color:green],2)[/color]
}
However, instead of evaluating %Dec (= $$1-) twice, why don't you pass %Chan to the alias?
Code:
...
stats %Chan
...
alias stats {
  echo -a $$1-
}

Last edited by qwerty; 15/09/06 11:54 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: windowfx.dll #159277 15/09/06 11:53 PM
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
oops, yeah your right.

i should pass %chan instead!!

thanks.

Page 1 of 2 1 2