mIRC Home    About    Download    Register    News    Help

Print Thread
Create a auto timed message #169565 25/01/07 11:38 AM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Hi there folks.

How would i go about creating a auto timed channel message for when i am idling ?

Any help appreciated smile


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: BritishGent] #169566 25/01/07 11:44 AM
Joined: May 2005
Posts: 449
bwr30060 Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Code:
timer 0 30 {
if ($idle) {
msg #channel I am idle
}
}


*Untested, and I just woke up, but I think it should work.

Re: Create a auto timed message [Re: bwr30060] #169567 25/01/07 12:58 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Thanks for assistance but that doesn't seem to work when loaded into remotes. frown


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: bwr30060] #169568 25/01/07 03:27 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
alias idlemsg {
  .timeridlemsg 0 30 if ($idle > 60) { msg #channel I am idle. }
}


Put that into remotes and type /idlemsg. It will only display the message if you have been idle for at least a minute (60 seconds). To change that, change the 60. The 30 is the time between each message in seconds. You can change that as well.


Invision Support
#Invision on irc.irchighway.net
Re: Create a auto timed message [Re: Riamus2] #169624 26/01/07 11:58 AM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Thank you very much for your help.

This is what i have compiled:

Code:
alias idlemsg {
  .timeridlemsg 0 3600 if ($idle > 300) { msg #Simons-Forums 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg 0 3600 if ($idle > 1200) { msg #Simons-Forums 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg 0 3600 if ($idle > 2400) { msg #Simons-Forums 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) }
  .timeridlemsg 0 3600 if ($idle > 3600) { msg #Simons-Forums 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) }
}


I now have it working to 1 channel, how would i make it so it displays in any open channel, is it $active as opposed to #channel ?

Last edited by BritishGent; 26/01/07 02:04 PM.

Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: BritishGent] #169631 26/01/07 02:18 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You'd have to loop each one through all of the open channels. So you'd need to run each one through an alias that does that.

For one network connection, that's pretty easy:

Code:
alias idlemsg {
  .timeridlemsg1 0 3600 if ($idle > 300) { MsgChans 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg2 0 3600 if ($idle > 1200) { MsgChans 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg3 0 3600 if ($idle > 2400) { MsgChans 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) }
  .timeridlemsg4 0 3600 if ($idle > 3600) { MsgChans 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) }
}

alias MsgChans {
  var %cnt = 1
  while (%cnt <= $chan(0)) {
    msg $chan(%cnt) $1-
    inc %cnt
  }
}


For multiple connections, you'd need to use /scon. Since I'm not that good at using it (I don't ever need it for my own scripts), I'll leave it for someone else to show how to loop through multiple networks with it.

Of course, the simple way for it to work in multiple networks would be to call the idle alias on all networks. You'd just need to remove the timer names or else tack on the network/server name to the timer name because you can't have 2 timers running with the same name.


Invision Support
#Invision on irc.irchighway.net
Re: Create a auto timed message [Re: BritishGent] #169633 26/01/07 02:22 PM
Joined: Dec 2006
Posts: 80
Scripto Offline
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
If you use $active, it will attempt to msg to whatever window is currently active. If youre not sitting right there changing active windows, then it just msg's whatever window you walked away leaving active... channel, query, whatever. If that window is your status window, it will try to message it there... which will just give an raw error, 'status' no such nickname, or something like that, as you would be trying to msg 'Status Window' instead of #channelname.

If you want it to msg to all channels, use /amsg.

Code:
alias idlemsg {
  .timeridlemsg 0 300 if ($idle > 300) { amsg 3I am currently joing the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
}

 




Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Re: Create a auto timed message [Re: Scripto] #169634 26/01/07 02:23 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Lol! I completely forgot /amsg blush

The timer names still need to be changed the way I showed, though.


Invision Support
#Invision on irc.irchighway.net
Re: Create a auto timed message [Re: Scripto] #169636 26/01/07 02:25 PM
Joined: Dec 2006
Posts: 80
Scripto Offline
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
For multiple server, use: scid -a amsg whatever text you want to send.


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
Re: Create a auto timed message [Re: Riamus2] #169669 26/01/07 08:56 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Originally Posted By: Riamus2
You'd have to loop each one through all of the open channels. So you'd need to run each one through an alias that does that.

For one network connection, that's pretty easy:

Code:
alias idlemsg {
  .timeridlemsg1 0 3600 if ($idle > 300) { MsgChans 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg2 0 3600 if ($idle > 1200) { MsgChans 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg3 0 3600 if ($idle > 2400) { MsgChans 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) }
  .timeridlemsg4 0 3600 if ($idle > 3600) { MsgChans 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) }
}

alias MsgChans {
  var %cnt = 1
  while (%cnt <= $chan(0)) {
    msg $chan(%cnt) $1-
    inc %cnt
  }
}


For multiple connections, you'd need to use /scon. Since I'm not that good at using it (I don't ever need it for my own scripts), I'll leave it for someone else to show how to loop through multiple networks with it.

Of course, the simple way for it to work in multiple networks would be to call the idle alias on all networks. You'd just need to remove the timer names or else tack on the network/server name to the timer name because you can't have 2 timers running with the same name.


RE: your last.

This is what i have thanks to your last post, i did what i thought was correct:

Code:
alias idlemsg {
  .timeridlemsg1 0 3600 if ($idle > 300) { amsg 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg2 0 3600 if ($idle > 1200) { amsg 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  .timeridlemsg3 0 3600 if ($idle > 2400) { amsg 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) }
  .timeridlemsg4 0 3600 if ($idle > 3600) { amsg 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) }
}

alias amsg {
  var %cnt = 1
  while (%cnt <= $chan(0)) {
    amsg $chan(%cnt) $1-
    inc %cnt
  }
}


But this is what i get:

Code:
[19:29] <04^Silent_Runner^> 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :)
[19:41] <04^Silent_Runner^> #Simons-Forums 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :)
[19:41] <04^Silent_Runner^> #Simons-Forums 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :)
[19:41] <04^Silent_Runner^> #Simons-Forums 3I am still an Idle Chat User! 7 Give up saying my name! 5Please leave me a message! :)
[19:43] <03+CHIEFY> Hello ^Silent_Runner^
[19:44] <03+CHIEFY> are playing with your script again m8???
[19:46] <03+CHIEFY> !afk having a bath
[19:46] <04@^Merlin> CHIEFY is away @07:46 Jan 26 2007
[20:15] * +CHIEFY (Me@4B6027ED.497BE68A.15E9BA6D.IP) Quit (Quit: When they finish making styro-foam what do they package it in?)
[20:29] <04^Silent_Runner^> 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :)
[20:41] <04^Silent_Runner^> #Simons-Forums 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :)
[20:41] <04^Silent_Runner^> #Simons-Forums 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :)
[20:41] <04^Silent_Runner^> #Simons-Forums 3I am still an Idle Chat User! 7 Give up saying my name! 5Please leave me a message! :)
[20:41] <04^Silent_Runner^> #Simons-Forums 3I've been an Idle Chat User for an hour now! 7 Give up saying my name! 5Please leave me a message! :)


Where am i going wrong ?


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: BritishGent] #169672 26/01/07 09:04 PM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
How about:

Code:
alias idlemsg {
  if ($idle > 3600) { .timeridlemsg4 0 3600 amsg 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) | halt }
  if ($idle > 2400) { .timeridlemsg3 0 3600 amsg 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) | halt }
  if ($idle > 1200) { .timeridlemsg2 0 3600 amsg 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) | halt }
  if ($idle > 300) { .timeridlemsg1 0 3600 amsg 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) | halt }
}


