mIRC Home    About    Download    Register    News    Help

Print Thread
#141943 14/02/06 05:31 AM
Joined: Dec 2002
Posts: 94
K
krunch Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Dec 2002
Posts: 94
using the edit box, is there a quick way of making text scroll back and forth automaticly?

Last edited by krunch; 14/02/06 06:26 AM.

Lets get dirty
#141944 14/02/06 05:32 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You'll have to use a timer and 'hard spaces' ($chr(160) / $chr(255))

#141945 14/02/06 06:01 AM
Joined: Dec 2002
Posts: 94
K
krunch Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Dec 2002
Posts: 94
i understand what you mean, but i can scroll it one way but not the other


Lets get dirty
#141946 14/02/06 09:51 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You mean you want it to scroll to the left as well? If so you can use the same logic but use $mid(text,N) (so you effectively remove the first character each time the timer executes.)

#141947 14/02/06 06:35 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I dont know about a "quick way"
but you can try this
Code:
alias rescroll dialog -m rescroll rescroll
dialog rescroll {
  title "Reversing Scroll Sample"
  size -1 -1 100 50
  option dbu
  edit "", 100, 5 5 90 15
  button "Start", 900, 24 25 25 15
  button "Stop", 901, 51 25 25 15 
  button "", 999, 0 0 0 0, cancel
}
on *:dialog:rescroll:init:0:{
  set %rescroll.text ....................This string of text.
  set %rescroll.control left
  set %rescroll.count 1
  .timerrescroll.left 0 1 moveleft
}
on *:dialog:rescroll:sclick:900:{
  if (%rescroll.count > 10) {
    .timerrescroll.left 0 1 moveleft
  }
  if (%rescroll.count <= 9) {
    .timerrescroll.right 0 1 moveright
  }

}
on *:dialog:rescroll:sclick:901:{
  .timerrescroll* off
}
on *:dialog:rescroll:sclick:999:{
  .timerrescroll* off
  unset %rescroll*
}
alias moveleft {
  if (%rescroll.count > 39) { 
    .timerrescroll.left off
    .timerrescroll.right 0 1 moveright
  }
  did -ra rescroll 100 $mid(%rescroll.text,%rescroll.count,40)
  inc %rescroll.count
}
alias moveright {
  if (%rescroll.count <= 1) { 
    .timerrescroll.right off
    .timerrescroll.left 0 1 moveleft
  }
  did -ra rescroll 100 $mid(%rescroll.text,%rescroll.count,40)
  dec %rescroll.count
}

#141948 14/02/06 10:42 PM
Joined: Dec 2002
Posts: 94
K
krunch Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Dec 2002
Posts: 94
cheers mate,
that code woks well
witch a little tweking for my script


Lets get dirty

Link Copied to Clipboard