mIRC Home    About    Download    Register    News    Help

Print Thread
#197226 31/03/08 05:50 PM
Joined: Sep 2007
Posts: 109
K
kwell Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
There are ways to schedule a timer for continuous playback of photos ...

I have a list with 5 photos

photo-1.jpg
photo-2.jpg
photo-3.jpg
photo-4.jpg
photo-5.jpg

What I want to achieve is to show each with a time interval, $while is very fast, there are ways to retard

kwell #197233 31/03/08 07:11 PM
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
You can always include a timer inside the while loop and also use a variable for the timer's delay, which increases with the while loop.
Something along the lines of:
Code:
var %a = 5
while (something) {
  .timer 1 %a command here
  inc %a 5
}

This will result in a 5 second delay between the execution of each command in the while loop.

kwell #197256 31/03/08 10:36 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

If the list of files is stored in a file you could use the /play command.

kwell #197257 31/03/08 10:44 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Or, you can just use an alias that calls a timer that calls that alias...

Code:
alias PicDisplay {
  [display command for picture]
  inc %filenumber
  if (%filenumber > %total_files) { unset %filenumber | halt }
  .timer 1 10 PicDisplay photo- $+ %filenumber $+ .jpg
}


Note that you have to set up the total files variable manually or have it check total files in a folder or whatever. All pictures would have to be named the same way that you showed without any missing numbers. If numbers are missing, you'll want to have it verify the file exists prior to the timer. Change the "10" to the interval you're looking for. Throw in your display commands and you should be fine. If you want it to loop rather than just go through one time, change the /unset and /halt to just /set %filenumber 1 and it will start from the beginning again.

As a note, I put the timer command using $+ just to make it easy to understand, but you can shorten it to:

Code:
  .timer 1 10 PicDisplay $+(photo-, %filenumber ,.jpg)


EDIT: An alternative method if you don't care about the order and nothing else is in the folder except the images, you can use $findfile() and $rand to randomly get a file.

Last edited by Riamus2; 31/03/08 10:47 PM.

Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard