rendered paste body English (CA) French German
general pastebin - Miscellany - post number 446991
Stuff to Do
* New Post
* Upload a Post
* Goto Newest
* Search
* Archives
Information
* Site News
* Get a Pastebin
* Other Pastebins
* What is This?
* Features
* Statistics
* Comments
* Polls
Recent Posts
* Someone
31 secs
* Miscellany
58 secs
* Unnamed
2 mins 9 secs
* Mine
2 mins 16 secs
* Miscellany
2 mins 56 secs
* Unnamed
3 mins 35 secs
* Mine
PHP Source
3 mins 56 secs
* Miscellany
6 mins 2 secs
* Something
7 mins 10 secs
* Someone
8 mins 24 secs
* Dracos
9 mins 38 secs
* Something
10 mins 5 secs
* Untitled
11 mins 7 secs
* Blackman
13 mins 20 secs
* Someone
13 mins 47 secs
Post: Miscellany on Wednesday, April 18th, 2007 at 1:41:54pm MDT (57 secs ago)
This URL: http://pastebin.ca/446991
This post will expire in 4 mins 2 secs
1.
; ##############################################
2.
; # Start Idle Away Timer #
3.
; ##############################################
4.
on *:start: if ($readini(Settings.ini,Away.Config,AutoAway) == on) .timerAway.IdleCheck -o 0 30 Away.IdleCheck
5.
6.
; ##############################################
7.
; # Load Default Options #
8.
; ##############################################
9.
on *:load: {
10.
if (!$readini(AwaySettings.ini,Config,NickEditType)) writeini AwaySettings.ini Config NickEditType Suffix
11.
if (!$readini(AwaySettings.ini,Config,NickPrefix)) writeini AwaySettings.ini Config NickPrefix Away|
12.
if (!$readini(AwaySettings.ini,Config,NickSuffix)) writeini AwaySettings.ini Config NickSuffix |Away
13.
if (!$readini(AwaySettings.ini,Config,NickSetTo)) writeini AwaySettings.ini Config NickSuffix Away
14.
if (!$readini(AwaySettings.ini,Config,AutoAway)) writeini AwaySettings.ini Config AutoAway off
15.
if (!$readini(AwaySettings.ini,Config,AutoAwayTime)) writeini AwaySettings.ini Config AutoAwayTime 900
16.
if (!$readini(AwaySettings.ini,Config,IdleSettings)) writeini AwaySettings.ini Config IdleSettings Suffix~|Idle~Auto away after %time minutes idle
17.
if (!$readini(AwaySettings.ini,Config,LeavingTime)) writeini AwaySettings.ini Config LeavingTime off
18.
if (!$readini(AwaySettings.ini,Config,LeavingTimeFormat)) writeini AwaySettings.ini Config LeavingTimeFormat HH:nn:ss
19.
if (!$readini(AwaySettings.ini,Config,TimeAway)) writeini AwaySettings.ini Config TimeAway off
20.
if (!$readini(AwaySettings.ini,Config,TimeAwayFormat)) writeini AwaySettings.ini Config TimeAwayFormat Short
21.
if (!$readini(AwaySettings.ini,Config,ARChannelMessage)) writeini AwaySettings.ini Config ARChannelMessage off
22.
if (!$readini(AwaySettings.ini,Config,ARPrivateMessage)) writeini AwaySettings.ini Config ARPrivateMessage off
23.
if (!$readini(AwaySettings.ini,Config,MsgChans)) writeini AwaySettings.ini Config MsgChans on
24.
if (!$readini(AwaySettings.ini,Config,MsgQueries)) writeini AwaySettings.ini Config MsgQueries off
25.
if (!$readini(AwaySettings.ini,Config,RespondHilights)) writeini AwaySettings.ini Config RespondHilights on
26.
if (!$readini(AwaySettings.ini,Config,RespondPM)) writeini AwaySettings.ini Config RespondPM on
27.
if (!$readini(AwaySettings.ini,Config,RespondNotice)) writeini AwaySettings.ini Config RespondNotice on
28.
echo -a 4>>> Successfully loaded $remove($script,$scriptdir) - Away System script by Urza
29.
}
30.
; ##############################################
31.
; # Remove Away if unloaded #
32.
; ##############################################
33.
on *:unload: {
34.
disable #away
35.
unset %away.*
36.
hfree away.*.responses
37.
timerAway.Idlecheck off
38.
}
39.
; ##############################################
40.
; # Cancel Away on exit #
41.
; ##############################################
42.
on *:exit: {
43.
disable #away
44.
unset %away.*
45.
timerAway.Idlecheck off
46.
}
47.
; ##############################################
48.
; # Popup Menus #
49.
; ##############################################
50.
menu status,channel,query,menubar,@Away.Logs {
51.
-
52.
Away Settings
53.
.Open away options: Dialog $iif($dialog(away),-o,-m) away away
54.
.$iif($active == @Away.Logs,Close window):window -c $active
55.
. -
56.
. Set away $+ $chr(58) $iif($group(#away) == off,on,off): {
57.
if ($group(#away) == off) away $?="Enter away reason or leave black for default (if set)"
58.
else back
59.
}
60.
.-
61.
.$iif($group(#away) == on && %Away.Preset == 1,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,1),$style(2))) Preset 1 - $iif($readini(AwaySettings.ini,Presets,1),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,1),1,126)
62.
.$iif($group(#away) == on && %Away.Preset == 2,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,2),$style(2))) Preset 2 - $iif($readini(AwaySettings.ini,Presets,2),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,2),1,126)
63.
.$iif($group(#away) == on && %Away.Preset == 3,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,3),$style(2))) Preset 3 - $iif($readini(AwaySettings.ini,Presets,3),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,3),1,126)
64.
.$iif($group(#away) == on && %Away.Preset == 4,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,4),$style(2))) Preset 4 - $iif($readini(AwaySettings.ini,Presets,4),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,4),1,126)
65.
.$iif($group(#away) == on && %Away.Preset == 5,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,5),$style(2))) Preset 5 - $iif($readini(AwaySettings.ini,Presets,5),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,5),1,126)
66.
.$iif($group(#away) == on && %Away.Preset == 6,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,6),$style(2))) Preset 6 - $iif($readini(AwaySettings.ini,Presets,6),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,6),1,126)
67.
.$iif($group(#away) == on && %Away.Preset == 7,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,7),$style(2))) Preset 7 - $iif($readini(AwaySettings.ini,Presets,7),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,7),1,126)
68.
}
69.
70.
; ##############################################
71.
; # Main Dialog #
72.
; ##############################################
73.
dialog away {
74.
title Away System Settings
75.
size -1 -1 150 177
76.
option dbu
77.
tab "Basic Settings" 100,0 0 150 156
78.
tab "Exceptions and Messaging" 200,0 0 150 156
79.
Box "Default Away Settings", 2, 4 15 142 45, tab 100
80.
text "Nick:", 1, 8 28 12 10, tab 100
81.
combo 3, 22 26 50 10, drop tab 100
82.
edit "", 5, 75 26 50 10, tab 100
83.
button "?", 6, 130 26 10 10, tab 100
84.
text "Default Away Message:", 24, 8 39 100 10, tab 100
85.
edit "", 25, 8 47 117 10, autohs tab 100
86.
button "?", 26, 130 47 10 10, tab 100
87.
box "Global Options" 4, 4 62 142 92, tab 100
88.
check "A&uto Away After", 7, 12 71 50 10, tab 100
89.
edit "", 8, 63 71 10 10, tab 100
90.
text "minutes.", 9, 75 72.5 40 10, tab 100
91.
button "?", 10, 130 71 10 10, tab 100
92.
button "options", 27, 98 71 30 10, tab 100
93.
check "Show &Leaving Time?" 11, 12 85 60 10, tab 100
94.
edit "" 12, 75 85 50 10, tab 100
95.
button "?", 13, 130 85 10 10, tab 100
96.
check "Show &Time Away?" 14, 12 100 55 10, tab 100
97.
combo 15, 75 100 50 10, drop tab 100
98.
button "?", 16, 130 100 10 10, tab 100
99.
box "Auto Return" 17, 7 115 136 35, tab 100
100.
text "Cancel away on:" 18, 12 125 80 10, tab 100
101.
check "&Channel Message" 19, 60 124 50 10, tab 100
102.
check "&Private Message" 20, 60 134 50 10, tab 100
103.
button "?", 21, 130 134 10 10, tab 100
104.
105.
;Exception + messaging options: - display only does nothing yet
106.
box "Messaging", 30, 4 15 142 90, tab 200
107.
text "Send messages to:", 31, 8 26 50 10, tab 200
108.
check "All open channels" 32, 60 25 50 10, tab 200
109.
check "All open queries" 33, 60 35 50 10, tab 200
110.
button "?", 34, 130 26 10 10, tab 200
111.
box "Response Messages", 35, 8 48 134 38, tab 200
112.
text "Respond to:", 36, 12 56 50 10, tab 200
113.
check "Channel highlight", 37, 60 55 50 10, tab 200
114.
check "Private message", 38, 60 65 50 10, tab 200
115.
check "Private notice", 39, 60 75 50 10, tab 200
116.
button "?", 40, 130 55 10 10, tab 200
117.
button "Get mIRC hilights", 42, 18 90 50 10, tab 200
118.
button "Modify Hilights", 43, 70 90 50 10, tab 200
119.
button "?", 44, 130 90 10 10, tab 200
120.
box "Exceptions", 45, 4 109 142 24, tab 200
121.
button "Modify Away System Exceptions" 46, 8 118 100 10, tab 200
122.
button "?", 48, 130 118 10 10, tab 200
123.
124.
button "Edit &Presets" 22, 12 159 60 15
125.
button "&Ok" 23, 80 159 60 15, ok
126.
}
127.
; ##############################################
128.
; # Custom presets dialog #
129.
; ##############################################
130.
dialog Custom.Aways {
131.
title Custom Away Messages
132.
size -1 -1 236 110
133.
option dbu
134.
box "Custom Away Triggers" 1, 4 4 227 85
135.
text "Trigger", 2, 16 12 30 10
136.
text "Nick Settings", 3, 50 12 50 10
137.
text "Away Message", 4, 130 12 50 10
138.
list 5, 10 20 30 50
139.
list 6, 40 20 50 50
140.
list 7, 90 20 134 50, autohs
141.
button "Add", 8, 10 70 50 15
142.
button "Edit", 10, 65 70 50 15
143.
button "Delete", 9, 120 70 50 15
144.
button "Clear", 12, 175 70 50 15
145.
button "OK", 11, 90 90 50 15, OK
146.
147.
}
148.
; ##############################################
149.
; # Idle Away Settings + Help dialogs #
150.
; ##############################################
151.
dialog Idle.Away.Settings {
152.
title Idle Away Settings
153.
size -1 -1 120 85
154.
option dbu
155.
box "Idle away settings", 1, 4 4 112 55
156.
text "Nick Settings:", 2, 8 12 50 10
157.
combo 3, 8 20 50 10, drop
158.
edit "", 4, 62 20 50 10
159.
text "Idle away message:", 5, 8 35 50 10
160.
edit "", 6, 8 43 104 10, autohs
161.
button "&Help" 7, 5 65 50 15
162.
button "&Ok", 8, 65 65 50 15, OK
163.
}
164.
Dialog Idle.Away.Help {
165.
title Away System Help
166.
size -1 -1 150 90
167.
option dbu
168.
box "Idle away help", 1, 4 4 142 60
169.
text "Idle away nick and automatic message settings work in the same way as the default away settings in the main dialog, except that they define the settings used when you are automatically set away from Idle" 2, 8 15 133 25
170.
text "you can use %time to refer to the time you must idle before being set as away", 3, 8 45 133 20
171.
button "&Ok", 4, 50 70 50 15, OK
172.
}
173.
; ##############################################
174.
; # Preset Settings + Help dialogs #
175.
; ##############################################
176.
dialog Preset.Settings {
177.
title Preset Settings
178.
size -1 -1 120 100
179.
option dbu
180.
box "Preset settings", 1, 4 4 112 70
181.
text "Trigger:", 2, 8 14 50 10
182.
edit "", 3, 30 13 50 10
183.
text "Nick Settings:", 4, 8 27 50 10
184.
combo 5, 8 35 50 10, drop
185.
edit "", 6, 62 35 50 10
186.
text "Away message:", 7, 8 50 50 10
187.
edit "", 8, 8 58 104 10, autohs
188.
button "&Help" 9, 5 80 50 15
189.
button "&Ok", 10, 65 80 50 15, OK
190.
}
191.
Dialog Preset.Help {
192.
title Away System Help
193.
size -1 -1 150 90
194.
option dbu
195.
box "Presets help", 1, 4 4 142 60
196.
text "Preset nick and Away message settings work in the same way as the default away settings in the main dialog, except that they define the settings used for the preset you are creating" 2, 8 15 133 27
197.
text "To use a preset once you have created it simply type /Away TRIGGER", 3, 8 45 133 20
198.
button "&Ok", 4, 50 70 50 15, OK
199.
}
200.
; ##############################################
201.
; # Exceptions dialogs #
202.
; ##############################################
203.
dialog Away.Exceptions {
204.
title Away System Exceptions
205.
size -1 -1 120 100
206.
option dbu
207.
box "Exceptions" 1, 4 4 112 75
208.
text "Networks" 2, 8 12 50 10, center
209.
list 3, 8 19 50 58
210.
button "Add" 6, 61 20 50 10
211.
button "Delete" 7, 61 34 50 10
212.
button "Edit" 8, 61 49 50 10
213.
button "Clear" 9, 61 63 50 10
214.
button "OK" 10, 35 82 50 15, oks
215.
}
216.
dialog Away.AddException {
217.
title Add Exception
218.
size -1 -1 156 190
219.
option dbu
220.
box "Add Exception" 1, 4 4 148 165
221.
text "Network Name:" 2, 8 16 40 10
222.
edit "" 3, 50 15 60 10
223.
text "If you are unsure of a network name you can type: //echo -a $network in mIRC to view it." 20, 8 30 130 15
224.
box "Exception scope" 4, 8 50 140 55
225.
Text "This exception affects:" 5, 12 60 55 10
226.
radio "Entire network" 6, 69 59 65 10
227.
radio "certain channels only" 7, 69 69 65 10
228.
Text "Enter Channels to be excepted, seperated by spaces." 8, 12 80 130 10
229.
edit "" 9, 12 90 130 10
230.
box "Exception Options" 10, 8 110 140 55
231.
text "On this network:" 11, 12 120 45 10
232.
check "Do not change nick" 12, 55 120 55 10
233.
check "Do not send away messages" 13, 55 130 80 10
234.
check "Do not send hilight responses" 14, 55 140 80 10
235.
check "Do not send PM responses" 15, 55 150 80 10
236.
button "OK" 16, 53 172 50 15, Ok
237.
}
238.
239.
; ##############################################
240.
; # Help Dialogs #
241.
; ##############################################
242.
dialog Away.Help.6 {
243.
title Away System Help
244.
size -1 -1 150 120
245.
option dbu
246.
box "Nick Settings Help", 1, 5 5 140 90
247.
text "Nick PREFIX: Adds the specified text to the FRONT of your nick when going away", 2, 8 15 133 20
248.
text "Nick SUFFIX: Adds the specified text to the END of your nick when going away", 3, 8 35 133 20
249.
text "Set to: Sets your nick to the specified nick when you set away", 4, 9 55 133 20
250.
text "Dont Change: Means that youre nick will not change when going away or coming back", 5, 8 75 133 20
251.
button "OK", 7, 50 100 50 15, OK
252.
}
253.
dialog Away.Help.10 {
254.
title Away System Help
255.
size -1 -1 150 90
256.
option dbu
257.
box "Auto Away Help", 1, 5 5 140 60
258.
text "Enabling Auto-Away will automatically set you as away if you are idle for the specified time", 2, 8 15 134 20
259.
text "Time must be between 1 and 60 minutes", 3, 8 35 134 20
260.
text "Options for settings Idle nick and message can be found by clicking the options button", 4, 8 45 134 20
261.
button "OK", 5, 50 70 50 15, ok
262.
}
263.
dialog Away.Help.13 {
264.
title Away System Help
265.
size -1 -1 150 80
266.
option dbu
267.
box "Show Leaving Time Help", 1, 5 5 140 50
268.
text "Enabling 'Show Leaving Time' will display the time you went away in all your away messages in the specified Time Format", 2, 8 15 134 20
269.
button "Click Here for a list of codes used in time format", 3, 8 40 134 10
270.
button "OK", 4, 50 60 50 15, ok
271.
}
272.
dialog Away.Help.16 {
273.
title Away System Help
274.
size -1 -1 150 90
275.
option dbu
276.
box "Show Time Away Help", 1, 5 5 140 60
277.
text "Enabling 'Show Time Away' will display how long you have been away in all your away messages in the specified Time Format", 2, 8 15 134 20
278.
text "Example of Short format: 5h 6m 10s" 3, 8 40 134 10
279.
text "Example of Medium format: 5hrs 6mins 10secs" 4, 8 48 134 10
280.
text "Example of long format: 5 hours 6 minutes 10 seconds" 5, 8 56 134 10
281.
button "OK", 6, 50 70 50 15, ok
282.
}
283.
dialog Away.Help.21 {
284.
title Away System Help
285.
size -1 -1 150 65
286.
option dbu
287.
box "Automatic Return Help", 1, 5 5 140 35
288.
text "Enabling 'Automatic Return' will automatically bring you back from away if you send any Channel And/Or Private message", 2, 8 15 134 20
289.
button "OK", 5, 50 45 50 15, ok
290.
}
291.
dialog Away.Help.26 {
292.
title Away System Help
293.
size -1 -1 150 55
294.
option dbu
295.
box "Default Message Help", 1, 5 5 140 27
296.
text "If you do not enter a reason when going away this default will be used", 2, 8 15 134 20
297.
button "OK", 3, 50 35 50 15, ok
298.
}
299.
dialog Away.Help.34 {
300.
title Away System Help
301.
size -1 -1 150 60
302.
option dbu
303.
box "Message sending help", 1, 5 5 140 32
304.
text "These options refer to weather your away message will be sent to channels and/or Pm's (Queries) when leaving and returning.", 2, 8 15 134 20
305.
button "OK", 3, 50 40 50 15, ok
306.
}
307.
dialog Away.Help.40 {
308.
title Away System Help
309.
size -1 -1 150 80
310.
option dbu
311.
box "Auto Response Help", 1, 5 5 140 50
312.
text "These options refer to what actions will trigger an auto message alerting the person that you are away.", 2, 8 15 134 20
313.
text "Channel highlight is triggered whenever someone says a word that is in your hilights list", 3, 8 35 134 20
314.
button "OK", 4, 50 60 50 15, ok
315.
}
316.
dialog Away.Help.44 {
317.
title Away System Help
318.
size -1 -1 150 120
319.
option dbu
320.
box "Hilight help", 1, 5 5 140 92
321.
text "'Hilight' occurs whenever somebody says a word that is in your hilights list.", 2, 8 15 134 20
322.
text "Your away hilights determine what words, when said, will cause the script to notify the person that you are away, and log the message", 3, 8 31 134 20
323.
text "If you have hilights set in mIRC you can click 'Get mIRC Hilights' to have the away system use these same hilights", 4, 8 54 134 20
324.
text "You may also add or modify seperate ones using the 'Modify Hilights' button. Note that Identifiers such as $me (which refers to your current nick) are also allowed" 5, 8 75 134 20
325.
button "OK", 6, 50 100 50 15, ok
326.
}
327.
dialog Away.Help.48 {
328.
title Away System Help
329.
size -1 -1 150 65
330.
option dbu
331.
box "Exceptions help", 1, 5 5 140 35
332.
text "Exceptions allow you to specify networks/channels in which away messages are not sent, or networks in which your nick is not changed", 2, 8 15 134 25
333.
button "OK", 3, 50 45 50 15, ok
334.
}
335.
336.
dialog Away.Help.Time {
337.
title Away System Help
338.
size -1 -1 150 155
339.
option dbu
340.
box "Time Format Help", 1, 5 5 140 120
341.
text "The following is a list of Codes that can be used in Time Formats", 2, 8 15 134 20
342.
box "Time Format Codes", 3, 8 30 134 88
343.
list 4, 20 40 20 75
344.
list 5, 40 40 90 75
345.
button "OK", 6, 50 130 50 15, ok
346.
}
347.
348.
349.
; ##############################################
350.
; # Dialog Initiation events #
351.
; ##############################################
352.
; ----- Populate Time help
353.
on *:dialog:Away.Help.Time:init:*: {
354.
did -a $dname 4 HH
355.
did -a $dname 5 Hours - 2 Digit 24 hour time - $time(HH)
356.
did -a $dname 4 H
357.
did -a $dname 5 Hours - 1 Digit 24 hour time - $time(H)
358.
did -a $dname 4 hh
359.
did -a $dname 5 Hours - 2 Digit 12 hour time - $time(hh)
360.
did -a $dname 4 h
361.
did -a $dname 5 Hours - 1 Digit 12 hour time - $time(h)
362.
did -a $dname 4 nn
363.
did -a $dname 5 Minutes - 2 Digit - $time(nn)
364.
did -a $dname 4 n
365.
did -a $dname 5 Minutes - 1 Digit - $time(n)
366.
did -a $dname 4 ss
367.
did -a $dname 5 Seconds - 2 Digit - $time(ss)
368.
did -a $dname 4 s
369.
did -a $dname 5 Seconds - 1 Digit - $time(s)
370.
did -a $dname 4 tt
371.
did -a $dname 5 am/pm - Lower case - $time(tt)
372.
did -a $dname 4 TT
373.
did -a $dname 5 AM/PM - Upper Case - $time(TT)
374.
}
375.
; ----- Populate main dialog settings
376.
on *:dialog:away:init:*: {
377.
;Tab 100 Controls
378.
did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Prefix,c) $dname 3 Prefix
379.
did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Suffix,c) $dname 3 Suffix
380.
did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Set to,c) $dname 3 Set to
381.
did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Don't Change,c) $dname 3 Don't Change
382.
if ($readini(AwaySettings.ini,Config,NickEditType) == Don't Change) did -m $dname 5
383.
if ($readini(AwaySettings.ini,Config,NickPrefix)) && ($did(away,3).seltext == Prefix) did -ra $dname 5 $readini(AwaySettings.ini,Config,NickPrefix)
384.
if ($readini(AwaySettings.ini,Config,NickSuffix)) && ($did(away,3).seltext == Suffix) did -ra $dname 5 $readini(AwaySettings.ini,Config,NickSuffix)
385.
if ($readini(AwaySettings.ini,Config,NickSetTo)) && ($did(away,3).seltext == Set To) did -ra $dname 5 $readini(AwaySettings.ini,Config,NickSetTo)
386.
if ($readini(AwaySettings.ini,Config,AutoAway) == on) did -c $dname 7 | else did -m $dname 8
387.
if ($readini(AwaySettings.ini,Config,AutoAwayTime)) did -a $dname 8 $calc($ifmatch / 60) | else did -a $dname 8 900
388.
if ($readini(AwaySettings.ini,Config,LeavingTime) == on) did -c $dname 11 | else did -m $dname 12
389.
if ($readini(AwaySettings.ini,Config,LeavingTimeFormat)) did -a $dname 12 $ifmatch | else did -a $dname 12 HH:nn:ss
390.
if ($readini(AwaySettings.ini,Config,TimeAway) == on) did -c $dname 14 | else did -b $dname 15
391.
if ($readini(AwaySettings.ini,Config,TimeAwayFormat) == Short) did -ac $dname 15 Short | else did -a $dname 15 Short
392.
if ($readini(AwaySettings.ini,Config,TimeAwayFormat) == Medium) did -ac $dname 15 Medium | else did -a $dname 15 Medium
393.
if ($readini(AwaySettings.ini,Config,TimeAwayFormat) == Long) did -ac $dname 15 Long | else did -a $dname 15 Long
394.
if ($readini(AwaySettings.ini,Config,ARChannelMessage) == on) did -c $dname 19
395.
if ($readini(AwaySettings.ini,Config,ARPrivateMessage) == on) did -c $dname 20
396.
if ($readini(AwaySettings.ini,Config,DefaultMessage)) did -a $dname 25 $ifmatch
397.
;Tab 200 controls
398.
if ($readini(AwaySettings.ini,Config,MsgChans) == on) did -c $dname 32
399.
if ($readini(AwaySettings.ini,Config,MsgQueries) == on) did -c $dname 33
400.
if ($readini(AwaySettings.ini,Config,RespondHilights) == on) did -c $dname 37
401.
if ($readini(AwaySettings.ini,Config,RespondPM) == on) did -c $dname 38
402.
if ($readini(AwaySettings.ini,Config,RespondNotice) == on) did -c $dname 39
403.
}
404.
; ----- Populate Custom presets list
405.
on *:dialog:Custom.Aways:init:*: {
406.
var %x = 1
407.
while (%x <= 7) {
408.
if ($readini(AwaySettings.ini,Presets,%x)) {
409.
did -a $dname 5 $gettok($v1,1,126)
410.
did -a $dname 6 $gettok($v1,2,126)
411.
did -a $dname 7 $gettok($v1,3-,126)
412.
}
413.
else halt
414.
inc %x
415.
}
416.
}
417.
; ----- Populate Idle Away Settings
418.
on *:dialog:Idle.Away.Settings:init:*: {
419.
tokenize 126 $readini(AwaySettings.ini,n,Config,IdleSettings)
420.
did -a $+ $iif($1 == Prefix,c) $dname 3 Prefix
421.
did -a $+ $iif($1 == Suffix,c) $dname 3 Suffix
422.
did -a $+ $iif($1 == Set to,c) $dname 3 Set to
423.
did -a $+ $iif($1 == Don't Change,c) $dname 3 Don't Change
424.
if ($1 == Don't Change) did -m $dname 5
425.
else did -ra $dname 4 $2
426.
if ($3) did -a $dname 6 $3-
427.
}
428.
; ----- Populate Preset settings
429.
on *:dialog:Away.Preset:init:*: {
430.
if (%Away.EditPreset) {
431.
var %pre = %Away.EditPreset, %trigger = $did(Custom.Aways,5).seltext
432.
var %edittype = $gettok($did(Custom.Aways,6).seltext,1,58), %nickedit = $gettok($did(Custom.Aways,6).seltext,2,58)
433.
var %reason = $did(Custom.Aways,7).seltext
434.
did -a $dname 3 %trigger
435.
did -a $+ $iif(%edittype == Prefix,c) $dname 5 Prefix
436.
did -a $+ $iif(%edittype == Suffix,c) $dname 5 Suffix
437.
did -a $+ $iif(%edittype == Set to,c) $dname 5 Set to
438.
did -a $+ $iif(%edittype == Don't Change,c) $dname 5 Don't Change
439.
if (%edittype == Don't Change) did -m $dname 6
440.
else did -ra $dname 6 %nickedit
441.
if (%reason) did -a $dname 8 %reason
442.
}
443.
else {
444.
did -a $dname 5 Prefix
445.
did -a $dname 5 Suffix
446.
did -a $dname 5 Set to
447.
did -a $dname 5 Don't Change
448.
}
449.
}
450.
; Exception initiation events
451.
on *:dialog:Away.Exceptions:init:*: {
452.
var %x = 1,%total = $ini(AwaySettings.ini,Exceptions,0)
453.
while (%x <= %total) {
454.
did -a $dname 3 $ini(AwaySettings.ini,Exceptions,%x)
455.
inc %x
456.
}
457.
}
458.
on *:dialog:Away.AddException:init:*: {
459.
if (%Away.Exception) {
460.
var %info = $readini(AwaySettings.ini,Exceptions,%away.Exception)
461.
var %scope = $gettok(%info,1,126), %options = $gettok(%info,2,126), %chans = $gettok(%info,3-,126)
462.
did -a $dname 3 %Away.Exception
463.
if (%scope == 1) {
464.
did -c $dname 6
465.
did -b $dname 9
466.
}
467.
else {
468.
did -c $dname 7
469.
did -b $dname 12,15
470.
did -e $dname 9
471.
did -a $dname 9 %chans
472.
}
473.
if ($left(%options,1) == 1) && (%scope == 1) did -c $dname 12
474.
if ($mid(%options,2,1) == 1) did -c $dname 13
475.
if ($mid(%options,3,1) == 1) did -c $dname 14
476.
if ($right(%options,1) == 1) && (%scope == 1) did -c $dname 15
477.
}
478.
else {
479.
did -c $dname 6
480.
did -b $dname 9
481.
}
482.
}
483.
484.
; ##############################################
485.
; # Dialog Sclick Events #
486.
; ##############################################
487.
; ----- Open Time Help dialog
488.
on *:dialog:Away.Help.13:sclick:3: {
489.
dialog $iif($dialog(Away.Help.Time),-o,-m) Away.Help.Time Away.Help.Time
490.
dialog -x $dname
491.
}
492.
; ----- Select same line in each column in time help dialog
493.
on *:dialog:Away.Help.Time:sclick:*: {
494.
if ($did == 4) did -c $dname 5 $did(4).sel
495.
elseif ($did == 5) did -c $dname 4 $did(5).sel
496.
}
497.
; ----- Processing clicks for main dialog
498.
on *:dialog:away:sclick:*: {
499.
; Tab 100
500.
if ($did == 3) {
501.
writeini AwaySettings.ini Config NickEditType $did(3).seltext
502.
if ($did(3).seltext == Prefix) did -nra $dname 5 $readini(AwaySettings.ini,Config,NickPrefix)
503.
elseif ($did(3).seltext == suffix) did -nra $dname 5 $readini(AwaySettings.ini,Config,NickSuffix)
504.
elseif ($did(3).seltext == Set to) did -nra $dname 5 $readini(AwaySettings.ini,Config,NickSetTo)
505.
else did -rm $dname 5
506.
}
507.
if ($did == 7) && ($did(7).state == 0) did -m $dname 8
508.
elseif ($did == 7) && ($did(7).state == 1) did -n $dname 8
509.
elseif ($did == 11) && ($did(11).state == 0) did -m $dname 12
510.
elseif ($did == 11) && ($did(11).state == 1) did -n $dname 12
511.
elseif ($did == 14) && ($did(14).state == 0) did -b $dname 15
512.
elseif ($did == 14) && ($did(14).state == 1) did -e $dname 15
513.
elseif ($istok(6|10|13|16|21|26|34|40|44|48,$did,124)) dialog $iif($dialog($+(Away.Help.,$did)),-o,-m) $+(Away.Help.,$did) $+(Away.Help.,$did)
514.
elseif ($did == 22) dialog $iif($dialog(Custom.Aways),-o,-m) Custom.Aways Custom.Aways
515.
elseif ($did == 27) dialog $iif($dialog(Idle.Away.Settings),-o,-m) Idle.Away.Settings Idle.Away.Settings
516.
; Tab 200
517.
elseif ($did == 42) {
518.
if ($input(Retrieved the following hilights from your current mIRC settings: $crlf $crlf $+ $Get.Highlights $Crlf $crlf $+ Would you like to use these as your away system highlights? You can use the 'Modify Hilights' button to modify or add to these.,yi,Highlights)) {
519.
writeini AwaySettings.ini Config Hilights $Get.Highlights
520.
}
521.
}
522.
elseif ($did == 43) {
523.
var %hilights = $input(Enter Hilight words or identifiers seperated by commans ONLY. $crlf $+ Eg: $+($me,$chr(44),ALTNICK,$chr(44),$ $+ me),oe,Modify Hilights,$readini(AwaySettings.ini,n,Config,Hilights)))
524.
if (%hilights) writeini AwaySettings.ini Config Hilights $remove(%hilights,$chr(32))
525.
else remini Settings.ini Away.Config Hilights
526.
}
527.
elseif ($did == 46) {
528.
dialog $iif($dialog(Away.Exceptions),-v,-m) Away.Exceptions Away.Exceptions
529.
}
530.
}
531.
; ----- Process button clicks and keep selection of all columns the same in presets dialog
532.
on *:dialog:Custom.Aways:sclick:*: {
533.
if ($did == 5) did -c $dname 6,7 $did(5).sel
534.
elseif ($did == 6) did -c $dname 5,7 $did(6).sel
535.
elseif ($did == 7) did -c $dname 5,6 $did(7).sel
536.
elseif ($did == 8) dialog $iif($dialog(Away.Preset),-v,-m) Away.Preset Preset.Settings
537.
elseif ($did == 9) {
538.
if (!$did(5).sel) var %x = $input(Error: You must select an entry to delete,wo,Invalid Selection)
539.
elseif ($?!="Are you sure you want to delete this entry - $did(5).seltext ") {
540.
did -d $dname 5 $did(5).sel
541.
did -d $dname 6 $did(6).sel
542.
did -d $dname 7 $did(7).sel
543.
}
544.
}
545.
elseif ($did == 10) {
546.
if (!$did(5).sel) { var %x = $input(Error: You must select an entry to edit,wo,Invalid Selection) | halt }
547.
set %Away.EditPreset $did(5).sel
548.
dialog $iif($dialog(Away.Preset),-v,-m) Away.Preset Preset.Settings
549.
}
550.
elseif ($did == 12) {
551.
if ($input(Are you sure you want to clear all your presets?,qy,Validation Prompt)) {
552.
var %x = 7
553.
while (%x > 0) {
554.
did -c $dname 5 %x
555.
if ($did(5).seltext) did -d $dname 5,6,7 $did(5).sel
556.
dec %x
557.
}
558.
}
559.
}
560.
}
561.
562.
; ----- Process Idle Away clicks/settings
563.
on *:dialog:Idle.Away.Settings:sclick:*: {
564.
var %time = $calc($readini(AwaySettings.ini,Config,AutoAwayTime) / 60)
565.
if ($did == 3) {
566.
if ($did(3).seltext == Don't Change) did -rm $dname 4
567.
else did -n $dname 4
568.
}
569.
elseif ($did == 7) dialog $iif($dialog(Idle.Away.help),-v,-m) Idle.Away.help Idle.Away.Help
570.
}
571.
; ----- Process Preset dialog clicks/settings
572.
on *:dialog:Away.Preset:sclick:*: {
573.
if ($did == 5) {
574.
if ($did(5).seltext == Don't Change) did -rm $dname 6
575.
else did -n $dname 6
576.
}
577.
elseif ($did == 9) dialog $iif($dialog(Preset.Help),-v,-m) Preset.Help Preset.Help
578.
}
579.
; ----- Exception Clicks
580.
on *:dialog:Away.Exceptions:sclick:*: {
581.
if ($did == 6) dialog $iif($dialog(Away.AddException),-v,-m) Away.AddException Away.AddException
582.
elseif ($did == 7) {
583.
if (!$did(3).sel) var %x = $input(You must select an entry to delete,wo,Invalid Selection)
584.
elseif ($?!="Are you sure you want to delete this entry - $did(3).seltext ") {
585.
remini AwaySettings.ini Exceptions $did(3).seltext
586.
did -d $dname 3 $did(3).sel
587.
}
588.
}
589.
elseif ($did == 8) {
590.
if (!$did(3).sel) var %x = $input(You must select an entry to edit,wo,Invalid Selection)
591.
else {
592.
set %Away.Exception $did(3).seltext
593.
set %Away.ExceptionNum $did(3).sel
594.
dialog $iif($dialog(Away.AddException),-v,-m) Away.AddException Away.AddException
595.
}
596.
}
597.
elseif ($did == 9) {
598.
if ($input(Are you sure you want to clear all your network exceptions?,qy,Validation Prompt)) {
599.
var %x = $did(3).lines
600.
remini AwaySettings.ini Exceptions
601.
while (%x > 0) {
602.
did -c $dname 3 %x
603.
if ($did(3).seltext) did -d $dname 3 $did(3).sel
604.
dec %x
605.
}
606.
}
607.
}
608.
}
609.
on *:dialog:Away.AddException:Sclick:*: {
610.
if ($did == 6) {
611.
did -e $dname 12,15
612.
did -b $dname 9
613.
did -r $dname 9
614.
}
615.
elseif ($did == 7) {
616.
did -b $dname 12,15
617.
did -e $dname 9
618.
if ($did(12).state == 1) did -u $dname 12
619.
if ($did(15).state == 1) did -u $dname 15
620.
}
621.
}
622.
; ##############################################
623.
; # Dialog Close Events #
624.
; ##############################################
625.
; ----- Main dialog - save data
626.
on *:dialog:Away:close:*: {
627.
; tab 100 settings
628.
if ($did(5)) {
629.
if ($did(3).seltext == Prefix) writeini AwaySettings.ini Config NickPrefix $did(5)
630.
elseif ($did(3).seltext == Suffix) writeini AwaySettings.ini Config NickSuffix $did(5)
631.
elseif ($did(3).seltext == Set to) writeini AwaySettings.ini Config NickSetTo $did(5)
632.
}
633.
else {
634.
writeini AwaySettings.ini Config NickPrefix Away|
635.
writeini AwaySettings.ini Config NickSuffix |Away
636.
}
637.
writeini AwaySettings.ini Config AutoAway $iif($did(7).state == 0,off,on)
638.
writeini AwaySettings.ini Config AutoAwayTime $iif($did(8),$calc($did(8) * 60),900)
639.
writeini AwaySettings.ini Config LeavingTime $iif($did(11).state == 0,off,on)
640.
writeini AwaySettings.ini Config LeavingTimeFormat $iif($did(12),$did(12),HH:nn:ss)
641.
writeini AwaySettings.ini Config TimeAway $iif($did(14).state == 0,off,on)
642.
writeini AwaySettings.ini Config TimeAwayFormat $iif($did(15),$did(15),Shorts)
643.
writeini AwaySettings.ini Config ARChannelMessage $iif($did(19).state == 0,off,on)
644.
writeini AwaySettings.ini Config ARPrivateMessage $iif($did(20).state == 0,off,on)
645.
if ($did(25)) writeini AwaySettings.ini Config DefaultMessage $did(25)
646.
else remini Settings.ini Away.Config DefaultMessage
647.
if ($readini(AwaySettings.ini,Config,AutoAway) == on) .timerAway.IdleCheck -o 0 30 Away.IdleCheck
648.
elseif ($timer(Away.IdleCheck)) .timerAway.IdleCheck off
649.
650.
;Tab 200 settings
651.
writeini AwaySettings.ini Config MsgChans $iif($did(32).state == 0,off,on)
652.
writeini AwaySettings.ini Config MsgQueries $iif($did(33).state == 0,off,on)
653.
writeini AwaySettings.ini Config RespondHilights $iif($did(37).state == 0,off,on)
654.
writeini AwaySettings.ini Config RespondPM $iif($did(38).state == 0,off,on)
655.
writeini AwaySettings.ini Config RespondNotice $iif($did(39).state == 0,off,on)
656.
}
657.
; ----- Save presets
658.
on *:dialog:Custom.Aways:close:*: {
659.
var %x = 1, %lines = $did(5).lines
660.
while (%x <= %lines) {
661.
did -c $dname 5,6,7 %x
662.
writeini AwaySettings.ini presets %x $+($did(5).seltext,~,$did(6).seltext,~,$did(7).seltext)
663.
inc %x
664.
}
665.
dec %x
666.
while (%x < 7) {
667.
inc %x
668.
if ($readini(AwaySettings.ini,presets,%x)) remini AwaySettings.ini Presets %x
669.
}
670.
}
671.
; ----- Save Idle away settings
672.
on *:dialog:Idle.Away.Settings:close:*: {
673.
writeini AwaySettings.ini Config IdleSettings $+($did(3).seltext,~,$iif($did(4),$ifmatch,IDLE),~,$iif($did(6),$ifmatch,Auto away after % $+ time minutes idle))
674.
}
675.
; ----- Save Preset settings
676.
on *:dialog:Away.Preset:close:*: {
677.
var %pre = %away.EditPreset
678.
if (!$did(3)) var %x = $input(Error: No trigger was specified,ow,Input Error)
679.
elseif (!$did(6)) && ($did(5).seltext != Don't Change) var %x = $input(Error: You did not specify $iif($did(5).seltext,a nick $iif($did(5).seltext == set to,to change to,$ifmatch),any nick settings),ow,Input Error)
680.
elseif ($remove($did(6),$chr(91),$chr(93),$chr(92),$chr(45),$chr(95),$chr(123),$chr(124),$chr(125)) !isalnum) && ($did(6)) { var %x = $input(Error: Invalid Characters detected in specified nick,wo,Input Error) | halt }
681.
elseif (!$did(5).seltext) var %x = $input(Error: You have not specified how to change your nick - Select an option from the nick settings drop down,ow,Error)
682.
elseif ($numtok($did(3),32) > 1) || ($numtok($did(6),32) > 1) var %x = $input(Error: Trigger and nick Settings can each only be one word long,wo,Input Error)
683.
else {
684.
did $iif(%pre,-o,-a) Custom.Aways 5 $iif(%pre,%pre) $did(3)
685.
did $iif(%pre,-o,-a) Custom.Aways 6 $iif(%pre,%pre) $did(5).seltext $+ $iif($did(5).seltext != Don't Change,: $did(6))
686.
did $iif(%pre,-o,-a) Custom.Aways 7 $iif(%pre,%pre) $did(8)
687.
unset %away.EditPreset
688.
}
689.
}
690.
; ---- Save Exception settings
691.
on *:dialog:Away.AddException:close:*: {
692.
if (!$did(3)) var %x = $input(No Network name was entered,wo,Input Error)
693.
elseif ($numtok($did(3),32) > 1) var %x = $input(Network name may not contain spaces,wo,Input Error)
694.
else {
695.
var %scope = $iif($did(6).state == 1,1,2)
696.
var %x = 1, %numchans = $numtok($did(9),32)
697.
while (%x <= %numchans) {
698.
var %token = $gettok($did(9),%x,32)
699.
if (#?* iswm %token) var %chans = %chans %token
700.
elseif (%token != $chr(35)) var %chans = %chans $+($chr(35),%token)
701.
inc %x
702.
}
703.
var %x = 12
704.
while (%x <= 15) {
705.
var %options = %options $+ $did(%x).state
706.
inc %x
707.
}
708.
did $iif(%Away.ExceptionNum,-o,-a) Away.Exceptions 3 $iif(%Away.ExceptionNum,$ifmatch) $did(3)
709.
writeini AwaySettings.ini Exceptions $did(3) $+(%scope,~,%options,~,%chans)
710.
unset %Away.Exception*
711.
}
712.
}
713.
; ##############################################
714.
; # /Away And /back aliases #
715.
; ##############################################
716.
alias away {
717.
; ----- Unset Idle timer, Get highlights, enable #away group for logging etc
718.
if ($timer(Away.IdleCheck)) .timerAway.IdleCheck off
719.
set %Away.Hilights $readini(awaySettings.ini,n,Config,Hilights)
720.
.enable #away
721.
722.
; ---- Retrieve away settings from config/User entry
723.
var %time = $calc($readini(AwaySettings.ini,Config,AutoAwayTime) / 60)
724.
if ($1) set %away.Reason $1-
725.
elseif ($readini(AwaySettings.ini,Config,DefaultMessage)) set %away.Reason $v1
726.
set %Away.LeftAt $ctime
727.
if ($readini(AwaySettings.ini,Config,LeavingTime) == on) {
728.
var %LeavingTimeFormat = $readini(AwaySettings.ini,Config,LeavingTimeFormat)
729.
set %away.LeaveTime $time(%LeavingTimeFormat)
730.
}
731.
; ---- Check for idleaway
732.
If ($1- = Auto.Idle.Away) {
733.
var %IdleInfo = $readini(AwaySettings.ini,Config,IdleSettings)
734.
var %edittype = $gettok(%IdleInfo,1,126)
735.
if (%edittype == Set to) var %nickset = $gettok(%IdleInfo,2,126)
736.
else var %nickadd = $gettok(%IdleInfo,2,126)
737.
set %Away.Reason $($gettok(%IdleInfo,3-,126),2)
738.
}
739.
else {
740.
var %edittype = $readini(AwaySettings.ini,Config,NickEditType)
741.
if (%edittype == Set To) var %nickset = $readini(AwaySettings.ini,Config,NickSetTo)
742.
else var %nickadd = $readini(AwaySettings.ini,Config,Nick $+ %edittype)
743.
}
744.
; ----- Check for presets
745.
var %x 1
746.
while (%x <= 7) {
747.
if ($readini(AwaySettings.ini,Presets,%x)) {
748.
var %preset = $v1
749.
if ($1- == $gettok(%preset,1,126)) {
750.
var %edittype = $gettok($gettok(%preset,2,126),1,58)
751.
var %nickadd = $remove($gettok($gettok(%preset,2,126),2,58),$chr(32))
752.
set %Away.Reason $gettok(%preset,3-,126)
753.
set %Away.Preset %x
754.
var %x = 7
755.
}
756.
}
757.
inc %x
758.
}
759.
; ----- Cycle Connections to change nick/send msg
760.
var %x = 1, %connections = $scon(0)
761.
while (%x <= %connections) {
762.
scon %x
763.
if ($status == connected) {
764.
unset %Except.*
765.
if ($readini(AwaySettings.ini,Exceptions,$network)) {
766.
var %Except.info = $v1
767.
var %Except.Scope = $gettok(%Except.info,1,126)
768.
var %Except.Options = $gettok(%Except.info,2,126)
769.
if (%Except.Scope == 2) && ($mid(%Except.Options,2,1) == 1) var %Except.NoMsgChans = $gettok(%Except.Info,3-,126)
770.
if (%Except.Scope == 1) && ($left(%Except.Options,1) == 1) var %Except.NoNickChange = 1
771.
if (%Except.Scope == 1) && ($mid(%Except.Options,2,1) == 1) var %Except.NoAwayMsg = 1
772.
}
773.
set $+(%,Away.Oldnick.,$network) $me
774.
if ($readini(AwaySettings.ini,Config,NickEditType) != Don't Change) && (!%Except.NoNickChange) {
775.
if (%edittype == Set To) && (%NickSet != $me) var %newnick = %NickSet
776.
if (%edittype == Prefix) && ($+(%nickadd,*) !iswm $me) var %newnick = $+(%nickadd,$me)
777.
if (%edittype == Suffix) && ($+(*,%nickadd) !iswm $me) var %newnick = $+($me,%nickadd)
778.
set $+(%,Away.Newnick.,$network) $iif(%newnick,$ifmatch,$me)
779.
if (%newnick) nick %newnick
780.
}
781.
if ($chan(0)) && ($readini(AwaySettings.ini,Config,MsgChans) == on) && (!%Except.NoAwayMsg) {
782.
amsg 7[14Away7] $iif(%Away.Reason,14Reason:07 %Away.Reason) $iif(%Away.leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7))
783.
}
784.
if ($readini(AwaySettings.ini,Config,MsgQueries) == on) && (!%Except.NoAwayMsg) {
785.
qmsg 7[14Away7] $iif(%Away.Reason,14Reason:07 %Away.Reason) $iif(%Away.leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7))
786.
}
787.
!away 7[14Away7] $iif(%Away.Reason,14Reason:07 %Away.Reason) $iif(%Away.leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7))
788.
}
789.
inc %x
790.
}
791.
}
792.
793.
alias back {
794.
var %x = 1, %connections = $scon(0)
795.
while (%x <= %connections) {
796.
scon %x
797.
if ($status == connected) {
798.
unset %Except.*
799.
if ($readini(AwaySettings.ini,Exceptions,$network)) {
800.
var %Except.info = $v1
801.
var %Except.Scope = $gettok(%Except.info,1,126)
802.
var %Except.Options = $gettok(%Except.info,2,126)
803.
if (%Except.Scope == 2) && ($mid(%Except.Options,2,1) == 1) var %Except.NoMsgChans = $gettok(%Except.Info,3-,126)
804.
if (%Except.Scope == 1) && ($left(%Except.Options,1) == 1) var %Except.NoNickChange = 1
805.
if (%Except.Scope == 1) && ($mid(%Except.Options,2,1) == 1) var %Except.NoAwayMsg = 1
806.
}
807.
808.
if (!%Except.NoNickChange) && ($($+(%,Away.Oldnick.,$network),2)) nick $ifmatch
809.
810.
; ----- Cycle Connections to change nick/send msg
811.
if ($chan(0)) && ($readini(AwaySettings.ini,Config,MsgChans) == on) && (!%Except.NoAwayMsg) {
812.
amsg 7[14Back7] $iif(%away.Reason,14From:07 %Away.Reason) $iif(%Away.Leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7)) $iif($Away.GoneFor,14Gone for:07 $Away.GoneFor)
813.
}
814.
if ($readini(AwaySettings.ini,Config,MsgQueries) == on) && (!%Except.NoAwayMsg) {
815.
qmsg 7[14Back7] $iif(%away.Reason,14From:07 %Away.Reason) $iif(%Away.Leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7)) $iif($Away.GoneFor,14Gone for:07 $Away.GoneFor)
816.
}
817.
!away
818.
}
819.
inc %x
820.
}
821.
.disable #away
822.
unset %away.*
823.
if ($hget(Away.PM.Responses)) || ($hget(Away.Highlight.Responses)) hfree -w Away.*.Responses
824.
if ($readini(AwaySettings.ini,Config,AutoAway) == on) .timerAway.IdleCheck -o 0 30 Away.IdleCheck
825.
}
826.
; ##############################################
827.
; # Other Aliases #
828.
; ##############################################
829.
alias -l Away.Gonefor {
830.
if ($readini(AwaySettings.ini,Config,TimeAway) == on) {
831.
var %TimeAwayFormat = $readini(AwaySettings.ini,Config,TimeAwayFormat)
832.
if (%Away.LeftAt) {
833.
var %duration = $duration($calc($ctime - %Away.LeftAt),%TimeAwayFormat)
834.
if (%TimeAwayFormat == Short) return $Short.Duration(%duration)
835.
elseif (%TimeAwayFormat == medium) return %duration
836.
elseif (%TimeAwayFormat == long) return $Long.Duration(%duration)
837.
}
838.
}
839.
else return $false
840.
}
841.
alias -l Short.Duration return $replacex($1-,secs,s,sec,s,mins,m,min,m,hrs,h,hr,h,days,d,day,d,wks,w,wk,w)
842.
alias -l Long.Duration return $replacex($1-,sec,second,secs,seconds,min,minute,mins,minutes,hr,hour,hrs,hours,wk,week,wks,weeks)
843.
844.
alias -l Get.Highlights {
845.
var %x = 1, %Groups = $ini(mirc.ini,highlight,0)
846.
while (%x <= %groups) {
847.
var %Away.Highlights = $addtok(%Away.highlights,$highlight(%x),44)
848.
inc %x
849.
}
850.
return %Away.Highlights
851.
}
852.
alias -l Check.For.highlights {
853.
if (!%Away.Highlights) set %Away.Highlights $readini(AwaySettings.ini,n,Config,Hilights)
854.
var %x = 1, %highlights = $numtok(%Away.highlights,44)
855.
while (%x <= %highlights) {
856.
var %chighlight = $($gettok(%Away.Highlights,%x,44),2)
857.
if ($istok($1-,%chighlight,32)) return %chighlight
858.
inc %x
859.
}
860.
return $false
861.
}
862.
alias -l Away.Logwin {
863.
if (!$window(@Away.Logs)) window -eknz @Away.Logs
864.
echo -ti2 @Away.Logs $1-
865.
}
866.
alias -l Highlight.Response {
867.
if (!$hget(Away.highlight.Responses,$+($1,.,$2))) {
868.
scid $1 .notice $2 7[14Away7] $iif(%Away.Reason,14Reason:7 %Away.Reason) $iif(%Away.LeaveTime,14Left at:07 %Away.LeaveTime (14+1 GMT7)) $iif($away.gonefor,14Gone for:07 $away.gonefor)
869.
hadd -m Away.Highlight.Responses $+($1,.,$2) 1
870.
}
871.
}
872.
alias -l Private.Message.Response {
873.
if (!$hget(Away.PM.Responses,$+($1,.,$2))) {
874.
scid $1 .msg $2 7[14Away7] $iif(%Away.Reason,14Reason:7 %Away.Reason) $iif(%Away.LeaveTime,14Left at:07 %Away.LeaveTime (14+1 GMT7)) $iif($away.gonefor,14Gone for:07 $away.gonefor)
875.
hadd -m Away.PM.Responses $+($1,.,$2) 1
876.
}
877.
}
878.
alias -l Away.IdleCheck {
879.
var %x = 1, %networks = $scon(0)
880.
var %AutoAwayTime = $readini(AwaySettings.ini,Config,AutoAwayTime)
881.
while (%x <= %networks) {
882.
scon %x {
883.
if ($status == Connected) && ($idle < %AutoAwayTime) var %Idle = off
884.
}
885.
inc %x
886.
}
887.
if (%idle != off) away Auto away
888.
}
889.
alias Away.Config dialog $iif($dialog(Away),-v,-m) Away Away
890.
; ##############################################
891.
; # Logging and hilight resposes #
892.
; ##############################################
893.
#away off
894.
;Hilight responses
895.
on *:text:*:#: {
896.
if (!$Check.For.highlights($1-)) && (!$istok($1-,$me,32)) && (!$istok($1-,$($+(%,Away.Oldnick.,$network),2),32)) return
897.
if ($nick == [DM]) halt
898.
else {
899.
Away.Logwin 4[10CHANNEL MESSAGE4] $+(4[10,$iif($scon(0) > 1,$+($network,12/10)),$chan,12/10,$nick,4]) $1-
900.
if ($readini(AwaySettings.ini,Exceptions,$network)) {
901.
var -s %Except.info = $v1
902.
var -s %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126)
903.
if (%Except.Scope == 2) && ($mid(%Except.Options,3,1) == 1) var %Except.NoHilight = $gettok(%Except.Info,3-,126)
904.
elseif (%Except.Scope == 1) && ($mid(%Except.Options,3,1) == 1) return
905.
}
906.
if (!$istok(%Except.NoHilight,$chan,32)) && ($readini(AwaySettings.ini,Config,RespondHilights) == on) Highlight.Response $cid $nick
907.
}
908.
}
909.
on *:action:*:#: {
910.
if (!$check.for.highlights($1-)) && (!$istok($1-,$me,32)) && (!$istok($1-,$($+(%,Away.Oldnick.,$network),2),32)) return
911.
else {
912.
Away.Logwin 4[10CHANNEL 10ACTION4] $+(4[10,$iif($scon(0) > 1,$+($network,12/10)),$chan,12/10,$nick,4]) * $nick $1-
913.
if ($readini(AwaySettings.ini,Exceptions,$network)) {
914.
var %Except.info = $v1
915.
var %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126)
916.
if (%Except.Scope == 2) && ($mid(%Except.Options,3,1) == 1) var %Except.NoHilight = $gettok(%Except.Info,3-,126)
917.
elseif (%Except.Scope == 1) && ($mid(%Except.Options,3,1) == 1) return
918.
}
919.
if (!$istok(%Except.NoHilight,$chan,32)) && ($readini(AwaySettings.ini,Config,RespondHilights) == on) Highlight.Response $cid $nick
920.
}
921.
}
922.
; Private notice response
923.
on *:notice:*:?: {
924.
if (*serv !iswm $nick) {
925.
Away.Logwin 4[10PRIVATE NOTICE4] $+(4[10,$iif($scon(0) > 1,$+($network,12/10)),Private,12/10,$nick,4]) $1-
926.
if ($readini(AwaySettings.ini,Exceptions,$network)) {
927.
var %Except.info = $v1
928.
var %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126)
929.
if (%Except.Scope == 1) && ($right(%Except.Options,1) == 1) return
930.
}
931.
if ($readini(AwaySettings.ini,Config,RespondNotice) == on) Private.Message.Response $cid $nick
932.
}
933.
}
934.
;PM responses
935.
on *:text:*:?: {
936.
if ($readini(AwaySettings.ini,Config,RespondPM) == on) && (*serv !iswm $nick) {
937.
if ($readini(AwaySettings.ini,Exceptions,$network)) {
938.
var %Except.info = $v1
939.
var %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126)
940.
if (%Except.Scope == 2) && ($mid(%Except.Options,3,1) == 1) var %Except.NoHilight = $gettok(%Except.Info,3-,126)
941.
elseif (%Except.Scope == 1) && ($right(%Except.Options,1) == 1) return
942.
}
943.
Private.Message.Response $cid $nick
944.
}
945.
}
946.
;Return from away on input if set
947.
on *:input:#: {
948.
if ($left($1,1) != $readini(mirc.ini,text,commandchar)) {
949.
if ($readini(AwaySettings.ini,Config,ARChannelMessage) == on) back
950.
}
951.
}
952.
on *:input:?: {
953.
if ($left($1,1) != $readini(mirc.ini,text,commandchar)) {
954.
if ($readini(AwaySettings.ini,Config,ARPrivateMessage) == on) back
955.
}
956.
}
957.
#away end
958.
959.
alias reset.away {
960.
set %away.LeaveTime $time
961.
set %Away.LeftAt $ctime
962.
echo -ta Reset away
963.
}
Raw Content Download: http://pastebin.ca/raw/446991
Total Paste Views: 4
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
paste below
; ############################################## ; # Start Idle Away Timer # ; ############################################## on *:start: if ($readini(Settings.ini,Away.Config,AutoAway) == on) .timerAway.IdleCheck -o 0 30 Away.IdleCheck ; ############################################## ; # Load Default Options # ; ############################################## on *:load: { if (!$readini(AwaySettings.ini,Config,NickEditType)) writeini AwaySettings.ini Config NickEditType Suffix if (!$readini(AwaySettings.ini,Config,NickPrefix)) writeini AwaySettings.ini Config NickPrefix Away| if (!$readini(AwaySettings.ini,Config,NickSuffix)) writeini AwaySettings.ini Config NickSuffix |Away if (!$readini(AwaySettings.ini,Config,NickSetTo)) writeini AwaySettings.ini Config NickSuffix Away if (!$readini(AwaySettings.ini,Config,AutoAway)) writeini AwaySettings.ini Config AutoAway off if (!$readini(AwaySettings.ini,Config,AutoAwayTime)) writeini AwaySettings.ini Config AutoAwayTime 900 if (!$readini(AwaySettings.ini,Config,IdleSettings)) writeini AwaySettings.ini Config IdleSettings Suffix~|Idle~Auto away after %time minutes idle if (!$readini(AwaySettings.ini,Config,LeavingTime)) writeini AwaySettings.ini Config LeavingTime off if (!$readini(AwaySettings.ini,Config,LeavingTimeFormat)) writeini AwaySettings.ini Config LeavingTimeFormat HH:nn:ss if (!$readini(AwaySettings.ini,Config,TimeAway)) writeini AwaySettings.ini Config TimeAway off if (!$readini(AwaySettings.ini,Config,TimeAwayFormat)) writeini AwaySettings.ini Config TimeAwayFormat Short if (!$readini(AwaySettings.ini,Config,ARChannelMessage)) writeini AwaySettings.ini Config ARChannelMessage off if (!$readini(AwaySettings.ini,Config,ARPrivateMessage)) writeini AwaySettings.ini Config ARPrivateMessage off if (!$readini(AwaySettings.ini,Config,MsgChans)) writeini AwaySettings.ini Config MsgChans on if (!$readini(AwaySettings.ini,Config,MsgQueries)) writeini AwaySettings.ini Config MsgQueries off if (!$readini(AwaySettings.ini,Config,RespondHilights)) writeini AwaySettings.ini Config RespondHilights on if (!$readini(AwaySettings.ini,Config,RespondPM)) writeini AwaySettings.ini Config RespondPM on if (!$readini(AwaySettings.ini,Config,RespondNotice)) writeini AwaySettings.ini Config RespondNotice on echo -a 4>>> Successfully loaded $remove($script,$scriptdir) - Away System script by Urza } ; ############################################## ; # Remove Away if unloaded # ; ############################################## on *:unload: { disable #away unset %away.* hfree away.*.responses timerAway.Idlecheck off } ; ############################################## ; # Cancel Away on exit # ; ############################################## on *:exit: { disable #away unset %away.* timerAway.Idlecheck off } ; ############################################## ; # Popup Menus # ; ############################################## menu status,channel,query,menubar,@Away.Logs { - Away Settings .Open away options: Dialog $iif($dialog(away),-o,-m) away away .$iif($active == @Away.Logs,Close window):window -c $active . - . Set away $+ $chr(58) $iif($group(#away) == off,on,off): { if ($group(#away) == off) away $?="Enter away reason or leave black for default (if set)" else back } .- .$iif($group(#away) == on && %Away.Preset == 1,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,1),$style(2))) Preset 1 - $iif($readini(AwaySettings.ini,Presets,1),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,1),1,126) .$iif($group(#away) == on && %Away.Preset == 2,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,2),$style(2))) Preset 2 - $iif($readini(AwaySettings.ini,Presets,2),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,2),1,126) .$iif($group(#away) == on && %Away.Preset == 3,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,3),$style(2))) Preset 3 - $iif($readini(AwaySettings.ini,Presets,3),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,3),1,126) .$iif($group(#away) == on && %Away.Preset == 4,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,4),$style(2))) Preset 4 - $iif($readini(AwaySettings.ini,Presets,4),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,4),1,126) .$iif($group(#away) == on && %Away.Preset == 5,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,5),$style(2))) Preset 5 - $iif($readini(AwaySettings.ini,Presets,5),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,5),1,126) .$iif($group(#away) == on && %Away.Preset == 6,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,6),$style(2))) Preset 6 - $iif($readini(AwaySettings.ini,Presets,6),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,6),1,126) .$iif($group(#away) == on && %Away.Preset == 7,$style(3),$iif($group(#away) == on || !$readini(AwaySettings.ini,Presets,7),$style(2))) Preset 7 - $iif($readini(AwaySettings.ini,Presets,7),$gettok($v1,1,126),Not set):away $gettok($readini(AwaySettings.ini,Presets,7),1,126) } ; ############################################## ; # Main Dialog # ; ############################################## dialog away { title Away System Settings size -1 -1 150 177 option dbu tab "Basic Settings" 100,0 0 150 156 tab "Exceptions and Messaging" 200,0 0 150 156 Box "Default Away Settings", 2, 4 15 142 45, tab 100 text "Nick:", 1, 8 28 12 10, tab 100 combo 3, 22 26 50 10, drop tab 100 edit "", 5, 75 26 50 10, tab 100 button "?", 6, 130 26 10 10, tab 100 text "Default Away Message:", 24, 8 39 100 10, tab 100 edit "", 25, 8 47 117 10, autohs tab 100 button "?", 26, 130 47 10 10, tab 100 box "Global Options" 4, 4 62 142 92, tab 100 check "A&uto Away After", 7, 12 71 50 10, tab 100 edit "", 8, 63 71 10 10, tab 100 text "minutes.", 9, 75 72.5 40 10, tab 100 button "?", 10, 130 71 10 10, tab 100 button "options", 27, 98 71 30 10, tab 100 check "Show &Leaving Time?" 11, 12 85 60 10, tab 100 edit "" 12, 75 85 50 10, tab 100 button "?", 13, 130 85 10 10, tab 100 check "Show &Time Away?" 14, 12 100 55 10, tab 100 combo 15, 75 100 50 10, drop tab 100 button "?", 16, 130 100 10 10, tab 100 box "Auto Return" 17, 7 115 136 35, tab 100 text "Cancel away on:" 18, 12 125 80 10, tab 100 check "&Channel Message" 19, 60 124 50 10, tab 100 check "&Private Message" 20, 60 134 50 10, tab 100 button "?", 21, 130 134 10 10, tab 100 ;Exception + messaging options: - display only does nothing yet box "Messaging", 30, 4 15 142 90, tab 200 text "Send messages to:", 31, 8 26 50 10, tab 200 check "All open channels" 32, 60 25 50 10, tab 200 check "All open queries" 33, 60 35 50 10, tab 200 button "?", 34, 130 26 10 10, tab 200 box "Response Messages", 35, 8 48 134 38, tab 200 text "Respond to:", 36, 12 56 50 10, tab 200 check "Channel highlight", 37, 60 55 50 10, tab 200 check "Private message", 38, 60 65 50 10, tab 200 check "Private notice", 39, 60 75 50 10, tab 200 button "?", 40, 130 55 10 10, tab 200 button "Get mIRC hilights", 42, 18 90 50 10, tab 200 button "Modify Hilights", 43, 70 90 50 10, tab 200 button "?", 44, 130 90 10 10, tab 200 box "Exceptions", 45, 4 109 142 24, tab 200 button "Modify Away System Exceptions" 46, 8 118 100 10, tab 200 button "?", 48, 130 118 10 10, tab 200 button "Edit &Presets" 22, 12 159 60 15 button "&Ok" 23, 80 159 60 15, ok } ; ############################################## ; # Custom presets dialog # ; ############################################## dialog Custom.Aways { title Custom Away Messages size -1 -1 236 110 option dbu box "Custom Away Triggers" 1, 4 4 227 85 text "Trigger", 2, 16 12 30 10 text "Nick Settings", 3, 50 12 50 10 text "Away Message", 4, 130 12 50 10 list 5, 10 20 30 50 list 6, 40 20 50 50 list 7, 90 20 134 50, autohs button "Add", 8, 10 70 50 15 button "Edit", 10, 65 70 50 15 button "Delete", 9, 120 70 50 15 button "Clear", 12, 175 70 50 15 button "OK", 11, 90 90 50 15, OK } ; ############################################## ; # Idle Away Settings + Help dialogs # ; ############################################## dialog Idle.Away.Settings { title Idle Away Settings size -1 -1 120 85 option dbu box "Idle away settings", 1, 4 4 112 55 text "Nick Settings:", 2, 8 12 50 10 combo 3, 8 20 50 10, drop edit "", 4, 62 20 50 10 text "Idle away message:", 5, 8 35 50 10 edit "", 6, 8 43 104 10, autohs button "&Help" 7, 5 65 50 15 button "&Ok", 8, 65 65 50 15, OK } Dialog Idle.Away.Help { title Away System Help size -1 -1 150 90 option dbu box "Idle away help", 1, 4 4 142 60 text "Idle away nick and automatic message settings work in the same way as the default away settings in the main dialog, except that they define the settings used when you are automatically set away from Idle" 2, 8 15 133 25 text "you can use %time to refer to the time you must idle before being set as away", 3, 8 45 133 20 button "&Ok", 4, 50 70 50 15, OK } ; ############################################## ; # Preset Settings + Help dialogs # ; ############################################## dialog Preset.Settings { title Preset Settings size -1 -1 120 100 option dbu box "Preset settings", 1, 4 4 112 70 text "Trigger:", 2, 8 14 50 10 edit "", 3, 30 13 50 10 text "Nick Settings:", 4, 8 27 50 10 combo 5, 8 35 50 10, drop edit "", 6, 62 35 50 10 text "Away message:", 7, 8 50 50 10 edit "", 8, 8 58 104 10, autohs button "&Help" 9, 5 80 50 15 button "&Ok", 10, 65 80 50 15, OK } Dialog Preset.Help { title Away System Help size -1 -1 150 90 option dbu box "Presets help", 1, 4 4 142 60 text "Preset nick and Away message settings work in the same way as the default away settings in the main dialog, except that they define the settings used for the preset you are creating" 2, 8 15 133 27 text "To use a preset once you have created it simply type /Away TRIGGER", 3, 8 45 133 20 button "&Ok", 4, 50 70 50 15, OK } ; ############################################## ; # Exceptions dialogs # ; ############################################## dialog Away.Exceptions { title Away System Exceptions size -1 -1 120 100 option dbu box "Exceptions" 1, 4 4 112 75 text "Networks" 2, 8 12 50 10, center list 3, 8 19 50 58 button "Add" 6, 61 20 50 10 button "Delete" 7, 61 34 50 10 button "Edit" 8, 61 49 50 10 button "Clear" 9, 61 63 50 10 button "OK" 10, 35 82 50 15, oks } dialog Away.AddException { title Add Exception size -1 -1 156 190 option dbu box "Add Exception" 1, 4 4 148 165 text "Network Name:" 2, 8 16 40 10 edit "" 3, 50 15 60 10 text "If you are unsure of a network name you can type: //echo -a $network in mIRC to view it." 20, 8 30 130 15 box "Exception scope" 4, 8 50 140 55 Text "This exception affects:" 5, 12 60 55 10 radio "Entire network" 6, 69 59 65 10 radio "certain channels only" 7, 69 69 65 10 Text "Enter Channels to be excepted, seperated by spaces." 8, 12 80 130 10 edit "" 9, 12 90 130 10 box "Exception Options" 10, 8 110 140 55 text "On this network:" 11, 12 120 45 10 check "Do not change nick" 12, 55 120 55 10 check "Do not send away messages" 13, 55 130 80 10 check "Do not send hilight responses" 14, 55 140 80 10 check "Do not send PM responses" 15, 55 150 80 10 button "OK" 16, 53 172 50 15, Ok } ; ############################################## ; # Help Dialogs # ; ############################################## dialog Away.Help.6 { title Away System Help size -1 -1 150 120 option dbu box "Nick Settings Help", 1, 5 5 140 90 text "Nick PREFIX: Adds the specified text to the FRONT of your nick when going away", 2, 8 15 133 20 text "Nick SUFFIX: Adds the specified text to the END of your nick when going away", 3, 8 35 133 20 text "Set to: Sets your nick to the specified nick when you set away", 4, 9 55 133 20 text "Dont Change: Means that youre nick will not change when going away or coming back", 5, 8 75 133 20 button "OK", 7, 50 100 50 15, OK } dialog Away.Help.10 { title Away System Help size -1 -1 150 90 option dbu box "Auto Away Help", 1, 5 5 140 60 text "Enabling Auto-Away will automatically set you as away if you are idle for the specified time", 2, 8 15 134 20 text "Time must be between 1 and 60 minutes", 3, 8 35 134 20 text "Options for settings Idle nick and message can be found by clicking the options button", 4, 8 45 134 20 button "OK", 5, 50 70 50 15, ok } dialog Away.Help.13 { title Away System Help size -1 -1 150 80 option dbu box "Show Leaving Time Help", 1, 5 5 140 50 text "Enabling 'Show Leaving Time' will display the time you went away in all your away messages in the specified Time Format", 2, 8 15 134 20 button "Click Here for a list of codes used in time format", 3, 8 40 134 10 button "OK", 4, 50 60 50 15, ok } dialog Away.Help.16 { title Away System Help size -1 -1 150 90 option dbu box "Show Time Away Help", 1, 5 5 140 60 text "Enabling 'Show Time Away' will display how long you have been away in all your away messages in the specified Time Format", 2, 8 15 134 20 text "Example of Short format: 5h 6m 10s" 3, 8 40 134 10 text "Example of Medium format: 5hrs 6mins 10secs" 4, 8 48 134 10 text "Example of long format: 5 hours 6 minutes 10 seconds" 5, 8 56 134 10 button "OK", 6, 50 70 50 15, ok } dialog Away.Help.21 { title Away System Help size -1 -1 150 65 option dbu box "Automatic Return Help", 1, 5 5 140 35 text "Enabling 'Automatic Return' will automatically bring you back from away if you send any Channel And/Or Private message", 2, 8 15 134 20 button "OK", 5, 50 45 50 15, ok } dialog Away.Help.26 { title Away System Help size -1 -1 150 55 option dbu box "Default Message Help", 1, 5 5 140 27 text "If you do not enter a reason when going away this default will be used", 2, 8 15 134 20 button "OK", 3, 50 35 50 15, ok } dialog Away.Help.34 { title Away System Help size -1 -1 150 60 option dbu box "Message sending help", 1, 5 5 140 32 text "These options refer to weather your away message will be sent to channels and/or Pm's (Queries) when leaving and returning.", 2, 8 15 134 20 button "OK", 3, 50 40 50 15, ok } dialog Away.Help.40 { title Away System Help size -1 -1 150 80 option dbu box "Auto Response Help", 1, 5 5 140 50 text "These options refer to what actions will trigger an auto message alerting the person that you are away.", 2, 8 15 134 20 text "Channel highlight is triggered whenever someone says a word that is in your hilights list", 3, 8 35 134 20 button "OK", 4, 50 60 50 15, ok } dialog Away.Help.44 { title Away System Help size -1 -1 150 120 option dbu box "Hilight help", 1, 5 5 140 92 text "'Hilight' occurs whenever somebody says a word that is in your hilights list.", 2, 8 15 134 20 text "Your away hilights determine what words, when said, will cause the script to notify the person that you are away, and log the message", 3, 8 31 134 20 text "If you have hilights set in mIRC you can click 'Get mIRC Hilights' to have the away system use these same hilights", 4, 8 54 134 20 text "You may also add or modify seperate ones using the 'Modify Hilights' button. Note that Identifiers such as $me (which refers to your current nick) are also allowed" 5, 8 75 134 20 button "OK", 6, 50 100 50 15, ok } dialog Away.Help.48 { title Away System Help size -1 -1 150 65 option dbu box "Exceptions help", 1, 5 5 140 35 text "Exceptions allow you to specify networks/channels in which away messages are not sent, or networks in which your nick is not changed", 2, 8 15 134 25 button "OK", 3, 50 45 50 15, ok } dialog Away.Help.Time { title Away System Help size -1 -1 150 155 option dbu box "Time Format Help", 1, 5 5 140 120 text "The following is a list of Codes that can be used in Time Formats", 2, 8 15 134 20 box "Time Format Codes", 3, 8 30 134 88 list 4, 20 40 20 75 list 5, 40 40 90 75 button "OK", 6, 50 130 50 15, ok } ; ############################################## ; # Dialog Initiation events # ; ############################################## ; ----- Populate Time help on *:dialog:Away.Help.Time:init:*: { did -a $dname 4 HH did -a $dname 5 Hours - 2 Digit 24 hour time - $time(HH) did -a $dname 4 H did -a $dname 5 Hours - 1 Digit 24 hour time - $time(H) did -a $dname 4 hh did -a $dname 5 Hours - 2 Digit 12 hour time - $time(hh) did -a $dname 4 h did -a $dname 5 Hours - 1 Digit 12 hour time - $time(h) did -a $dname 4 nn did -a $dname 5 Minutes - 2 Digit - $time(nn) did -a $dname 4 n did -a $dname 5 Minutes - 1 Digit - $time(n) did -a $dname 4 ss did -a $dname 5 Seconds - 2 Digit - $time(ss) did -a $dname 4 s did -a $dname 5 Seconds - 1 Digit - $time(s) did -a $dname 4 tt did -a $dname 5 am/pm - Lower case - $time(tt) did -a $dname 4 TT did -a $dname 5 AM/PM - Upper Case - $time(TT) } ; ----- Populate main dialog settings on *:dialog:away:init:*: { ;Tab 100 Controls did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Prefix,c) $dname 3 Prefix did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Suffix,c) $dname 3 Suffix did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Set to,c) $dname 3 Set to did -a $+ $iif($readini(AwaySettings.ini,Config,NickEditType) == Don't Change,c) $dname 3 Don't Change if ($readini(AwaySettings.ini,Config,NickEditType) == Don't Change) did -m $dname 5 if ($readini(AwaySettings.ini,Config,NickPrefix)) && ($did(away,3).seltext == Prefix) did -ra $dname 5 $readini(AwaySettings.ini,Config,NickPrefix) if ($readini(AwaySettings.ini,Config,NickSuffix)) && ($did(away,3).seltext == Suffix) did -ra $dname 5 $readini(AwaySettings.ini,Config,NickSuffix) if ($readini(AwaySettings.ini,Config,NickSetTo)) && ($did(away,3).seltext == Set To) did -ra $dname 5 $readini(AwaySettings.ini,Config,NickSetTo) if ($readini(AwaySettings.ini,Config,AutoAway) == on) did -c $dname 7 | else did -m $dname 8 if ($readini(AwaySettings.ini,Config,AutoAwayTime)) did -a $dname 8 $calc($ifmatch / 60) | else did -a $dname 8 900 if ($readini(AwaySettings.ini,Config,LeavingTime) == on) did -c $dname 11 | else did -m $dname 12 if ($readini(AwaySettings.ini,Config,LeavingTimeFormat)) did -a $dname 12 $ifmatch | else did -a $dname 12 HH:nn:ss if ($readini(AwaySettings.ini,Config,TimeAway) == on) did -c $dname 14 | else did -b $dname 15 if ($readini(AwaySettings.ini,Config,TimeAwayFormat) == Short) did -ac $dname 15 Short | else did -a $dname 15 Short if ($readini(AwaySettings.ini,Config,TimeAwayFormat) == Medium) did -ac $dname 15 Medium | else did -a $dname 15 Medium if ($readini(AwaySettings.ini,Config,TimeAwayFormat) == Long) did -ac $dname 15 Long | else did -a $dname 15 Long if ($readini(AwaySettings.ini,Config,ARChannelMessage) == on) did -c $dname 19 if ($readini(AwaySettings.ini,Config,ARPrivateMessage) == on) did -c $dname 20 if ($readini(AwaySettings.ini,Config,DefaultMessage)) did -a $dname 25 $ifmatch ;Tab 200 controls if ($readini(AwaySettings.ini,Config,MsgChans) == on) did -c $dname 32 if ($readini(AwaySettings.ini,Config,MsgQueries) == on) did -c $dname 33 if ($readini(AwaySettings.ini,Config,RespondHilights) == on) did -c $dname 37 if ($readini(AwaySettings.ini,Config,RespondPM) == on) did -c $dname 38 if ($readini(AwaySettings.ini,Config,RespondNotice) == on) did -c $dname 39 } ; ----- Populate Custom presets list on *:dialog:Custom.Aways:init:*: { var %x = 1 while (%x <= 7) { if ($readini(AwaySettings.ini,Presets,%x)) { did -a $dname 5 $gettok($v1,1,126) did -a $dname 6 $gettok($v1,2,126) did -a $dname 7 $gettok($v1,3-,126) } else halt inc %x } } ; ----- Populate Idle Away Settings on *:dialog:Idle.Away.Settings:init:*: { tokenize 126 $readini(AwaySettings.ini,n,Config,IdleSettings) did -a $+ $iif($1 == Prefix,c) $dname 3 Prefix did -a $+ $iif($1 == Suffix,c) $dname 3 Suffix did -a $+ $iif($1 == Set to,c) $dname 3 Set to did -a $+ $iif($1 == Don't Change,c) $dname 3 Don't Change if ($1 == Don't Change) did -m $dname 5 else did -ra $dname 4 $2 if ($3) did -a $dname 6 $3- } ; ----- Populate Preset settings on *:dialog:Away.Preset:init:*: { if (%Away.EditPreset) { var %pre = %Away.EditPreset, %trigger = $did(Custom.Aways,5).seltext var %edittype = $gettok($did(Custom.Aways,6).seltext,1,58), %nickedit = $gettok($did(Custom.Aways,6).seltext,2,58) var %reason = $did(Custom.Aways,7).seltext did -a $dname 3 %trigger did -a $+ $iif(%edittype == Prefix,c) $dname 5 Prefix did -a $+ $iif(%edittype == Suffix,c) $dname 5 Suffix did -a $+ $iif(%edittype == Set to,c) $dname 5 Set to did -a $+ $iif(%edittype == Don't Change,c) $dname 5 Don't Change if (%edittype == Don't Change) did -m $dname 6 else did -ra $dname 6 %nickedit if (%reason) did -a $dname 8 %reason } else { did -a $dname 5 Prefix did -a $dname 5 Suffix did -a $dname 5 Set to did -a $dname 5 Don't Change } } ; Exception initiation events on *:dialog:Away.Exceptions:init:*: { var %x = 1,%total = $ini(AwaySettings.ini,Exceptions,0) while (%x <= %total) { did -a $dname 3 $ini(AwaySettings.ini,Exceptions,%x) inc %x } } on *:dialog:Away.AddException:init:*: { if (%Away.Exception) { var %info = $readini(AwaySettings.ini,Exceptions,%away.Exception) var %scope = $gettok(%info,1,126), %options = $gettok(%info,2,126), %chans = $gettok(%info,3-,126) did -a $dname 3 %Away.Exception if (%scope == 1) { did -c $dname 6 did -b $dname 9 } else { did -c $dname 7 did -b $dname 12,15 did -e $dname 9 did -a $dname 9 %chans } if ($left(%options,1) == 1) && (%scope == 1) did -c $dname 12 if ($mid(%options,2,1) == 1) did -c $dname 13 if ($mid(%options,3,1) == 1) did -c $dname 14 if ($right(%options,1) == 1) && (%scope == 1) did -c $dname 15 } else { did -c $dname 6 did -b $dname 9 } } ; ############################################## ; # Dialog Sclick Events # ; ############################################## ; ----- Open Time Help dialog on *:dialog:Away.Help.13:sclick:3: { dialog $iif($dialog(Away.Help.Time),-o,-m) Away.Help.Time Away.Help.Time dialog -x $dname } ; ----- Select same line in each column in time help dialog on *:dialog:Away.Help.Time:sclick:*: { if ($did == 4) did -c $dname 5 $did(4).sel elseif ($did == 5) did -c $dname 4 $did(5).sel } ; ----- Processing clicks for main dialog on *:dialog:away:sclick:*: { ; Tab 100 if ($did == 3) { writeini AwaySettings.ini Config NickEditType $did(3).seltext if ($did(3).seltext == Prefix) did -nra $dname 5 $readini(AwaySettings.ini,Config,NickPrefix) elseif ($did(3).seltext == suffix) did -nra $dname 5 $readini(AwaySettings.ini,Config,NickSuffix) elseif ($did(3).seltext == Set to) did -nra $dname 5 $readini(AwaySettings.ini,Config,NickSetTo) else did -rm $dname 5 } if ($did == 7) && ($did(7).state == 0) did -m $dname 8 elseif ($did == 7) && ($did(7).state == 1) did -n $dname 8 elseif ($did == 11) && ($did(11).state == 0) did -m $dname 12 elseif ($did == 11) && ($did(11).state == 1) did -n $dname 12 elseif ($did == 14) && ($did(14).state == 0) did -b $dname 15 elseif ($did == 14) && ($did(14).state == 1) did -e $dname 15 elseif ($istok(6|10|13|16|21|26|34|40|44|48,$did,124)) dialog $iif($dialog($+(Away.Help.,$did)),-o,-m) $+(Away.Help.,$did) $+(Away.Help.,$did) elseif ($did == 22) dialog $iif($dialog(Custom.Aways),-o,-m) Custom.Aways Custom.Aways elseif ($did == 27) dialog $iif($dialog(Idle.Away.Settings),-o,-m) Idle.Away.Settings Idle.Away.Settings ; Tab 200 elseif ($did == 42) { if ($input(Retrieved the following hilights from your current mIRC settings: $crlf $crlf $+ $Get.Highlights $Crlf $crlf $+ Would you like to use these as your away system highlights? You can use the 'Modify Hilights' button to modify or add to these.,yi,Highlights)) { writeini AwaySettings.ini Config Hilights $Get.Highlights } } elseif ($did == 43) { var %hilights = $input(Enter Hilight words or identifiers seperated by commans ONLY. $crlf $+ Eg: $+($me,$chr(44),ALTNICK,$chr(44),$ $+ me),oe,Modify Hilights,$readini(AwaySettings.ini,n,Config,Hilights))) if (%hilights) writeini AwaySettings.ini Config Hilights $remove(%hilights,$chr(32)) else remini Settings.ini Away.Config Hilights } elseif ($did == 46) { dialog $iif($dialog(Away.Exceptions),-v,-m) Away.Exceptions Away.Exceptions } } ; ----- Process button clicks and keep selection of all columns the same in presets dialog on *:dialog:Custom.Aways:sclick:*: { if ($did == 5) did -c $dname 6,7 $did(5).sel elseif ($did == 6) did -c $dname 5,7 $did(6).sel elseif ($did == 7) did -c $dname 5,6 $did(7).sel elseif ($did == 8) dialog $iif($dialog(Away.Preset),-v,-m) Away.Preset Preset.Settings elseif ($did == 9) { if (!$did(5).sel) var %x = $input(Error: You must select an entry to delete,wo,Invalid Selection) elseif ($?!="Are you sure you want to delete this entry - $did(5).seltext ") { did -d $dname 5 $did(5).sel did -d $dname 6 $did(6).sel did -d $dname 7 $did(7).sel } } elseif ($did == 10) { if (!$did(5).sel) { var %x = $input(Error: You must select an entry to edit,wo,Invalid Selection) | halt } set %Away.EditPreset $did(5).sel dialog $iif($dialog(Away.Preset),-v,-m) Away.Preset Preset.Settings } elseif ($did == 12) { if ($input(Are you sure you want to clear all your presets?,qy,Validation Prompt)) { var %x = 7 while (%x > 0) { did -c $dname 5 %x if ($did(5).seltext) did -d $dname 5,6,7 $did(5).sel dec %x } } } } ; ----- Process Idle Away clicks/settings on *:dialog:Idle.Away.Settings:sclick:*: { var %time = $calc($readini(AwaySettings.ini,Config,AutoAwayTime) / 60) if ($did == 3) { if ($did(3).seltext == Don't Change) did -rm $dname 4 else did -n $dname 4 } elseif ($did == 7) dialog $iif($dialog(Idle.Away.help),-v,-m) Idle.Away.help Idle.Away.Help } ; ----- Process Preset dialog clicks/settings on *:dialog:Away.Preset:sclick:*: { if ($did == 5) { if ($did(5).seltext == Don't Change) did -rm $dname 6 else did -n $dname 6 } elseif ($did == 9) dialog $iif($dialog(Preset.Help),-v,-m) Preset.Help Preset.Help } ; ----- Exception Clicks on *:dialog:Away.Exceptions:sclick:*: { if ($did == 6) dialog $iif($dialog(Away.AddException),-v,-m) Away.AddException Away.AddException elseif ($did == 7) { if (!$did(3).sel) var %x = $input(You must select an entry to delete,wo,Invalid Selection) elseif ($?!="Are you sure you want to delete this entry - $did(3).seltext ") { remini AwaySettings.ini Exceptions $did(3).seltext did -d $dname 3 $did(3).sel } } elseif ($did == 8) { if (!$did(3).sel) var %x = $input(You must select an entry to edit,wo,Invalid Selection) else { set %Away.Exception $did(3).seltext set %Away.ExceptionNum $did(3).sel dialog $iif($dialog(Away.AddException),-v,-m) Away.AddException Away.AddException } } elseif ($did == 9) { if ($input(Are you sure you want to clear all your network exceptions?,qy,Validation Prompt)) { var %x = $did(3).lines remini AwaySettings.ini Exceptions while (%x > 0) { did -c $dname 3 %x if ($did(3).seltext) did -d $dname 3 $did(3).sel dec %x } } } } on *:dialog:Away.AddException:Sclick:*: { if ($did == 6) { did -e $dname 12,15 did -b $dname 9 did -r $dname 9 } elseif ($did == 7) { did -b $dname 12,15 did -e $dname 9 if ($did(12).state == 1) did -u $dname 12 if ($did(15).state == 1) did -u $dname 15 } } ; ############################################## ; # Dialog Close Events # ; ############################################## ; ----- Main dialog - save data on *:dialog:Away:close:*: { ; tab 100 settings if ($did(5)) { if ($did(3).seltext == Prefix) writeini AwaySettings.ini Config NickPrefix $did(5) elseif ($did(3).seltext == Suffix) writeini AwaySettings.ini Config NickSuffix $did(5) elseif ($did(3).seltext == Set to) writeini AwaySettings.ini Config NickSetTo $did(5) } else { writeini AwaySettings.ini Config NickPrefix Away| writeini AwaySettings.ini Config NickSuffix |Away } writeini AwaySettings.ini Config AutoAway $iif($did(7).state == 0,off,on) writeini AwaySettings.ini Config AutoAwayTime $iif($did(8),$calc($did(8) * 60),900) writeini AwaySettings.ini Config LeavingTime $iif($did(11).state == 0,off,on) writeini AwaySettings.ini Config LeavingTimeFormat $iif($did(12),$did(12),HH:nn:ss) writeini AwaySettings.ini Config TimeAway $iif($did(14).state == 0,off,on) writeini AwaySettings.ini Config TimeAwayFormat $iif($did(15),$did(15),Shorts) writeini AwaySettings.ini Config ARChannelMessage $iif($did(19).state == 0,off,on) writeini AwaySettings.ini Config ARPrivateMessage $iif($did(20).state == 0,off,on) if ($did(25)) writeini AwaySettings.ini Config DefaultMessage $did(25) else remini Settings.ini Away.Config DefaultMessage if ($readini(AwaySettings.ini,Config,AutoAway) == on) .timerAway.IdleCheck -o 0 30 Away.IdleCheck elseif ($timer(Away.IdleCheck)) .timerAway.IdleCheck off ;Tab 200 settings writeini AwaySettings.ini Config MsgChans $iif($did(32).state == 0,off,on) writeini AwaySettings.ini Config MsgQueries $iif($did(33).state == 0,off,on) writeini AwaySettings.ini Config RespondHilights $iif($did(37).state == 0,off,on) writeini AwaySettings.ini Config RespondPM $iif($did(38).state == 0,off,on) writeini AwaySettings.ini Config RespondNotice $iif($did(39).state == 0,off,on) } ; ----- Save presets on *:dialog:Custom.Aways:close:*: { var %x = 1, %lines = $did(5).lines while (%x <= %lines) { did -c $dname 5,6,7 %x writeini AwaySettings.ini presets %x $+($did(5).seltext,~,$did(6).seltext,~,$did(7).seltext) inc %x } dec %x while (%x < 7) { inc %x if ($readini(AwaySettings.ini,presets,%x)) remini AwaySettings.ini Presets %x } } ; ----- Save Idle away settings on *:dialog:Idle.Away.Settings:close:*: { writeini AwaySettings.ini Config IdleSettings $+($did(3).seltext,~,$iif($did(4),$ifmatch,IDLE),~,$iif($did(6),$ifmatch,Auto away after % $+ time minutes idle)) } ; ----- Save Preset settings on *:dialog:Away.Preset:close:*: { var %pre = %away.EditPreset if (!$did(3)) var %x = $input(Error: No trigger was specified,ow,Input Error) elseif (!$did(6)) && ($did(5).seltext != Don't Change) var %x = $input(Error: You did not specify $iif($did(5).seltext,a nick $iif($did(5).seltext == set to,to change to,$ifmatch),any nick settings),ow,Input Error) elseif ($remove($did(6),$chr(91),$chr(93),$chr(92),$chr(45),$chr(95),$chr(123),$chr(124),$chr(125)) !isalnum) && ($did(6)) { var %x = $input(Error: Invalid Characters detected in specified nick,wo,Input Error) | halt } elseif (!$did(5).seltext) var %x = $input(Error: You have not specified how to change your nick - Select an option from the nick settings drop down,ow,Error) elseif ($numtok($did(3),32) > 1) || ($numtok($did(6),32) > 1) var %x = $input(Error: Trigger and nick Settings can each only be one word long,wo,Input Error) else { did $iif(%pre,-o,-a) Custom.Aways 5 $iif(%pre,%pre) $did(3) did $iif(%pre,-o,-a) Custom.Aways 6 $iif(%pre,%pre) $did(5).seltext $+ $iif($did(5).seltext != Don't Change,: $did(6)) did $iif(%pre,-o,-a) Custom.Aways 7 $iif(%pre,%pre) $did(8) unset %away.EditPreset } } ; ---- Save Exception settings on *:dialog:Away.AddException:close:*: { if (!$did(3)) var %x = $input(No Network name was entered,wo,Input Error) elseif ($numtok($did(3),32) > 1) var %x = $input(Network name may not contain spaces,wo,Input Error) else { var %scope = $iif($did(6).state == 1,1,2) var %x = 1, %numchans = $numtok($did(9),32) while (%x <= %numchans) { var %token = $gettok($did(9),%x,32) if (#?* iswm %token) var %chans = %chans %token elseif (%token != $chr(35)) var %chans = %chans $+($chr(35),%token) inc %x } var %x = 12 while (%x <= 15) { var %options = %options $+ $did(%x).state inc %x } did $iif(%Away.ExceptionNum,-o,-a) Away.Exceptions 3 $iif(%Away.ExceptionNum,$ifmatch) $did(3) writeini AwaySettings.ini Exceptions $did(3) $+(%scope,~,%options,~,%chans) unset %Away.Exception* } } ; ############################################## ; # /Away And /back aliases # ; ############################################## alias away { ; ----- Unset Idle timer, Get highlights, enable #away group for logging etc if ($timer(Away.IdleCheck)) .timerAway.IdleCheck off set %Away.Hilights $readini(awaySettings.ini,n,Config,Hilights) .enable #away ; ---- Retrieve away settings from config/User entry var %time = $calc($readini(AwaySettings.ini,Config,AutoAwayTime) / 60) if ($1) set %away.Reason $1- elseif ($readini(AwaySettings.ini,Config,DefaultMessage)) set %away.Reason $v1 set %Away.LeftAt $ctime if ($readini(AwaySettings.ini,Config,LeavingTime) == on) { var %LeavingTimeFormat = $readini(AwaySettings.ini,Config,LeavingTimeFormat) set %away.LeaveTime $time(%LeavingTimeFormat) } ; ---- Check for idleaway If ($1- = Auto.Idle.Away) { var %IdleInfo = $readini(AwaySettings.ini,Config,IdleSettings) var %edittype = $gettok(%IdleInfo,1,126) if (%edittype == Set to) var %nickset = $gettok(%IdleInfo,2,126) else var %nickadd = $gettok(%IdleInfo,2,126) set %Away.Reason $($gettok(%IdleInfo,3-,126),2) } else { var %edittype = $readini(AwaySettings.ini,Config,NickEditType) if (%edittype == Set To) var %nickset = $readini(AwaySettings.ini,Config,NickSetTo) else var %nickadd = $readini(AwaySettings.ini,Config,Nick $+ %edittype) } ; ----- Check for presets var %x 1 while (%x <= 7) { if ($readini(AwaySettings.ini,Presets,%x)) { var %preset = $v1 if ($1- == $gettok(%preset,1,126)) { var %edittype = $gettok($gettok(%preset,2,126),1,58) var %nickadd = $remove($gettok($gettok(%preset,2,126),2,58),$chr(32)) set %Away.Reason $gettok(%preset,3-,126) set %Away.Preset %x var %x = 7 } } inc %x } ; ----- Cycle Connections to change nick/send msg var %x = 1, %connections = $scon(0) while (%x <= %connections) { scon %x if ($status == connected) { unset %Except.* if ($readini(AwaySettings.ini,Exceptions,$network)) { var %Except.info = $v1 var %Except.Scope = $gettok(%Except.info,1,126) var %Except.Options = $gettok(%Except.info,2,126) if (%Except.Scope == 2) && ($mid(%Except.Options,2,1) == 1) var %Except.NoMsgChans = $gettok(%Except.Info,3-,126) if (%Except.Scope == 1) && ($left(%Except.Options,1) == 1) var %Except.NoNickChange = 1 if (%Except.Scope == 1) && ($mid(%Except.Options,2,1) == 1) var %Except.NoAwayMsg = 1 } set $+(%,Away.Oldnick.,$network) $me if ($readini(AwaySettings.ini,Config,NickEditType) != Don't Change) && (!%Except.NoNickChange) { if (%edittype == Set To) && (%NickSet != $me) var %newnick = %NickSet if (%edittype == Prefix) && ($+(%nickadd,*) !iswm $me) var %newnick = $+(%nickadd,$me) if (%edittype == Suffix) && ($+(*,%nickadd) !iswm $me) var %newnick = $+($me,%nickadd) set $+(%,Away.Newnick.,$network) $iif(%newnick,$ifmatch,$me) if (%newnick) nick %newnick } if ($chan(0)) && ($readini(AwaySettings.ini,Config,MsgChans) == on) && (!%Except.NoAwayMsg) { amsg 7[14Away7] $iif(%Away.Reason,14Reason:07 %Away.Reason) $iif(%Away.leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7)) } if ($readini(AwaySettings.ini,Config,MsgQueries) == on) && (!%Except.NoAwayMsg) { qmsg 7[14Away7] $iif(%Away.Reason,14Reason:07 %Away.Reason) $iif(%Away.leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7)) } !away 7[14Away7] $iif(%Away.Reason,14Reason:07 %Away.Reason) $iif(%Away.leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7)) } inc %x } } alias back { var %x = 1, %connections = $scon(0) while (%x <= %connections) { scon %x if ($status == connected) { unset %Except.* if ($readini(AwaySettings.ini,Exceptions,$network)) { var %Except.info = $v1 var %Except.Scope = $gettok(%Except.info,1,126) var %Except.Options = $gettok(%Except.info,2,126) if (%Except.Scope == 2) && ($mid(%Except.Options,2,1) == 1) var %Except.NoMsgChans = $gettok(%Except.Info,3-,126) if (%Except.Scope == 1) && ($left(%Except.Options,1) == 1) var %Except.NoNickChange = 1 if (%Except.Scope == 1) && ($mid(%Except.Options,2,1) == 1) var %Except.NoAwayMsg = 1 } if (!%Except.NoNickChange) && ($($+(%,Away.Oldnick.,$network),2)) nick $ifmatch ; ----- Cycle Connections to change nick/send msg if ($chan(0)) && ($readini(AwaySettings.ini,Config,MsgChans) == on) && (!%Except.NoAwayMsg) { amsg 7[14Back7] $iif(%away.Reason,14From:07 %Away.Reason) $iif(%Away.Leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7)) $iif($Away.GoneFor,14Gone for:07 $Away.GoneFor) } if ($readini(AwaySettings.ini,Config,MsgQueries) == on) && (!%Except.NoAwayMsg) { qmsg 7[14Back7] $iif(%away.Reason,14From:07 %Away.Reason) $iif(%Away.Leavetime,14Left at:07 %Away.Leavetime (14+1 GMT7)) $iif($Away.GoneFor,14Gone for:07 $Away.GoneFor) } !away } inc %x } .disable #away unset %away.* if ($hget(Away.PM.Responses)) || ($hget(Away.Highlight.Responses)) hfree -w Away.*.Responses if ($readini(AwaySettings.ini,Config,AutoAway) == on) .timerAway.IdleCheck -o 0 30 Away.IdleCheck } ; ############################################## ; # Other Aliases # ; ############################################## alias -l Away.Gonefor { if ($readini(AwaySettings.ini,Config,TimeAway) == on) { var %TimeAwayFormat = $readini(AwaySettings.ini,Config,TimeAwayFormat) if (%Away.LeftAt) { var %duration = $duration($calc($ctime - %Away.LeftAt),%TimeAwayFormat) if (%TimeAwayFormat == Short) return $Short.Duration(%duration) elseif (%TimeAwayFormat == medium) return %duration elseif (%TimeAwayFormat == long) return $Long.Duration(%duration) } } else return $false } alias -l Short.Duration return $replacex($1-,secs,s,sec,s,mins,m,min,m,hrs,h,hr,h,days,d,day,d,wks,w,wk,w) alias -l Long.Duration return $replacex($1-,sec,second,secs,seconds,min,minute,mins,minutes,hr,hour,hrs,hours,wk,week,wks,weeks) alias -l Get.Highlights { var %x = 1, %Groups = $ini(mirc.ini,highlight,0) while (%x <= %groups) { var %Away.Highlights = $addtok(%Away.highlights,$highlight(%x),44) inc %x } return %Away.Highlights } alias -l Check.For.highlights { if (!%Away.Highlights) set %Away.Highlights $readini(AwaySettings.ini,n,Config,Hilights) var %x = 1, %highlights = $numtok(%Away.highlights,44) while (%x <= %highlights) { var %chighlight = $($gettok(%Away.Highlights,%x,44),2) if ($istok($1-,%chighlight,32)) return %chighlight inc %x } return $false } alias -l Away.Logwin { if (!$window(@Away.Logs)) window -eknz @Away.Logs echo -ti2 @Away.Logs $1- } alias -l Highlight.Response { if (!$hget(Away.highlight.Responses,$+($1,.,$2))) { scid $1 .notice $2 7[14Away7] $iif(%Away.Reason,14Reason:7 %Away.Reason) $iif(%Away.LeaveTime,14Left at:07 %Away.LeaveTime (14+1 GMT7)) $iif($away.gonefor,14Gone for:07 $away.gonefor) hadd -m Away.Highlight.Responses $+($1,.,$2) 1 } } alias -l Private.Message.Response { if (!$hget(Away.PM.Responses,$+($1,.,$2))) { scid $1 .msg $2 7[14Away7] $iif(%Away.Reason,14Reason:7 %Away.Reason) $iif(%Away.LeaveTime,14Left at:07 %Away.LeaveTime (14+1 GMT7)) $iif($away.gonefor,14Gone for:07 $away.gonefor) hadd -m Away.PM.Responses $+($1,.,$2) 1 } } alias -l Away.IdleCheck { var %x = 1, %networks = $scon(0) var %AutoAwayTime = $readini(AwaySettings.ini,Config,AutoAwayTime) while (%x <= %networks) { scon %x { if ($status == Connected) && ($idle < %AutoAwayTime) var %Idle = off } inc %x } if (%idle != off) away Auto away } alias Away.Config dialog $iif($dialog(Away),-v,-m) Away Away ; ############################################## ; # Logging and hilight resposes # ; ############################################## #away off ;Hilight responses on *:text:*:#: { if (!$Check.For.highlights($1-)) && (!$istok($1-,$me,32)) && (!$istok($1-,$($+(%,Away.Oldnick.,$network),2),32)) return if ($nick == [DM]) halt else { Away.Logwin 4[10CHANNEL MESSAGE4] $+(4[10,$iif($scon(0) > 1,$+($network,12/10)),$chan,12/10,$nick,4]) $1- if ($readini(AwaySettings.ini,Exceptions,$network)) { var -s %Except.info = $v1 var -s %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126) if (%Except.Scope == 2) && ($mid(%Except.Options,3,1) == 1) var %Except.NoHilight = $gettok(%Except.Info,3-,126) elseif (%Except.Scope == 1) && ($mid(%Except.Options,3,1) == 1) return } if (!$istok(%Except.NoHilight,$chan,32)) && ($readini(AwaySettings.ini,Config,RespondHilights) == on) Highlight.Response $cid $nick } } on *:action:*:#: { if (!$check.for.highlights($1-)) && (!$istok($1-,$me,32)) && (!$istok($1-,$($+(%,Away.Oldnick.,$network),2),32)) return else { Away.Logwin 4[10CHANNEL 10ACTION4] $+(4[10,$iif($scon(0) > 1,$+($network,12/10)),$chan,12/10,$nick,4]) * $nick $1- if ($readini(AwaySettings.ini,Exceptions,$network)) { var %Except.info = $v1 var %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126) if (%Except.Scope == 2) && ($mid(%Except.Options,3,1) == 1) var %Except.NoHilight = $gettok(%Except.Info,3-,126) elseif (%Except.Scope == 1) && ($mid(%Except.Options,3,1) == 1) return } if (!$istok(%Except.NoHilight,$chan,32)) && ($readini(AwaySettings.ini,Config,RespondHilights) == on) Highlight.Response $cid $nick } } ; Private notice response on *:notice:*:?: { if (*serv !iswm $nick) { Away.Logwin 4[10PRIVATE NOTICE4] $+(4[10,$iif($scon(0) > 1,$+($network,12/10)),Private,12/10,$nick,4]) $1- if ($readini(AwaySettings.ini,Exceptions,$network)) { var %Except.info = $v1 var %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126) if (%Except.Scope == 1) && ($right(%Except.Options,1) == 1) return } if ($readini(AwaySettings.ini,Config,RespondNotice) == on) Private.Message.Response $cid $nick } } ;PM responses on *:text:*:?: { if ($readini(AwaySettings.ini,Config,RespondPM) == on) && (*serv !iswm $nick) { if ($readini(AwaySettings.ini,Exceptions,$network)) { var %Except.info = $v1 var %Except.Scope = $gettok(%Except.info,1,126), %Except.Options = $gettok(%Except.info,2,126) if (%Except.Scope == 2) && ($mid(%Except.Options,3,1) == 1) var %Except.NoHilight = $gettok(%Except.Info,3-,126) elseif (%Except.Scope == 1) && ($right(%Except.Options,1) == 1) return } Private.Message.Response $cid $nick } } ;Return from away on input if set on *:input:#: { if ($left($1,1) != $readini(mirc.ini,text,commandchar)) { if ($readini(AwaySettings.ini,Config,ARChannelMessage) == on) back } } on *:input:?: { if ($left($1,1) != $readini(mirc.ini,text,commandchar)) { if ($readini(AwaySettings.ini,Config,ARPrivateMessage) == on) back } } #away end alias reset.away { set %away.LeaveTime $time set %Away.LeftAt $ctime echo -ta Reset away }
details of this paste
Note: Only the paste content is required, though a Name for it is useful.
Description / Question:
Content Type:
Expire this post in:
Name/Title: (if left blank, it will be set for you randomly)
Save this name/title in a cookie?
Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that aren't marked to expire will be indexable by search engines. Be careful with your passwords.
W3CXHTML
W3CCSS
services provided and written by NetMonks Consulting Corporation