WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need some help with fairly simple script please!

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
Oddballs24



Joined: 16 Mar 2008
Posts: 4

Digg It
PostPosted: 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
View user's profile Send private message
Oddballs24



Joined: 16 Mar 2008
Posts: 4

Digg It
PostPosted: 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group