Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menu * {
- Away System:dialog -m Away_System Away_System
- }
- alias awaysystem {
- dialog -m Away_System Away_System
- }
- dialog away_system {
- title "Away System"
- size -1 -1 95 115
- option dbu
- tab " Nicks", 1, 0 -2 95 139
- tab "Reasons", 7
- tab "Options", 13
- box "Away Nick:", 16, 5 13 85 20, tab 1
- box "Reasons:", 18, 5 34 55 60, tab 7
- box "Away Nicks:", 15, 5 34 55 60, tab 1
- box "Reason:", 17, 5 13 85 20, tab 7
- button "Save", 4, 65 50 25 15, tab 1
- button "Remove", 5, 65 75 25 15, tab 1
- list 11, 7 44 50 48, tab 7 hsbar vsbar size
- edit "", 12, 8 20 80 10, tab 7 autohs
- list 6, 7 44 50 48, tab 1 hsbar vsbar size
- edit "", 2, 8 20 80 10, tab 1 autohs
- button "Away", 3, 5 98 25 15
- button "Back", 8, 35 98 25 15
- button "Done", 20, 65 98 25 15, cancel
- button "Save", 10, 65 50 25 15, tab 7
- button "Remove", 9, 65 75 25 15, tab 7
- box "Page System", 14, 5 15 85 27, tab 13
- box "Auto Away", 22, 5 45 85 50, tab 13
- radio "60 Minutes Auto Away", 23, 15 63 68 8, tab 13
- radio "90 Minutes Auto Away", 24, 15 73 68 8, tab 13
- radio "120 Minutes Auto Away", 25, 15 83 68 8, tab 13
- radio "Disable Auto Away", 26, 15 53 68 8, tab 13
- check "Enable Page System", 19, 18 23 60 8, tab 13
- check "Disable Page System", 21, 18 32 60 8, tab 13
- }
- on *:dialog:away_system:init:*: {
- if (%page == on) { did -c $dname 19 | did -u $dname 21 }
- if (%page == off) { did -c $dname 21 | did -u $dname 19 }
- if (%autoawayoff == on) { did -c $dname 26 }
- if (%autoaway60 == on) { did -c $dname 23 }
- if (%autoaway90 == on) { did -c $dname 24 }
- if (%autoaway120 == on) { did -c $dname 25 }
- var %away.nick = 1
- while (%away.nick <= $lines(awaynicks.txt)) {
- did -a $dname 6 $read(awaynicks.txt,%away.nick))
- inc %away.nick
- }
- var %away.reason = 1
- while (%away.reason <= $lines(awayreasons.txt)) {
- did -a $dname 11 $read(awayreasons.txt,%away.reason))
- inc %away.reason
- }
- }
- on *:DIALOG:away_system:sclick:3: {
- if ($away) { noop $input(You are already away.,uwo,Error!) | halt }
- set %away.cnick $me
- set %away.time $ctime
- set %away.reason $did(12).text
- set %away.nick $did(2).text
- if (%away.nick == $null) { noop $input(You must choose an Away Nick.,uwo,Error!) | halt }
- if (%away.reason == $null) { noop $input(You must choose an Away Reason.,uwo,Error!) | halt }
- if (%page == on) { amsg 15,1I 15,1a0,1m 15,1n0,1ow 15,1a0,1way - 15,1R0,1eason:4,1 %away.reason 15,1T0,1ime:4,1 $time
- nick %away.nick
- away %away.reason | halt
- else {
- amsg 15,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way - 15,1R0,1eason:4,1 %away.reason 15,1T0,1ime:4,1 $time
- nick %away.nick
- away %away.reason
- }
- }
- }
- on *:DIALOG:away_system:sclick:8: {
- if (%input.return == on) { noop $input(You are on Auto Away please must type to set yourself back.,uwo,Error!) | halt }
- if (!$away) { noop $input(You are not currently away.,uwo,Error!) | halt }
- nick %away.cnick
- amsg 15,1I 15,1a0,1m 15,1n0,1ow 15,1b0,1ack 15,1f0,1rom:4,1 %away.reason 15,1I 15,1w0,1as 15,1g0,1one 15,1f0,1or:4,1 $duration($calc($ctime - %away.time))
- .away
- }
- on *:dialog:away_system:sclick:4: {
- if ($did(2).text == $null)) { noop $input(You did not choose a nick to add to the Nick List list.,uwo,Error!) | halt }
- if (%away.nick == $null) { halt }
- var %away.nick $did(2).text
- if (%away.nick == $read(awaynicks.txt,w,%away.nick)) { noop $input(%away.nick is already in the Nick List.,uwo,Error!) | halt }
- write awaynicks.txt %away.nick
- did -a $dname 6 %away.nick
- }
- on *:dialog:away_system:sclick:10: {
- if ($did(12).text == $null)) { noop $input(You did not choose a Reason to add to the Reason List.,uwo,Error!) | halt }
- if (%away.reason == $null) { halt }
- var %away.reason $did(12).text
- if (%away.reason == $read(awayreasons.txt,w,%away.reason)) { noop $input(%away.reason is already in the Reason List.,uwo,Error!) | halt }
- write awayreasons.txt %away.reason
- did -a $dname 11 %away.reason
- }
- on *:DIALOG:away_system:Sclick:5: {
- if (!$did(6).sel) { noop $input(You did not select a nick to remove.,uwo,Error!) | halt }
- write -dl $+ $did(6).sel awaynicks.txt
- did -d $dname 6 $did(6).sel
- }
- on *:DIALOG:away_system:Sclick:9: {
- if (!$did(11).sel) { noop $input(You did not select a reason to remove.,uwo,Error!) | halt }
- write -dl $+ $did(11).sel awayreasons.txt
- did -d $dname 11 $did(11).sel
- }
- on *:Dialog:away_system:sclick:6: {
- did -ra $dname 2 $did(6).seltext
- set %away.nick $did(6).seltext
- }
- on *:Dialog:away_system:sclick:11: {
- did -ra $dname 12 $did(11).seltext
- set %away.nick $did(11).seltext
- }
- on *:Dialog:away_system:sclick:*: {
- if ($did == 19) { set %page on | dialog -x away_system away_system | dialog -m away_system away_system | did -fu $dname 13 }
- if ($did == 21) { set %page off | dialog -x away_system away_system | dialog -m away_system away_system | did -fu $dname 13 }
- if ($did == 26) { set %autoawayoff on | unset %autoaway60 %autoaway90 %autoaway120 | .timerautoaway* off }
- if ($did == 23) { set %autoaway60 on | unset %autoawayoff %autoaway90 %autoaway120 | .timerautoaway60 0 1 autoaway60 }
- if ($did == 24) { set %autoaway90 on | unset %autoawayoff %autoaway60 %autoaway120 | .timerautoaway90 0 1 autoaway90 }
- if ($did == 25) { set %autoaway120 on | unset %autoawayoff %autoaway60 %autoaway90 | .timerautoaway120 0 1 autoaway120 }
- }
- on *:TEXT:*:#: {
- if ($($+(%,_Page_Lock,.,$nick),2) >= 2) { halt }
- if (%page == on) && ($me isin $strip($1-)) && ($Away) {
- .notice $nick 4,1 $nick 14,1I A15,1m 14,1C15,1urrently 14,1A15,1way4,1. 14,1T15,1o 14,1P15,1age 14,1M15,1e 14,1T15,1ype /notice $me @page [message here]
- inc -u3600 $+(%,_Page_lock,.,$nick)) 1
- }
- }
- on *:NOTICE:*:?: {
- if ($($+(%,_Page_Lock,.,$nick),2) >= 2) { .notice $nick 0,1 $nick 15,1I A0,1m 15,1A0,1way, 15,1P0,1ease 15,1D0,1ont 15,1A0,1buse 15,1M0,1y 15,1P0,1age 15,1S0,1ystem! | halt )
- if ($Away) && ($1 == @page) {
- beep 10 2
- inc %paged
- window @Page
- echo -t @Page 0,1 $nick 15,1P0,1aged 15,1Y0,1ou 15,1W0,1ith 15,1T0,1he %paged 15,1M0,1essage: " $strip($2-) 0,1"
- write Page.txt 0,1 $nick 15,1P0,1aged 15,1Y0,1ou 15,1W0,1ith 15,1T0,1he %paged 15,1M0,1essage: " $strip($2-) 0,1"
- .notice $nick 15,1T0,1hank 15,1Y0,1ou 0,1 $nick $+ , 15,1Y0,1our 15,1M0,1essage 15,1H0,1as 15,1B0,1een 15,1S0,1aved 15,1A0,1s 15,1N0,1umber %paged $+ .
- inc -u86400 $+(%,_Page_lock,.,$nick)) 1
- }
- }
- }
- alias autoaway60 {
- if (!$away && $nick($active,$me).idle >= 3600) {
- set %away.time $ctime
- amsg 15,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way - 15,1R0,1eason15,1: 60 15,1M0,1ins 15,1A0,1uto 15,1A0,1way.
- .away 15,1A0,1uto 15,1A0,1way.
- set %input.return on
- }
- }
- alias autoaway90 {
- if (!$away && $nick($active,$me).idle >= 5400) {
- set %away.time $ctime
- amsg 15,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way - 15,1R0,1eason15,1: 90 15,1M0,1ins 15,1A0,1uto 15,1A0,1way.
- .away 15,1A0,1uto 15,1A0,1way.
- set %input.return on
- }
- }
- alias autoaway120 {
- if (!$away && $nick($active,$me).idle >= 7200) {
- set %away.time $ctime
- amsg 14,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way15,1 - 15,1R0,1eason15,1: 120 15,1M0,1ins 15,1A0,1uto 15,1A0,1way15,1.
- .away 15,1A0,1uto 15,1A0,1way.
- set %input.return on
- }
- }
- on *:input:*:{
- if (%input.return == on) {
- set %input.return off
- .amsg 15,1I 15,1a0,1m 15,1n0,1ow 15,1b0,1ack 15,1f0,1rom15,1: 15,1A0,1uto 15,1A0,1way15,1. 15,1I 15,1w0,1as 15,1g0,1one 15,1f0,1or15,1: $duration($calc($ctime - %away.time))
- echo -a $timestamp 15,1[0,1 $+ $me $+ 15,1] 15,1I 15,1a0,1m 15,1n0,1ow 15,1b0,1ack 15,1f0,1rom15,1: 15,1A0,1uto 15,1A0,1way15,1. 15,1I 15,1w0,1as 15,1g0,1one 15,1f0,1or15,1: $duration($calc($ctime - %away.time))
- .away
- if (%autoaway60 == on) { .timerautoaway60 0 1 autoaway60 }
- if (%autoaway90 == on) { .timerautoaway90 0 1 autoaway 90 }
- if (%autoaway120 == on) { .timerautoaway120 0 1 autoaway120 }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement