运行就停不下来 以及 效果不理想 求大佬看下

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 运行就停不下来 以及 效果不理想 求大佬看下

Re: 运行就停不下来 以及 效果不理想 求大佬看下

Post by fwejifjjwk2 » 11 Oct 2019, 05:37

Code: Select all

; 滾輪向下
WheelDown::
    {
        Random, rand, 0.0, 1.0
        ; 把 msgbox 改成你的取顏色代碼
        MsgBox, 4, , do-some-thing, 1
        Sleep, 50
        if (rand>0.5)
        {
            ; 改成你要的操作1
            MsgBox, 4, , cond1, 1
            Sleep, 50
        }
        else {
            ; 改成你要的操作2
            MsgBox, 4, , cond2, 1
            Sleep, 50
        }
    }
return

Re: 有大佬帮忙看循环问题么 谢谢!!

Post by au6 » 22 Jan 2019, 23:38

判斷時間是奇數或偶數來完成隨機

Code: Select all

XButton1::Send,% (A_Tickcount & 1) ? 3 : 2
A_Tickcount內建的一種時間變量
& 1是二進位運算,這裡是取二進制數字中的最後一位
條件?A:B是ternary operator,If-Else的簡寫方式

运行就停不下来 以及 效果不理想 求大佬看下

Post by joy033 » 19 Jan 2019, 04:09

理想效果是 取色段 之后 else 随机 send 3 或者 send 2
但是不会弄
只能搞个顺序 先send 3 再 send 2 但是不打工 要么不起作用 要么无限循环 send 3 send 2 放开Xbutton1都还在循环!?


Code: Select all

XButton1::

Hotkey, XButton1, Off
GoSub, Label
SetTimer, Label, 0
return

XButton1 up::
Hotkey, XButton1, On
SetTimer, Label, Off
return

Label:

SetTimer, Label, 0
{
if ( GetColor(749,952)=="0xDFDCDC" ) ;5
{
send {5 down}
sleep 10
send {5 up}

else
{
Gosub, tim
SetTimer, tim, 0
}

}
Return


tim:
Z:=!Z
Loop 
{

if(Z!=0)

send {3 down}
sleep 2000
send {3 up}

if(Z!=1)

send {1 down}
sleep 2000
send {1 up}

if(Z!=2)
Break tim


}
Return

Top