Simple !afk & back

By Walkman on Jun 28, 2011

This is my first script & just a simple script.
!afk
!back

Image

on *:TEXT:*!afk*:#:{
  if ($nick) {
    /set %reason $2- | /amsg 9 $nick is away 
    /amsg 4Reason: 4 $+ %reason $+ 9,0 | set %away.time $ctime | enable #away | set %away on
 }
on *:TEXT:*!back*:#:{
  if ( $nick) {
    /amsg 7 $nick Is back from 4Reason: $+ %reason $+ 9
    /amsg 9 He was away for $duration($calc($ctime - %away.time)) $+ 6. | unset %reason | disable #away | unset %away.time | unset %away on
  }

Comments

Sign in to comment.
baloe12nl   -  Jun 13, 2012

@Dany

delet the 4 and use Ctrl+k then typ a 4

/amsg $nick Is back from Reasen: 4 $+ %reason.
 Respond  
baloe12nl   -  Jun 08, 2012
on *:TEXT:!afk*:#: {
  if ( $nick isin %qq. [ $+ [ $nick ] ] ) {
    /notice $nick $nick $+ ? Je staat al afgemeld. reden: 4 $+ %reason. [ $+ [ $nick ] ] $+
    /notice $nick Voor een tijd van: 4  $duration($calc($ctime - %away.time. [ $+ [ $nick ] ] ) ) $+
    /notice $nick Als je weer terug bent $nick $+ , Meld je dan weer aan met: 4 !back 
 }
  else ( $nick ) {
    /set %reason. [ $+ [ $nick ] ] $2- | /amsg 4 $nick is FF weg 
    /amsg reden: 4 $+ %reason. [ $+ [ $nick ] ] $+ 9,0 | set %away.time. [ $+ [ $nick ] ] $ctime | enable #away | set %away. [ $+ [ $nick ] ] on | set %qq. [ $+ [ $nick ] ] $nick 
  }
}

on *:TEXT:!back*:#: {
  if ($nick isin %qq. [ $+ [ $nick ] ] ) {
    /amsg $nick Is terug van, Reden: 4 $+ %reason. [ $+ [ $nick ] ]  $+ 
    /amsg Hij was weg voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $nick ] ] ) ) $+ 6. | unset %reason. [ $+ [ $nick ] ] | disable #away | unset %away.time. [ $+ [ $nick ] ] | unset %away. [ $+ [ $nick ] ] | unset %qq. [ $+ [ $nick ] ] $nick
  }
}
On *:TEXT:*:#: {
  if ( $1 isin %qq. [ $+ [ $1 ] ] ) {
    /msg # $1 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $1 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $1 ] ] $+ 
  }
  if ( $2 isin %qq. [ $+ [ $2 ] ] ) {
    /msg # $2 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $2 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $2 ] ] $+
  }
  if ( $3 isin %qq. [ $+ [ $3 ] ] ) {
    /msg # $3 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $3 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $3 ] ] $+
  }
  if ( $4 isin %qq. [ $+ [ $4 ] ] ) {
    /msg # $4 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $4 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $4 ] ] $+
  }
  if ( $5 isin %qq. [ $+ [ $5 ] ] ) {
    /msg # $5 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $5 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $5 ] ] $+
  }
  if ( $6 isin %qq. [ $+ [ $6 ] ] ) {
    /msg # $6 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $6 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $6 ] ] $+
  }
  if ( $7 isin %qq. [ $+ [ $7 ] ] ) {
    /msg # $7 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $7 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $7 ] ] $+
  }
  if ( $8 isin %qq. [ $+ [ $8 ] ] ) {
    /msg # $8 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $8 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $8 ] ] $+
  }
  if ( $9 isin %qq. [ $+ [ $9 ] ] ) {
    /msg # $9 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $9 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $9 ] ] $+
  }
  if ( $10 isin %qq. [ $+ [ $10 ] ] ) {
    /msg # $10 is afwezig voor een tijd van:4  $duration($calc($ctime - %away.time. [ $+ [ $10 ] ] ) ) $+
    /msg # Reden:  4 $+ %reason. [ $+ [ $10 ] ] $+
  }
  else goto ww
  :ww
}

A adation to the code. This is my first try to adet a code. credit to the origenal code maker

 Respond  
Dany   -  May 23, 2012

[00:15] <~Dany> !afk testin
[00:15] <~Hi> Dany is away
[00:15] <~Hi> Reason: testin
[00:15] <~Dany> !back
[00:15] <~Hi> Dany Is back from Reason:4
[00:15] <~Hi> He was away for 2secs.

see the "reason" on the 5th line its showing "4" ?????????????

 Respond  
Snip3KitTy   -  Jul 01, 2011

i prefer to just have my own personal afk script rather than a bot script

 Respond  
GrimReaper   -  Jun 28, 2011

If you have just %reason for everyone that uses the script, It will over-write the previous reason set by the previous user.. I would suggest using something like

set $+(%reason.,$nick) $2-

Same with %away.time But that's just my opinion.

 Respond  
xbox_gamer1   -  Jun 28, 2011
on *:TEXT:!afk *:#:{
  set %reason $2- | /amsg 9 $nick is away 
  /amsg 4Reason: 4 $+ %reason $+ 9,0 | set %away.time $ctime | enable #away | set %away on
}
on *:TEXT:!back *:#:{
  if ( $nick) {
    /amsg 7 $nick Is back from 4Reason: $+ %reason $+ 9
    /amsg 9 He was away for $duration($calc($ctime - %away.time)) $+ 6. | unset %reason | disable #away | unset %away.time | unset %away on
  }
}

work on your coding

 Respond  
napa182   -  Jun 28, 2011

This seems like it was ripped out of something larger. I am not saying you ripped this from someone it is just you have things missing. you have it enabling a group but you don't use it as well you are missing brackets. Just seems odd with the use of wildcards for the triggers.
the use of amsg can get you banned from some servers.

It would be better to place this under one text event instead of 2, but what ever to each their own.

 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.