Away script v1.5

By Jonesy44 on Jan 23, 2009

Realised i didn't have one, so i made one.

Version 1.5
Command is /aw [awaymsg] to open the dialog. any additions or bugs? post.

Screenshot
Image

image (not mandatory, but looks nicer)
Image
Save the image to your mircdirectory [//run $mircdir]

menu * {
  Away Manager:aw
}
alias aw { dialog $iif($dialog(xaway),-v,-m)) xaway xaway | if ($1 && !$away) { did -ra xaway 301 $1- } | halt }
dialog xaway {
  size -1 -1 443 75
  option pixels
  title Away $+([,$iif($away,Away for $duration($awaytime),Online),])

  ; -- REMOVE THE COMMENT ";" FROM THE NEXT LINE IF YOU HAVE THE IMAGE
  ; -- IF YOU DON'T, LEAVE THE COMMENT, OR DELETE THIS BLOCK
  ;icon 1, 0 35 443 40, bottom.png, noborder actual
  ; -- ##############
  ; -- ##############

  button "Online", 101, 10 43 100 25
  button "Away", 102, 115 43 100 25
  button "Close", 103, 333 43 100 25
  button "Set new message styles", 104, 10 43 205 25
  button ">>", 105, 300 43 30 25

  text "Away message", 201, 10 12 80 20
  text "Away msg style", 202, 10 83 80 20
  text "Message method", 203, 10 105 80 30
  text "Return msg style", 204, 10 178 85 20

  edit $awaymsg, 301, 93 10 340 20, autohs
  edit %away.msgstyle, 302, 93 81 340 20, autohs
  radio "/say", 303, 93 103 50 20, group
  radio "/me", 304, 93 123 50 20
  edit %away.rmsgstyle, 305, 93 175 340 20, autohs
  radio "Active channel each server", 306, 150 103 150 20, group
  radio "All channels each server", 307, 150 123 150 20

  check "Notice users who say my name", 308, 10 150 170 20
  check "| one time response", 309, 179 150 110 20, left

  text Bold: [b] $+ $crlf $+ Underline: [u] $+ $crlf $+ Color: [k] $+ $crlf $+ Awaymsg: [m] $+ $crlf $+ (return) Awaytime: [t], 1001, 298 103 130 70, right
}
on *:dialog:xaway:init:*: { away.u | .timeraway 0 1 away.u | did -c $dname $iif(%away.msgsetting == me,304,303) | did -h $dname 104 | did -f $dname 301 | did -c $dname $iif(%away.serversetting == 1,306,307)
  if (%away.notice) { did -c $dname 308 }
  else { did -b $dname 309 }
  if (%away.notice.once) { did -c $dname 309 }
}
on *:dialog:xaway:close:*: { .timeraway* off }
on *:dialog:xaway:edit:*: {
  if ($did == 302 || $did == 305) { 
    if ($did(302) != %away.msgstyle || $did(305) != %away.rmsgstyle) { did -v $dname 104 | did -h $dname 101,102 }
    else { did -h $dname 104 | did -v $dname 101,102 }
  }
}
on *:dialog:xaway:sclick:*: {
  if ($did == 101) {
    did -b $dname 101,102
    var %x = 1
    while (%x <= $scon(0)) {
      scid $scon(%x)
      $+(away,%away.msgsetting) $replace(%away.rmsgstyle,[b],,[u],,[k],,[m],$iif($awaymsg,$v1,n/a),[t],$duration($awaytime))
      away
      inc %x
    }
    .remove away.temp
  }
  elseif ($did == 102) { 
    did -b $dname 101,102
    var %x = 1
    while (%x <= $scon(0)) {
      scid $scon(%x)
      $+(away,%away.msgsetting) $replace(%away.msgstyle,[b],,[u],,[k],,[m],$iif($did(301),$v1,n/a))
      away $iif($did(301),$v1,n/a)
      inc %x
    }
  }
  if ($did == 103) { dialog -x $dname | .timeraway* off | halt }
  elseif ($did == 104) { set %away.msgstyle $did(302) | set %away.rmsgstyle $did(305) | did -h $dname 104 | did -v $dname 101,102 }
  elseif ($did == 105) { 
    if ($did(105) == >>) { dialog -s $dname -1 -1 443 200  | did -ra $dname 105 << }
    else { dialog -s $dname -1 -1 443 75 | did -ra $dname 105 >> }
  }
  elseif ($did == 303) { set %away.msgsetting say }
  elseif ($did == 304) { set %away.msgsetting me }
  elseif ($did == 306) { set %away.serversetting 1 }
  elseif ($did == 307) { set %away.serversetting 2 }
  elseif ($did == 308) { 
    if (!$did(308).state) { did -b $dname 309 | set %away.notice 0 }
    else { did -e $dname 309 | set %away.notice 1 }
  }
  elseif ($did == 309) {
    if ($did(309).state) { set %away.notice.once 1 }
    else { set %away.notice.once 0 }
  }
  away.u
}
alias away.u {
  did $iif(!$away,-b,-e) xaway 101
  did $iif($away,-b,-e) xaway 102,301
  dialog -t xaway Away $+([,$iif($away,Away for $duration($awaytime),Online),])
}
alias awayme { $iif(%away.serversetting == 2,ame,describe $active) $1- }
alias awaysay { $iif(%away.serversetting == 2,amsg,msg $active) $1- }
on *:text:*:#: {
  if ($me isin $1- && %away.notice && $away) {
    if (%away.notice.once) {
      if (!$read(away.temp,s,$nick)) { notice $nick I am currently away. Reason: $qt($awaymsg) $+ . I have been away for $duration($awaytime) (one time response) | write away.temp $nick $+([,$time,]) $1- }
      halt
    }
    else { notice $nick I am currently away. Reason: $qt($awaymsg) $+ . I have been away for $duration($awaytime) | write away.temp $nick $+([,$time,]) $1- }
  }
}
on *:connect: { 
  scid $scon(1)
  var %a = $awaymsg
  if ($away) { scid -r | away $iif(%a,$v1,n/a) }
}

