Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider becoming a contibuting member by either clicking this text or the Patreon link on the right.

Patreon

If neither of those of work for you, you can donate any amount by clicking here.

Recommended Posts

Posted

Sorry, yes AHK = AutoHotKey. That's one of the main languages people code in at this forum. If you see AI, it means AutoIt (a similar scripting language).

Posted

Hmmm!

I know Java, JavaScript and XML but never heard AutoHotKey!

From a quick wiki read i saw that this is a scripting language in order to automate tasks?

Is it difficult to learn it?I am asking cause i couldn't find any "tutorial"!The wiki page is really short, but from what i read i am really triggered to use it!

Haven't searched thoroughly cause in 3 weeks or so my exams in uni start so i don't have so much time!

ps: i am planning to "rebuild" my HTPC in order to "automate" things and make it more user-friendly.

I am planning to create 3 users in the startup page:

1: GameEx

2: MediaPortal

3: Just-Windows

When i choose the 2nd user i want to have the windows start only the MediaPortal (i don't want to see any desktop etc) (i will make it start up with windows)

I was planning to do this with GameEx but the thing is that i couldn't because i have to open BlueSoleil,Connect the WiiRemote,Open GlovePie, open the script and hit run.

Is it possible with AHK to automate those tasks {open BlueSoleil,Connect the WiiRemote,Open GlovePie, open the script and hit run} with the start up of the windows?

Posted

AHK can do pretty much anything a user could do with a keyboard, mouse, etc. The language is pretty simple to learn IMO. I've never seen a real tutorial, but there are several guides for different topics at the AHK forum/wiki (e.g., how to remap keys/mice/joysticks). I don't think it replaces a real language like C or VB, but it definitely is nice to implement high level tasks quickly. I think it's a nice language to have in your toolbox!

Oh, and some people prefer AI over AHK. I have seen a few things that AI can do that AHK can't. It might be a good idea to learn both if you have time. The code from AI and AHK are nearly identical, so it might not be that big a challenge.

Posted

Sire, what script are you using? I've not had luck getting a good script for the Wiimote to control the mouse. I get some movement/button pushes but that's about it.

Posted

The script i am using is:

  Quote
//Mouse Control Script using IR

//by vkapadia

//vkapadia@vkapadia.com

//

//Options:

var.smooth = 10 //how many frames to smooth over. higher = more smooth, less precise

//var.smooth doesnt work yet, if you want to change the smoothing,

//find the "Mouse.CursorPosX =" and "Mouse.CursorPosY =" lines and change

//the very last number (should be 10 initially) to whatever value.

var.KITTspeed = 100 ms //delay speed for flashing LEDs. higher = slower

var.rumble = false //makes the wiimote rumble if you hit the edge of the screen

//more options to be added later

//Controls:

//Point Wiimote = Move Mouse

//D-Pad = Arrow Keys

//B-Button = Left Click

//Home = Middle Click

//A-Button = Right Click

//Plus and Minus = Control Volume

//One = Unmapped

//Two = Unmapped

//

//If the pointer hits the edge of the screen, the Wiimote will rumble a bit.

//

//The LEDs attempt to emulate KITT's grill from Knight Rider

//Display the location of the mouse in Pixels

//debug = round(RemoveUnits(Mouse.x * screen.Width)) + ", " + round(RemoveUnits(Mouse.y * screen.Height))

//Set the D-Pad to function as the Arrow Keys

if wiimote.Up

Up = true

Wait 200 ms

Up = false

endif

if wiimote.Down

Down = true

Wait 200 ms

Down = false

endif

if wiimote.Left

Left = true

Wait 200 ms

Left = false

endif

if wiimote.Right

Right = true

Wait 200 ms

Right = false

endif

//Mouse Buttons

Mouse.RightButton = Wiimote.A

Mouse.LeftButton = Wiimote.B

Mouse.MiddleButton = Wiimote.Home

//Plus and Minus handle Volume

if wiimote.plus then

volumeup = true

wait 60 ms

volumeup = false

endif

if wiimote.minus then

volumedown = true

wait 60 ms

volumedown = false

endif

//wiimote.One

//wiimote.Two

//LEDs look somewhat like KITT's grill from Knight Rider

if 0 = 0 then

if var.kitt = 0 then

wiimote.Leds = 1

endif

if var.kitt = 1 then

wiimote.Leds = 3

endif

if var.kitt = 2 then

wiimote.Leds = 6

endif

if var.kitt = 3 then

wiimote.Leds = 12

endif

if var.kitt = 4 then

wiimote.Leds = 8

endif

if var.kitt = 5 then

wiimote.Leds = 12

endif

if var.kitt = 6 then

wiimote.Leds = 6

endif

if var.kitt = 7 then

wiimote.Leds = 3

endif

wait var.KITTspeed

var.kitt = (var.kitt + 1) % 8

endif

//If the mouse reaches the end, rumble for 200 milliseconds

if var.rumble and (mouse.x = 0 or mouse.x = 1 or mouse.y = 0 or mouse.y = 1) then

if var.rmbl = false

wiimote.Rumble = 1

wait 200 ms

wiimote.Rumble = 0

endif

var.rmbl = true

else

var.rmbl = false

endif

//motion (with help from Dunks)

if wiimote.dot1vis then

var.actualX=((1-(round(Wiimote.dot1x)/1024))*Screen.Width)

var.speedX = ((var.actualX/((Screen.Width /2))) - 1) * 10

if abs(var.speedX) > 1 then Mouse.CursorPosX = Mouse.CursorPosX+var.speedX

var.actualY=(((round(Wiimote.dot1y)/1024))*Screen.Height)

var.speedY = ((var.actualY/((Screen.Height /2))) - 1) * 10

if abs(var.speedY) > 1 then Mouse.CursorPosY = Mouse.CursorPosY+var.speedY

endif

Guest
This topic is now closed to further replies.
×
×
  • Create New...