|
benchmarks
snippets
scripts
tutorials
links
|
here are some codes i made and some explanations
ON *:signal:bmark:echo - $2- done in $calc($ticks - $1) $+ ms
a new event that you can call from your alias or events. unless forced not to, it only executes after the script has finished. for example:
alias eko {
.signal bmark $ticks Eko Alias
%ctr 1000
while(%ctr) {
echo -s $uptime(system,1)
dec %ctr
}
}
- Eko Alias done in 1662ms
however, a lot more complicated alias can give you an inaccurate result. i really have no idea about it because it seems the script can end even if it's still displaying or doing something. im not too sure. i have codes that is kinda long (without echo). and then i used another method for speed checking. both returned the same result. i also noticed this on my engine, when using $sfile() (first thing on the script after .signal bmark), the bmark signal already executes. what i did was, i moved .signal bmark after the code where i used $sfile().
alias space return $str( ,$1)
i used a none breaking space here. i think copy paste wouldn't work. use alt + 0160 instead. i use this for indenting lines. $space(10) fills in 10 character spaces.
alias cwin {
if ($wildtok($1-,@*,1,32)) {
if ($window($ifmatch)) { clear $ifmatch | return }
else { window $1- }
}
}
/cwin -lk0 @CustomWindow is just like saying /window -lk0 @CustomWindow. the difference is that, if the window exists, it clears it. otherwise, it creates the window. i use this most of the time.
|