tglogo.png
0 LIKES

Snippet


Aliases to handle note_file by gennarino

In Category General IRC Posted by Snippets On 12/04/23

I wrote some aliases for my scripts. They might be of any use for some of you so I decided to post them here. You can install them just as any other mirc script: ALT-R for remote, NEW_FILE, past the following code and SAVE.
Now you have a few aliases to handle your notes.

To test the functions you can use the additional alias test_note or just type /note.h for the help.
Hope the best for you all!
;       - -_##_------------------------------------------------_##_-
;       -  ( ") Merry Christmas and happy 2021 to all of you   (" )
;       - \/ .\-  Respect others and enjoy your stay on IRC.  -/. \/
;       - (  : )----------------------------------------------( :  )
;

; ----------> note.help <----------
alias note.h /echo 8 -a note.h=This-help ; note.w=write (append) ; note.i=insert ; note.d=delete ; note.t=total lines ; note.r=readline (random) ; note.l=readline num. ; note.s=search ; note.a=searchAll ; note.c=clear-file 

; ----------> note.write line (append) <----------
alias note.w //write note.txt $$1- | //echo 4 -a write: $lines(note.txt) lines           

; ---------->  note.delete line_num
alias note.d //write -dl $+ $$1 note.txt | //echo 4 -a delete: $lines(note.txt) lines

; ---------->  note.read line(random)
alias note.r //echo 4 -a $read(note.txt, n)                                              

; ---------->  note.read line @ specific row
alias note.l //echo 4 -a $read(note.txt, n, $$1)                                         

; ---------->  note.search 1st occurrency
alias note.s //echo 4 -a $read(note.txt, nw, $+(*,$1-,*))  

; ----------> note.all = search all occurrencies
alias note.a //while ($read(note.txt, nw, $+(*,$$1-,*), $calc($readn + 1))) echo 8 -a $v1  

; ----------> note.insert @line
alias note.i //write -il $+ $$1 note.txt $$2- | echo 4 line $1 inserted                                      

; ----------> note.clear file (empty)
alias note.c //write -c note.txt | //echo 4 -a $lines(note.txt) lines             

; ----------> note.t = total number of lines
alias note.t //echo 4 -a $lines(note.txt) lines total 

alias test_note {
  note.c
  note.w this is 1st line
  note.w this is 2nd line
  note.w this is last line
  note.t
  note.i 2 this is a new 2nd line
  note.t
  note.s 2nd
  note.a 2nd
  note.a *
}


Comments 0


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand