mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
Why wont this work!?!??! ->

Code:
[color:green]ctcp *:dcc send *:?:{
  unset %dcc.get
  var %n = 1 
  while ($get(%n)) {
    set %dcc.get $addtok(%dcc.get,$ifmatch,32)
    inc %n
  }
  set %dcc.acc $true 
  .timerdcc.acc 0 1 dcc.acc
}[/color]

Ive checked and rechecked and rerechecked and i cant figure it out!!!!.. confused it works at another place but with alittle edited identifiers. And there are NO unset thingies except for the one in the beginning (which works fine in another place)

ANYTHING is appreciated!! Flames/suggestions/comments on my looks etc.. anything!!
Edit:
If you need the rest of the script tell me and ill post it asap!

Last edited by toe_cutter; 09/03/03 08:10 PM.
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
What is it supposed to do? Which part of what it's supposed to do is it not doing as you expect?


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
oh, forgot smile.. tired and partly crazy..

Uhm, the while loop doesnt seem to even give a blink to whatever is happening.
Its supposed to set a variable containing the nicks of every dcc get. In the long run its an attempt on controlling which dcc windows are open when the connection is "inactive"; on a getfailure it runs a timer every second so an alias can check to see if the same amount of windows are open, if not, it updates.

Hope that helps smile
Anything else, just ask!

Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
If more than one get is from the same person, $addtok() won't add the nick again. $addtok() adds tokens only if they do not already exist in the string.

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
...In which case he'll need to use set %dcc.get %dcc.get $ifmatch

Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
Nimue:
Ok, thanks for the heads up, but while trying to get the script working i only tried to receive from one guy and the [damn] script didnt want to create (i should probably have added this in my reply to Hammer) the variable %dcc.get which i cant really figure out confused

Online:
Thx for the code, ill save it until i can get the above code working smile

Joined: Dec 2002
Posts: 77
B
Babel fish
Offline
Babel fish
B
Joined: Dec 2002
Posts: 77
or he could use $instok

Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
But why wont it work!?!?!

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
If I understand what you are trying to do, I believe you should be doing the loop inside the alias that the timer calls.

var %i = $send(0)
while %i { if ($send(%i).status == inactive) window -c $+("Send $send(%i) $send(%i).file,") | dec %i )


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Jan 2003
Posts: 38
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 38
mhm...
should probably learn to be more clear in the future...

Ill try it, even though i meant it to be $get rather then $send wink

And i see that i should probably be more clear now.
The reason for this to be done is that i cant get a trigger when i close the inactive dcc get window. why i want the trigger on that is for the reason that i want my treeview switchbar reloaded, otherwise it keeps the information it got from the last trigger (ie. the getfail).. id get a screenshot to show what i mean if there were any to send a file (everybodys away/busy).
Now, the code i have for the trigger that wont work:

Code:
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]
[color:green]  set %dcc.acc $true
  .timerdcc.acc 0 1 dcc.acc
   [color:red];switchbar reload[/color]  
  .timer -m 1 1 load.switchbar
}[/color]
[color:red];The above makes a variable that contains the nick of the send 
;(Online and Nimue: yeah i know it wont work with more then 1 sender)[/color]

[color:green]
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]
[color:red];OT: /me is listening to the last night of the proms :D
;The above is the alias that checks if the sends/gets have been accepted and
;have started to send the file[/color]

[color:green]
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]
[color:red];Starts the timer that starts the alias that checks for any closed windows, more of that below[/color]

[color:green]
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]
[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]


REMEMBER! ask questions first, shoot later! laugh

thx to those of the repliers, for their insight in this question.

Last edited by toe_cutter; 10/03/03 09:01 PM.

Link Copied to Clipboard