Away Script v1.1

By Conscious on Feb 18, 2011

Commands:
(the same as normal /away commands - type in mIRC /help /away)

/away [message]

Leaves a message indicating that you are currently not paying attention to IRC. When someone sends you a message, they will automatically see your away message. Using /AWAY with no message marks you as no longer being away and removes your previous message.
example: /away Off to get something to eat, back in a moment.

/amsg's a notify you being away/no longer away...

Current Version: 1.1
Working on at the moment:
-Themes

Open to suggestions.

Older Versions:
-1.0 - A few bugs.

/*
Away script written by Conscious (Aka Onions).
Version 1.1
Check for updates at http://www.hawkee.com/snippet/8420/
Created: 19/02/2011
Updated: 20/02/2011
*/
on *:INPUT:#:{
  if (($1- == /away) || ($1- == //away)) && ($ctrlenter == $false) && ($away == $true) {
    haltdef
    var %a = $awaytime $awaymsg
    away
    a.me.none %a
  }
}
raw 306:*:{
  a.me.new
}
on *:TEXT:*:#:{
  if ($away) {
    if ($me isin $strip($1-)) {
      if (!%away.ping) { 
        describe $chan $themereturn($chan,1) $+ is away for the reason: $themereturn($chan,2) $+ $awaymsg $+ $themereturn($chan,1) - gone for $themereturn($chan,2) $+ $duration($awaytime)
        set -u300 %away.ping $nick
      }
    }
  }
}
alias a.me.new {
  var %chans $chan(0)
  var %chans1 1
  while (%chans1 <= %chans) {
    describe $chan(%chans1) $themereturn($chan(%chans1),1)) $+ is now away for the reason: $themereturn($chan(%chans1),2)) $+ $awaymsg
    inc %chans1
  }
}
alias a.me.none {
  var %chans $chan(0)
  var %chans1 1
  while (%chans1 <= %chans) {
    describe $chan(%chans1) $themereturn($chan(%chans1),1)) $+ is back from $themereturn($chan(%chans1),2)) $+ $2- $+ $themereturn($chan(%chans1),1)) - gone for $themereturn($chan(%chans1),2)) $+ $duration($1)
    inc %chans1
  }
}
alias themereturn {
  if (!$read(a.methemes.txt, sn, $1)) {
    if ($2 == 1) return 3
    elseif ($2 == 2) return 11
    elseif ($2 == 3) return 12
  }
  elseif ($read(a.methemes.txt, sn, $1 == 1)) {
    return $null
  }
}
menu Channel { 
  $iif($read(a.methemes.txt, sn, $active),$style(1)) Block away script colours in $active $+ : write $iif($read(a.methemes.txt, sn, $active),-ds $+ $active) a.methemes.txt $iif(!$read(a.methemes.txt, sn, $active),$active 1)
}

Comments

Sign in to comment.
Stewie1k94   -  May 02, 2011

good script i use it but i had 1 error with it one it never showed the reason then min later never showed anything so i unloaded the script then loaded it again then it worked but aprt from that i like the script

 Respond  
Conscious   -  Feb 20, 2011

Found the error..

 Respond  
Conscious   -  Feb 20, 2011

No it is working for the acutal away, apart from one person.

The unsetting away is faulting, any clue why?

 Respond  
joelp54   -  Feb 19, 2011

From what i can tell your not actually setting yourself to mode /away your only telling people that your away.

 Respond  
Conscious   -  Feb 19, 2011

I was talking to someone on IRC saying this was not working for them, I tried for about an hour to find the problem, we are using the exact same script, I can't see it :s
Any pointers?

[21:45] * %Chaddeh 3is now away for the reason:

Doesn't say the message, and that's the only bit that works..
:s

Edit: On further investigation, it's stopping them becoming actually /away. (eg. $away = $false, etc).

Any clue why?

 Respond  
Conscious   -  Feb 19, 2011

Okay, I understand your suggestion, and figure it'd work, but how would I tie that over the already existing /away command?

 Respond  
Jethro   -  Feb 18, 2011

Just a suggestion. You can use an alias rather than an input event.

 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.