DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd September 2010
guitarscn guitarscn is offline
Package Pilot
 
Join Date: Oct 2008
Posts: 166
Default How to make delays between multiple commands in an alias (ircII)

Okay so I have an alias that looks like this:

Code:
ALIAS gscn {
MSG gscn Test1
MSG gscn Test2
MSG gscn Test3
MSG gscn Test4
MSG gscn Test5
}
How do I make it wait 5 seconds between each command before it executes the next one after that in order from top to bottom? I tried the TIMER command like this:

Code:
ALIAS gscn {
MSG gscn Test1
TIMER 5 MSG gscn Test2
TIMER 5 MSG gscn Test3
TIMER 5 MSG gscn Test4
TIMER 5 MSG gscn Test5
}
But all it does is wait 5 seconds after the first MSG, then send the rest of the MSGs instantly all at once like it usually does.
Reply With Quote
  #2   (View Single Post)  
Old 22nd September 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by guitarscn View Post
How do I make it wait 5 seconds between each command before it executes the next...
Look at the manpage for sleep(1).
Reply With Quote
  #3   (View Single Post)  
Old 23rd September 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

While I have never gotten into scripting ircII (I do use it :-P) and I assume that ocicat was thinking you meant shell scripting when he referenced the commands manual page, he is however almost correct.

Code:
SLEEP:
Usage: SLEEP <number of seconds>
  This suspends IRCII for the number of seconds given.  NOTHING happens
  during this time.  This is really only useful for automatons.
  Maybe not even then. Try the TIMER command instead.

See Also:
  TIMER
===========================================================================
TIMER:
Usage: TIMER [-refnum <num>] [-delete <num>] <seconds> [<command>]
  Waits for the given number of seconds and then executes the
  command.  This is done without hindering normal operation of
  the client.  Any number of TIMERs can be set at once, and
  all will activate at the appropriate time.
    TIMER with arguments will list pending TIMERs.
    TIMER -refnum <num>
  will assign a specific number to that action allowing you
  to delete it later if necessary with
    TIMER -delete <num>
  If no refnum is specified, one is automatically assigned.
===========================================================================
I believe that timer is what you actually need, but I never learned the scripting facilities for ircII, so I can't be much help
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #4   (View Single Post)  
Old 23rd September 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by TerryP View Post
...I assume that ocicat was thinking you meant shell scripting when he referenced the commands manual page
Correct, I had assumed this ultimately was a scripting question. My bad.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't load any scripts in ircII guitarscn General software and network 4 22nd November 2010 12:06 AM
Mozilla delays Firefox 3.6.4 J65nko News 0 2nd June 2010 08:08 PM
Changing MAC address to an alias interface? DNAeon FreeBSD General 6 20th January 2009 04:48 PM
Mounting NAS as apache alias directory Yuka FreeBSD General 7 18th July 2008 02:58 PM
ip alias confusion hamba FreeBSD General 2 5th June 2008 10:23 AM


All times are GMT. The time now is 06:49 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick