Jump to content

Auto-idle/nick


Jagie

Recommended Posts

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

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

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

$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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...