Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Top
- Hawkee Technology Social Network
- Join Hawkee | Login
- Search in
- * Home
- *
- Platforms
- o .NET
- o BYOND
- o C++
- o Cold Fusion
- o CSS
- o Hi5
- o iPhone
- o Java
- o Javascript
- o mIRC
- o MySpace
- o mySQL
- o OpenSocial
- o Perl
- o PHP
- o Python
- o Ruby / Rails
- o TCL
- * Apps
- *
- Images
- o Recently Liked
- o Most Liked
- o Most Comments
- *
- Snippets
- o .NET (17)
- o BYOND (4)
- o C++ (23)
- o Cold Fusion (1)
- o CSS (3)
- o Hi5 (1)
- o iPhone (3)
- o Java (14)
- o Javascript (23)
- o mIRC (5,692)
- o MySpace (2)
- o mySQL (1)
- o OpenSocial (2)
- o Perl (14)
- o PHP (174)
- o Python (14)
- o Ruby / Rails (6)
- o TCL (26)
- *
- Products
- o Apps (99,235)
- o Computers (15,291)
- o Electronics (9,786)
- o Software (1,674)
- o Video Games (5,459)
- * Systems
- *
- Reviews
- o Apps (13)
- o Computers (36,272)
- o Electronics (59,900)
- o Software (9,605)
- o Video Games (39,298)
- *
- Comments
- o Snippets
- o Scripts
- o Images
- o Profiles
- o Products
- o Reviews
- * Forum
- *
- username password auto login
- Home > Code Snippets > Ratmatix's Snippets > mIRC
- Auto Connect/Join/Identify v3
- mIRC Code
- + 0 likes
- Like it
- Please Register to submit score.
- Bookmark and Share
- Average Score 9.0 (of 1 scores)
- Date Added Jan 13, 2010
- Last Updated Jan 14, 2010
- Tags auto automatically channels dialog ghost gui identify ini join manager multiple nicks server servers
- Introduction
- 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.
- By right clicking on a Status, Query or Channel, you'll have the option of popping up the dialog for the script.
- Functionality:
- * 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"
- * 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"
- * 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
- * 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)
- * All settings are saved in an ini file in your mirc settings directory
- Improvements from v2:
- * Improved GUI
- * Can handle more than 5 servers
- * Can handle more than 2 nicknames per server (useful if you're running bots)
- * Removed useless functionality (I realised I didn't find it very useful, anyway)
- * Improved code
- PS: I am the same user that submitted v2.1, just wanted to use a newer alias ;)
- 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.
- Grab the Code
- ;Shows a link to the script when you right click a status, query or channel window
- menu status,query,channel {
- Auto Connect/Join/Identify v3:/showacji
- }
- ;Calls the dialog window initialisation and loads the first server
- alias showacji dialog -m acji acji
- ;Initialises the dialog window
- dialog acji {
- title "Auto Connect/Join/Identify v3"
- size -1 -1 355 425
- ; type | text | id | x y w h | style
- text "Change settings for:", 1, 5 8 100 20
- combo 2, 110 5 240 20, drop
- text "Servers address", 3, 15 30 160 12
- edit "", 4, 15 45 132 20, autohs
- text "Server network", 5, 153 30 160 12
- edit "", 6, 153 45 132 20, autohs
- check "Enabled", 29, 290 40 55 20
- text "Add nickname", 7, 22 85 70 20
- edit "", 8, 20 99 72 21, autohs
- text "Group password", 9, 99 85 78 20
- edit "", 10, 99 99 76 21, autohs pass
- button "Add nickname", 11, 20 125 155 25
- text "View/delete existing nicknames", 12, 182 85 150 20
- combo 13, 180 99 155 20, drop
- button "Delete nickname", 14, 180 125 155 25
- text "Add channel to this server", 15, 22 180 140 20
- edit "", 16, 20 194 155 21, autohs
- button "Add channel", 17, 20 220 155 25
- text "View/delete existing channels", 18, 182 180 150 20
- combo 19, 180 194 155 20, drop
- button "Delete channel", 20, 180 220 155 25
- button "Add/Save server", 21, 20 275 100 25
- button "Delete server", 22, 125 275 100 25
- button "Close manager", 23, 230 275 100 25, cancel
- box "", 24, 5 22 345 245
- box "Grouped nicknames", 25, 15 70 325 90
- box "Channels", 26, 15 165 325 90
- box "Hover over buttons/boxes for help.", 27, 5 305 345 110
- text "", 28, 10 318 325 92, multi
- ; type | text | id | x y w h | style
- }
- ;On initialisation, display default help text and load first tab
- on 1:dialog:acji:init:*: acji.loadgui $iif($gettok($rs(0, Order), 1, 46) != $null, $ifmatch, 1)
- ;loads the gui with the information for the requested server (called with $1 being server number in acjiSettings.ini)
- alias -l acji.loadgui {
- acji.resetgui
- set %n 1
- while (%n <= $rs(0,Servers)) {
- did -a acji 2 $+(%n, :) $rs($gettok($rs(0, Order), %n, 46), Server)
- inc %n
- }
- did -a acji 2 Add a new server
- did -c acji 2 $iif($findtok($rs(0, Order), $1, 46) != $null, $ifmatch, $did(2).lines)
- ;If no servers are set up, or if "Add a new server" is selected, disable some entry fields and rename buttons.
- if $did(2).sel == $did(2).lines {
- did -b acji 8,10,11,13,14,16,17,19,20,22,29
- did -ra acji 21 Add Server
- }
- ;Enable them otherwise
- else {
- did -e acji 8,10,11,13,14,16,17,19,20,22,29
- did -ra acji 21 Save Server
- }
- did -a acji 4 $rs($1, Server)
- did -a acji 6 $rs($1, Network)
- did $iif($rs($1, Enabled) == 1, -c, -u) acji 29
- set %n 1
- while (%n <= $rs($1,Nicks)) {
- did -a acji 13 $rs($1, Nick $+ %n)
- inc %n
- }
- did -a acji 10 $rs($1, Password)
- set %n 1
- while (%n <= $rs($1,Channels)) {
- did -a acji 19 $rs($1, Channel $+ %n)
- inc %n
- }
- unset %n
- }
- alias -l acji.resetgui {
- did -r acji 2,4,6,8,10,13,16,19
- did -u acji 29
- }
- ;Listens for clicks on the gui
- on 1:dialog:acji:sclick:*: {
- if ($did(2).sel != $did(2).lines) {
- set %sID $gettok($rs(0, Order), $did(2).sel, 46)
- }
- else set %sID $did(2).lines
- ;If combo box changed, update gui with details of the correct server
- if ($did == 2) {
- acji.loadgui %sID
- }
- ;If the save button is clicked, save all information into the acjiSettings.ini file
- if ($did == 21) {
- ;If the last line of combo box is selected, add a new server
- if ($did(2).sel == $did(2).lines) {
- set %servers $calc($rs(0,Servers) + 1)
- $wsdata(0, Servers, %servers)
- ;Determine next free token, then save the settings into the correct server position
- set %n 1
- while (%n <= %servers) {
- if (!$istok($rs(0,Order,46), %n, 46)) {
- $wsdata(0, Order, $addtok($rs(0,Order,46), %n, 46)))
- }
- inc %n
- }
- unset %n
- $ws(%sID, Server, 4)
- $ws(%sID, Network, 6)
- }
- if ($did(10).text != $null) { $ws(%sID, Password, 10) }
- else { $rms(%sID, Password) }
- $wsdata(%sID, Enabled, $did(29).state)
- acji.loadgui %sID
- }
- ;If the add nick button is pressed, add a nick to the current server (and save password if entered)
- if ($did == 11) {
- if ($did($dname, 8).text != $null) {
- $wsdata(%sID, Nicks, $calc($rs(%sID, Nicks) + 1))
- $ws(%sID, Nick $+ $rs(%sID, Nicks), 8)
- did -r acji 8
- if ($did(10).text != $null) { $ws(%sID, Password, 10) }
- else { $rms(%sID, Password) }
- acji.loadgui %sID
- }
- }
- ;If the add channel button is pressed, add a channel to the current server
- if ($did == 17) {
- if ($did($dname, 16).text != $null) {
- $wsdata(%sID, Channels, $calc($rs(%sID, Channels) + 1))
- $ws(%sID, Channel $+ $rs(%sID, Channels), 16)
- did -r acji 16
- acji.loadgui %sID
- }
- }
- ;If the delete nickname button is pressed, delete the current nickname and move all those after it up a spot
- if ($did == 14) {
- if ($did(13).sel != $null) {
- set %nicks $rs(%sID, Nicks)
- set %n $did(13).sel
- $rms(%sID, Nick $+ %n)
- dec %nicks
- set %s %n
- while (%n <= %nicks) {
- inc %s
- $wsdata(%sID, Nick $+ %n, $rs(%sID, Nick $+ %s))
- inc %n
- }
- $rms(%sID, Nick $+ %n)
- $wsdata(%sID, Nicks, %nicks)
- unset %s | unset %n | unset %nicks
- }
- acji.loadgui %sID
- }
- ;If the delete channel button is pressed, delete the current channel and move all those after it up a spot
- if ($did == 20) {
- if ($did(19).sel != $null) {
- set %channels $rs(%sID, Channels)
- set %n $did(19).sel
- $rms(%sID, Channel $+ %n)
- dec %channels
- set %s %n
- while (%n <= %channels) {
- inc %s
- $wsdata(%sID, Channel $+ %n, $rs(%sID, Channel $+ %s))
- inc %n
- }
- $rms(%sID, Channel $+ %n)
- $wsdata(%sID, Channels, %channels)
- unset %s | unset %n | unset %channels
- }
- acji.loadgui %sID
- }
- ;If the delete server button is pressed, delete the current server's token from the "Order" field
- if ($did == 22) {
- ;Remove the entire section
- $rms(%sID,)
- ;Remove the servers token from the Order field
- $iif($deltok($rs(0, Order), $did(2).sel, 46) != $null, $wsdata(0, Order, $ifmatch), $rms(0,Order))
- $wsdata(0, Servers, $calc($rs(0, Servers) - 1))
- acji.loadgui $gettok($rs(0, Order), 1, 46)
- }
- unset %sID
- }
- ;When mIRC starts, connect to each of the servers in the Settings.ini file with the primary nick supplied, if there is one.
- on *:Start: {
- set %n 1
- while (%n <= $rs(0, Servers)) {
- if ($rs($gettok($rs(0, Order),%n,46), Enabled) == 1) {
- server $iif(%n == 1,,-m) $rs($gettok($rs(0, Order),%n,46), Server) -i $rs(%n, Nick1),)
- inc %n
- }
- else inc %n
- }
- unset %n
- }
- ;When you connect to a server, check that it's one in the Settings.ini file and then connect to the supplied channels
- on *:Connect: {
- set %n 1
- while (%n <= $rs(0, Servers)) {
- if ($rs(%n, Network) == $network) {
- set %c 1
- while (%c <= $rs(%n, Channels)) {
- join $rs(%n, Channel $+ %c)
- inc %c
- }
- unset %c
- if ($rs(%n, Password) != $null) nickserv identify $rs(%n, Password)
- }
- inc %n
- }
- unset %n
- }
- ;When nickserv asks to identify, do so with the supplied password from the acjiSettings.ini file
- on *:notice:*nickname is regsitered and protected*:?: {
- if ($nick == nickserv) {
- set %n 1
- while (%n <= $rs(0, Servers)) {
- if ($rs(%n, Network) == $network) {
- nickserv identify $rs(%n, Password)
- }
- inc %n
- }
- unset %n
- }
- }
- ;If the nickname is currently being used, attempt to connect with the first free nickname saved for the server
- ;-- $2 is the current nickname, find it in tokens and try the next one.
- raw 433:*:{
- set %n 1
- while (%n <= $rs(0, Servers)) {
- if ($rs(%n, Server) == $server) {
- set %c 1
- while (%c <= $rs(%n, Nicks)) {
- $iif($rs(%n, Nick $+ %c) != $2, nick $ifmatch,)
- inc %c
- }
- }
- inc %n
- }
- unset %c
- unset %n
- }
- ;When hovering over any of the edit boxes or buttons, the help label will display help information for that element
- on 1:dialog:acji:mouse:*: {
- 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. }
- 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 }
- 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 }
- 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. }
- 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. }
- 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. }
- 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 }
- 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. }
- elseif ($did == 21) { did -ra $dname 28 By clicking this button all the info in the edit boxes will be saved for this server. }
- 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. }
- }
- ;called by $rs(server number, item) - if server number is 0, then general settings are stored.
- alias -l rs return $readini(acjiSettings.ini, Server $+ $1, $2)
- ;called by $wsdata(server number, data name, data)
- alias -l wsdata writeini acjiSettings.ini Server $+ $1 $2 $3
- ;called by $ws(server number, data name, dialog item id to read from)
- alias -l ws writeini acjiSettings.ini Server $+ $1 $2 $did($3).text
- ;called by $rms(server number, item)
- alias -l rms remini acjiSettings.ini Server $+ $1 $2
- Comments
- (5) RSS
- Go to Bottom
- ChiefDean
- Comments: 6
- mIRC Snippet: Auto Connect/Join/Identify v3
- Posted on Jan 14, 2010 5:38 am
- great script, would be awesome if you could add a simple port feature being i have some auto servers on port 1337
- otherwise all good
- SnoooP
- Comments: 420
- mIRC Snippet: Auto Connect/Join/Identify v3
- Posted on Jan 14, 2010 6:13 am
- Excellent script mate, give you a 9 for this, ChiefDean is right though, a port feature would improve this.
- Ratmatix
- Comments: 2
- mIRC Snippet: Auto Connect/Join/Identify v3
- Posted on Jan 14, 2010 7:26 am
- Just add the port after the server :)
- e.g. in the server box put: irc.gamesurge.net:6667
- Also for channels which require passwords, put the password after the channel
- e.g. in the channel box put: #channel password
- I'll add this to the description, thanks for reminding me :)
- Ratmatix
- Comments: 2
- mIRC Snippet: Auto Connect/Join/Identify v3
- Posted on Jan 15, 2010 6:34 am
- 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 ;)
- Rickmasta
- Comments: 1
- mIRC Snippet: Auto Connect/Join/Identify v3
- Posted on Jan 17, 2010 2:37 am
- 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
- Enter comment here..
- Commenting Options
- Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.
- Ratmatix
- Last seen: Jan 15, 2010
- Profile
- Snippets (1)
- Images (1)
- Comments (2)
- My Snippet Tags
- auto automatically channels dialog ghost gui identify ini join manager multiple nicks server servers
- Contact
- Add to Friends
- Send Private Message
- Sponsors
- top of page · about · credits · privacy policy · linking · contact us
- Copyright © 1996-2009 Hawkee.com
- Bottom
- on *:INPUT:#: {
- if ($regex($1,/[+-]/)) {
- if ($len($remove($1,+,-)) > $modespl) {
- echo -a The maximum number of parameters allowed per mode is $v2 $+ .
- }
- elseif ($regex($1,/^[+-][vhoaqbceiIfjklmnprstzACGMKLNOQRSTVu]/)) {
- mode $chan $1 $iif($2,$($2-,2),$me $iif($len($1) != 2, $str($+ $chr(32) $me,$len($remove($1,+,-)))))
- }
- }
- if ($1 == .k) { inc %kickcount | !kick $chan $2 2Motivo: $3- 10Vítima: %kickcount }
- if ($1 == .del) { chanserv access $chan del $2 }
- if ($1 == .add) { chanserv access $chan add $2 $3 }
- if ($1 == .list) { chanserv access $chan list $2 }
- if ($1 == .clearbans) { chanserv clear $chan bans }
- if ($1 == .clearops) { chanserv clear $chan ops }
- if ($1 == .clearvoices) { chanserv clear $chan voices }
- if ($1 == .clearusers) { chanserv clear $chan users }
- if ($1 == .addak) { chanserv akick $chan add $2 $3- }
- if ($1 == .delak) { chanserv akick $chan del $2 }
- if ($1 == .aklist) { chanserv akick $chan list $2 }
- if ($1 == .viewak) { chanserv akick $chan view $2 }
- if ($1 == .tpc) { topic $chan }
- if ($1 == .info) { chanserv info $chan $+ $2- }
- if ($1 == .infon) { nickserv info $2 }
- if ($1 == .vem) { invite $2 $chan }
- if ($1 == .restricted) { chanserv set $chan restricted $2- }
- if ($1 == .bantype) { chanserv set $chan bantype $2- }
- if ($1 == .set) { chanserv levels $chan set $2- $2- }
- if ($1 == .dis) { chanserv levels $chan dis $2- }
- if ($1 == .mlock) { chanserv set $chan mlock $2- }
- if ($1 == .tpclock) { chanserv set $chan topiclock $2- }
- if ($1 == .m) { mode # $2- }
- if ($1 == .uptime) { echo $uptime(system,1) }
- if ($1 == .opnotice) { chanserv set # opnotice $2- }
- if ($1 == .enforce) { chanserv set # enforce $2- }
- if ($1 == .secureops) { chanserv set # secureops $2- }
- if (.assign == $1) { bs assign $chan $2 }
- if (.unassign == $1) { bs unassign $chan $2 }
- if ($1 == .rbr) { server -m irc.unirc.org }
- if ($1 == .swift) { server -m irc.swiftirc.net }
- if ($1 == .vlife) { server -m irc.virtualife.com.br }
- if ($1 == .seers) { server -m irc.seersirc.net }
- if ($1 == .hub) { server -m irc.hub4ever.org }
- if ($1 == .vl) { server -m irc.virtualife.com.br }
- if ($1 == .p2p) { server -m irc.p2p-net.eu -j #pre }
- 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 }
- if ($1 == .kb) { mode $chan +b $address($2,2) | mode $chan +b $address($2, 3) | k $2 $3- }
- if ($1 == .rn) { server -m irc.redenorte.net -j $2 }
- }
- alias -l amsg.tag { return 4,1[15GLOBAL4] }
- alias -l amsg.blocker { return #RuneBNC #Clantrack #msl #IRCHelp #ajuda }
- alias amsg {
- var %x $chan(0)
- while (%x) {
- if (!$istok($amsg.blocker,$chan(%x),32)) { msg $chan(%x) $amsg.tag $1- 4,1[15GLOBAL4] }
- dec %x
- }
- }
- ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
- ; Query Control Script ;
- ; Created & Coded by SyntaxError ;
- ; Version 2.0.3 last updated December 6rd, 2007 ;
- ; /server -m irc.SwiftIRC.net -j #acethebunny ;
- ; © 2007 Gary Hoalcraft III (acethebunny@gmail.com) ;
- ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
- menu Status,Channel,MenuBar,Query {
- $iif($group(#qc) == on,$style(1)Disable,$style(0)Enable) Query Control: {
- var %status = $iif($group(#qc) == on,Disable,Enable)
- $+(.,%status) #qc
- echo -a 4» Query Control has been $+(%status,d)
- }
- }
- menu Query {
- $iif($hget(qcaccept,$address($active,3)),$style(1),$style(0)) Query Auto-Accept $+([,$active,]): {
- var %status = $iif($hget(qcaccept,$address($active,3)) = 1,Del,Add)
- $+(h,%status) qcaccept $address($active,3) 1
- echo -a 4» $active has been $iif(%status = del,deleted from,added to) Auto-Accept.
- }
- }
- dialog qc {
- title "Query Control"
- size -1 -1 130 47
- option dbu
- text "From:", 1, 4 7 25 10, right
- text "Time:", 2, 82 7 15 10, left
- text "", 3, 97 7 28 10, read
- edit "", 4, 30 6 50 10, read
- text "Message:", 5, 4 19 25 10, right
- edit "", 6, 30 18 95 10, read
- box "", 7, 1 1 127 29
- button "Auto-Accept", 15, 4 32 37 10, ok
- button "Accept", 8, 42 32 20 10, ok
- button "Decline", 9, 63 32 20 10, ok
- button "Ignore", 10, 84 32 20 10, ok
- box "", 11, 1 27 106 18
- link "e-mail", 12, 110 31 15 8
- text "v2.0.3", 13, 110 37 18 8
- box "", 14, 107 27 21 18
- }
- on *:DIALOG:qc:sclick:8:{
- window -w %qc.nick
- .msg %qc.nick $ewrap(Query Accepted. I am reading what you've already said.)
- dialog -x qc
- window -a %qc.nick
- unset %qc.*
- }
- on *:DIALOG:qc:sclick:15:{
- window -w %qc.nick
- .msg %qc.nick $ewrap(Query Accepted. You have been added to the Auto-Accept list. $+([,%qc.address,]) )
- dialog -x qc
- hadd -m qcaccept %qc.address 1
- window -a %qc.nick
- unset %qc.*
- }
- on *:DIALOG:qc:sclick:9:{
- .msg %qc.nick $ewrap(Private Message Declined. Sorry.)
- window -c %qc.nick
- unset %qc.*
- dialog -x qc
- }
- on *:DIALOG:qc:sclick:10:{
- .msg %qc.nick $ewrap(Private Message Declined. You have been ignored.)
- window -c %qc.nick
- .ignore -pu1200 %qc.nick 2
- unset %qc.*
- dialog -x qc
- }
- on *:DIALOG:qc:sclick:12:{
- url -na mailto:acethebunny@gmail.com
- }
- #qc on
- on *:START:{
- echo $color(info) -st 6» Script: Query Control script by SyntaxError is loaded and running.
- hmake qcaccept 100
- if ($exists(qcaccept.hsh)) {
- .hload -s qcaccept qcaccept.hsh
- echo $color(info) -st 6» Script: hash table for Query Control loaded
- }
- }
- on *:EXIT:{
- hsave -s qcaccept qcaccept.hsh
- }
- on *:INPUT:?:{
- if ($active != -psyBNC && $active != -sBNC && !$away) {
- .timerclose.query. $+ $active 1 300 close.query $active
- }
- }
- on *:TEXT:*:?:{
- if ($nick != -psyBNC && $active != -sBNC && !$away) {
- .timerclose.query. $+ $nick 1 300 close.query $nick
- }
- }
- alias close.query {
- if ($query($$1)) {
- close -m $1
- notice $1 $ewrap(The query window with you has been closed after 5 minutes of inactivity.)
- }
- }
- on *:CLOSE:?:{
- if ($timer($+(close.query.,$nick))) .timer $+ $($+(close.query.,$nick),2) off
- }
- on *:OPEN:?:{
- if ($nick == -psyBNC || $nick == -sBNC || $nick == acethebunny|bot) {
- goto end
- }
- elseif ($hget(qcaccept,$address($nick,3))) {
- .msg $nick $ewrap(Query Auto-Accepted. I have been idle for $dur($idle) . $&
- $iif($away,[I am also away: $awaymsg - $+($dur($awaytime),])) )
- goto end
- }
- elseif ($away) {
- notice $nick $ewrap(I am currently away: $awaymsg ~ gone $dur($awaytime))
- goto end
- }
- elseif ($dialog(qc)) {
- .msg $nick $ewrap(Sorry $nick $+ , but I am busy with another message. Please try again later. (15 second ignore))
- echo $color(info) -ast 6» Query Control: $nick tried to Query you with an active Query Control dialog open
- close -m $nick
- .ignore -pu15 $nick
- }
- else {
- set %qc.nick $nick
- set %qc.address $address($nick,3)
- window -h $nick
- .msg $nick $ewrap(Please Wait For PM Acceptance/Decline)
- dialog -mdo qc qc
- did -a qc 3 $asctime(hh:nn:ss)
- did -a qc 4 $nick
- did -a qc 6 $1-
- did -f qc 1
- }
- :end
- }
- CTCP *:VERSION:*:{
- if (!$($+(%,ctcp.qc.,$wildsite),2)) {
- .ctcpreply $nick VERSION Query Control Script v2.0.3 by Gary Hoalcraft (acethebunny@gmail.com)
- set -eu15 $+(%,ctcp.qc.,$wildsite) on
- }
- }
- #qc end
- alias dur {
- return $replace($duration($1), wk,$chr(32) week,day,$chr(32) day,hr,$chr(32) hour,min,$chr(32) minute,sec,$chr(32) second )
- }
- alias ewrap {
- var %msg
- var %tok = 1
- var %word
- while ($gettok($1-,%tok,32) != $null) {
- %word = $gettok($1-,%tok,32)
- %msg = %msg $+($chr(3)) $+ 15 $+ $upper($left(%word,1)) $+ $+($chr(3)) $+ 15 $+ $right(%word,-1)
- inc %tok
- }
- return $+($chr(2),$chr(3)) $+ 12,1{~ $+ $+($chr(2),$chr(3)) $+ 15 $+ %msg $+ $+($chr(2),$chr(3)) $+ 12~} $+ $chr(15)
- }
- ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
- ; ;
- ; End Of File ;
- ; ;
- ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement