|
- //在游戏中,按下鼠标中键——运行脚本:自动按F1、按鼠标右键,不断循环。
- //按鼠标左键,脚本暂停/停止。
- namespace 辅助按键
- //定义默认空间
- int handle,handle1
- function bool 控制()
- while(true)
- bool 是否暂停 = false
- if(是否暂停==false)
- int mousecode=mouse.waitclick()
- if(mousecode==1000)//鼠标左键
- 是否暂停=thread.suspendthread(handle)//暂停脚本
- endif
- endif
- if(是否暂停)//暂停后,再按左键,恢复脚本
- int mousecode1=mouse.waitclick()
- if(mousecode1==1000)//鼠标左键
- thread.resumethread(handle)//恢复脚本
- 是否暂停=false
- endif
- endif
- help.sleep(500)
- endwhile
- return true
- endfunction
- function bool 循环点击()
- while(true)
- keyboard.keypress(65,1)//A:65用于txt测试,F1:112
- help.sleep(50)
- // mouse.rightclick(1)
- // help.sleep(50)
- endwhile
- return true
- endfunction
- function bool hotkey0_onhotkey()
- //这里添加你要执行的代码
- int mousecode_begin=mouse.waitclick()
- if(mousecode_begin==1006)//鼠标左键
- handle=thread.beginthread("辅助按键.循环点击","")
- handle1=thread.beginthread("辅助按键.控制","")
- endif
- return true
- endfunction
- function bool hotkey1_onhotkey()
- //这里添加你要执行的代码
- thread.closethread(handle)
- thread.closethread(handle1)
- //help.exit()
- return true
- endfunction
- endnamespace
- //空间结束语句
复制代码
这是我写的,你试下看。
加了2个热键,F9,F10
按F9后,等待鼠标按键,按中键后,开始循环(循环按F1和鼠标右键)。循环过程中,按鼠标左键,则暂停循环(循环按F1和鼠标右键),再按鼠标左键,则继续循环。。。。。如此类推
循环(循环按F1和鼠标右键),或者暂停,状态下,按F10,则脚本停止。再次开启脚本,需要按F9,后等待按鼠标中间才启动。
大致就是这样,我也是刚刚学没多久,楼主看看能用不
|
|