Away Popup Menu

By Spoof on Dec 09, 2011

The script was made and tested on mIRC v6.35 by me and tested on mIRC v7.22 and v7.25 by my friend Lewy

Load in a new remote file. To activate right click your mouse in a channel window and find [Away Popup Menu] Now is able to block a channel from displaying your away and back msg's.

simple, yet it works... enjoy everyone :)

on ^*:notice:*:?: {
  if ($_år(åwåy.script,switch) == off) { halt }
  /beep 10 | notice $nick 4*** Automated MSG 4*** I am currently 9•4[ AWAY4 ]9• 4Reason $+ :4 %åwåy.reason $+ .
  if ($window(@åwåy.system) == $null) { /window @åwåy.system Verdana 13 }
  aline @åwåy.system 9¤ 4Away[4Notice Highlight] 9¤ 
  aline @åwåy.system $time(12(15h9:15nn TT12)) 9¤ $date(12(15mm9/15dd9/15yyyy12)) 9¤ 12(15Server12)9:15 $server
  aline @åwåy.system 12(15Nick12)9:15 $nick 
  aline @åwåy.system 12(15Message12)9: $1-
  aline @åwåy.system 9¤ 4End of notice 9¤
  .write $+($shortfn($logdir),away.log) Away Notice Highlight Log
  .write $+($shortfn($logdir),away.log) $time(h:nntt) - $date(mm/dd/yyyy) - $server
  .write $+($shortfn($logdir),away.log) Nick: $+ $nick - Message: $+ $1-
  .write $+($shortfn($logdir),away.log) -
}
on *:text:*:#: { 
  if ($_år(åwåy.script,switch) == off) || ($me !isin $1-) { halt }
  if ($ini(Awaydata\blocklist,chans($chan,2),0) >= 0) || ($readini(Awaydata\blocklist,chans,$chan)) { halt }
  /beep 10 | notice $nick 4*** Automated MSG 4*** I am currently 9•4[ AWAY4 ]9• 4Reason $+ :4 %åwåy.reason $+ .
  if ($window(@åwåy.system) == $null) { /window @åwåy.system Verdana 13 }
  aline @åwåy.system 9¤ 4Away[4Channel Highlight] 9¤ 
  aline @åwåy.system $time(12(15h9:15nn TT12)) 9¤ $date(12(15mm9/15dd9/15yyyy12)) 9¤ 12(15Server12)9:15 $server
  aline @åwåy.system 12(15Chan12)9:15 $chan
  aline @åwåy.system 12(15Nick12)9:15 $nick 
  aline @åwåy.system 12(15Message12)9: $1-
  aline @åwåy.system 9¤ 4End of notice 9¤
  .write $+($shortfn($logdir),away.log) Away Channel Highlight Log
  .write $+($shortfn($logdir),away.log) $time(h:nntt) - $date(mm/dd/yyyy) - $server
  .write $+($shortfn($logdir),away.log) $chan - Nick: $+ $nick - Message: $+ $1-
  .write $+($shortfn($logdir),away.log) -
}
alias åwåy {
  set %nick1 $me
  set %nick2 $me $+ [away]
  set %åwåy.reason $?="Enter Reason:"
  .nick %nick2
  var %i 1
  :next
  var %chan $chan(%i)
  if (%chan == $null) { goto done }
  elseif ($ini(Awaydata\blocklist,chans(%chan,2),0) >= 0) || ($readini(Awaydata\blocklist,chans,%chan)) { goto done }
  else { 
    msg %chan 4*** Automated MSG 4*** I am currently 9•4[ AWAY4 ]9• 4Reason $+ :9 %åwåy.reason $+ . 
  }
  inc %i
  goto next
  :done
}
alias båck {
  .nick %nick1
  var %i 1
  :next
  var %chan $chan(%i)
  if (%chan == $null) { goto done }
  elseif ($ini(Awaydata\blocklist,chans(%chan,2),0) >= 0) || ($readini(Awaydata\blocklist,chans,%chan)) { goto done }
  else {
    msg %chan 9•4[ Back4 ]9• 4from $+ :9 %åwåy.reason $+ . 
  }
  inc %i
  goto next
  :done 
  unset %åwåy.reason
}
;[read write Awaydata/setting.ini]
alias _år {
  if ($exists(Awaydata\setting.ini) == $false) { mkdir Awaydata | write -c Awaydata\setting.ini }
  return $readini Awaydata\setting.ini $$1 $$2 
}
alias _åw {
  if ($exists(Awaydata\setting.ini) == $false) { mkdir Awaydata | write -c Awaydata\setting.ini }
  writeini Awaydata\setting.ini $$1 $$2 $$3-
}
alias _årem {
  if ($exists(Awaydata\setting.ini) == $false) { mkdir Awaydata | write -c Awaydata\setting.ini }
  remini Awaydata\setting.ini $$1 $$2 
}
menu * {
  [Away Popup Menu]
  ..åwåy $åwåyo:_årem åwåy switch off | _åw åwåy.script switch on | åwåy
  ..båck $åwåyf:_årem åwåy switch on | _åw åwåy.script switch off | båck
  [Channels]
  ..Add Block Chan:{
    if ($exists(Awaydata\blocklist) == $false) { write -c Awaydata\blocklist }
    writeini Awaydata\blocklist chans $?="Enter Channel:" $?="Enter Channel:" | echo -a $! was added to the Away Blocked Channels list.
  }
  ..Del Block Chan:{
    if ($exists(Awaydata\blocklist) == $false) { write -c Awaydata\blocklist }
    remini -d Awaydata\blocklist chans $?="Enter Channel:" | echo -a $! was removed from Away Blocked Channels list.
  }
  ..Read Chan List:/window @Chan-Blocked-List Verdana 13 | echo @Chan-Blocked-List The following channels will be blocked from displaying an Away messages. | echo @Chan-Blocked-List [Chans] | var %chans 1 | while (%chans <= $ini(Awaydata\blocklist,chans,0)) { echo @Chan-Blocked-List $readini(Awaydata\blocklist,chans,$ini(Awaydata\blocklist,chans,%chans)) | inc %chans 1 }
}
alias -l åwåyo { 
  if ($_år(åwåy.script,switch) == on) { return [x] }
}
alias -l åwåyf { 
  if ($_år(åwåy.script,switch) == off) { return [x] }
}

