1st snippet so go easy on me :D
any suggestions would be nice
alias away { if (!%away) {
if ($1 == $null) {
set %away Away }
else { set %away $1- }
gamsg 14I am now away10! 14Reason: 10 $+ %away
set %awaytime $ctime
scon -at1 !away %away }
elseif (%away) {
echo -a 2>10>7Error10<2< 14You are allready 10Away }
}
alias back { if (%away) { gbmsg 14I am now back from: 10 $+ %away 14- I was away for 10 $+ $duration($calc($ctime - %awaytime))
unset %away
unset %pm.*
scon -at1 !away }
elseif (!%away) {
echo -a 2>10>7Error10<2< 14You are not 10Away }
}
alias brb { if (!%away) {
if ($1 == $null) {
set %away Brb }
else { set %away $1- }
gbrbmsg 14Be right back from: 10 $+ %away
set %awaytime $ctime
scon -at1 !away %away }
elseif (%away) {
echo -a 2>10>7Error10<2< 14You are allready 10Away }
}
on *:TEXT:*:?:{
if (%away) && (!%pm. [ $+ [ $nick ] ]) {
set %pm. $+ $nick $true
msg $nick 2>10>7Away10<2< 14I am currently 10away14, I have been away for 10 $duration($calc($ctime - %awaytime)) 14, leave me a message and i will reply when i get back - 2(one time response to private message)
}
}
on *:NOTICE:*:?:{
if (%away) && (!%pm. [ $+ [ $nick ] ]) {
set %pm. $+ $nick $true
notice $nick 2>10>7Away10<2< 14I am currently 10away14, I have been away for 10 $duration($calc($ctime - %awaytime)) 14, leave me a message and i will reply when i get back - 2(one time response to notice)
}
}
on $*:text:$($+(/,$me,|,$mnick,/iS)):#:{
if (%away) && (!%pm. [ $+ [ $nick ] ]) {
set %pm. $+ $nick $true | notice $nick 2>10>7Away10<2< 14I am currently 10away14, I have been away for 10 $duration($calc($ctime - %awaytime)) 14, leave me a message and i will reply when i get back - 2(one time response to highlight)
}
}
alias gamsg scon -at1 /amsg 2>10>7Away10<2< $$1-
alias gbmsg scon -atl /amsg 2>10>7Back10<2< $$1-
alias gbrbmsg scon -atl /amsg 2>10>7Brb10<2< $$1-
on *:INPUT:*:{
.timeraway 0 1200 autoaway
}
alias autoaway {
if (!%away) {
away auto away after 20 mins idle
}
}
on *:CONNECT:{ if (%away) {
!away %away
}
}
alias quit {
if ($1 == $null) {
amsg 2>10>7AMSG10<2< 14bye
!quit Going offline, memo me and ill get back to you }
else {
amsg 2>10>7AMSG10<2< 14 $+ $1-
!quit Going offline, memo me and ill get back to you
}
}
if anyone got something to add on to block the msgs to certain chans on certain netws would be nice The only way to do this, is to loop through the channels that you are on and then check if the channel (via the loop) is one you want to send the message to or not.
For an idea on how to do this, check my Common Channel Message snippet http://www.hawkee.com/snippet/2746/
if (!%away) && (!%pm. [ $+ [ $nick ] ]) {
That's saying "if (%away == $null && %pm. [ $+ [ $nick ] ] != $null)"
You only use ! to negate it.
if (%away) --> if (%away != $null) --> "if %away has a value"
if (!%away) --> if (%away == $null) --> "if %away doesn't have a value (or zero)"
So you shouldn't have the ! in checking %away
kk script edited to use !%away (didnt know about that one ty) and taken out pipes (good point about debugging / editing)
yes it does presume that if you are away on one network, then you are away on all networks.
that is because normally im either active irc (all networks i use) or not active on all networks, of course if you wanted to make it individual networks you can just remove all the the scon -at1 from the script :D
if anyone got something to add on to block the msgs to certain chans on certain netws would be nice as i havent done while loops yet and dont have the time (at the moment) to try some out.
Personally I hate codes that use pipes | to separate commands when braces work.
This is due to the fact that a line with (for example) 5 commands on one line separated with pipes will show that one line if there's a problem with any of the 5 commands.
Using braces allows each command to be put on a different line, therefore only giving the line of the command that's not working in an error message.
Makes codes, imo, easier to debug, fix, and/or alter.
Also noted that this presumes that if you are away on one network, then you are away on all networks.