Jagie Posted August 10, 2009 Report Share Posted August 10, 2009 Would it be possible, so if you idle over 10 minutes after 11PM on mIRC, it will change your nickname, and send /amsg to everyone. I want this, because i occasionally leave mIRC open, and forget to change, and let people know im gone, so it would be good, that it does it automatically Thanks <3 Link to comment Share on other sites More sharing options...
Haggis Posted August 10, 2009 Report Share Posted August 10, 2009 u can make mirc check the time and see is it matches 23:00 or whatever format you want i am not sure how to check idle time but one of the other guys will know easy enough to do after that i would think Link to comment Share on other sites More sharing options...
Haggis Posted August 10, 2009 Report Share Posted August 10, 2009 this is not perfect yet but if you do /timer 0 60 whois yournick and have this in remotes raw 317:*:{ set %idle $3 if (%idle > 600) { /away idle } haltdef } raw 311:*:{ haltdef } raw 312:*:{ haltdef } raw 378:*:{ haltdef } raw 307:*:{ haltdef } raw 318:*:{ haltdef } raw 301:*:{ haltdef } this will after being away for 10 mins set you away but will continue to do it every 60 secs as i said not perfect but all time i got just now Link to comment Share on other sites More sharing options...
err0r Posted August 10, 2009 Report Share Posted August 10, 2009 this is a quick throw together.. ( untested but should work ) alias checkidle { ;Just start a timer to checkidle every once in awhile ;3600 equals 1 hour 23 equals 11pm and 8 equals 8 am ;The below code will activate durning the hours of 11 pm to 8 am if you are idle more than an hour if ($idle > 3600) && ($gettok($time,1,58) >= 23) && ($gettok($time,1,58) < 8) { if (%sleeptime != on) { <do nickchange and amsg here> | set -e %sleeptime on } } } either add a manual unset %sleeptime | change nick on return or use $idle again Link to comment Share on other sites More sharing options...
Haggis Posted August 10, 2009 Report Share Posted August 10, 2009 see i knew there would be an easier way to do it lol at leat i tried Link to comment Share on other sites More sharing options...
err0r Posted August 10, 2009 Report Share Posted August 10, 2009 that's the kewl thing about all of this.. there are always lots of ways to do the same thing. Link to comment Share on other sites More sharing options...
Haggis Posted August 10, 2009 Report Share Posted August 10, 2009 yeah very true i never knew about $idle and have never looked at gettok maybe you could write a wee tutorial Link to comment Share on other sites More sharing options...
err0r Posted August 10, 2009 Report Share Posted August 10, 2009 $gettok and all the tok's are extremely useful. in my above example using $time $time returns something like 11:15:36 but i only need the 11 in my example using gettok i can get just the 11 $gettok($time,1,44) 44 is simply the chr number for : ie $chr(44) so the gettok is looking for 1 ( the first instance of something before the first : if i did $gettok(this is a test heh,4,32) it would be test as test is the 4th token in the string using 32 (space) as the separator You can also get a string $gettok(this is a test heh,2-4,32) would return is a test and $gettok(this is a test heh,2-,32) would return is a test heh all the tok's are very useful and are pretty well explained in the mirc help file Link to comment Share on other sites More sharing options...
Rift Posted August 10, 2009 Report Share Posted August 10, 2009 i also like gettok for dynamic arrays such as keep-alive socket sessions that are read into a variable using sockread, it's great for organizing and managing your data, on *:sockread:sockname: { var %var sockread %var tokenize 32 %var if ($1 == PING) { echo -a Server: $1- } } that bit of code sets a variable (var) reads the data into the variable (var) then 'tokenizes' %var and would use chr(32) , a space, as a delimiter. then you can use $gettok(%var,1,32) to return the first value and even better since it's seperated by spaces depending on where your using the code you can use $1 $2 etc.... identifiers on your tokenized string. tokens are greate:) especially mixed with regex imo Link to comment Share on other sites More sharing options...
Haggis Posted August 11, 2009 Report Share Posted August 11, 2009 err0r see this line if ($idle > 3600) && ($gettok($time,1,58) < 23) && ($gettok($time,1,58) > 8) { is that not saying if $gettok($time,1,58) is lees than 23 and $gettok($time,1,58) is greater than 8 shoud it not be other way around Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now