ok, ive got a problem with the $get() identifier in some of my treeview switchbar.. the problem is descibed after the code i currently use
ctcp *:dcc send *:?:{
unset %dcc.get
var %n = 1
while ($get(%n)) {
set %dcc.get $addtok(%dcc.get,$ifmatch,32)
inc %n
}
[color:red];This sets another var and starts another timer that checks to see if the
;send has started (ie. been accepted)[/color]
set %dcc.acc $true
[color:red];switchbar reload [/color]
.timer -m 1 1 load.switchbar
.timerdcc.acc 0 1 dcc.acc
}
[color:red];The above makes a variable that contains the nick of the send
;(yeah i know it wont work with more then 1 sender)[/color]
alias dcc.acc {
if (!%dcc.acc) { .timerdcc.acc off | halt }
elseif ($get(0) >= 1) {
var %n = 1
while ($get(%n)) {
if ($get(%n).rcvd > 1) {
.timer -m 1 1 load.switchbar
unset %dcc.acc
}
inc %n
}
}
elseif ($send(0) >= 1) {
var %x = 1
while ($send(%x)) {
if ($send(%x).sent > 1) {
.timer -m 1 1 load.switchbar
unset %dcc.acc
}
inc %x
}
}
}
[color:red];The above is the alias that checks if the sends/gets have been accepted and
;have started to send the file[/color]
alias dcc.canc {
if ($get(0) < $numtok(%dcc.get,32)) { .timer -m 1 1 load.switchbar | .timerdcc.canc off }
else { .timerdcc.canc off | halt }
}
[color:red];Above checks the %dcc.get variable and trys to match the amount of open dcc
;get windows with the amount that was accepted, if
;less than the var, it updates the switchbar. (the else i added in hope for a miracle so dont
;bother about it unless u figure its important)[/color]
on *:getfail:*:{
.timer -m 1 1 load.switchbar
.timerdcc.canc 0 1 dcc.canc
echo -a Failed to receive $nopath($filename) from $nick ( $+ $_comchan($nick) $+ )
}
[color:red];Starts the timer that starts the alias that checks for any closed windows[/color]
so the problem, nothing gets added to the %dcc.get variable, it seems fairly simple but ive tried to place the set at different lines inside the { } but still no reaction.
i tried to make an alias that was run istead of the /set.. but that didnt work aswell, and i tried replaceing the $ifmatch with $get(0),
and it returned 0 in the variable
The wierd thing is that it works perfectly in the switchbar which updates almost instantly (the timer is on 1ms), all the info appears (sender, file, size, status) but nothing in the variable!
This is the code used in the switchbar:
var %x = 1
while (%x <= $get(0)) {
did -a switchbar 1 +e 3 3 0 $iif($len($get(%x).file) > 20,$wrap($left($get(%x).file,20),arial,12,95,0,1) $&
$+ ...,$get(%x).file)) $+( ,File: $get(%x).file $cr $+ Sender: $get(%x) $&
$cr $+ Size: $bytes($get(%x).size,m) $+ Mb $cr $+ Com. channels: $_comchan($get(%x)) $&
$cr $+ Status: $get(%x).status )
inc %x
}
So i dont know if i need to re-evaluate the $ifmatch or the $get(0) nor do i know why or if i need a completely different code for it all to happen!
For me this is a big problem, dunno if it is for anyone else, but i REALLY would like help with a solution for it, or WHY it wouldnt work