Skip to content
General IRCd

Auto-idle/nick

A TG007 community discussion started by Jagie.

Discussion 18 posts
Page 1 of 1
Open
Topic #13252 · 18 published posts · 3,715 views

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

 

Its what I do.

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

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

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

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

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

Edited Aug 11, 2009 5:23 PM by err0r

Get information about ircWx here

see i knew there would be an easier way to do it lol

 

at leat i tried

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

that's the kewl thing about all of this.. there are always lots of ways to do the same thing.

Get information about ircWx here

yeah very true

i never knew about $idle

 

and have never looked at gettok

 

maybe you could write a wee tutorial

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

$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

Edited Aug 10, 2009 8:22 PM by err0r

Get information about ircWx here

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

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

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

yeah it should

 

could also be just ($gettok($time,1,58) !isnum 9-22)

 

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) !isnum 9-22) {
      if (%sleeptime != on) { <do nickchange and amsg here> | set -e %sleeptime on }
    }
  }

Edited Aug 11, 2009 5:28 PM by err0r

Get information about ircWx here

Can someone explain to me like, what i should do, Step by step like ^^. If its possible :D thanks

 

 

 

Jagie

Its what I do.

this should work ( again untested )

 

 

on *:connect: { .timercheckidle 0 300 checkidle }
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) !isnum 9-22) {
       if (%sleeptime != on) {  /nick jagie_away | amsg Idle mode active | set -e %sleeptime on }
     }
   }
menu channel {
   $iif(%sleeptime,$style(1),$style(2)) Idleaway: { if (%sleeptime) { unset %sleeptime | /nick jagie } }
}

Edited Aug 11, 2009 9:38 PM by err0r

Get information about ircWx here

This bit starts a time that every 300 seconds (5 Mins) runs the checkidle alias

on *:connect: { .timercheckidle 0 300 checkidle }

 

The Checkidle Alias

alias checkidle {

 

If your idle time is more than 3600 seconds (1 hour) AND time is not between 9am and 10pm

if ($idle > 3600) && ($gettok($time,1,58) !isnum 9-22) {

 

if %sleeptime IS NOT on then change nickname to jagie_away and amsg "idle mode active" and set %sleeptime on

if (%sleeptime != on) {  /nick jagie_away | amsg Idle mode active | set -e %sleeptime on }

}

}[/code]

 

 

 

This put a menu in the channel menu that when clicked tells mirc you arer back unsets the %sleeptime and changes nick to jagie

menu channel {
   $iif(%sleeptime,$style(1),$style(2)) Idleaway: { if (%sleeptime) { unset %sleeptime | /nick jagie } }
}

 

 

 

 

I hope that helps

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Works great, one more code I could require to finish it off :)

 

Is their a way to get rid of all the Titlebar? Atm it has like [#chan, (server), Modes, Topic)

 

Can i not completely get rid of that. I have a script + dll, so if i do the alias /whatever "Word", it will change the whole titlebar to that word, and nothing else, but if you close mIRC and restart or hop channels it goes back to way it was.

 

Is their no way to completely rid the title bar, I dont like how long it is, and would rather have it so it only has a word or two.

 

Thanks

Its what I do.

the blue bar at the top?

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)

Erm, well, the titlebar, you know the top of the program, the bar at the top. the one after all the "file, view, tools", and it says like "mIRC blah blah blah", basically the bar where the minimize, restore, and close button is ^^ :D

Its what I do.

i took mine away

 

its in the view menu i think

Spam Honeypot - http://www.haggistech.co.uk/honey(humans do not register)