finally, a real afk script

By bandbonjtv on Jan 30, 2013

Screenshots

IM NO EXPERT!
this is what i came up with from jsg55's script for my bot, thank you jsg55. i couldnt figure out how to get the script to read the nickname in the text to automatically trigger. ex: "where is john?" the script would then return the status for "john" like i wrote below. or how to get this lil peice of code into the script. preferably the auto trigger anywhere in text. please help if you can, so i can clean up the code im using and also learn more. thank you.

BUG: i am also having an issue with the script not displaying the time after mirc has been shutdown (ex: need to restart server, mirc crash). Is there any way to remember the time after the restart of mirc? i have a screenshot attached for what its doing.

snippet - it only works if i have it in a different file for some reason. please help me include it or make it automatically trigger upon mention of $nick in chat by any user. wether they have a status or not. if they do, then display status, if not, then display alternate generic status.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on :text:!status :#:{
if ($readini(away.ini, $2, away) == on) {
msg $chan $2 is $readini(away.ini, $2, reason) and has been gone $duration(%time [ $+ [ $2 ] ]) }
if ($readini(away.ini, $2, away) != on) {
msg $chan $2 is either Watching the show, or Silently Lurking. If they dont respond, Try harder. } }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

snippet - it only works if i have it in a different file for some reason. please help me include it or make it automatically trigger upon mention of $nick in chat by any user. wether they have a status or not. if they do, then display status, if not, then display alternate generic status.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 on *:text:!status *:#:{  
  if ($readini(away.ini, $2, away) == on) {
  msg $chan $2 is $readini(away.ini, $2, reason) and has been gone $duration(%time [ $+ [ $2 ] ]) } 
  if ($readini(away.ini, $2, away) != on) { 
msg $chan $2 is either Watching the show, or Silently Lurking. If they dont respond, Try harder. } }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

main code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on $*:text:/^(brb|bbl|afk|bbiab)\b/Si:#:awaycheck $1-
on $*:action:/^(brb|bbl|afk|bbiab)\b/Si:#:awaycheck $1-

alias -l awaycheck {
  if ($2 == $null) { writeini away.ini $nick reason lurking. }
  if ($2 != $null) { writeini away.ini $nick reason $remove($2-,$chr(36)) }
  msg # $nick is now $readini(away.ini, $nick, reason)
  writeini away.ini $nick away on | set %away [ $+ [ $nick ] ] on | set %time [ $+ [ $nick ] ]
  if ($readini(away.ini, $nick, away) == on) inc -c %time [ $+ [ $nick ] ]
}
on *:text:*:#:awaycheck2 $1-
on *:action:*:#:awaycheck2 $1-

alias -l awaycheck2 {
  if ($readini(away.ini, $nick, away) == on) { 
    msg # welcome back $nick $+ , You were gone $duration(%time [ $+ [ $nick ] ])
  remini away.ini $nick | unset %away [ $+ [ $nick ] ] on | unset %time [ $+ [ $nick ] ] }
}
}

Comments

Sign in to comment.
xplo   -  Mar 10, 2013

Oh, this is so usefull, a bot to keep my status, too bad those clients didn't came with /AWAY

 Respond  
bandbonjtv   -  Feb 02, 2013

i need help

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.