Since the code makes a control variable( if (!$($+(%,note,$2),2)) ), takes advantage of the variable. :)
example:
ON *:TEXT:-addname *:#: {
fbnumber $2
;// if don t exist...continue (message chan + write in the file.txt)
if (!$($+(%,name,$2),2)) {
set $+(%,name,$2) $3-
msg $chan Name $3- has been added to Facebook ID, $2. | load -rs addname.txt
write addname.txt Added by $nick - Name $3 - Facebook ID $2 - $asctime -
}
;// esle ...sorry is already in DT DateBase etc etc ...and not write in the file.txt
else {
msg $chan $nick $+ : Sorry this 1[04Name]: ( $3- ) for 1[04FB ID]: ( $2 ) is already in DT DateBase.
}
}
2 i dont understand what u mean ?
ON *:TEXT:-addnote *:#: {
;// when you type the command ''-addnote word word etc etc'', is adding a line in the file even if the same row already exists.
;// example: frederik type: -addnote MoMy not understand anything about English
;// in the file addnote.txt will add the line '' Added by frederik - Notes MoMy not understand anything about English'' date -
;// If you throw the same command with the same sentence, get the message ''Sorry this [FB ID]: ( -addnote ) is already in DT DateBase for [Note]'' etc etc
;// because there is a variable %note-addnote(etc-etc) but the file will add a new row duplicates.
write addnote.txt Added by $nick - Notes $3 - Facebook ID $2 - $asctime -
fbnumber $2
if (!$($+(%,note,$2),2)) {
set $+(%,note,$2) ( $3- ) $asctime
msg $chan 1[04Note]: $3- ,has been added to Dt Database . by $nick for 1[04FB ID]: ( $2 ) Date : $asctime | load -rs addnote.txt
}
else {
msg $chan $nick Sorry this 1[04FB ID]: ( $2 ) is already in DT DateBase for 1[04Note]: ( $3- ).
}
}
and this thing happens on all the events on text that you wrote
There are some things I do not understand:
line 19, Why divide a number by 1, is not a transaction in more?
$calc($calc($1 / 1) * 2)
Why in many events on text for it is the control variable (if exist) but does not check whether this file contains the line?
Thus writes the same text several times
Why are asked to load a txt file?
It is easier to use $read to check or read the content
What is the command /ISNUMBER $2??
What is the command fbnumber?
For example, in facebook I do not have a numeric id but alphanumeric id, so I always get an error.
I see this alias repeated several times:
alias isnumber {
%cislo = $calc($calc($1 / 1) * 2)
if (%cislo != $calc($1 * 2) || %cislo == 0) { msg # $nick $+ : Please put Facebook ID . | halt }
}
I did not understand what is.
And then, if $calc($1 / 1) = $1 (123456789 / 1 = 123456789), why divide by 1?.
if the variables need not be invoked in other events or alias, why not use local variables that dirty minus mirc register?.
set %variable = value and %variable = value, leave traces in the registry and this helps when you need to call a variable with alias or other events.
excuse my bad english
Edit: I do not know why out of the tag
to each line in the code. :\