Comments

Sign in to comment.
fahadmehar   -  Oct 26, 2018

It is not auto away...

 Respond  
Slyvar   -  Apr 29, 2011

Hey Jonesy, It's nice Script I like it. but if you could add something like Adding Auto Away Function of course you should add on and off for it, also something like for each Server and Room, Like You can only enable the Script on one Server and specific room or active room. if you got what I mean :D

Thank you.

Rated : 7 / 10
Liked Button : Clicked

 Respond  
Jonesy44   -  Apr 16, 2010

I've edited the script so you opt-in to add the icon.. Not sure why i didn't do this in the first place, would have solved a lot of confusion. Just do what napa said, or overwrite the old script with this new one. J

 Respond  
napa182   -  Apr 16, 2010

Meow comment out the line with a ; or delete it
line is

 icon 1, 0 35 443 40, bottom.png, noborder actual
 Respond  
Meow   -  Apr 15, 2010
  • /dialog: 'xaway' error loading icon 'bottom.png' (line 4, Away Script)

...

 Respond  
Jonesy44   -  Mar 28, 2010

lol

 Respond  
PuNkTuReD   -  Mar 26, 2010

@Warriorii
the answer to your problem is in the comment above your own.

 Respond  
Warriorii   -  Mar 26, 2010

when I tried to set away i got this...* /dialog: 'xaway' error loading icon 'bottom.png' (line 4, AwaySystem.mrc)

 Respond  
Jonesy44   -  Jul 30, 2009

Comment out line 5 with a ";" :)

 Respond  
sk68   -  Jul 30, 2009
  • /dialog: 'xaway' error loading icon 'bottom.png' (line 5, away.mrc)

