Simple but highly efficient (if used properly) script based mIRC locker. More like demonstration of optimized coding and to be used as locking part in complex scripts.
*
common Q'z:
1)mIRC already have built-in locker, why scripting solution?
--> Built-in locker is registry based. Just move ur mirc to another system (without reg changes) and u will open it like it's never been locked. One restart for 'dualbooters'.
2)Is it safe? (%mirc.ini/%win.ini)
--> Completely! (just vars)
3)Why insulting loop name?
--> To discourage potential breaker. :)
4)Can i use it in my script?
--> Yep, thats why i coded it. No need to gain permission or add to credits (tho i always do so).
*
useful tip'z:
1)spread aliases (doitp, _doitp, doitn & _doitn) in different files inside your script in the middle of other code, where it would be harder to find
2)do the same with group #jmp & status menu, u could also properly rename group & aliases..
3)add some unimportant confusing vars, like %encode whats up
4)if you want password prompter to arise before other things (like welcome message in your script), put .mrc file containing #jmp group upper in file list, in remotes (scriptEditor/File/Order)
5)when u finish everything (spread aliases & group in diff files etc..), perform '/set %locked Off' to complete process of passlock implementation for ur script.
*
Enjoy! :)
Ozy^
;----->
;passlock v1.4 by Ozy
;thxto:burek & SkYNeT
;mailto:addplus@gmail.com
;-----<
#jmp off
on 1:START:{ var %temp $input(Enter Password ,p, Password Protected!)
{ if ((%temp = $decode(%win.ini)) && (%win.ini = $decode(%mirc.ini,m)) && (%locked = On) && ($len($decode(%win.ini)) > 4)) return | else exit }
}
#jmp end
alias doitp { :readitidiot | set %win.ini $encode($$?="Set ChatClient Password (5 chars minimum):")
if ($len($decode(%win.ini)) < 5) { echo -s - | echo -s ChatClient Password must contain 5 characters minimum! | echo -s - | .set %win.ini $decode(%mirc.ini,m) | goto readitidiot }
echo -s -
echo -s -->ChatClient protected with $decode(%win.ini)
echo -s --<
echo -s -->remember it for later use!
echo -s -
set %mirc.ini $encode(%win.ini,m)
}
alias _doitp { unset %win.ini | unset %mirc.ini | _doitn }
alias doitn { if ((%win.ini == $null) || ($len($decode(%win.ini)) < 5)) doitp | .enable #jmp | set %locked On }
alias _doitn { .disable #jmp | set %locked Off }
menu status {
-
Lock ( $+ %locked $+ )
.On:doitn
.Off:_doitn
.-
.Pass
..Set:doitp
..Reset:_doitp
}
;eof