你们有4.0以上版本的吗?调用PY脚本可以返回变量值不
tasker吧
全部回复
仅看楼主
level 1
theking3657
楼主
我的版本太低,不能返回变量值,只能传递变量
在PY里写了个返回值的脚本,才发现不能返回
想获得手机的磁场数据怎么搞,获得数值大小,没有这个功能啊
2013年04月24日 13点04分
1
level 9
cdce49
磁场强度变量:Magnetic Field Strengh
在变量选择菜单里有的。
2013年04月24日 13点04分
2
cdce49
PY没学,完全不懂。
2013年04月24日 13点04分
theking3657
回复 cdce49 :非常简单,用到PY的只有几行代码而已,主要用的是SL4A的API,早知道有磁场变量我就不研究这个了,哈哈哈
2013年04月24日 13点04分
level 1
theking3657
楼主
这都被你发现了,强悍,哈哈哈
2013年04月24日 13点04分
3
cdce49
回复 theking3657 :事实证明至少我的手机是不能的,因为随着次数增多,本来应该挺高的磁场强度变得越来越不灵敏,必须重新校准。现在的手机NFC功能说不定可以
2013年04月24日 14点04分
theking3657
回复 cdce49 :磁场感应器很耗电的,而且关屏状态下好像不能开启吧,我倒是可以用磁场感应做个好玩的应用,正在构思中
2013年04月24日 14点04分
cdce49
以前尝试过用一块放在口袋里的磁铁来作个手机防盗,用磁场强度来监测距离...现在想来真是太天真了呃
2013年04月24日 13点04分
theking3657
你不怕手机被磁化了啊,哈哈哈,不过想法不错,希望厂商可以做成蓝牙监测防盗,离开蓝牙范围就报警
2013年04月24日 14点04分
level 1
theking3657
楼主
太强悍了,我已经知道如何将值从PY脚本里返回了,已经用Tasker弹出框显示出脚本查询到的磁场数值了,但是为啥帮助文件没写这种方法呢(在PY脚本把值设置到剪贴板,在Tasker里获取剪贴板),还说暂时无法获取返回值,4.0的版本可以获得吗???
谁有4.0的帮助文件,看看调用脚本的那个问号帮助提示是怎么写的???
2013年04月24日 15点04分
4
陈都灵
求py代码!可以发上来吗?
2013年04月24日 15点04分
level 9
cdce49
是指这个功能吗?
2013年04月24日 22点04分
5
theking3657
你的版本是4.0吗,和我显示的一样,不能返回
2013年04月25日 00点04分
level 1
theking3657
楼主
import android,time
droid = android.Android()
droid.startSensingTimed(1,250)
time.sleep(1)
s1 = droid.readSensors().result
s2 = droid.sensorsGetAccuracy().result
2013年04月24日 23点04分
6
level 1
theking3657
楼主
s4 =droid.sensorsReadAccelerometer().result
s5=droid.sensorsReadMagnetometer().result
s6=droid.sensorsReadOrientation().result
print"--all---"
print s1
print "---zuijin--"
print s2
print"---light--"
print s3
print"---jiasudu--"
print s4
print"---cichang--"
print s5
print s5[0]
print s5[1]
print s5[2]
droid.setClipboard(str(s5[1]))
print"---fangxiang"
print s6
droid.stopSensing()
打印的去掉,显示也看不到,以后我做个教程
2013年04月25日 00点04分
7
level 1
zhxb1101
请问tasker怎么传递变量给py?
2014年08月12日 02点08分
8
1