DescriptionThis is my first ever script that I'm posting on hawkee, also I'm a newbie in mIRC scripting so I hope you like it,
Define System:
System that saves definitions for different nicks / objects etc.
Features:
!setdefine <object/nick>
!define <object/nick>
!editdefine <object/nick> -------------------------> To edit a definition
!deldefine <object/nick> -----------------------------------> To delete a definition
The !deldefine and !editdefine are conditional, i.e you can replace "CHANGE_ME" with your nick to redirect access of the cmds.
;Define script by Areeb
on *:text:!dhelp:#: { /msg $chan Define system cmds: } { /msg $chan 12!setdefine <object/nick> <definition>, !define <object/nick> }
on *:text:!setdefine *:#: {
if (%define. [ $+ [ $2 ] ] = $null) {
set %define. $+ $2 $3- [Define by: $nick $+ ]
/msg $chan 12Define for $2 was saved! }
else {
/msg $chan 4Error:1 $2 is already defined }
}
on *:text:!editdefine *:#: {
if ($nick = CHANGEME) {
set %define. $+ $2 $3- [Edited by: $nick $+ ]
/msg $chan 12New define for $2 was saved! }
else {
/msg $chan 4Error:1 You're not authorised to perform this action. }
}
on *:text:!deldefine *:#: {
if ($nick = CHANGEME) {
set %define. $+ $2 $null
/msg $chan 12Define for $2 was deleted. }
else {
/msg $chan 4Error: 1You're not authorised to perform this action. }
}
on *:text:!define *:#:{
var %define = %define. [ $+ [ $2 ] ]
if (%define != $null) {
msg $chan 4 $2 $+ :1 %define $+ .
}
else {
msg $chan 12 $2 doesn't have a define set yet. !setdefine $2 <definition> to set a define for $2 $+ .
}
}
Couple things to point out. In the first on text event, you have two sets of commands in different brackets ({ }). Also instead of all of those event, combine those in one. Using if/elseif statements. Also, there is no need for a slash in the msg part. I know I am nitpicking, but it's just me. I know that this is your first one, but it isn't that bad. Probably the last part I would recommend is either storing them in a hash table or INI file, because with that, you can identify which term is valid, with the use of evaluation brackets.
Thanks for the feedback, will improve my scripts accordingly :).