Comments

Sign in to comment.
Anon_Lewy   -  Mar 17, 2012

Good Job Spoof :)

More
 Respond  
Fuzionx   -  Dec 12, 2011

That's what I told him but he changed it..

More
 Respond  
blackvenomm666   -  Dec 11, 2011
if (%åwåy.pager == OFF) { halt }
  window -De @åwåy.highlights
  echo -t @åwåy.highlights $time(hh:nntt) **** $date(mm/dd/yyyy) **** 
  echo -t @åwåy.highlights $time(hh:nntt) **** $server ****
  echo -t @åwåy.highlights $time(hh:nntt) **** $chan ****
  echo -t @åwåy.highlights $time(hh:nntt) **** Nick: $+ $nick Message: $+ $1- ****
  .msg # *** Automated MSG *** I am currently [away] reason: $+ %åwåy.reason $+ .
}

could also be done as

if (%åwåy.pager != OFF) {
  window -De @åwåy.highlights
  echo -t @åwåy.highlights $time(hh:nntt) **** $date(mm/dd/yyyy) **** 
  echo -t @åwåy.highlights $time(hh:nntt) **** $server ****
  echo -t @åwåy.highlights $time(hh:nntt) **** $chan ****
  echo -t @åwåy.highlights $time(hh:nntt) **** Nick: $+ $nick Message: $+ $1- ****
  .msg # *** Automated MSG *** I am currently [away] reason: $+ %åwåy.reason $+ .
}
}

