| View previous topic :: View next topic |
| Author |
Message |
Vrilya
Joined: 08 Jun 2008 Posts: 4 Location: Sweden
Digg It |
Posted: Sun Jun 08, 2008 3:36 am Post subject: Help with a script |
|
|
Hey!
I have just been starting to try out Glovepie a bit and I believe it does it's job pretty well.. however I would like to know it there is any way to change the assignments of keys in the middle of a running script... or just for example disabling the wiimote mouse emulation?
For example... I am playing around a little bit with a world of warcraft script now and I have button A and button B on the wiimote assigned to the right and left mouse buttons.
I would like to be able to switch these buttons out when I am playing to something else... is that even possible?
//Vrilya |
|
| Back to top |
|
 |
TigerGD
Joined: 16 Apr 2007 Posts: 71 Location: SoCal
Digg It |
Posted: Mon Jun 09, 2008 12:44 am Post subject: |
|
|
| Code: |
var.ScriptAB = True
If pressed(Wiimote.[whateverbutton])
toggle(var.ScriptAB)
EndIf
If var.ScriptAB
[fill in button assignments here]
Else
[fill in alternate button assignments here]
EndIf
|
That ought to do it for you. [/code] |
|
| Back to top |
|
 |
Vrilya
Joined: 08 Jun 2008 Posts: 4 Location: Sweden
Digg It |
Posted: Mon Jun 09, 2008 10:57 am Post subject: |
|
|
thanks alot.... I'll try it out tonight.
and btw... I really appreciate the help
wkr
Vrilya |
|
| Back to top |
|
 |
Vrilya
Joined: 08 Jun 2008 Posts: 4 Location: Sweden
Digg It |
Posted: Tue Jun 10, 2008 1:38 am Post subject: |
|
|
ok... soo I tried your code but it did'nt work... I sat for hours reading through the manual to come up with something different.
The thing with the code you posted was just a single mistake.... I am sure you knew about it but kinda missed it somehow but anyway.
as the script is constantly looping it will automatically set var.ScriptAB to true.. as that is the first thing the script is telling the variable before we are pressing the button to assign new button assignments.
however I changed the code to start out like this instead
| Code: | var.ScriptAB = var.ScriptAB
If pressed(Wiimote.[whateverbutton])
toggle(var.ScriptAB)
EndIf
|
As var.ScriptAB is equal to either true or false depending on the toggle(var.ScriptAB), the loop of the script will automaticaly set it to True everytime it loops even though you have toggled it to false.
anyway thanks alot for the code you gave me... it took me a few hours as I said to get it to really work as I wanted it to but I learnt alot from reading the manual and scanning through all sorts of code.
wkr
Vrilya |
|
| Back to top |
|
 |
Wreyth

Joined: 03 Nov 2007 Posts: 77
Digg It |
Posted: Mon Jun 23, 2008 8:08 am Post subject: |
|
|
ok i have found the easiest way for me instead of creating a bunch of variables is to write it out like this
| Code: |
if Wiimote.Nunchuk.CButton then
escape = Wiimote.A
elseif Wiimote.Nunchuk.ZButton then
mouse.rightbutton = Wiimote.A
else
mouse.leftbutton = Wiimote.A
end if
|
hope that shines some light for ya |
|
| Back to top |
|
 |
|