Go easy on me I'm new to scripting and this is one of my first full scripts.
This is an away system that is able to be personalized without editing the lines of the script at all.
--Has an auto-away on idle that you can set how many minutes it waits before setting you as away
--Allows you to make an AWAY nick, and an ONLINE nick, and it automatically switches between the two as you go from away to online or vice versa.
--Allows you to create up to 5 unofficial nicknames (ie: apoc instead of apoc137), when you are away if anyone says these it will message you and tell you who, what time, and what line was said.
--Tells everyone when you come back, why you were gone, and how long you were gone
--If anyone says your online nick, your away nick, or any of yoru unofficial nicks, it will send them a notice explaining that you are away, why you're gone, and how long. It also has a flood limit so it only sends them a notice one time every 30 minutes they say you're name.
Please tell me of any suggestions, problems, etc I am enjoying this quite a bit and would like to improve it.
To start, load it and type /p00fsetup to personalize the settigns for you!
/p00fhelp displays the help system
EDIT: Regarding the issue that was seen as this:
Nick|a{gone} No such nick/channel
Fixed this issue :)
Edit2: Added a right click thing. Right click in the channel to see the commands listed, much more convenient!
//***----_Apoc's Away System "p00f"_----***
//type /p00fhelp for a list of commands and instructions!
//First type /p00fsetup, it will get your system set up!
//For help, suggestions, and everything in between use following:
//IRC: Apoc137 or Mudkipz137 in #mudkipz
//MSN: apocalypse137@hotmail.com
//Yahoo: apocalypse_seer
on *:CONNECT: {
if (%p00fruncount != 1) {
set %p00fruncount 1
//echo 4,1Thank you for loading Apoc's p00f System, the best and a more complicated away system than any decent human being could possibly desire!!!!
//echo 8,1This system will not function until you run the setup.
//echo 8,1Do this by typing 7/p00fsetup 8and follow the instructions!
}
elseif ((%p00fnick != $null) && (%afktimerswitch == on)) {
timer 0 %afktimer idlecheck
set %lastword on
}
}
menu channel {
Away
.Set Away :/p00f $?:"Please say why you're leaving!"
.Set Online :/f00p
.Setup
..Idle Off :/afktimer off
..Idle On :/afktimer on
..Idle Time :/afktimer $?:"How many minutes before you automatically get set as away?"
..Away Nick :/awaynick $?:"What would you like your nick to be while you're away?"
..Online Nick :/onlinenick $?:"What would you like your nick to be while you're online?"
..Other Nicks :/othernick $?:"What would you like to be an unofficial nickname?"
}
on *:INPUT:*: {
set %lastword off
if (%idle1 == on) {
f00p
//echo 15,1You're idle away has ended since you're now here!
set %idle1 off
}
}
alias idlecheck {
if ((%lastword == on) && (%afktimerswitch == on)) {
p00f Auto-Away after being idle for like 30 minutes or so
//echo 14,1You are now set as away due to being idle for 30 minutes!
set %idle1 on
set %lastword on
}
}
alias p00fhelp {
//echo |
//echo 11,1Apoc's p00f System Help:
//echo |
//echo 9,1Right Click a Channel to see the functions without needing commands!
//echo |
//echo 11,2Commands:
//echo 8,1/p00fsetup 9-- Sets the p00f system up so it will work! Just follow the instructions it gives you!
//echo 8,1/p00f [Reason for being away] 9--Sets you as away!
//echo 8,1/f00p 9-- Returns from being 4away 9and tells everyone that you're back.
//echo 8,1/afktimer on 9--Turns the auto-away system on (default 30 minutes)
//echo 8,1/afktimer off 9--Turns the auto-away system off
//echo 8,1/afktimer [Number of Minutes] 9--Sets the number of minutes for the auto away system to any number you want.
//echo 8,1/awaynick [nick] 9--Sets your AWAY nick
//echo 8,1/onlinenick [nick] 9--Sets your ONLINE nick
//echo |
}
alias p00finfo {
//echo 4,1***----_9Apoc's Away System "p00f"4_----***
//echo --type /p00fhelp for a list of commands and instructions!
//echo --First type /p00fsetup, it will get your system set up!
//echo --For help, suggestions, and everything in between use following:
//echo --IRC: Apoc137 or Mudkipz137 in #mudkipz on Cyanide-x.net
//echo --MSN: apocalypse137@hotmail.com
//echo --Yahoo: apocalypse_seer
}
alias p00fsetup {
//echo |
//echo 15,1Welcome to Apoc's p00f system, follow these few steps to set up your new away system!
//echo 9,1Please set what your 4AWAY nickname will be by typing 7/awaynick [Desired Away Nick]
//echo |
}
alias awaynick {
set %p00fnick $1
//echo |
//echo 9,1Your 4p00f 9nick has been set as 7 %p00fnick $+ 9, if this is wrong type 4/p00fsetup 9again to fix it!
//echo 11,2Please set what your 4ONLINE nickname will be by typing 7/onlinenick [Desired ONLINE Nick]
//echo |
set %p00fnickonlineswitch on
}
alias onlinenick {
set %p00fnickonline $1
set %nextnick 1
//echo 9,1Your 4online 9nick has been set as 7 %p00fnickonline $+ 9, if this is wrong type 4/p00fsetup 9again to fix it!
//echo |
//echo 7,1--Now it's time to set up what unofficial nicknames you wish to alert you (shortened versions of your nick people use).
//echo 7,1--Use the command 4/othernick [insert nick here] 7for up to 5 nicknames that will alert you when they are said and you're away.
//echo 7,1--When you're done setting up nicks, use the command 4/stopnicks
//echo |
}
alias othernick {
if (%nextnick == 1) {
set %othernick1 $1
set %nextnick 2
//echo |
//echo 8,1Stored 7 $1 8as your first unofficial nickname!
//echo 8,1Use 4/othernick [insert nick here] 8to store up to 4 more unofficial nicks //echo 8,1If you are done storing nicks, type 4/stopnicks !
//echo 8,1If you are done storing nicks, type 4/stopnicks !
//echo |
}
elseif (%nextnick == 2) {
set %othernick2 $1
set %nextnick 3
//echo |
//echo 8,1Stored 7 $1 8as your second unofficial nickname!
//echo 8,1Use 4/othernick [insert nick here] 8to store up to 3 more unofficial nicks!
//echo 8,1If you are done storing nicks, type 4/stopnicks !
//echo |
}
elseif (%nextnick == 3) {
set %othernick3 $1
set %nextnick 4
//echo |
//echo 8,1Stored 7 $1 8as your third unofficial nickname!
//echo 8,1Use 4/othernick [insert nick here] 8to store up to 2 more unofficial nicks!
//echo 8,1If you are done storing nicks, type 4/stopnicks !
//echo |
}
elseif (%nextnick == 4) {
set %othernick4 $1
set %nextnick 5
//echo |
//echo 8,1Stored 7 $1 8as your fourth unofficial nickname!
//echo 8,1Use 4/othernick [insert nick here] 8to store up to 1 more unofficial nicks!
//echo 8,1If you are done storing nicks, type 4/stopnicks !
//echo |
}
elseif (%nextnick == 5) {
set %othernick5 $1
set %nextnick 1
//echo |
//echo 8,1Stored 7 $1 8as your Fifth and LAST unofficial nickname!
//echo 8,1You can store no more nicks, if you wish to change the ones you have saved, type 4/p00fsetup 8and restart the setup process!
stopnicks
}
}
alias stopnicks {
set %nextnick 1
//echo |
//echo 15,1Thanks for registering your unofficial nicks!
//echo 9,1You're done installing 7Apoc's p00f System!
//echo 9,1Type 4/p00fhelp 9for a list of commands and instructions
//echo 9,1Type 4/p00f 9to start being AWAY (good chance to get a life maybe?)
//echo |
}
alias afktimer {
if ($1 == on) {
set %afktimerswitch on
//echo 15,1You have set the auto-away on idle to on! The default idle time is 4 30 15minutes, to change this type 7/afktimer [Minutes] . 15To turn it off type 7/afktimer off
}
elseif ($1 == off) {
set %afktimerswitch off
//echo 15,1You have set the auto-away on idle to off! To turn it on type 7/afktimer on
}
elseif ($1 > 30) {
set %afktimerswitch on
set %afkcount $1
set %afktimer $calc(%afkcount * 60)
set %afktimer1 $1
//echo 15,1You're auto idle time has been set to %afktimer1 minutes. If you would like to change this, type 7/afktimer [number of minutes]
}
elseif ($1 < 30) {
//echo 15,1Sorry, the auto-away system minimum number of minutes is 30.
}
}
alias p00f {
if ((%p00fnick == $null) && (%%p00fnickonline == $null) && (%p00fnick == $null)) {
//echo |
//echo 7,1Sorry, you haven't set up an away nick, please do this by typing 4/p00fsetup
//echo |
}
elseif (%p00fnick != $null) {
nick %p00fnick
set %p00fswitch on
set %p00ftime $ctime
set %p00freason $1-
//echo |
//echo 9,1You are now 4AWAY 9when you return type 8/f00p and your status will return to online! 7Reason: %p00freason
//echo |
if (%p00fedcount == $null) {
set %p00fedcount 1
}
elseif (%p00fedcount > 0) {
set %p00fedcount $calc(%p00fedcount + 1)
}
}
}
alias f00p {
if (%p00fswitch == on) {
nick %p00fnickonline
set %p00fswitch off
amsg I'm no longer away! Reason Gone: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
unset -s %p00ftime
unset -s %p00freason
msg $me You can read the beeps people did on you while you were away by reading these messages!
}
elseif (%p00fswitch == off) {
//echo |
//echo 4,1You're not away dope.
//echo |
}
}
alias p00fstats {
//echo 7,1You've p00fed %p00fedcount times!
}
on *:text:*:#: {
if ($me isin $1-) {
if (%p00fswitch == on) {
if (%p00falert [ $+ [ $nick ] ] != off) {
notice $nick Sorry, $nick $+ , I'm currently away! Check back in 30 minutes by typing my name! Reason: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
set %p00falert [ $+ [ $nick ] ] off
timer 1 1800 unset %p00falert [ $+ [ $nick ] ]
msg $me 4,1 $nick just beeped you with the following line:9 $ctime 7 $1-
}
}
}
elseif (%p00fnickonline isin $1-) {
if (%p00fswitch == on) {
if (%p00falert [ $+ [ $nick ] ] != off) {
notice $nick Sorry, $nick $+ , I'm currently away! Check back in 30 minutes by typing my name! Reason: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
set %p00falert [ $+ [ $nick ] ] off
timer 1 1800 unset %p00falert [ $+ [ $nick ] ]
msg $me 4,1 $nick just beeped you with the following line:9 $ctime 7 $1-
}
}
}
elseif (%othernick1 isin $1-) {
if (%p00fswitch == on) {
if (%p00falert [ $+ [ $nick ] ] != off) {
notice $nick Sorry, $nick $+ , I'm currently away! Check back in 30 minutes by typing my name! Reason: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
set %p00falert [ $+ [ $nick ] ] off
timer 1 1800 unset %p00falert [ $+ [ $nick ] ]
msg $me 4,1 $nick just beeped you with the following line:9 $ctime 7 $1-
}
}
}
elseif (%othernick2 isin $1-) {
if (%p00fswitch == on) {
if (%p00falert [ $+ [ $nick ] ] != off) {
notice $nick Sorry, $nick $+ , I'm currently away! Check back in 30 minutes by typing my name! Reason: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
set %p00falert [ $+ [ $nick ] ] off
timer 1 1800 unset %p00falert [ $+ [ $nick ] ]
msg $me 4,1 $nick just beeped you with the following line:9 $ctime 7 $1-
}
}
}
elseif (%othernick3 isin $1-) {
if (%p00fswitch == on) {
if (%p00falert [ $+ [ $nick ] ] != off) {
notice $nick Sorry, $nick $+ , I'm currently away! Check back in 30 minutes by typing my name! Reason: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
set %p00falert [ $+ [ $nick ] ] off
timer 1 1800 unset %p00falert [ $+ [ $nick ] ]
msg $me 4,1 $nick just beeped you with the following line:9 $ctime 7 $1-
}
}
}
elseif (%othernick4 isin $1-) {
if (%p00fswitch == on) {
if (%p00falert [ $+ [ $nick ] ] != off) {
notice $nick Sorry, $nick $+ , I'm currently away! Check back in 30 minutes by typing my name! Reason: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
set %p00falert [ $+ [ $nick ] ] off
timer 1 1800 unset %p00falert [ $+ [ $nick ] ]
msg $me 4,1 $nick just beeped you with the following line:9 $ctime 7 $1-
}
}
}
elseif (%othernick5 isin $1-) {
if (%p00fswitch == on) {
if (%p00falert [ $+ [ $nick ] ] != off) {
notice $nick Sorry, $nick $+ , I'm currently away! Check back in 30 minutes by typing my name! Reason: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
set %p00falert [ $+ [ $nick ] ] off
timer 1 1800 unset %p00falert [ $+ [ $nick ] ]
msg $me 4,1 $nick just beeped you with the following line:9 $ctime 7 $1-
}
}
}
}
yeah dialogs are a whole new window.
to learn dialogs. look at these two
Thank you for the suggestion pwnisher, sorry this is my first time posting anything on this website so I'm still learning.
Just so I am aware, a dialog box is something like when you right click and see a list of available commands (so you don't have to memorize a command).
If this is the case, I just threw this in there.
These are commands I put in the menu so far:
/p00f
/f00p
/afktimer off
/afktimer on
/afktimer [set minutes]
Works when I tested it, maybe it's not the cleanest if anyone understands how to make this better lemme know I'll do my best.
I know what the error is, sorry about that. Here's what happened.
I set it to message yourself because then it opens a query window so you can read your messages and they're all in one spot and not spread throughout the channel like //echo's.
Here's an updated segment (Btw I fixed this in the script above so just copy paste again it'll work)
alias f00p {
if (%p00fswitch == on) {
nick %p00fnickonline
set %p00fswitch off
amsg I'm no longer away! Reason Gone: %p00freason $+ . Time Away: $replace($duration($calc($ctime - %p00ftime)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s)
unset -s %p00ftime
unset -s %p00freason
//echo 7,1You can read the beeps people did on you while you were away by reading these messages!
I am trying to tihnk of a way to make the messages get saved as variables, and when you return have it relay them all back to you (or allow you to use a command to retrieve them) however I am still trying to figure this out so give me some time.
Thank you for the compliments though! I'll fix any further issues
EDIT: pwnisher if you do end up creating a dialog please provide me with a copy, I'm still learning and that'd really help me. I'll research it a bit after I figure out the beep issue!