This way you dont auto fire off than one even if there's more than one statement that's true


Those who fail history are doomed to repeat it
Re: Create a auto timed message [Re: landonsandor] #169689 26/01/07 10:32 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Get rid of the amsg alias as you don't need it. /amsg is a command already.

Use what landonsandor gave you, but change the 2nd to 4th IF's to ELSEIF's rather than halting it:

Code:
alias idlemsg {
  if ($idle > 3600) { .timeridlemsg4 0 3600 amsg 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 2400) { .timeridlemsg3 0 3600 amsg 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 1200) { .timeridlemsg2 0 3600 amsg 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  elseif ($idle > 300) { .timeridlemsg1 0 3600 amsg 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
}


Invision Support
#Invision on irc.irchighway.net
Re: Create a auto timed message [Re: Riamus2] #169694 26/01/07 10:40 PM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
ah yes, I dont know why I keep forgetting or ELSEIF *shrugs* No biggie, thanks for the correction


Those who fail history are doomed to repeat it
Re: Create a auto timed message [Re: Riamus2] #169729 27/01/07 11:11 AM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Originally Posted By: Riamus2
Get rid of the amsg alias as you don't need it. /amsg is a command already.

Use what landonsandor gave you, but change the 2nd to 4th IF's to ELSEIF's rather than halting it:

Code:
alias idlemsg {
  if ($idle > 3600) { .timeridlemsg4 0 3600 amsg 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 2400) { .timeridlemsg3 0 3600 amsg 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 1200) { .timeridlemsg2 0 3600 amsg 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  elseif ($idle > 300) { .timeridlemsg1 0 3600 amsg 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
}


I now have this above format but nothing is happening on periods of idling.


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: BritishGent] #169750 27/01/07 07:08 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Hm.. I should have read the rewrite that landonsandor did a bit more. Here you go:

Code:
alias idlemsg {
  .timeridlemsg 0 3600 SendIdle
}

alias SendIdle {
  if ($idle > 3600) { amsg 3I've been an Idle Chat User for an hour now! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 2400) { amsg 3I am still an Idle Chat User! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 1200) { amsg 3I have joined the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
  elseif ($idle > 300) { amsg 3I am currently joining the ranks of being an Idle Chat User! 7 Say my name if you need me. :) }
}


Invision Support
#Invision on irc.irchighway.net
Re: Create a auto timed message [Re: Riamus2] #169751 27/01/07 07:10 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Thank you, i'll give that a try, does it just go into remotes as before and do i need to type /idlemsg as before ?


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: BritishGent] #169757 27/01/07 07:20 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Type /idlemsg to start it (everything there would go into Remotes). If you want it to start automatically when you start mIRC, change the first line of the idlemsg alias to an on START event:

on *:start: {

instead of:

alias idlemsg {

Just remember that it won't start automatically when you write that in... you'd have to restart mIRC to get it to start.


Invision Support
#Invision on irc.irchighway.net
Re: Create a auto timed message [Re: Riamus2] #169758 27/01/07 07:22 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
thank you so much for your help smile


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: Riamus2] #169769 27/01/07 07:55 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
So sorry for being a pain, but i still seem to be unable to get it to work.

I have tried with the :

alias idlemsg {

and

on*:start: {

commands and have even altered the order of messages but it still does not work, i have tried it on 3 seperate scripts, restarting all upon loading and nothing happens.

this is as i have it now:

Code:
on *:start: {
  .timeridlemsg 0 3600 SendIdle
}

alias SendIdle {
  if ($idle > 300) { amsg 3I am currently joining the ranks of being an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Say my name if you need me. :) }
  elseif ($idle > 1200) { amsg 3I have joined the ranks of being an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Say my name if you need me. :) }
  elseif ($idle > 2400) { amsg 3I am still an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 3600) { amsg 3I'm an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Give up saying my name!  5Please leave me a message! :) }
}


i did try it with the 4 messages reversed as you posted but it didn't work then either.

frown


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: Create a auto timed message [Re: BritishGent] #169773 27/01/07 08:16 PM
Joined: Dec 2006
Posts: 80
Scripto Offline
Babel fish
Offline
Babel fish
Joined: Dec 2006
Posts: 80
That timer is currently set up to trigger at 1 hour after you start your script, and will trigger every hour on the hour after that point, triggering the alias 'SendIdle'

If your idle times do not exceed 300 (which is 5 minutes) then it will not do anything. And it won't check it again for 1 hour. Your number of $idle seconds must be greater than 300 on the instant of that hourly check, or nothing happens.

If you want to check 'SendIdle' more often than having to wait the full hour, then just reduce the 3600 (1hr) to say 300 which is 5 mins. Otherwise, youll just have to wait for the initial hour, and be idle for at least 5 mins, or nothing will happen.

If you wanted to start that timer without restarting the script every time, you can just paste it into your editbox, and press enter.

/timeridlemsg 0 300 SendIdle


Also the way it is written right now is incorrect, if your idle time is over 300 seconds, it will message the first line, and then the script will not execute any farther.

You will have to set this up with a different order to get it to work properly, all you will have to do is just switch the statements in reverse order from top to bottom so that it evaluates the largest time length first:

Code:
 
alias SendIdle {
  if ($idle > 3600) { amsg 3I'm an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 2400) { amsg 3I am still an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Give up saying my name!  5Please leave me a message! :) }
  elseif ($idle > 1200) { amsg 3I have joined the ranks of being an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Say my name if you need me. :) }
  elseif ($idle > 300) { amsg 3I am currently joining the ranks of being an Idle Chat User I have been idle for12 $duration($idle,3) 3! 7 Say my name if you need me. :) }
}



This way, (as landonsander, and Riamus wrote it) every length of time will be evaluted cool


Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)