Snippets
  • Uploaded By: entropy
  • Added: 2 years ago
  • Updated: 29 days ago
  • mIRC Version: 7.52+
  • Hits: 1,032
  • Size: 21.2KB
  • Downloads: 37
  • Review By: entropy



Away System v2.0

This snippet is fully featured and powerful.
This snippet manages your aways on all networks.
I hope you enjoy this snippet!
Screenshot...

    
  2    0  Login to Vote.


Source Code:
  1.  
  2. ; Away System v2.0 - by entropy 2020 (released 7/15/20)
  3.  
  4. ;================================================================= MENUS
  5.  
  6. menu menubar,status,channel,query {
  7. -
  8. $iif($server,Away System $sversion) { awaysys }
  9. -
  10. }
  11.  
  12. ;================================================================= MAIN EVENTS
  13.  
  14. on *:start:{
  15. if (!$isfile($qt($scriptdirawaymessages.txt))) { write -c $qt($scriptdirawaymessages.txt) }
  16. if (!$isfile($qt($scriptdirawayreasons.txt))) { write -c $qt($scriptdirawayreasons.txt) }
  17. if (!$isfile($qt($scriptdirawayverbose.txt))) { write -c $qt($scriptdirawayverbose.txt) }
  18. if (!$isfile($qt($scriptdirawaynicks.txt))) { write -c $qt($scriptdirawaynicks.txt) }
  19. unset %away_status %away_reason %away_msgs %away_gone
  20. .titlebar [HERE]
  21. }
  22. on *:exit:{ unset %away_status %away_reason %away_msgs %away_gone }
  23. on *:connect:{ .timercheckawayidle -o 0 1 checkidle }
  24. on *:disconnect:{ if ($dialog(awaysys)) { did -b awaysys 5 | did -c awaysys 5 | did -ue awaysys 4 | did -e awaysys 2 } }
  25. on *:load:{ .timercheckawayidle -o 0 1 checkidle | echomsg Welcome to $_b(Away System $sversion) - by $_b(entropy) 2020 - Script: $_b($qt($nopath($script))) has been loaded! }
  26. on *:unload:{
  27. if (%away_status) { scon -at1 !away }
  28. unset %away_status %away_reason %away_msgs %away_gone
  29. .timerupdatethis off
  30. .timercheckawayidle off
  31. if ($dialog($qt($scriptdirawaysys))) { dialog -x awaysys }
  32. if ($isfile($qt($scriptdirawaymessages.txt))) { .remove $qt($scriptdirawaymessages.txt) }
  33. if ($isfile($qt($scriptdirawayreasons.txt))) { .remove $qt($scriptdirawayreasons.txt) }
  34. if ($isfile($qt($scriptdirawayverbose.txt))) { .remove $qt($scriptdirawayverbose.txt) }
  35. if ($isfile($qt($scriptdirawaynicks.txt))) { .remove $qt($scriptdirawaynicks.txt) }
  36. echomsg Script: $_b($qt($nopath($script))) has been unloaded! Thanks for using this script!
  37. }
  38.  
  39. ;================================================================= MAIN ALIASES
  40.  
  41. alias -l awaysys { dialog $iif($dialog(awaysys),-x,-m) awaysys awaysys }
  42. alias -l echomsg { echo $iif($color(back) == 0 || $color(back) == 36,02,11) -tag * [AWAY] $1- }
  43. alias -l _b { return $+($chr(2),$1-,$chr(2)) }
  44. alias -l _f { return $remove($replace($duration($calc($ctime + 1 - %away_gone)),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s),$chr(32)) }
  45. alias -l _c { return $chr(9679) }
  46. alias -l updatetitle { if ($dialog(awaysys)) { dialog -t awaysys Away System $sversion - $iif(%away_status,[AWAY] - Gone: $_f,[HERE]) } | titlebar $iif(%away_status,[AWAY] - Gone: $_f,[HERE]) }
  47. alias -l isreason { var %a = 1, %b | while ($read(awayreasons.txt,%a)) { %b = $v1 | if (%b == $1-) { return $true } | inc %a } | return $false }
  48. alias -l all { if (!$dialog(awaysys)) { return } | did $iif($1 == e,-e,-b) awaysys 1,2,3,6,7,8,10,11,12,16,17,18,19,20,21,24,25,27,28,29 }
  49. alias -l smart { var %a = 1, %b, %c = brb bbl afk bbiaf bbiab bbs | while ($gettok(%c,%a,32)) { %b = $v1 | if ($+(%b,*) iswm $1) { return $true } | inc %a } | return $false }
  50. alias -l sversion { return v2.0 }
  51. alias -l syear { return 2020 }
  52. alias -l sauthor { return entropy }
  53.  
  54. alias -l verbose {
  55. if (%away_reason && %away_verbose == on) {
  56. if (%away_method == message) { var %method = message }
  57. else { var %method = action }
  58. var %a = 1, %b
  59. while ($scon(%a)) {
  60. scid $v1
  61. if ($read(awayverbose.txt,wn,$network *)) {
  62. var %x = 1, %y, %l = $gettok($v1,2-,32)
  63. if (%l == all) {
  64. while ($chan(%x)) {
  65. %y = $v1
  66. $+(.timerawayverbose,$network,%y) 1 1 $iif(%method == message,msg,describe) $unsafe( %y ) $unsafe( $1- )
  67. inc %x
  68. }
  69. }
  70. else {
  71. var %x = 1, %y
  72. while ($gettok(%l,%x,32)) {
  73. %y = $v1
  74. if (%y ischan) { $+(.timerawayverbose,$network,%y) 1 1 $iif(%method == message,msg,describe) $unsafe( %y ) $unsafe( $1- ) }
  75. inc %x
  76. }
  77. }
  78. }
  79. inc %a
  80. }
  81. scid -r
  82. if ($read(awayverbose.txt,wn,all *)) {
  83. var %c = $gettok($v1,2-,32)
  84. if (%c == all) {
  85. var %x = 1, %y
  86. while ($scon(%x)) {
  87. %y = $v1
  88. scid %y
  89. var %o = 1, %n
  90. while ($chan(%o)) {
  91. %n = $v1
  92. $+(.timerawayverbose,$network,%n) 1 1 $iif(%method == message,msg,describe) $unsafe( %n ) $unsafe( $1- )
  93. inc %o
  94. }
  95. inc %x
  96. }
  97. scid -r
  98. }
  99. else {
  100. var %x = 1, %y
  101. while ($scon(%x)) {
  102. %y = $v1
  103. scid %y
  104. var %a = 1, %n
  105. while ($gettok(%c,%a,32)) {
  106. %n = $v1
  107. if (%n ischan) { $+(.timerawayverbose,$network,%n) 1 1 $iif(%method == message,msg,describe) $unsafe( %n ) $unsafe( $1- ) }
  108. inc %a
  109. }
  110. inc %x
  111. }
  112. scid -r
  113. }
  114. }
  115. }
  116. }
  117.  
  118. alias -l setnick {
  119. if (%away_reason && %away_nicks == on) {
  120. var %a = 1, %b
  121. while ($scon(%a)) {
  122. scid $v1
  123. if ($read(awaynicks.txt,wn,$network *)) {
  124. var %l = $gettok($v1,2-,32)
  125. if ($numtok(%l,32) == 2) { $+(.timerawaynick,$network) -om 1 500 nick $iif($1 == main,$gettok(%l,1,32),$gettok(%l,2,32)) }
  126. }
  127. inc %a
  128. }
  129. scid -r
  130. }
  131. }
  132.  
  133. alias -l undo {
  134. if ($dialog(awaysys)) {
  135. if (!%away_status) { all e | did -b awaysys 5 | did -c awaysys 5 | did -ue awaysys 4 }
  136. else { all b | did -b awaysys 4 | did -c awaysys 4 | did -ue awaysys 5 }
  137. }
  138. echomsg Away Flood Protection has expired.
  139. }
  140.  
  141. alias -l gettime {
  142. var %a = 1, %b, %c = $replace($1,w,$+(w,$chr(1)),d,$+(d,$chr(1)),h,$+(h,$chr(1)),m,$+(m,$chr(1)),s,$+(s,$chr(1))), %secs = 0
  143. while ($gettok(%c,%a,1)) {
  144. %b = $v1
  145. if (w isin %b) { inc %secs $calc($remove(%b,w) * 60 * 60 * 24 * 7) }
  146. if (d isin %b) { inc %secs $calc($remove(%b,d) * 60 * 60 * 24) }
  147. if (h isin %b) { inc %secs $calc($remove(%b,h) * 60 * 60) }
  148. if (m isin %b) { inc %secs $calc($remove(%b,m) * 60) }
  149. if (s isin %b) { inc %secs $remove(%b,s) }
  150. inc %a
  151. }
  152. if (%secs == 0) { return $1 }
  153. else { return %secs }
  154. }
  155.  
  156. alias -l checkidle {
  157. var %a = $gettime(%away_idle)
  158. if (!%away_status && %a != 0 && $server) {
  159. if ($idle >= %a) {
  160. away $iif(%away_idle isnum, $remove($replace($duration(%away_idle),wks,w,wk,w,days,d,day,d,hrs,h,hr,h,mins,m,min,m,secs,s,sec,s),$chr(32)),%away_idle) idle
  161. if ($dialog(awaysys)) {
  162. did -c awaysys 4
  163. did -b awaysys 4
  164. did -ue awaysys 5
  165. var %a = 1, %b, %found = no, %line
  166. while ($read(awayreasons.txt,%a)) {
  167. %b = $v1
  168. if (%b == %away_reason) { %found = yes | %line = %a | break }
  169. inc %a
  170. }
  171. if (%found == no) { did -ac awaysys 2 %away_reason }
  172. else { did -c awaysys 2 %line }
  173. did -b awaysys 2
  174. }
  175. }
  176. }
  177. }
  178.  
  179. alias away {
  180. if (!$server) { echomsg You are not connected to any server! }
  181. elseif ($timer(awayflood)) { echomsg You must wait $_b($+($timer(awayflood).secs,s)) to go away again! | did -b awaysys 4,5 }
  182. elseif (!$1) {
  183. if (%away_status == away) {
  184. if (%away_wait) {
  185. if ($dialog(awaysys)) {
  186. did -ue awaysys 5
  187. did -b awaysys 4
  188. did -c awaysys 4
  189. }
  190. noop $input(You recently used this command. Please wait $var(%away_wait,1).secs seconds and try again.,12,Prompt)
  191. return
  192. }
  193. scon -at1 !away
  194. updatetitle
  195. if ($dialog(awaysys)) {
  196. dialog -t awaysys Away System $sversion - [HERE]
  197. all e
  198. did -b awaysys 5
  199. did -c awaysys 5
  200. did -ue awaysys 4
  201. did -u awaysys 2
  202. }
  203. titlebar [HERE]
  204. .timerupdatethis off
  205. scon -at1 .resetidle
  206. set -u10 %away_wait $ctime
  207. }
  208. else { echomsg You are not away! }
  209. }
  210. else {
  211. if (!%away_status) {
  212. if (%away_wait) {
  213. if ($dialog(awaysys)) {
  214. did -ue awaysys 4
  215. did -b awaysys 5
  216. did -c awaysys 5
  217. }
  218. noop $input(You recently used this command. Please wait $var(%away_wait,1).secs seconds and try again.,12,Prompt)
  219. return
  220. }
  221.  
  222. scon -at1 !away $strip($1-)
  223. %away_status = away
  224. %away_reason = $strip($1-)
  225. %away_msgs = 0
  226.  
  227. var %a = 1, %b, %found = no, %line
  228. if ($dialog(awaysys)) {
  229. while ($did(awaysys,2,%a)) {
  230. %b = $v1
  231. if (%b == $1-) { %found = yes | %line = %a | break }
  232. inc %a
  233. }
  234. }
  235.  
  236. if (%found == no) { if ($dialog(awaysys)) { did -ac awaysys 2 $strip($1-) } | if (!$isreason($strip($1-))) { write awayreasons.txt $strip($1-) } }
  237. elseif ($dialog(awaysys)) { did -c awaysys 2 %line }
  238.  
  239. if ($dialog(awaysys) && !$did(awaysys,2)) { did -c awaysys 2 No reason }
  240. updatetitle
  241. .timerupdatethis -o 0 1 updatetitle
  242. if ($dialog(awaysys)) {
  243. all b
  244. did -c awaysys 4
  245. did -ue awaysys 5
  246. }
  247. set -u10 %away_wait $ctime
  248. }
  249. else { echomsg You are already away! }
  250. }
  251. }
  252.  
  253. ;================================================================= ON INPUT
  254.  
  255. on *:input:*:{
  256. if (/* !iswm $1 && $server && $active != Status Window) {
  257. if ($query($active) || $chan($active)) {
  258. scon -at1 .resetidle
  259. if (%away_status && %away_cancel == yes) { unset %away_wait | away }
  260. elseif (!%away_status && $smart($strip($1)) && %away_smart == on) { away $strip($1-) }
  261. }
  262. }
  263. }
  264.  
  265. ;================================================================= DIALOG
  266.  
  267. dialog awaysys {
  268. title "Away System"
  269. size -1 -1 566 290
  270. option pixels notheme
  271. check "Away", 4, 10 256 78 25, push
  272. check "Back", 5, 88 256 78 25, push
  273. button "OK", 9, 483 256 75 25, ok
  274. button "Unload", 13, 405 256 78 25
  275. tab "Main", 14, 10 9 548 241
  276. text "Away Reason:", 1, 23 44 73 16, tab 14
  277. combo 2, 100 42 391 156, tab 14 sort size edit drop
  278. text "Messages:", 7, 23 68 50 16, tab 14
  279. list 8, 22 84 528 131, tab 14 size extsel hsbar vsbar
  280. button "Delete", 10, 491 216 57 20, tab 14
  281. button "Clear", 17, 490 42 57 19, tab 14
  282. tab "Options", 15
  283. text "Idle Away:", 11, 19 44 57 16, tab 15 right
  284. edit "", 6, 79 40 61 23, tab 15
  285. check "Cancel away on activity", 12, 210 41 136 20, tab 15
  286. check "Away Verbose", 3, 21 65 93 20, tab 15
  287. edit "", 16, 20 84 185 151, tab 15 multi return autohs autovs hsbar vsbar
  288. check "Away Nicknames", 18, 210 65 102 20, tab 15
  289. edit "", 19, 210 84 180 150, tab 15 multi return autohs autovs hsbar vsbar
  290. check "Smart Away", 21, 396 41 82 20, tab 15
  291. text "Verbose Method:", 20, 396 68 120 16, tab 15
  292. radio "Action", 24, 395 84 55 20, tab 15
  293. radio "Message", 25, 454 84 64 20, tab 15
  294. check "Away Notices", 27, 396 108 87 20, tab 15
  295. edit "", 29, 395 149 152 41, tab 15 multi hsbar
  296. text "Away Notice Message:", 28, 396 133 120 16, tab 15
  297. tab "Help", 22
  298. edit "", 23, 18 42 531 195, tab 22 read multi return autovs vsbar
  299. }
  300.  
  301. ;================================================================= DIALOG EVENTS
  302.  
  303. on *:dialog:awaysys:init:0:{
  304. if (%away_text) { did -ra awaysys 29 $v1 }
  305.  
  306. if (%away_notices == yes) { did -c awaysys 27 }
  307.  
  308. if (%away_method == message) { did -c awaysys 25 }
  309. else { did -c awaysys 24 }
  310.  
  311. if (%away_smart == on) { did -c awaysys 21 }
  312. updatetitle
  313. var %a = 1, %b
  314. while ($read(awaymessages.txt,%a)) { did -za awaysys 8 $v1 | inc %a }
  315. if (%away_statuts == away) { did -c awaysys 6 | did -b awaysys 6 }
  316. else { did -c awaysys 5 | did -b awaysys 5 }
  317. var %a = 1, %b
  318. while ($read(awayreasons.txt,%a)) {
  319. %b = $v1
  320. did -a awaysys 2 %b
  321. inc %a
  322. }
  323. if (%away_status) {
  324. var %a = 1, %b, %c = %away_reason
  325. while ($did(2,%a).text) {
  326. %b = $v1
  327. if (%b == %c) { did -c awaysys 2 %a | break }
  328. inc %a
  329. }
  330. did -cb awaysys 4
  331. did -ue awaysys 5
  332. all b
  333. }
  334. else { did -e awaysys 6,7,8,10,11,12 }
  335. did -ra awaysys 6 $iif(%away_idle,$v1,0)
  336. if (%away_cancel) { did -c awaysys 12 }
  337. if ($timer(awayflood) && !%away_status) {
  338. all b
  339. did -c awaysys 5
  340. did -u awaysys 4
  341. }
  342. if (%away_verbose == on) { did -c awaysys 3 }
  343. if ($read(awayverbose.txt,1)) { loadbuf -o awaysys 16 awayverbose.txt }
  344.  
  345. if (%away_nicks == on) { did -c awaysys 18 }
  346. if ($read(awaynicks.txt,1)) { loadbuf -o awaysys 19 awaynicks.txt }
  347.  
  348. if (%away_tab) { .timer -m 1 10 did -c awaysys $v1 }
  349.  
  350. did -a awaysys 23 ===========================[ NOTICE ]============================= $+ $crlf $+ $crlf
  351. did -a awaysys 23 Please note that an away message/nick change on away is frowned upon by a lot of people. You could get banned by using these on some networks/channels. Use at your OWN RISK! $crlf $+ $crlf
  352. did -a awaysys 23 ==========================[ IDLE AWAY ]=========================== $+ $crlf $+ $crlf
  353. did -a awaysys 23 Idle Away: "0" to disable going away on idle. Type: "1800" for 30mins (1800 seconds). Type: "1h30m23s" for (5423 seconds). $crlf $+ $crlf
  354. did -a awaysys 23 =========================[ AWAY VERBOSE ]========================== $+ $crlf $+ $crlf
  355. did -a awaysys 23 Away Verbose: "Network #chan1 #chan2 #chan3" To advertise your away messages to this network/chans. $crlf $+ $crlf
  356. did -a awaysys 23 Example Verbose: "mIRCScripts #chat #opers" To advertise your away messages to network "mIRCScripts" and channels "#chat #opers". $crlf $+ $crlf
  357. did -a awaysys 23 Example Verbose: "UnderNet all". Will advertise your away messages on all channels on this particular network. $crlf $+ $crlf
  358. did -a awaysys 23 Example Verbose: "all #chan1 #chan2 #chan3". Will advertise your away messages on all networks on the channels specified. $crlf $+ $crlf
  359. did -a awaysys 23 Example Verbose: "all all". Will advertise your away messages on all networks and on all channels. $crlf $+ $crlf
  360. did -a awaysys 23 =========================[ CANCEL AWAY ]========================== $+ $crlf $+ $crlf
  361. did -a awaysys 23 Cancel away on activity - Anything you type, that is not a command and being away, will make you return from away. $crlf $+ $crlf
  362. did -a awaysys 23 ========================[ AWAY NICKNAMES ]========================= $+ $crlf $+ $crlf
  363. did -a awaysys 23 Away Nicknames: "Network <mainnick> <awaynick>" - to change nicknames when going away/coming back on these networks. $crlf $+ $crlf
  364. did -a awaysys 23 Example Nicknames: "mIRCScripts entropy entropy[a]". You cannot use "all" for away nicknames. $crlf $+ $crlf
  365. did -a awaysys 23 =========================[ SMART AWAY ]=========================== $+ $crlf $+ $crlf
  366. did -a awaysys 23 Smart Away - puts you as away when you type one of the following: "brb bbl afk bbiaf bbiab bbs" $crlf $+ $crlf
  367. did -a awaysys 23 ========================[ VERBOSE METHOD ]========================= $+ $crlf $+ $crlf
  368. did -a awaysys 23 Verbose Method - Uses either "action/message" for displaying away messages. $crlf $+ $crlf
  369. did -a awaysys 23 =========================[ AWAY NOTICES ]========================== $+ $crlf $+ $crlf
  370. did -a awaysys 23 Away Notices - sends a notice to all nicks that "highlight/PM/ctcp" you. $crlf $+ $crlf
  371. did -a awaysys 23 =======================[ AWAY NOTICE MESSAGE ]====================== $+ $crlf $+ $crlf
  372. did -a awaysys 23 Away Notice Message - If "Away Notices" is ticked, you will send a custom message to everyone who "highlights/PM/ctcp" you. $crlf $+ $crlf
  373. did -a awaysys 23 ===========================[ EOF ]===============================
  374. }
  375. on *:dialog:awaysys:sclick:10:{
  376. if (!$did(8,1).sel && $did(8).lines) { if ($input(Are you sure you want to delete all messages?,8,Delete)) { write -c awaymessages.txt | did -rz awaysys 8 } }
  377. else { var %a = 1 | while ($did(8,1).sel) { write $+(-dl,$did(8,1).sel) awaymessages.txt | did -dz awaysys 8 $did(8,1).sel | inc %a } }
  378. }
  379. on *:dialog:awaysys:sclick:21:{ %away_smart = $iif($did(21).state == 1,on,off) }
  380. on *:dialog:awaysys:sclick:14,15,22:{ %away_tab = $did }
  381. on *:dialog:awaysys:sclick:4:{ did -b awaysys 4 | did -c awaysys 4 | did -ue awaysys 5 | away $iif($did(2),$v1,No reason) }
  382. on *:dialog:awaysys:sclick:5:{ did -b awaysys 5 | did -c awaysys 5 | did -ue awaysys 4 | away }
  383. on *:dialog:awaysys:sclick:12:{ %away_cancel = $iif($did(12).state == 1,yes) }
  384. on *:dialog:awaysys:edit:6:{ .timeraway_idle -o 1 1 set %away_idle $iif($did(6),$v1,0) | scon -at1 .resetidle }
  385. on *:dialog:awaysys:sclick:13:{ if ($input(Are you sure you want to unload this script?,8,Confirm)) { .unload -rs $qt($script) } }
  386. on *:dialog:awaysys:edit:16:{ write -c awayverbose.txt | var %a = 1, %b, %to = $did(16).lines | while (%a <= %to) { %b = $did(16,%a).text | write awayverbose.txt $iif(%b,$v1,$crlf) | inc %a } | var %m = $read(awayverbose.txt,$lines(awayverbose.txt)) | if (!%m) { write $+(-dl,$lines(awayverbose.txt)) awayverbose.txt } }
  387. on *:dialog:awaysys:sclick:3:{ if ($did(3).state == 1) { %away_verbose = on } | else { %away_verbose = off } }
  388. on *:dialog:awaysys:sclick:18:{ if ($did(18).state == 1) { %away_nicks = on } | else { %away_nicks = off } }
  389. on *:dialog:awaysys:edit:19:{ write -c awaynicks.txt | var %a = 1, %b, %to = $did(19).lines | while (%a <= %to) { %b = $did(19,%a).text | write awaynicks.txt $iif(%b,$v1,$crlf) | inc %a } | var %m = $read(awaynicks.txt,$lines(awaynicks.txt)) | if (!%m) { write $+(-dl,$lines(awaynicks.txt)) awaynicks.txt } }
  390. on *:dialog:awaysys:sclick:17:{ if ($did(2).lines && $input(Are you sure you want to delete all away reasons?,8,Delete)) { write -c awayreasons.txt | did -r awaysys 2 } }
  391. on *:dialog:awaysys:sclick:24:{ %away_method = action }
  392. on *:dialog:awaysys:sclick:25:{ %away_method = message }
  393. on *:dialog:awaysys:sclick:27:{ %away_notices = $iif($did(27).state == 1,yes,no) }
  394. on *:dialog:awaysys:edit:29:{ %away_text = $did(29) }
  395.  
  396. ;================================================================= ON TEXT EVENTS
  397.  
  398. on *:open:?:*:{
  399. if (%away_status == away && %away_notices == yes) {
  400. .timernoticenick -o 1 1 .notice $nick I am currently away: $_b($qt(%away_reason)) - Gone: $_b($_f) $iif(%away_text,- $v1)
  401. }
  402. }
  403. on *:text:*:?:{
  404. if (%away_status == away) {
  405. var %m = $+([,$adate,]) $timestamp * $+([,$network,/PM]) $+(<,$nick,>) $strip($1-)
  406. write awaymessages.txt $unsafe( %m )
  407. inc %away_msgs
  408. if ($dialog(awaysys)) { did -az awaysys 8 %m }
  409. }
  410. }
  411. on *:text:*:#:{
  412. if ($istok($remove($strip($1-),~,&,@,%,+,!,?,$chr(44),.,:),$me,32) && %away_status == away) {
  413. if (%away_notices == yes) { $+(.timernoticenick,$nick) -o 1 1 .notice $nick I am currently away: $_b($qt(%away_reason)) - Gone: $_b($_f) $iif(%away_text,- $v1) }
  414. var %m = $+([,$adate,]) $timestamp * $+([,$network,/,#,]) $+(<,$nick,>) $strip($1-)
  415. write awaymessages.txt $unsafe( %m )
  416. inc %away_msgs
  417. if ($dialog(awaysys)) { did -az awaysys 8 %m }
  418. }
  419. }
  420.  
  421. ;================================================================= CTCP VERSION
  422.  
  423. ctcp *:*:?:{
  424. if ($1 == version) { .ctcpreply $nick VERSION Away System $sversion (https://mircscripts.net/fk1IK) - by $sauthor $syear }
  425. if (%away_status == away) {
  426. if (%away_notices == yes) { .timernoticenick -o 1 1 .notice $nick I am currently away: $_b($qt(%away_reason)) - Gone: $_b($_f) $iif(%away_text,- $v1) }
  427. var %m = $+([,$adate,]) $timestamp * $+([,$network,/CTCP,]) $+(<,$nick,>) $strip($1-)
  428. write awaymessages.txt $unsafe( %m )
  429. inc %away_msgs
  430. if ($dialog(awaysys)) { did -az awaysys 8 %m }
  431. }
  432. }
  433.  
  434. ;================================================================= RAWS
  435.  
  436. raw 429:*:{
  437. .timerawayflood -o 1 30 undo
  438. .timerfloodactivated -o 1 1 echomsg Too many aways - Flood Protection activated (expires: 30secs)
  439. unset %away_status %away_reason %away_gone
  440. .timerupdatethis off
  441. titlebar [HERE]
  442. if ($dialog(awaysys)) {
  443. dialog -t awaysys Away System $sversion - [HERE]
  444. all b
  445. did -c awaysys 5
  446. did -u awaysys 4
  447. did -u awaysys 2
  448. }
  449. halt
  450. }
  451.  
  452. raw 305:*:{
  453. if (%away_reason) {
  454. .timerbackfromaway -o 1 1 echomsg You are back from: $_b($qt(%away_reason)) - Left: $_b($asctime(%away_gone,$remove($timestampfmt,[,]))) - Gone: $_b($_f) $iif(%away_msgs,- Messages: $_b(%away_msgs))
  455. scon -at1 .resetidle
  456. verbose $iif(%away_method == message,I am back from:,is back from:) $_b($qt(%away_reason)) - Gone: $_b($_f)
  457. setnick main
  458. unset %away_msgs %away_status %away_reason %away_gone
  459. }
  460. halt
  461. }
  462. raw 306:*:{
  463. if (%away_reason) {
  464. %away_gone = $calc($ctime + 1)
  465. .timerawayit -o 1 1 echomsg You are now away: $_b($qt(%away_reason)) - Left: $_b($asctime(%away_gone,$remove($timestampfmt,[,])))
  466. verbose $iif(%away_method == message,I am now away:,is now away:) $_b($qt(%away_reason))
  467. setnick away
  468. }
  469. halt
  470. }
  471.  
  472. ;================================================================= EOF


Comments (2)
February 17th, 2020 - By: westor
Admin
I recommend to add credits when you include an extra code in your code that has been created from an other coder. :)
February 17th, 2020 - By: entropy
Admin
done :)

Login to Comment.