Well, this is my first script where I used /write and $read commands. That was pain in the ass when I started learning them :P Script is made for QuakeNet users that have more than 1 accounts and would like to sort them out :)
Code with dialogs IS NOT very clean, I could make it more clear but this was the easiest way for me to start learning write and $read commands - seperating every command on same dialog.
For any help find me @ Qnet #reality-squared , mail me chaplja@gmail.com or ask down here in comments :)
Script is tested on mIRC 6.16
dialog auths {
title "Auth manager v 0.01 by chaplja"
size -1 -1 112 96
option dbu
list 1, 2 2 65 90, size vsbar
button "ADD", 2, 70 2 37 12
button "REMOVE", 3, 70 17 37 12
button "AUTH", 4, 70 32 37 12
button "+x", 5, 70 47 37 12
button "* Debug *", 6, 70 62 37 12
}
dialog addauth {
title "Add Auth"
size -1 -1 100 55
option dbu
text "Auth Nick", 1, 5 11 23 8
edit "", 2, 43 11 50 10, autohs limit 15
text "Auth Password", 3, 5 22 36 8
edit "", 4, 43 22 50 10, pass autohs
button "Add", 5, 32 34 35 12
box "Auth Information", 6, 2 2 95 50
}
dialog authdebug {
title "Auth script - Debug info *alpha*"
size -1 -1 111 26
option dbu
check "Send debug info", 1, 2 2 60 10, flat
check "Open debug info", 2, 2 15 50 10, flat
button "D E B U G", 3, 70 8 37 11
}
dialog authdebugsend {
title "Enter the nick of person you would like to send the Debug Info"
size -1 -1 199 15
option dbu
edit "", 1, 2 2 105 10
button "Send", 2, 112 2 37 10
}
menu * {
.Auth Manager:authmanager
}
alias authmanager {
dialog -m auths auths
rauths
}
on *:DIALOG:auths:sclick:2: {
dialog -m addauth addauth
}
on *:DIALOG:addauth:sclick:5: {
if ($did(2)) && ($did(4)) {
set %newauth $did(2)
set %newpass $did(4)
addauth
}
else { echo -a 0,1Error while adding new auth. }
}
alias addauth {
write auths.txt %newauth
write pass.txt %newauth $encode($encode($encode($encode($encode($encode($encode($encode($encode($encode(%newpass,m),m),m),m),m),m),m),m),m),m)
did -a auths 1 %newauth
unset %newpass
unset %newauth
}
alias rauths {
did -r auths 1
var %a = $lines(auths.txt)
while (%a) {
did -a auths 1 $read(auths.txt,%a)
dec %a
}
}
on *:DIALOG:auths:sclick:3: {
if ($did(1).sel) {
write -ds $+ $did(1).seltext auths.txt
write -ds $+ $did(1).seltext pass.txt
did -d auths 1 $did(1).sel
}
else { echo -a 0,1Select some auth before you remove it }
}
on *:DIALOG:auths:sclick:4: {
if ($did(1).sel) {
.msg Q@CServe.quakenet.org auth $did(1).seltext $decode($decode($decode($decode($decode($decode($decode($decode($decode($decode($read(pass.txt, s, $did(1).seltext),m),m),m),m),m),m),m),m),m),m)
}
else { echo -a 0,1Error. }
}
on *:DIALOG:auths:sclick:5: {
if ($server) && ($network == QuakeNet) { mode $me +x }
elseif (!$server) { echo -a You are not connected }
elseif ($server) && ($network != Quakenet) {
echo -a 0,1You are connected to some Non-QuakeNet server and mode +x might not work.
echo -a 0,1Also, +x mode on some other servers could be something other, which may have bad effect on you/your computer
echo -a 0,1If you still want to use +x mode, write this: //mode $ $+ me +x
}
}
on *:DIALOG:auths:sclick:6: {
echo -a 0,1Debugging is new feature in this script and is still under construction.
echo -a 0,1If you decide to send debugged file to some user, passwords won't be sent for security reasons.
echo -a 0,1Debug info maybe won't enough to find the error in script, but it will probably help.
echo -a 0,1If you do not want to send debug info, don't select that option.
echo -a 0,1For more info about Debug feature feel free to mail me @ chaplja@gmail.com
echo -a 0,1When u generate Debug-Info file, find me on QuakeNet - #Reality-Squared or mail me debugged file to chaplja@gmail.com
dialog -m authdebug authdebug
}
on *:DIALOG:authdebug:sclick:3: {
if ($did(1).state == 1) { set %debugsend YES }
if ($did(1).state == 0) { set %debugsend NO }
if ($did(2).state == 1) { set %debugopen YES }
if ($did(2).state == 0) { set %debugopen NO }
doauthdebug
}
alias doauthdebug {
if (!%debugopen) || (!%debugsend) { echo -a Parameters not set. }
else {
set %debugfilename Auth_script_debug_ $+ $date(dd-mm-yyyy) $+ _at_ $+ $time(HH-nn-ss) $+ .txt
write %debugfilename ------------------------------
write %debugfilename Debug info for Auth manager version 0.01 by chaplja
write %debugfilename Mail: chaplja@gmail.com
write %debugfilename IRC: QuakeNet - #reality-squared
write %debugfilename ------------------------------
write %debugfilename Server: $server
write %debugfilename Network: $network
write %debugfilename Nick: $me
write %debugfilename ------------------------------
write %debugfilename mIRC version: $version
write %debugfilename OS: $os
write %debugfilename Aliases loaded: $alias(0)
write %debugfilename ------------------------------
write %debugfilename mIRC.exe size: $file(mirc.exe).size
write %debugfilename mIRC.exe creation date: $file(mirc.exe).ctime
write %debugfilename mIRC.exe last modification time: $file(mirc.exe).mtime
write %debugfilename Main mIRC file: $mircini
write %debugfilename ------------------------------
write %debugfilename $ $+ decode and $ $+ encode test
write %debugfilename Encode ( chaplja ): $encode(chaplja,m)
write %debugfilename Decode ( encoded chaplja ): $decode($encode(chaplja,m),m)
write %debugfilename ------------------------------
write %debugfilename Lines in auths.txt: $lines(auths.txt)
write %debugfilename Lines in pass.txt: $lines(pass.txt)
write %debugfilename ------------------------------
write %debugfilename Mirc folder: $mircdir
write %debugfilename Script folder: $scriptdir
write %debugfilename ------------------------------
write %debugfilename More features coming in next few versions !
write %debugfilename ------------------------------
if (%debugsend == YES) { authdebugsend }
elseif (%debugsend == NO) { unset %debugsend }
echo -a 0,1DebugInfo saved to $mircdir $+ %debugfilename
authdebugopen
}
}
alias authdebugsend {
dialog -m authdebugsend authdebugsend
}
alias authdebugopen {
if (%debugopen == YES) { /run $mircdir $+ %debugfilename }
elseif {%debugopen == NO) || (!%authdebugopen) { halt }
unset %debugopen
}
on *:DIALOG:authdebugsend:sclick:2: {
if ($did(1)) { /dcc send $did(1) $mircdir $+ %debugfilename }
elseif (!$did(1)) { echo -a 0,1Enter nickname you would like to recieve your Debug Info }
unset %authdebugsend
unset %debugfilename
}