same can be done with your on notice event

More
 Respond  
IllogicTC   -  Dec 10, 2011

Thanks for the explanation, jaytea. I assumed it had to at least kinda worked because it was working for this guy in his script, lol. I myself surround each individual condition, also. Helps minimize the "parantheses mess" when you've got a lot of embedded parantheses within the condition. However, if my IF statement is only has one line to do if $true, I don't use braces. Should I always use braces?

More
 Respond  
jaytea   -  Dec 10, 2011
Does using && and || within one paranthesis actually work? I thought you had to separate them.

it fails only in certain cases, only when used without '{', and only because of bugs in mIRC. for example:

//if (1 == 1 || 2 == 2) noop

ambiguous format. mIRC finds '1 == 1' to be true, sees '||' (OR) and attempts to short circuit part of the if statement by skipping ahead to the next relevant bit of code. it's not doing that very well, because the above is NOT really ambiguous. in fact, i'm going to go out on a limb and say that that error should not even exist because the rules governing the interpretation of if statements in mIRC are thorough enough to disambiguate every possible combination of code.

it requires rather deep knowledge of mIRC's interpreter to be able to predict the exact behaviour in all cases, but as long as you check your code carefully, and use braces, it's really just a matter of preference. i've seen a few good coders who don't use them at all. i find including them around each condition enhances readability, so i do :p

More
 Respond  
Spoof   -  Dec 10, 2011

I rewrote it... Yes I see now where I made a variable with $pager sorry... I didn't see it and am surprised I even typed it. Sorry Jethro IllogicTC sorry also. I work hard on these little scripts and the only reason I even attempt to make them is to learn something instead of letting my brain turn to mush in chat rooms from drama. The simplest script may seem unimportant to some but it is for me. and Jethro sometimes I type stuff backwards and even type out whole words and hit enter key before what I have had a chance to notice it. I get multiple things in my head and suck pretty bad at multitasking.

to napa182 thank you... Im no super human scripter nor do I have a lengthy PC experience.

I just like to share my versions compared to others Ive seen is all. I have been trying to make sure they arent buggy or showing error msgs so that users have a clean working script.

Everyone on this site is learning or they wouldnt bother with this site.

I apologize for my IRC PMS.

More
 Respond  
napa182   -  Dec 10, 2011

Jethro Wrote:

What is the purpose of using $pager when it's not an official identifier? You don't even have a custom alias to return the $pager identifier anywhere.

There are $away and $awaymsg identifiers to come in hand when making an away script, along with /tnick command to set a temporary nickname.

Brain fart? You can't possibly put the blame on it.

Spoof Wrote:

Jethro I'm perfectly aware of mirc help file triggers. I did it my way quote: Frank Sanatra ! And in regards to your useless post, opinions are like assholes... everyone has one and I don't see how showing yours in regards to this script is even helping with my code.

The point is that it works... doesn't matter what !@#$ identifiers I have used. Go troll someone else about a much worse coded script.

Harsh much? He was just asking about your $pager identifier only cause you didn't include it in your snippet. Why is everyone going the route of talking trash/flame wars? =/

anyways nice different take on this kind of snippet Keep at it..

More
 Respond  
IllogicTC   -  Dec 10, 2011

I was thinking of ss, not tt. You're correct on the $time() identifier. Although, what does TIME have to do with being American vs European? You're thinking Date.

And I have made plenty of my own. :)

More
 Respond  
Spoof   -  Dec 10, 2011

lllogicTC the time format I am using is the way I wanted it. 12:36am 12/10/2011 thats the way we show everything here in America... If youre Europian or what ever then change it the way you want it. I'm not reformating it. And I personialy dont give a flying rats ass about a popularity contest. This isnt a pissing match. I made a fucking script and posted it... If you dont like it go F O or make your own. I didnt ask you to use or anything.

More
 Respond  
IllogicTC   -  Dec 09, 2011

