Hey guys, thanks for the kind words :) I'm working on something new and I hope to be done with it soon. I'm brainstorming some new ideas, so whatever you may want to see done, post to my wall http://www.hawkee.com/profile/805/. Thanks, again!
You don't need the 'goto skipper' or the :skipper jump point. Example:
Instead of this:
if ($left($1,1) == /) || ($left($1,1) == !) || ($left($1,1) == .) { goto skipper }
Use this:
if ($left($1,1) == /) || ($left($1,1) == !) || ($left($1,1) == .) { return }
The 'return' alias allows you to exit out of a function without halting things, only skipping the rest of the code if the if-then-else statement is TRUE. Enjoy! :)
Why not make an INI file that allows you to add the words to? This will make adding TONS of words easier. So, in an ini file, you have it laid out as:
[words]
badword=kick
badderword=kick,ban
Etc. You could set the option to kick and ban the users, just kick, warn, etc, depending on the level. Then, all you need is a loop to scan and make sure that the word is not in the file. You would want to load the INI into an active hash so that way scanning is easier. Anyways, just my 2 cents ;)
Jethro_: mIRC does, indeed, have an option to do this, however it does not let you specify the options that this one allows, such as how many times to try and how long to wait between tries.
Savage_CL: Instead of using some random, obscure alias name, a589, just use the -l tag in front of it and name it whatever you want. ie:
alias -l rejoin {
if ($1 == to) { return 2 }
if ($1 == tries) { return 30 }
}
The -l switch specifies that this alias is local and cannot be triggered outside of this script.
Also, think about using a period in front of the times, like: .timerunsetter This will ensure that all the timer commands are silent, ie: they won't be shown in your status bar or any other window you have open. If you don't use it, you get things like "timerBLAHBLAH set" or on, or whatever. It's kind of annoying :)
Okay, added a few changes, especially on the actual lock. Instead of $?="", used $input(,wp,mIRC Lock) so that way when they enter a password it's passworded out, like *. Anyways, another change was checking to see if the lock was tampered with, by removing the .ini** file. If so, the default lock is put in place.
;;;;;;;;;;;;;;;
;;HELLO THERE;;
;;;;;;;;;;;;;;;
on *:input:*: {
if ( $readini(C:\lock.ini,main,lock) == 1 ) {
.timerlock off
.timerlock -o 1 $readini(C:\lock.ini,main,locktime) mirclock
}
}
dialog MIRClock {
title "mIRC Lock"
size -1 -1 117 84
option dbu
button "OK", 1, 3 62 33 12, ok
button "Close andLock", 2, 39 62 38 12, ok
button "Cancel", 3, 79 62 32 11
edit "OLDPASS", 4, 3 2 50 10, pass
edit "NEWPASS", 5, 3 14 50 10, pass
edit "TIME_BEFORE_LOCK", 6, 3 25 50 10
check "Lock mIRC when idle", 7, 3 40 64 9
text "Old password", 8, 57 2 50 9
text "New password", 9, 57 14 50 8
text "Idle time before lock", 10, 57 26 50 9
check "Lock mIRC when started", 11, 3 50 69 9
text "mIRC lock made by CAsercan3 AKA sercan386", 12, 3 77 112 8
box "", 13, 1 34 73 27
button "Reset", 14, 79 44 32 16
}
on *:dialog:mirclock:sclick:3: {
dialog -x mirclock mirclock
}
alias locksettings {
dialog -m mirclock mirclock
if ( $readini(C:\lock.ini,main,pass) == $null ) writeini C:\lock.ini main pass $md5($md5(1234))
}
on *:dialog:mirclock:sclick:14: {
did -r mirclock 4
did -r mirclock 5
did -r mirclock 6
did -u mirclock 7
did -u mirclock 11
}
on *:dialog:mirclock:init:0: {
did -ra mirclock 6 $readini(C:\lock.ini,main,locktime)
did -r mirclock 4
did -r mirclock 5
did - $+ [ $iif($readini(C:\lock.ini,main,lockstart) == 1,c,u) ] mirclock 11
did - $+ [ $iif($readini(C:\lock.ini,main,lock) == 1,c,u) ] mirclock 7
}
on *:dialog:mirclock:sclick:1: {
if ( $md5($md5($did(mirclock,4))) != $readini(C:\lock.ini,main,pass) ) halt
if ( $did(mirclock,5) != $null ) writeini C:\lock.ini main pass $md5($md5($did(mirclock,5)))
writeini C:\lock.ini main locktime $did(mirclock,6)
writeini C:\lock.ini main lock $did(mirclock,7).state
writeini C:\lock.ini main lockstart $did(mirclock,11).state
dialog -x mirclock mirclock
}
on *:dialog:mirclock:sclick:2: {
if ( $md5($md5($did(mirclock,4))) != $readini(C:\lock.ini,main,pass) ) { noop $input(Dude! WRONG PASSWORD!!!,o,ERROR,ERROR,ERROR) | halt }
if ( $did(mirclock,5) != $null ) writeini C:\lock.ini main pass $md5($md5($did(mirclock,5)))
if ( $did(mirclock,6) isnum ) writeini C:\lock.ini main locktime $did(mirclock,6)
else noop $input(Dude! the time in which the lock is activated must be only in NUMBERS!,o,ERROR,ERROR,ERROR)
writeini C:\lock.ini main lock $did(mirclock,7).state
writeini C:\lock.ini main lockstart $did(mirclock,11).state
dialog -x mirclock mirclock
mirclock
}
;;; Resetme Alias
;;; - Added to reset to the default '1234' password
;;; if the original ini file is tampered with
alias resetme { writeini C:\lock.ini main pass $md5($md5(1234)) | writeini C:\lock.ini main lock 0 | writeini C:\lock.ini main lockstart 1 | .timerinput $+ $ctime 1 1 return $input(mIRC's lock has been tampered with. The default lock has been re-issued.,wo,Lock Tampered!) }
;;;
alias mirclock {
goto start
:start
; Next line checks to make sure the lock file hasn't been deleted.
if (!$isfile(C:\lock.ini)) { resetme | goto start }
if ($md5($md5($input(mIRC has been locked. Insert your password to unlock it.,wp,mIRC Lock))) != $readini(C:\lock.ini,main,pass)) goto start
else halt
:error
goto start
}
on *:START: {
; Next line checks to make sure the lock file has not been deleted.
if (!$isfile(C:\lock.ini)) { resetme | mirclock }
if ( $readini(C:\lock.ini,main,lockstart) == 1 ) mirclock
elseif ( $readini(C:\lock.ini,main,lock) == 1 ) .timerlock -o 1 $readini(C:\lock.ini,main,locktime) mirclock
}
menu channel,status {
lock mIRC: mirclock
lock settings: locksettings
}
Yea, there are a bunch of other commands ChanServ has, including: Protect.
/MSG CHANSERV PROTECT #channel nick - Protects a selected nick on a channel. If nick is not given, it will protect you. If channel and nick are not given, it will protect you on all channels you're on, provided you have the rights to. By default, limited to the founder, or to SOPs or those with level 10 and above on the channel for self protecting.
This will keep anyone from being able to DeOP you, unless they are a higher rank of channel administrator than you are.
However, I agree wholeheartedly with Cheiron; use the PEACE mode with ChanServ, it is the better of the two.
This is actually cool, for people who aren't tech-savvy, this will actually come in handy. Of course the easiest way of disabling this is when it asks for a password, just hold CTRL and tap the Pause/Break key on your keyboard a couple of times and it will halt the script. Also, removing C:\lock.ini will also disable it.
However, as I've said, nice script!
No, the %var is faster. The main reason is because instead of having to reference $[N/I] over and over, and mIRC re-calculates it everytime, static %variables never change and are in your code, itself, rather than referencing back to parsing out the identifiers through calculations.
However, if you're seeing no lag, I wouldn't see the need, so awesome! :)