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 

[Problems] WoW Script (need help/tips)

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



Joined: 28 Jan 2007
Posts: 8

Digg It
PostPosted: Tue Jan 30, 2007 1:37 am    Post subject: [Problems] WoW Script (need help/tips)

Ok, Heres my script for WoW currently. It works flawlessly except for one tiny bit which makes me really mad. I use IR to work the mouse around the screen. When I right or left click, in WoW the camera rotates and such. Normally this is fine, but for some reason with my script it makes the camera go all psychotically crazy on me and spins real fast.. HELP!!!!

Heres the script:


//Mouse Control Script using IR
//by vkapadia with much assistance from inio
//vkapadia@vkapadia.com
//
//Calibration:
//To calibrate, run this program and put the Wiimote on a flat surface face-up.
//Then read the values in the debug line (next to the run button).
//Change these values until the debug line reads approx. all zeros.
var.xtrim = 6
var.ytrim = -31
var.ztrim = 6
//
//Options:
var.deadzone = 8
//distance in pixels that you have to move the wiimote in
//order for it to register movement. Creates a "dead zone" around the pointer
//to make it easier to click. Higher = smoother but less accurate.

var.accx = wiimote.RawForceX + var.xtrim
var.accy = wiimote.RawForceY + var.ytrim
var.accz = wiimote.RawForceZ + var.ztrim

if wiimote.dot1vis and wiimote.dot2vis then

if var.accy > -7 then
var.orientation = 0
elseif var.accy > -45 then
if var.accx < 0 then
var.orientation = 3
else
var.orientation = 1
endif
else
var.orientation = 2
endif

if var.leftpoint = 0 then
if var.orientation = 0 then
if wiimote.dot1x < wiimote.dot2x then
var.leftpoint = 1
else
var.leftpoint = 2
endif
endif
if var.orientation = 1 then
if wiimote.dot1y > wiimote.dot2y then
var.leftpoint = 1
else
var.leftpoint = 2
endif
endif
if var.orientation = 2 then
if wiimote.dot1x > wiimote.dot2x then
var.leftpoint = 1
else
var.leftpoint = 2
endif
endif
if var.orientation = 3 then
if wiimote.dot1y < wiimote.dot2y then
var.leftpoint = 1
else
var.leftpoint = 2
endif
endif
endif

if var.leftpoint = 1 then
var.fix1x = wiimote.dot1x
var.fix1y = wiimote.dot1y
var.fix2x = wiimote.dot2x
var.fix2y = wiimote.dot2y
else
var.fix1x = wiimote.dot2x
var.fix1y = wiimote.dot2y
var.fix2x = wiimote.dot1x
var.fix2y = wiimote.dot1y
endif

var.dx = var.fix2x - var.fix1x
var.dy = var.fix2y - var.fix1y
var.cx = (var.fix1x+var.fix2x)/1024.0 - 1
var.cy = (var.fix1y+var.fix2y)/1024.0 - .75

var.d = sqrt(var.dx*var.dx+var.dy*var.dy)

var.dx = var.dx / var.d
var.dy = var.dy / var.d

var.ox = -var.dy*var.cy-var.dx*var.cx;
var.oy = -var.dx*var.cy+var.dy*var.cx;

var.ax = (var.ox * screen.desktopwidth) + (screen.desktopwidth / 2)
var.ay = (-var.oy * screen.desktopwidth) + (screen.desktopheight / 2)




var.dx = var.ax - mouse.cursorposx
var.dy = var.ay - mouse.cursorposy

var.d = sqrt((var.dx*var.dx)+(var.dy*var.dy))

var.a = 180 / (200 + var.d * var.d * var.d * .001)

if var.d <= var.deadzone then var.a = 1

debug = var.d + " " + var.a

var.finalx = mouse.cursorposx * var.a + var.ax * (1 - var.a)
var.finaly = mouse.cursorposy * var.a + var.ay * (1 - var.a)

mouse.cursorposx = var.finalx
mouse.cursorposy = var.finaly

else

var.leftpoint = 0

endif

//EDIT BELOW HERE ------------------------------------------------

Right = Wiimote1.Nunchuk.JoyX > 0.2
Left = Wiimote1.Nunchuk.JoyX < -0.2
down = Wiimote1.Nunchuk.JoyY > 0.2
up = Wiimote1.Nunchuk.JoyY < -0.2

mouse.RightButton = wiimote.B // Right Click
mouse.leftButton = wiimote.A // Left Click

key.f = Wiimote.Down // Stormstrike
key.one = Wiimote.Up // Frost Shock
key.two = Wiimote.Left // Earth Shock
key.three = Wiimote.Right // Flame Shock
key.four = Wiimote.Minus // Healing Wave
key.five = Wiimote.Plus // Lesser Healing
key.x = Wiimote.Home // Sit
key.shift + key.b = Wiimote.One // Open Bags
key.c = Wiimote.Two // Character Pane
key.tab = Wiimote.Nunchuk.CButton // Nearest Enemy
key.ctrl + key.tab = Wiimote.Nunchuk.ZButton // Nearest Friend

key.Space = Wiimote.RelAccY >= 20 && Wiimote.RelAccX <= 0 // Jump
key.ctrl + key.f = Wiimote.RelAccX >= 20 && Wiimote.RelAccY <= 0 // Mount
key.ctrl + key.g = Wiimote.RelAccX >= 28 && Wiimote.RelAccY >= 28 // Attack
Back to top
View user's profile Send private message
plumpman



Joined: 28 Jan 2007
Posts: 8

Digg It
PostPosted: Tue Jan 30, 2007 5:10 pm    Post subject:

Anyone?
Back to top
View user's profile Send private message
FabioCapela



Joined: 09 Feb 2007
Posts: 1

Digg It
PostPosted: Fri Feb 09, 2007 2:39 am    Post subject: Re: [Problems] WoW Script (need help/tips)

plumpman wrote:
Ok, Heres my script for WoW currently. It works flawlessly except for one tiny bit which makes me really mad. I use IR to work the mouse around the screen. When I right or left click, in WoW the camera rotates and such. Normally this is fine, but for some reason with my script it makes the camera go all psychotically crazy on me and spins real fast.. HELP!!!!


It's the same problem you have when trying to use a tablet to control WoW: it expects relative mouse movements while you are feeding it absolute positions.
Unfortunately I don't know how to solve, as I don't yet have a Wii remote.
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