Does using && and || within one paranthesis actually work? I thought you had to separate them.

For example: Say I want to check if %x is greater than 3, and %y is less than 2. Your method would have me doing this:

if (%x > 3 && %y < 2)

Didn't know this works. I thought you have to separate different comparisons like so:

if (%x > 3) && (%y < 2)

And the reason Jethro asks about your identifiers is if you don't have an alias called pager to return something, it won't work. Jethro gives good advice, and it's better if you follow his advice or at least remember it for the next time rather than raging. Posting your scripts on here can either garner you praise or criticism, you'll have to learn to accept both.

Like so: You have no colon between nn and tt in the $time() identifiers? So instead of saying 09:27:33, it would say 09:2733 which would look off.

Also, without alias pager { } somewhere to return something for the ident, this script is broken. There's also no need to unset a variable just to reset it in the next line (unset %away.pager set %away.pager inthe away alias.) As for setting %nick2, you could just use a variable, or just /nick $+($me,[away]).

I understand you have pride in your work, but we're telling you these things so you can strive to make even better work.

More
 Respond  
Spoof   -  Dec 09, 2011

Jethro I'm perfectly aware of mirc help file triggers. I did it my way quote: Frank Sanatra ! And in regards to your useless post, opinions are like assholes... everyone has one and I don't see how showing yours in regards to this script is even helping with my code.

The point is that it works... doesn't matter what fucking identifiers I have used. Go troll someone else about a much worse coded script.

More
 Respond  
Jethro   -  Dec 09, 2011

What is the purpose of using $pager when it's not an official identifier? You don't even have a custom alias to return the $pager identifier anywhere.

There are $away and $awaymsg identifiers to come in hand when making an away script, along with /tnick command to set a temporary nickname.

Brain fart? You can't possibly put the blame on it.

More
 Respond  
Spoof   -  Dec 09, 2011

Fuzionx : if (%åwåy.pager != OFF && $nick != $me && $me isin %x) { %x variable would not allow the script to work. I changed it back to $1-

I don't mind when someone offers a different way of coding something out, but when you change a line of text in a script at least test it before you give out that advise. Cause changing could confuse a scripter specialy if they didn't know how to fix it.

I may have had 2 things in my script that 2 ppl didn't like, but at least it worked and had no error msg's.

More
 Respond  
Spoof   -  Dec 09, 2011

Dean that's called a scripting BRAIN FART. Sorry, happens from time to time.

Fuzionx thanks... its changed. Now to re-test the script again.

More
 Respond  
Fuzionx   -  Dec 09, 2011

Don't use goto's when they are not needed.

Try:

on ^*:notice:*:?: {
  if (%åwåy.pager != OFF) {
    window -De @pager
    echo -t @pager $time(hh:nntt) **** $date(mm/dd/yyyy) **** 
    echo -t @pager $time(hh:nntt) **** $server ****
    echo -t @pager $time(hh:nntt) **** Nick: $nick Message: $1- ****
    if (away isin $me) { 
      .notice $nick Im currently away reason: %åwåy.reason $+ , but your notice msg has been logged on my pager.
    }
  }
}

on *:text:*:#: { 
  var %x = $strip($1-)
  if (%åwåy.pager != OFF && $nick != $me && $me isin %x) {
    window -De @pager
    echo -t @pager $time(hh:nntt) **** $date(mm/dd/yyyy) **** 
    echo -t @pager $time(hh:nntt) **** $server ****
    echo -t @pager $time(hh:nntt) **** $chan ****
    echo -t @pager $time(hh:nntt) **** Nick: $nick Message: %x ****
    .msg # $nick I am currently [away] reason: %åwåy.reason $+ , but your msg has been logged on my pager.
  }
}

Why do you use $pager in the %away.reason variable. This will cause the script not to work properly..

More
 Respond  
_Dean_   -  Dec 09, 2011

what this condition is suposed to do?

if (text) $strip($1-)
More
 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.