Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.34 KB | None | 0 0
  1. Top
  2. Hawkee Technology Social Network
  3. Join Hawkee | Login
  4.  
  5.  
  6. Search in
  7.  
  8. * Home
  9. *
  10. Platforms
  11. o .NET
  12. o BYOND
  13. o C++
  14. o Cold Fusion
  15. o CSS
  16. o Hi5
  17. o iPhone
  18. o Java
  19. o Javascript
  20. o mIRC
  21. o MySpace
  22. o mySQL
  23. o OpenSocial
  24. o Perl
  25. o PHP
  26. o Python
  27. o Ruby / Rails
  28. o TCL
  29. * Apps
  30. *
  31. Images
  32. o Recently Liked
  33. o Most Liked
  34. o Most Comments
  35. *
  36. Snippets
  37. o .NET (17)
  38. o BYOND (4)
  39. o C++ (23)
  40. o Cold Fusion (1)
  41. o CSS (3)
  42. o Hi5 (1)
  43. o iPhone (3)
  44. o Java (14)
  45. o Javascript (23)
  46. o mIRC (5,692)
  47. o MySpace (2)
  48. o mySQL (1)
  49. o OpenSocial (2)
  50. o Perl (14)
  51. o PHP (174)
  52. o Python (14)
  53. o Ruby / Rails (6)
  54. o TCL (26)
  55. *
  56. Products
  57. o Apps (99,235)
  58. o Computers (15,291)
  59. o Electronics (9,786)
  60. o Software (1,674)
  61. o Video Games (5,459)
  62. * Systems
  63. *
  64. Reviews
  65. o Apps (13)
  66. o Computers (36,272)
  67. o Electronics (59,900)
  68. o Software (9,605)
  69. o Video Games (39,298)
  70. *
  71. Comments
  72. o Snippets
  73. o Scripts
  74. o Images
  75. o Profiles
  76. o Products
  77. o Reviews
  78. * Forum
  79.  
  80. *
  81. username password auto login
  82.  
  83. Home > Code Snippets > Ratmatix's Snippets > mIRC
  84. Auto Connect/Join/Identify v3
  85.  
  86. mIRC Code
  87. + 0 likes
  88.  
  89. Like it
  90. Please Register to submit score.
  91. Bookmark and Share
  92. Average Score 9.0 (of 1 scores)
  93. Date Added Jan 13, 2010
  94. Last Updated Jan 14, 2010
  95. Tags auto automatically channels dialog ghost gui identify ini join manager multiple nicks server servers
  96. Introduction
  97. This is the third iteration of the server manager. Made improvements large enough that I thought it was okay to resubmit as a new snippet.
  98.  
  99. By right clicking on a Status, Query or Channel, you'll have the option of popping up the dialog for the script.
  100.  
  101.  
  102.  
  103. Functionality:
  104.  
  105. * Can add as many servers to the autojoin list as you like, with the ability to enable/disable autojoining them via the manager. If you wish to connect with a different port, add a colon and the port after entering the server. e.g. "irc.gamesurge.net:6667"
  106. * Can add as many channels for each server as you like. If you wish to join a channel with a password, simply type the password after the channel. e.g. "#channel password"
  107. * Can add as many nicks as you like for each server, all of which share a group nickserv password - If a nick is already in use when you connect a server, you connect as the first available one in the list - and automatically idents
  108. * Persistant ordering of servers, nicks and channels - if you delete anything from any list, the remaining items in the list are still ordered the way you left them (I like having servers and channels in a particular order)
  109. * All settings are saved in an ini file in your mirc settings directory
  110.  
  111.  
  112. Improvements from v2:
  113.  
  114. * Improved GUI
  115. * Can handle more than 5 servers
  116. * Can handle more than 2 nicknames per server (useful if you're running bots)
  117. * Removed useless functionality (I realised I didn't find it very useful, anyway)
  118. * Improved code
  119.  
  120.  
  121. PS: I am the same user that submitted v2.1, just wanted to use a newer alias ;)
  122. PSS: I know there's a particular big with choosing the 'next free nick' if your nick is taken, i'll edit the snippet once I work out how :p Still works, just not the way I intended.
  123.  
  124. Grab the Code
  125.  
  126. ;Shows a link to the script when you right click a status, query or channel window
  127. menu status,query,channel {
  128. Auto Connect/Join/Identify v3:/showacji
  129. }
  130.  
  131. ;Calls the dialog window initialisation and loads the first server
  132. alias showacji dialog -m acji acji
  133.  
  134. ;Initialises the dialog window
  135. dialog acji {
  136. title "Auto Connect/Join/Identify v3"
  137. size -1 -1 355 425
  138.  
  139. ; type | text | id | x y w h | style
  140.  
  141. text "Change settings for:", 1, 5 8 100 20
  142. combo 2, 110 5 240 20, drop
  143.  
  144. text "Servers address", 3, 15 30 160 12
  145. edit "", 4, 15 45 132 20, autohs
  146. text "Server network", 5, 153 30 160 12
  147. edit "", 6, 153 45 132 20, autohs
  148. check "Enabled", 29, 290 40 55 20
  149.  
  150. text "Add nickname", 7, 22 85 70 20
  151. edit "", 8, 20 99 72 21, autohs
  152. text "Group password", 9, 99 85 78 20
  153. edit "", 10, 99 99 76 21, autohs pass
  154. button "Add nickname", 11, 20 125 155 25
  155. text "View/delete existing nicknames", 12, 182 85 150 20
  156. combo 13, 180 99 155 20, drop
  157. button "Delete nickname", 14, 180 125 155 25
  158.  
  159. text "Add channel to this server", 15, 22 180 140 20
  160. edit "", 16, 20 194 155 21, autohs
  161. button "Add channel", 17, 20 220 155 25
  162. text "View/delete existing channels", 18, 182 180 150 20
  163. combo 19, 180 194 155 20, drop
  164. button "Delete channel", 20, 180 220 155 25
  165.  
  166. button "Add/Save server", 21, 20 275 100 25
  167. button "Delete server", 22, 125 275 100 25
  168. button "Close manager", 23, 230 275 100 25, cancel
  169.  
  170. box "", 24, 5 22 345 245
  171. box "Grouped nicknames", 25, 15 70 325 90
  172. box "Channels", 26, 15 165 325 90
  173. box "Hover over buttons/boxes for help.", 27, 5 305 345 110
  174. text "", 28, 10 318 325 92, multi
  175. ; type | text | id | x y w h | style
  176. }
  177.  
  178. ;On initialisation, display default help text and load first tab
  179. on 1:dialog:acji:init:*: acji.loadgui $iif($gettok($rs(0, Order), 1, 46) != $null, $ifmatch, 1)
  180.  
  181. ;loads the gui with the information for the requested server (called with $1 being server number in acjiSettings.ini)
  182. alias -l acji.loadgui {
  183. acji.resetgui
  184.  
  185. set %n 1
  186. while (%n <= $rs(0,Servers)) {
  187. did -a acji 2 $+(%n, :) $rs($gettok($rs(0, Order), %n, 46), Server)
  188. inc %n
  189. }
  190. did -a acji 2 Add a new server
  191. did -c acji 2 $iif($findtok($rs(0, Order), $1, 46) != $null, $ifmatch, $did(2).lines)
  192.  
  193.  
  194. ;If no servers are set up, or if "Add a new server" is selected, disable some entry fields and rename buttons.
  195. if $did(2).sel == $did(2).lines {
  196. did -b acji 8,10,11,13,14,16,17,19,20,22,29
  197. did -ra acji 21 Add Server
  198. }
  199. ;Enable them otherwise
  200. else {
  201. did -e acji 8,10,11,13,14,16,17,19,20,22,29
  202. did -ra acji 21 Save Server
  203. }
  204.  
  205.  
  206. did -a acji 4 $rs($1, Server)
  207. did -a acji 6 $rs($1, Network)
  208. did $iif($rs($1, Enabled) == 1, -c, -u) acji 29
  209.  
  210. set %n 1
  211. while (%n <= $rs($1,Nicks)) {
  212. did -a acji 13 $rs($1, Nick $+ %n)
  213. inc %n
  214. }
  215. did -a acji 10 $rs($1, Password)
  216.  
  217. set %n 1
  218. while (%n <= $rs($1,Channels)) {
  219. did -a acji 19 $rs($1, Channel $+ %n)
  220. inc %n
  221. }
  222.  
  223. unset %n
  224. }
  225.  
  226. alias -l acji.resetgui {
  227. did -r acji 2,4,6,8,10,13,16,19
  228. did -u acji 29
  229. }
  230.  
  231. ;Listens for clicks on the gui
  232. on 1:dialog:acji:sclick:*: {
  233. if ($did(2).sel != $did(2).lines) {
  234. set %sID $gettok($rs(0, Order), $did(2).sel, 46)
  235. }
  236. else set %sID $did(2).lines
  237.  
  238. ;If combo box changed, update gui with details of the correct server
  239. if ($did == 2) {
  240. acji.loadgui %sID
  241. }
  242.  
  243. ;If the save button is clicked, save all information into the acjiSettings.ini file
  244. if ($did == 21) {
  245. ;If the last line of combo box is selected, add a new server
  246. if ($did(2).sel == $did(2).lines) {
  247. set %servers $calc($rs(0,Servers) + 1)
  248. $wsdata(0, Servers, %servers)
  249.  
  250. ;Determine next free token, then save the settings into the correct server position
  251. set %n 1
  252. while (%n <= %servers) {
  253. if (!$istok($rs(0,Order,46), %n, 46)) {
  254. $wsdata(0, Order, $addtok($rs(0,Order,46), %n, 46)))
  255. }
  256. inc %n
  257. }
  258. unset %n
  259. $ws(%sID, Server, 4)
  260. $ws(%sID, Network, 6)
  261. }
  262.  
  263. if ($did(10).text != $null) { $ws(%sID, Password, 10) }
  264. else { $rms(%sID, Password) }
  265. $wsdata(%sID, Enabled, $did(29).state)
  266. acji.loadgui %sID
  267. }
  268.  
  269. ;If the add nick button is pressed, add a nick to the current server (and save password if entered)
  270. if ($did == 11) {
  271. if ($did($dname, 8).text != $null) {
  272. $wsdata(%sID, Nicks, $calc($rs(%sID, Nicks) + 1))
  273. $ws(%sID, Nick $+ $rs(%sID, Nicks), 8)
  274. did -r acji 8
  275. if ($did(10).text != $null) { $ws(%sID, Password, 10) }
  276. else { $rms(%sID, Password) }
  277. acji.loadgui %sID
  278. }
  279. }
  280.  
  281. ;If the add channel button is pressed, add a channel to the current server
  282. if ($did == 17) {
  283. if ($did($dname, 16).text != $null) {
  284. $wsdata(%sID, Channels, $calc($rs(%sID, Channels) + 1))
  285. $ws(%sID, Channel $+ $rs(%sID, Channels), 16)
  286. did -r acji 16
  287. acji.loadgui %sID
  288. }
  289. }
  290.  
  291. ;If the delete nickname button is pressed, delete the current nickname and move all those after it up a spot
  292. if ($did == 14) {
  293. if ($did(13).sel != $null) {
  294. set %nicks $rs(%sID, Nicks)
  295. set %n $did(13).sel
  296. $rms(%sID, Nick $+ %n)
  297. dec %nicks
  298. set %s %n
  299. while (%n <= %nicks) {
  300. inc %s
  301. $wsdata(%sID, Nick $+ %n, $rs(%sID, Nick $+ %s))
  302. inc %n
  303. }
  304. $rms(%sID, Nick $+ %n)
  305. $wsdata(%sID, Nicks, %nicks)
  306. unset %s | unset %n | unset %nicks
  307. }
  308. acji.loadgui %sID
  309. }
  310.  
  311. ;If the delete channel button is pressed, delete the current channel and move all those after it up a spot
  312. if ($did == 20) {
  313. if ($did(19).sel != $null) {
  314. set %channels $rs(%sID, Channels)
  315. set %n $did(19).sel
  316. $rms(%sID, Channel $+ %n)
  317. dec %channels
  318. set %s %n
  319. while (%n <= %channels) {
  320. inc %s
  321. $wsdata(%sID, Channel $+ %n, $rs(%sID, Channel $+ %s))
  322. inc %n
  323. }
  324. $rms(%sID, Channel $+ %n)
  325. $wsdata(%sID, Channels, %channels)
  326. unset %s | unset %n | unset %channels
  327.  
  328. }
  329. acji.loadgui %sID
  330. }
  331.  
  332. ;If the delete server button is pressed, delete the current server's token from the "Order" field
  333. if ($did == 22) {
  334. ;Remove the entire section
  335. $rms(%sID,)
  336. ;Remove the servers token from the Order field
  337. $iif($deltok($rs(0, Order), $did(2).sel, 46) != $null, $wsdata(0, Order, $ifmatch), $rms(0,Order))
  338. $wsdata(0, Servers, $calc($rs(0, Servers) - 1))
  339. acji.loadgui $gettok($rs(0, Order), 1, 46)
  340. }
  341. unset %sID
  342. }
  343.  
  344. ;When mIRC starts, connect to each of the servers in the Settings.ini file with the primary nick supplied, if there is one.
  345. on *:Start: {
  346. set %n 1
  347. while (%n <= $rs(0, Servers)) {
  348. if ($rs($gettok($rs(0, Order),%n,46), Enabled) == 1) {
  349. server $iif(%n == 1,,-m) $rs($gettok($rs(0, Order),%n,46), Server) -i $rs(%n, Nick1),)
  350. inc %n
  351. }
  352. else inc %n
  353. }
  354. unset %n
  355. }
  356.  
  357. ;When you connect to a server, check that it's one in the Settings.ini file and then connect to the supplied channels
  358. on *:Connect: {
  359. set %n 1
  360. while (%n <= $rs(0, Servers)) {
  361. if ($rs(%n, Network) == $network) {
  362. set %c 1
  363. while (%c <= $rs(%n, Channels)) {
  364. join $rs(%n, Channel $+ %c)
  365. inc %c
  366. }
  367. unset %c
  368. if ($rs(%n, Password) != $null) nickserv identify $rs(%n, Password)
  369. }
  370. inc %n
  371. }
  372. unset %n
  373. }
  374.  
  375. ;When nickserv asks to identify, do so with the supplied password from the acjiSettings.ini file
  376. on *:notice:*nickname is regsitered and protected*:?: {
  377. if ($nick == nickserv) {
  378. set %n 1
  379. while (%n <= $rs(0, Servers)) {
  380. if ($rs(%n, Network) == $network) {
  381. nickserv identify $rs(%n, Password)
  382. }
  383. inc %n
  384. }
  385. unset %n
  386. }
  387. }
  388.  
  389. ;If the nickname is currently being used, attempt to connect with the first free nickname saved for the server
  390. ;-- $2 is the current nickname, find it in tokens and try the next one.
  391. raw 433:*:{
  392. set %n 1
  393. while (%n <= $rs(0, Servers)) {
  394. if ($rs(%n, Server) == $server) {
  395. set %c 1
  396. while (%c <= $rs(%n, Nicks)) {
  397. $iif($rs(%n, Nick $+ %c) != $2, nick $ifmatch,)
  398. inc %c
  399. }
  400. }
  401. inc %n
  402. }
  403. unset %c
  404. unset %n
  405. }
  406.  
  407. ;When hovering over any of the edit boxes or buttons, the help label will display help information for that element
  408. on 1:dialog:acji:mouse:*: {
  409. if ($did == 2) { did -ra $dname 28 Select the server you wish to change details for. If empty, proceed to add a server by filling out the form below. }
  410. elseif ($did == 4) { did -ra $dname 28 Enter the server address here. e.g. irc.gamesurge.net If you wish to connect to a server with a non-default port, simply add a colon and a port number after the server. e.g. irc.gamesurge.net:6667 }
  411. elseif ($did == 6) { did -ra $dname 28 Enter the servers network here. $crlf $+ Find this out by typing '//echo -a $+($,network') whilst connected the the server. e.g. GameSurge }
  412. elseif ($did == 8) || ($did == 11) { did -ra $dname 28 Enter a nickname and then click the Add button to add that nickname to this servers autoidentify list. }
  413. elseif ($did == 10) { did -ra $dname 28 Enter the password to the group of nicknames set for this server. You Will automatically identify when nickserv asks for the password. }
  414. elseif ($did == 13) || ($did == 14) { did -ra $dname 28 Use the dropdown menu to view the nicknames set to automatically attempt to connect with. If you wish to delete one, pick it from the list then click the Delete button. }
  415. elseif ($did == 16) || ($did == 17) { did -ra $dname 28 Enter a channel name and then click the Add button to add that channel to this servers autojoin list. If the channel has a password, enter it after the channel. $crlf e.g. #channel password }
  416. elseif ($did == 19) || ($did == 20) { did -ra $dname 28 Use the dropdown menu to view the channels set to automatically join when this server starts. If you wish to delete one, pick it from the list then click the Delete button. }
  417. elseif ($did == 21) { did -ra $dname 28 By clicking this button all the info in the edit boxes will be saved for this server. }
  418. elseif ($did == 22) { did -ra $dname 28 By clicking this button all changes will be lost. Be sure to click the Set button is you want to save this configuration. }
  419. }
  420.  
  421. ;called by $rs(server number, item) - if server number is 0, then general settings are stored.
  422. alias -l rs return $readini(acjiSettings.ini, Server $+ $1, $2)
  423.  
  424. ;called by $wsdata(server number, data name, data)
  425. alias -l wsdata writeini acjiSettings.ini Server $+ $1 $2 $3
  426.  
  427. ;called by $ws(server number, data name, dialog item id to read from)
  428. alias -l ws writeini acjiSettings.ini Server $+ $1 $2 $did($3).text
  429.  
  430. ;called by $rms(server number, item)
  431. alias -l rms remini acjiSettings.ini Server $+ $1 $2
  432.  
  433.  
  434.  
  435. Comments
  436. (5) RSS
  437. Go to Bottom
  438. ChiefDean
  439. Comments: 6
  440.  
  441. mIRC Snippet: Auto Connect/Join/Identify v3
  442. Posted on Jan 14, 2010 5:38 am
  443. great script, would be awesome if you could add a simple port feature being i have some auto servers on port 1337
  444.  
  445. otherwise all good
  446. SnoooP
  447. Comments: 420
  448.  
  449. mIRC Snippet: Auto Connect/Join/Identify v3
  450. Posted on Jan 14, 2010 6:13 am
  451. Excellent script mate, give you a 9 for this, ChiefDean is right though, a port feature would improve this.
  452. Ratmatix
  453. Comments: 2
  454.  
  455. mIRC Snippet: Auto Connect/Join/Identify v3
  456. Posted on Jan 14, 2010 7:26 am
  457. Just add the port after the server :)
  458. e.g. in the server box put: irc.gamesurge.net:6667
  459.  
  460. Also for channels which require passwords, put the password after the channel
  461. e.g. in the channel box put: #channel password
  462.  
  463. I'll add this to the description, thanks for reminding me :)
  464. Ratmatix
  465. Comments: 2
  466.  
  467. mIRC Snippet: Auto Connect/Join/Identify v3
  468. Posted on Jan 15, 2010 6:34 am
  469. Going overseas - when I get back, i'll add a manual connect button (Forgot to add it to this version) and another few nifty things. If anyone has any suggestions, i'll probably add them ;)
  470. Rickmasta
  471. Comments: 1
  472.  
  473. mIRC Snippet: Auto Connect/Join/Identify v3
  474. Posted on Jan 17, 2010 2:37 am
  475. Hey, I am soo totally confused on how to use this. Lol. What do I do? Cause It's not working for me. I clicked enable. When It starts, it just goes to the server. Doesn't connect to any channels, or even identify
  476. Enter comment here..
  477. Commenting Options
  478. Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.
  479.  
  480.  
  481.  
  482. Ratmatix
  483.  
  484.  
  485.  
  486. Last seen: Jan 15, 2010
  487. Profile
  488.  
  489. Snippets (1)
  490. Images (1)
  491. Comments (2)
  492. My Snippet Tags
  493. auto automatically channels dialog ghost gui identify ini join manager multiple nicks server servers
  494. Contact
  495. Add to Friends
  496. Send Private Message
  497. Sponsors
  498.  
  499. top of page · about · credits · privacy policy · linking · contact us
  500.  
  501. Copyright © 1996-2009 Hawkee.com
  502. Bottom
  503.  
  504. on *:INPUT:#: {
  505. if ($regex($1,/[+-]/)) {
  506. if ($len($remove($1,+,-)) > $modespl) {
  507. echo -a The maximum number of parameters allowed per mode is $v2 $+ .
  508. }
  509. elseif ($regex($1,/^[+-][vhoaqbceiIfjklmnprstzACGMKLNOQRSTVu]/)) {
  510. mode $chan $1 $iif($2,$($2-,2),$me $iif($len($1) != 2, $str($+ $chr(32) $me,$len($remove($1,+,-)))))
  511. }
  512. }
  513. if ($1 == .k) { inc %kickcount | !kick $chan $2 2Motivo: $3- 10Vítima: %kickcount }
  514. if ($1 == .del) { chanserv access $chan del $2 }
  515. if ($1 == .add) { chanserv access $chan add $2 $3 }
  516. if ($1 == .list) { chanserv access $chan list $2 }
  517. if ($1 == .clearbans) { chanserv clear $chan bans }
  518. if ($1 == .clearops) { chanserv clear $chan ops }
  519. if ($1 == .clearvoices) { chanserv clear $chan voices }
  520. if ($1 == .clearusers) { chanserv clear $chan users }
  521. if ($1 == .addak) { chanserv akick $chan add $2 $3- }
  522. if ($1 == .delak) { chanserv akick $chan del $2 }
  523. if ($1 == .aklist) { chanserv akick $chan list $2 }
  524. if ($1 == .viewak) { chanserv akick $chan view $2 }
  525. if ($1 == .tpc) { topic $chan }
  526. if ($1 == .info) { chanserv info $chan $+ $2- }
  527. if ($1 == .infon) { nickserv info $2 }
  528. if ($1 == .vem) { invite $2 $chan }
  529. if ($1 == .restricted) { chanserv set $chan restricted $2- }
  530. if ($1 == .bantype) { chanserv set $chan bantype $2- }
  531. if ($1 == .set) { chanserv levels $chan set $2- $2- }
  532. if ($1 == .dis) { chanserv levels $chan dis $2- }
  533. if ($1 == .mlock) { chanserv set $chan mlock $2- }
  534. if ($1 == .tpclock) { chanserv set $chan topiclock $2- }
  535. if ($1 == .m) { mode # $2- }
  536. if ($1 == .uptime) { echo $uptime(system,1) }
  537. if ($1 == .opnotice) { chanserv set # opnotice $2- }
  538. if ($1 == .enforce) { chanserv set # enforce $2- }
  539. if ($1 == .secureops) { chanserv set # secureops $2- }
  540. if (.assign == $1) { bs assign $chan $2 }
  541. if (.unassign == $1) { bs unassign $chan $2 }
  542. if ($1 == .rbr) { server -m irc.unirc.org }
  543. if ($1 == .swift) { server -m irc.swiftirc.net }
  544. if ($1 == .vlife) { server -m irc.virtualife.com.br }
  545. if ($1 == .seers) { server -m irc.seersirc.net }
  546. if ($1 == .hub) { server -m irc.hub4ever.org }
  547. if ($1 == .vl) { server -m irc.virtualife.com.br }
  548. if ($1 == .p2p) { server -m irc.p2p-net.eu -j #pre }
  549. if ($1 == .Sb) { mode $chan -e $address($2,2) | k $2 $3- | mode $chan +b $address($2,1) | mode $chan +b $address($2,2) | mode $chan +b $address($2,3) | mode $chan +b $address($2,4) | mode $chan +b $address($2,5) | mode $chan +b $address($2,6) | mode $chan +b $2 | chanserv akick $chan add $address($2,2) | chanserv akick $chan add $address($2,3) | chanserv akick $chan add $address($2,4) | chanserv akick $chan add $address($2,5) | chanserv akick $chan add $address($2,5) | chanserv akick $chan add $address($2,6) | chanserv access # del $2 }
  550. if ($1 == .kb) { mode $chan +b $address($2,2) | mode $chan +b $address($2, 3) | k $2 $3- }
  551. if ($1 == .rn) { server -m irc.redenorte.net -j $2 }
  552. }
  553. alias -l amsg.tag { return 4,1[15GLOBAL4] }
  554. alias -l amsg.blocker { return #RuneBNC #Clantrack #msl #IRCHelp #ajuda }
  555. alias amsg {
  556. var %x $chan(0)
  557. while (%x) {
  558. if (!$istok($amsg.blocker,$chan(%x),32)) { msg $chan(%x) $amsg.tag $1- 4,1[15GLOBAL4] }
  559. dec %x
  560. }
  561. }
  562. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
  563. ; Query Control Script ;
  564. ; Created & Coded by SyntaxError ;
  565. ; Version 2.0.3 last updated December 6rd, 2007 ;
  566. ; /server -m irc.SwiftIRC.net -j #acethebunny ;
  567. ; © 2007 Gary Hoalcraft III (acethebunny@gmail.com) ;
  568. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
  569.  
  570. menu Status,Channel,MenuBar,Query {
  571. $iif($group(#qc) == on,$style(1)Disable,$style(0)Enable) Query Control: {
  572. var %status = $iif($group(#qc) == on,Disable,Enable)
  573. $+(.,%status) #qc
  574. echo -a 4» Query Control has been $+(%status,d)
  575. }
  576. }
  577. menu Query {
  578. $iif($hget(qcaccept,$address($active,3)),$style(1),$style(0)) Query Auto-Accept $+([,$active,]): {
  579. var %status = $iif($hget(qcaccept,$address($active,3)) = 1,Del,Add)
  580. $+(h,%status) qcaccept $address($active,3) 1
  581. echo -a 4» $active has been $iif(%status = del,deleted from,added to) Auto-Accept.
  582. }
  583. }
  584. dialog qc {
  585. title "Query Control"
  586. size -1 -1 130 47
  587. option dbu
  588.  
  589. text "From:", 1, 4 7 25 10, right
  590. text "Time:", 2, 82 7 15 10, left
  591. text "", 3, 97 7 28 10, read
  592. edit "", 4, 30 6 50 10, read
  593. text "Message:", 5, 4 19 25 10, right
  594. edit "", 6, 30 18 95 10, read
  595. box "", 7, 1 1 127 29
  596.  
  597. button "Auto-Accept", 15, 4 32 37 10, ok
  598. button "Accept", 8, 42 32 20 10, ok
  599. button "Decline", 9, 63 32 20 10, ok
  600. button "Ignore", 10, 84 32 20 10, ok
  601. box "", 11, 1 27 106 18
  602.  
  603. link "e-mail", 12, 110 31 15 8
  604. text "v2.0.3", 13, 110 37 18 8
  605. box "", 14, 107 27 21 18
  606.  
  607. }
  608. on *:DIALOG:qc:sclick:8:{
  609. window -w %qc.nick
  610. .msg %qc.nick $ewrap(Query Accepted. I am reading what you've already said.)
  611. dialog -x qc
  612. window -a %qc.nick
  613. unset %qc.*
  614. }
  615. on *:DIALOG:qc:sclick:15:{
  616. window -w %qc.nick
  617. .msg %qc.nick $ewrap(Query Accepted. You have been added to the Auto-Accept list. $+([,%qc.address,]) )
  618. dialog -x qc
  619. hadd -m qcaccept %qc.address 1
  620. window -a %qc.nick
  621. unset %qc.*
  622. }
  623. on *:DIALOG:qc:sclick:9:{
  624. .msg %qc.nick $ewrap(Private Message Declined. Sorry.)
  625. window -c %qc.nick
  626. unset %qc.*
  627. dialog -x qc
  628. }
  629. on *:DIALOG:qc:sclick:10:{
  630. .msg %qc.nick $ewrap(Private Message Declined. You have been ignored.)
  631. window -c %qc.nick
  632. .ignore -pu1200 %qc.nick 2
  633. unset %qc.*
  634. dialog -x qc
  635. }
  636. on *:DIALOG:qc:sclick:12:{
  637. url -na mailto:acethebunny@gmail.com
  638. }
  639. #qc on
  640. on *:START:{
  641. echo $color(info) -st 6» Script: Query Control script by SyntaxError is loaded and running.
  642. hmake qcaccept 100
  643. if ($exists(qcaccept.hsh)) {
  644. .hload -s qcaccept qcaccept.hsh
  645. echo $color(info) -st 6» Script: hash table for Query Control loaded
  646. }
  647. }
  648. on *:EXIT:{
  649. hsave -s qcaccept qcaccept.hsh
  650. }
  651. on *:INPUT:?:{
  652. if ($active != -psyBNC && $active != -sBNC && !$away) {
  653. .timerclose.query. $+ $active 1 300 close.query $active
  654. }
  655. }
  656. on *:TEXT:*:?:{
  657. if ($nick != -psyBNC && $active != -sBNC && !$away) {
  658. .timerclose.query. $+ $nick 1 300 close.query $nick
  659. }
  660. }
  661. alias close.query {
  662. if ($query($$1)) {
  663. close -m $1
  664. notice $1 $ewrap(The query window with you has been closed after 5 minutes of inactivity.)
  665. }
  666. }
  667. on *:CLOSE:?:{
  668. if ($timer($+(close.query.,$nick))) .timer $+ $($+(close.query.,$nick),2) off
  669. }
  670. on *:OPEN:?:{
  671. if ($nick == -psyBNC || $nick == -sBNC || $nick == acethebunny|bot) {
  672. goto end
  673. }
  674. elseif ($hget(qcaccept,$address($nick,3))) {
  675. .msg $nick $ewrap(Query Auto-Accepted. I have been idle for $dur($idle) . $&
  676. $iif($away,[I am also away: $awaymsg - $+($dur($awaytime),])) )
  677. goto end
  678. }
  679. elseif ($away) {
  680. notice $nick $ewrap(I am currently away: $awaymsg ~ gone $dur($awaytime))
  681. goto end
  682. }
  683. elseif ($dialog(qc)) {
  684. .msg $nick $ewrap(Sorry $nick $+ , but I am busy with another message. Please try again later. (15 second ignore))
  685. echo $color(info) -ast 6» Query Control: $nick tried to Query you with an active Query Control dialog open
  686. close -m $nick
  687. .ignore -pu15 $nick
  688. }
  689. else {
  690. set %qc.nick $nick
  691. set %qc.address $address($nick,3)
  692. window -h $nick
  693. .msg $nick $ewrap(Please Wait For PM Acceptance/Decline)
  694. dialog -mdo qc qc
  695. did -a qc 3 $asctime(hh:nn:ss)
  696. did -a qc 4 $nick
  697. did -a qc 6 $1-
  698. did -f qc 1
  699. }
  700. :end
  701. }
  702. CTCP *:VERSION:*:{
  703. if (!$($+(%,ctcp.qc.,$wildsite),2)) {
  704. .ctcpreply $nick VERSION Query Control Script v2.0.3 by Gary Hoalcraft (acethebunny@gmail.com)
  705. set -eu15 $+(%,ctcp.qc.,$wildsite) on
  706. }
  707. }
  708. #qc end
  709.  
  710. alias dur {
  711. return $replace($duration($1), wk,$chr(32) week,day,$chr(32) day,hr,$chr(32) hour,min,$chr(32) minute,sec,$chr(32) second )
  712. }
  713. alias ewrap {
  714. var %msg
  715. var %tok = 1
  716. var %word
  717. while ($gettok($1-,%tok,32) != $null) {
  718. %word = $gettok($1-,%tok,32)
  719. %msg = %msg $+($chr(3)) $+ 15 $+ $upper($left(%word,1)) $+ $+($chr(3)) $+ 15 $+ $right(%word,-1)
  720. inc %tok
  721. }
  722. return $+($chr(2),$chr(3)) $+ 12,1{~ $+ $+($chr(2),$chr(3)) $+ 15 $+ %msg $+ $+($chr(2),$chr(3)) $+ 12~} $+ $chr(15)
  723. }
  724.  
  725.  
  726. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
  727. ; ;
  728. ; End Of File ;
  729. ; ;
  730. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement