Re: ShortcutMe - Cùng khám phá và chia sẻ những macro và thủ thuật hay nào!

Em cũng tính dùng elseif rồi chứ như tách riêng thế cho anh em cắt dán theo ý cho dễ. Hì hì

[ Posted by Mobile Device ]

--- Added at 22/10/2011, 12:45 ---




Trích dẫn Gửi bởi Cak30ut
theo code ban đầu thì có bao nhiêu trường hợp nó
xét hết
còn dùng if else thì nếu nó xét dk mà đúng trường
hợp đầu thì nó làm xong kết thúc if lun, không cần
xét các thằng còn lại
Cái này đúng nhỉ. Chắc là nên sửa.

--- Added at 22/10/2011, 13:18 ---

POWERFUL MOVES Ver 2 (bug fix) bởi Cak3u0t:

Cái này tối ưu hơn cái trên (ver1)

Macro p1 (thêm vào menu và sử dụng cho app hiện tại)

Macro:




input $Choose;

if0 $Choose == 0;

then0;input
$Space;launch GetForeground;set $i=0;while1 $i<$Space;do1;Spacekey;inc $i;endwhile1;

Elseif0 $Choose == 1;
input $MoveDown;launch GetForeground;navmovedown$MoveDown;

elseif0 $Choose == 2;
input $MoveUp;launch GetForeground;navmoveup$MoveUp;

elseif0 $Choose == 3;input $FromBottom;launch GetForeground;Menuitemfrombottom$FromBottom;

elseif0 $Choose == 4;input $FromTop;launch GetForeground;MenuitemfromTop$FromTop;

elseif0 $Choose == 5;input $MoveLeft;launch GetForeground;navmoveleft$MoveLeft;

elseif0 $Choose == 6;input $MoveRight;launch GetForeground;navmoveright$MoveRight;

else0;
ShowError! Please Retry Input Choose by Integer Number from 0 to 6;Stop;

endif0;
------------------------------------------------------------
Sử dụng cho hầu hết app đang chạy nền, có thể thêm hoặc không thêm vào menu

Macro:





input $AppName;Delay100;
input $Choose;

if0 $Choose == 0;then0;input
$Space;launch $AppName;Delay100;set $i=0;while1 $i<$Space;do1;Spacekey;inc$i;endwhile1;

elseif0 $Choose == 1;
input $MoveDown;launch$AppName;Delay100;navmovedown$Move Down;

elseif0 $Choose == 2;
input $MoveUp;launch $AppName;Delay100;navmoveup$MoveUp;

elseif0 $Choose == 3;
input $FromBottom;launch $AppName;Delay100;Menuitemfrombottom$FromBottom;

elseif0 $Choose == 4;
input $FromTop;launch $AppName;Delay100;MenuitemfromTop$FromTop;

elseif0 $Choose == 5;
input $MoveLeft;launch $AppName;Delay100;navmoveleft$MoveLeft;

elseif0 $Choose == 6;
input $MoveRight;launch $AppName;Delay100;navmoveright$MoveRight;

else0;
ShowError! Please Retry Input Choose by Integer Number from 0 to 6;Stop;

endif0;