|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
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)
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
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.
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Feb 2006
Posts: 164
Vogon poet
|
Vogon poet
Joined: Feb 2006
Posts: 164 |
That would be %#test as in the channel name, as it's an msn chat clone.
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
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?
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2005
Posts: 827 |
thanls for the reply. still getting: E_INVALID_WINDOW 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.
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2005
Posts: 827 |
ok this code isnt working
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?
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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: on *:join:*: {
if ($nick == $me) {
echo -a $dll(dlls/windowfx.dll, SetPadding, $!decode( $encode($chan,m) ,m) > 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
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2005
Posts: 827 |
awesome thanks mate. but lie this:
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, ) > 28 list
dll dlls/windowfx.dll SetChild $($active, ) > $Dname
}
i tried this: dll dlls/windowfx.dll SetPadding $!(%Chan, ) > 28 list dll dlls/windowfx.dll SetChild $!(%Chan, ) > $Dname it didnt work though
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
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.
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
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
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2005
Posts: 827 |
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.
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
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
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
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: 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? ...
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
|
|
|
|
Joined: Oct 2005
Posts: 827
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2005
Posts: 827 |
oops, yeah your right.
i should pass %chan instead!!
thanks.
|
|
|
|
|