any help? =[

 Respond  
Jonesy44   -  Jul 01, 2009

No worries, what server are you on? I'll come chat to you there instead?

 Respond  
Etalyx   -  Jul 01, 2009

Well I tried it again today and now it is something different altogether. What was wrong before was I was not entering a message style. Now that I have, however, the buttons gray as they should and the status informs me when I am marked as away and online, however my away message is not displayed in the channels I am in. I copied your text in the screenshots verbatim. There are no errors in the status window O.o
Thanks for the prompt reply.

 Respond  
Jonesy44   -  Jul 01, 2009

Hmm are you recieving any errors? Check your status window. This script has been known to be buggy unfortunately because of the nature of different servers giving different results. If you can tell me any errors etc or any extra info i should be able to help you fix it.

 Respond  
Etalyx   -  Jul 01, 2009

Looks nifty but each time I press "Away" after entering my message, the button dims and then lights back up. The "online" button remains grayed, indicating that I never actually go away. No mssg in the room, either. Any help?

 Respond  
Jonesy44   -  Mar 28, 2009

What MaxEvans said. Alternatively, you could comment out the line (ignore that line, so the image doens't show) by prefixing a ";" at the beginning of the line

 Respond  
MaxEvans   -  Mar 28, 2009

That's easy to fix, just save the image he has up in the introduction. That's what I did.

Right below where it says "image (not mandatory, but looks nicer)" below the line, right click, click save as. Save as bottom.png in the mIRC directory.

 Respond  
Hellogoodbye   -  Mar 28, 2009

All im getting is :

* /dialog: 'xaway' error loading icon 'bottom.png' (line 6, script59.ini)

And i don't want to play with it, my IRC skills aren't quite here yet

 Respond  
Jonesy44   -  Mar 28, 2009

That's my fault, sorry. The images is in a different directory on my computer.

Either;
1: remove the "appdata/" part on line 6 so line 6 should show;

icon 1, 0 35 443 40, bottom.png, noborder actual

2: copy&paste the entire update

Sorry abuot that.

 Respond  
AzzA   -  Mar 28, 2009

hmm when i try to click away manager i get:

  • /dialog: 'xaway' error loading icon 'appdata/bottom.png' (line 6, script2.ini)

i put the image and named it correctly and all that :S

 Respond  
Jonesy44   -  Mar 27, 2009

xXLifelessxLoren__x: what server/channel? I might be able to help you there. it may be a conflict with another script.

MaxEvans: I'm sure i could, just when i get a chance. I usually hate that so i didn't add it :L

 Respond  
MaxEvans   -  Mar 27, 2009

I love this next to the one I was using. Only thing is, can you add an option to change the nick to Yournick[AFK]?

 Respond  
xXLifelessxLoren__x   -  Mar 27, 2009

Maybez I just fail
/me goes to have Q.Q time
lol

 Respond  
Jonesy44   -  Mar 27, 2009

It works fine for me.. :/

 Respond  
xXLifelessxLoren__x   -  Mar 27, 2009
  • /dialog: 'xaway' no such table (line 6, script44)

eh? .-.

 Respond  
Jonesy44   -  Jan 25, 2009

ty :]

 Respond  
Aucun50   -  Jan 25, 2009

/me changes rating to 9/10 for updates that rox

 Respond  
Jonesy44   -  Jan 25, 2009

Updated fix to stop setting back on one server without setting back on otheers :)
Updated with optional away message entry into the /away command
Updated when you press return in the dialog it sets away

 Respond  
Jonesy44   -  Jan 25, 2009

Updated with the NNS bug fix.
Updated with an on connect, if you're set to away. it wil auto set away on the new server.

 Respond  
Spanky   -  Jan 24, 2009

/me coughs works good dont forget for the nns users

 menu * {
  Away Manager:a
}
alias a { dialog $iif($dialog(xaway),-v,-m)) xaway xaway } 

should be

 menu * {
  Away Manager:am
}
alias am { dialog $iif($dialog(xaway),-v,-m)) xaway xaway } 

;P

 Respond  
Jonesy44   -  Jan 24, 2009

lol, the 1/10 lost me a bit sorry :(

 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.