mIRC Home    About    Download    Register    News    Help

Print Thread
#152595 03/07/06 11:05 AM
Joined: Jul 2006
Posts: 7
S
sbsb Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2006
Posts: 7
Code:
 
on *:INPUT:*: { if ($readini($mircini,text,commandchar) == $left($1,1)) { return } | if ($inpaste) && (5 < $cb(0)) && ($active ischan) { writecb | playcb | halt } }
alias writecb {
  var %a = 2, %b = $cb(0)
  while (%a <= %b) {
    write clipboard.tmp $cb(%a)
    inc %a
  }
}
alias playcb {
  var %delay = 3000 | set %pastechan $active
  .play clipboard.tmp %delay
  echo $color(info2) -t %pastechan * Pasting $calc($play($active).lines +1) lines to $active with %delay $+ ms delay
  msg $active $cb(1)
}
on *:PLAYEND: { if ($gettok($filename,-1,$asc(\)) == clipboard.tmp) { echo $color(info2) -t %pastechan * Pasting finished | .remove clipboard.tmp | unset %pastechan } }
 


My problem is when I copy something into a channel nothing happens, but when i remove (5 < $cb(0)) from the code I get this:

[13:03:11] <nick> mytext
* /play: unable to open '...' (line ..., ....ini)
[13:03:11] <nick> mytext
* /play: unable to open '...' (line ..., ....ini)
[13:03:11] <nick> mytext
* /play: unable to open '...' (line ..., ....ini)
[13:03:11] <nick> mytext
* /play: unable to open '...' (line ..., ....ini)
[13:03:11] <nick> mytext
* /play: unable to open '...' (line ..., ....ini)
[13:03:11] <nick> mytext
* /play: unable to open '...' (line ..., ....ini)

So what's wrong with my script?

#152596 03/07/06 11:03 PM
Joined: Dec 2005
Posts: 58
S
Babel fish
Offline
Babel fish
S
Joined: Dec 2005
Posts: 58
replace clipboard.tmp with $shortfn(clipboard.tmp) smirk


i like that
#152597 04/07/06 07:24 AM
Joined: Jul 2006
Posts: 7
S
sbsb Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2006
Posts: 7
Quote:
replace clipboard.tmp with $shortfn(clipboard.tmp) smirk


that changes nothing

#152598 04/07/06 04:49 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I retract my last statement; this may be of some help regarding $cb

https://forums.mirc.com/showthreaded.php?Cat=0&Number=133958&page=&vc=1

I came accross this problem just simply echoing the $cb(0) value.

Last edited by KingTomato; 04/07/06 04:59 PM.

-KingTomato
#152599 04/07/06 06:00 PM
Joined: Jul 2006
Posts: 7
S
sbsb Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2006
Posts: 7
Quote:
I retract my last statement; this may be of some help regarding $cb

https://forums.mirc.com/showthreaded.php?Cat=0&Number=133958&page=&vc=1

I came accross this problem just simply echoing the $cb(0) value.



thanks that thread helped me a lot! laugh


Link Copied to Clipboard