Jump to content

Hey, can some1 create for me a little mouse script?


Recommended Posts

Hey,

I am new here and very interested in scripting. Especially to use it for a game.

Well it will take a while to create my own scripts. And I need some help.

I would be very thankfull if some1 could create for me a simple script for my mouse and it should be able to move my mouse to the right side and back to the left side (with right mouse button pressed) with a 15 second interval

Greetz

Hendrik

Link to comment
Share on other sites

Hey,

I am new here and very interested in scripting. Especially to use it for a game.

Well it will take a while to create my own scripts. And I need some help.

I would be very thankfull if some1 could create for me a simple script for my mouse and it should be able to move my mouse to the right side and back to the left side (with right mouse button pressed) with a 15 second interval

Greetz

Hendrik

We don't like to give handouts to the misinformed. Please post at least an attempt to ensure us that you actually have a desire to learn.

Link to comment
Share on other sites

Hey,

I am new here and very interested in scripting. Especially to use it for a game.

Well it will take a while to create my own scripts. And I need some help.

I would be very thankfull if some1 could create for me a simple script for my mouse and it should be able to move my mouse to the right side and back to the left side (with right mouse button pressed) with a 15 second interval

Greetz

Hendrik

that sounds like a great beginner script. it may seem hard at first, but you can do it. find the help file in your autoit folder, and in the search type in MouseMove. this is the example provided

MouseMove(10, 100)

this just says that you are using the function MouseMove and the 10 and 100 are your X and Y coordinates on your desktop.

you mentioned a 15 second interval.

there is a sleep function for this. an example for sleeping 15 seconds like you said is this

sleep(15000)

sleep is calculated in miliseconds, and because there are 1000 miliseconds in a second, you tell it to sleep for 15000.

to find the X and Y coordinates for mousemove, you can use the function MouseGetPos

Link to comment
Share on other sites

Thnx for help, the helpfile is doing a great job, but AutoIt 123 ^^, well I failed at basic exam :)

Well trying my best, I am testing... well my first script works well in Windows XP:

MouseClick("right")

MouseMove(640, 512)

MouseMove(1280, 512, 100)

MouseMove(0, 512, 100)

MouseMove(640, 512)

MouseClick("left")

The problem is that the mouse script doesnt work ingame, i am using this function:

Func Start()

Do

ControlSend("WormsWar","","","{F1}")

sleep(500)

MouseClick("right")

MouseMove(640, 512)

MouseMove(1280, 512, 100)

MouseMove(0, 512, 100)

MouseMove(640, 512)

MouseClick("left")

Until _IsPressed("!x")

EndFunc

The press F1 command works fine, but my mouse doenst react the commands ingame... any idea?

Edited by hendrikhe
Link to comment
Share on other sites

Hmm I really dont get it...

I made a simple script:

MouseClick("right")

MouseMove(640, 512)

MouseMove(1280, 512, 100)

MouseMove(0, 512, 100)

MouseMove(640, 512)

MouseClick("left")

Works fine in Windows, but it refuses to work ingame. Do I have to write a command like:

MouseClick("Programm/Gamename", "right")? for example

Well a bit strange but in some other games like Warcraft 3 this simple Mouse script works :/

Edited by hendrikhe
Link to comment
Share on other sites

No, maybe the game has MouseKeyBlocker a.k.a. GameGuard, a program which the program uses to stop the sending of keystrokes/mouseclicks via a application.

Edited by Swift
Link to comment
Share on other sites

Fullscreen games are often difficult to simulate mouse clicks with. Especially ones that have special controls to prevent simulation. If it's a full screen game, see if it has a 'windowed' option where you can play it in a window. It might help telling us what the game is too.

Also, a question, are you sure this is what you want your program to do?

MouseClick("right")

MouseMove(640, 512)

MouseMove(1280, 512, 100)

MouseMove(0, 512, 100)

MouseMove(640, 512)

MouseClick("left")

You know that it doesn't click in between those moves. If you want a function that moves the mouse to a location then clicks it, you can use MouseClick but add the x, y coordinates such as this example:

MouseClick("right", 200, 500, 1, 0)

Here is the documentation on the function and its parameters:

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

As you can see,

"Right" is the first parameter,

200 is x coordinate,

500 is y coordinate,

1 is the number of clicks, and

0 is the speed (which we will call just about instant)

Link to comment
Share on other sites

The game is called Rappelz and its protected by Hackshield. This Hackshield seems to wok very nice and it seems to block my mouse commands.

Its a fullscreen game, but I can 'windowed' it, but still the same problem: if I click on Desktop: mouse script is working well but if I click back to the 'windowed' game it does nothing. Any ideas to resolve it?

@packman

I have to improve my mouse script, but first I want to find out if I can run a mouse script for this game.

when I am finished this mouse script should be able to hold right mouse button, move to the right side, move to the left side and move to the middle of the screen, release right mouse button and press left mouse button (1280x1024).

So I should be able to take a look around my character in this game and make a step forward (press left mouse button).

But the biggest problem is that I am not able to run any mouse scripts in this game :)

Link to comment
Share on other sites

Make the mouse click the game on the toolbar.. MouseMove () to the game box on the toolbar, then make it wait a bit.. Then it should work.

I dont understand what you mean, can you explain it how it works? Sry I am a beginner.

HackShield seems to be very special, very hard to bypass, well I wont give up before my mouse script works:P

Edited by hendrikhe
Link to comment
Share on other sites

Hmm :/ I got a problem, if I use a script like this one the mouse works really fine like I need:

CODE

Start()

Func Start()

While 1

Opt( "MouseCoordMode", 0)

ControlClick("Rappelz","","","left", 1, 512, 384) ; move forward

sleep(1000)

ControlClick("Rappelz","","","left", 1, 1000, 384) ; move right

sleep(1000)

ControlClick("Rappelz","","","left", 1, 512, 630) ; move back

sleep(1000)

ControlClick("Rappelz","","","left", 1, 512, 630) ; move back

sleep(1000)

ControlClick("Rappelz","","","left", 1, 20, 384) ; move left

sleep(1000)

WEnd

EndFunc

but if I change it a bit (to be able to attack creatures and pick up items), the mouse moves only one or two times and only the attack creatures and pick up items commands work, any ideas how to fix it?

CODE
Func _void_Farm()

WinActivate("Rappelz")

Sleep(200)

ControlSend("Rappelz","","","{Tab}") ; Mob search

sleep(100)

ControlSend("Rappelz","","","{F1}") ; Attack with Creature

Sleep(100)

ControlSend("Rappelz","","","{F3}") ; Chip the Mob

Sleep(100)

ControlSend("Rappelz","","","{F4}") ; Attack with Creature

sleep(10000)

ControlSend("Rappelz","","","{F2}") ; pick up

sleep(1000)

ControlSend("Rappelz","","","{F2}") ; pick up

sleep(1000)

ControlSend("Rappelz","","","{F2}") ; pick up

sleep(1000)

EndFunc

Start()

Func Start()

While 1

Opt( "MouseCoordMode", 0)

ControlClick("Rappelz","","","left", 1, 512, 384) ; move forward

_void_Farm()

ControlClick("Rappelz","","","left", 1, 1000, 384) ; move right

_void_Farm()

ControlClick("Rappelz","","","left", 1, 512, 630) ; move back

_void_Farm()

ControlClick("Rappelz","","","left", 1, 512, 630) ; move back

_void_Farm()

ControlClick("Rappelz","","","left", 1, 20, 384) ; move left

_void_Farm()

WEnd

EndFunc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...