| View previous topic :: View next topic |
| Author |
Message |
Oddballs24
Joined: 16 Mar 2008 Posts: 4
Digg It |
Posted: Sun Mar 16, 2008 10:55 am Post subject: Need some help with fairly simple script please! |
|
|
Hi, I am trying to make a script so that:
when -40 < var.a < 40, then a key.a is pressed once. Then when var.a changes so that -50>var.a>-130, key.b is pressed once. I would like to have 4 ranges for var.a. The problem i am having is i can only make key.a/b/c/d be pressed repeatedly or be held continuously. Any help would be appreciated.
Thanks a lot! |
|
| Back to top |
|
 |
Oddballs24
Joined: 16 Mar 2008 Posts: 4
Digg It |
Posted: Mon Mar 17, 2008 4:13 pm Post subject: Fixed It! |
|
|
Hey, i got it all sorted now using a simple solution involving made up variables. If anyone is interested I was trying to make a script which made my screen rotate when it rotated physically, with a wiimote stuck behind the top. I used a program called iRotate so I could rotate it with a key combination. Here is the finished script:
//Debug
debug = 'X=' + Wiimote.rawforcex + 'Z=' + Wiimote.RawForceZ;
//Screen Normal
IF 20<Wiimote.RawForcex<25 AND var.a = 0
Keys.ctrl+alt+up=True
Wait 1ms
Keys.ctrl+alt+up=False
var.a = 1
var.b = 0
var.c = 0
var.d = 0
//Screen 90 degrees
ELSEIF 20<Wiimote.RawForceZ<30 AND var.b = 0
Keys.ctrl+alt+left=True
Wait 1ms
Keys.ctrl+alt+left=False
var.a = 0
var.b = 1
var.c = 0
var.d = 0
//Screen 180 degrees
ELSEIF -30<Wiimote.RawForcex<-25 AND var.c = 0
Keys.ctrl+alt+down=True
Wait 1ms
Keys.ctrl+alt+down=False
var.a = 0
var.b = 0
var.c = 1
var.d = 0
//Screen 270 degrees
ELSEIF -35<Wiimote.RawForceZ<-25 AND var.d = 0
Keys.ctrl+alt+right=True
Wait 1ms
Keys.ctrl+alt+right=False
var.a = 0
var.b = 0
var.c = 0
var.d = 1
ENDIF |
|
| Back to top |
|
 |
|