Jump to content

Trying to script a simple macro for a game


Recommended Posts

I'm trying to script a simple action for a game called Priston Tale. I've been able to use a script I found here in the game. (x,y coordinate display-under the mouse) My script works on the desktop. I'm a huge noob. Is there anything I'm forgetting or doing wrong? Thanks ahead of time for any help.

HotKeySet("{ESC}", "Terminate"); a way out of this
HotKeySet("+!d", "Wolf") ;Shift-Alt-d

While 1
    Sleep(100)
WEnd

Func Wolf()
    MouseMove(25, 25)
    MouseClick("left")
    MouseClick("left")
EndFunc  ;==>Wolf

Func Terminate()
    Exit 0
EndFunc  ;==>Terminate
Link to comment
Share on other sites

I'm trying to script a simple action for a game called Priston Tale. I've been able to use a script I found here in the game. (x,y coordinate display-under the mouse) My script works on the desktop. I'm a huge noob. Is there anything I'm forgetting or doing wrong? Thanks ahead of time for any help.

HotKeySet("{ESC}", "Terminate"); a way out of this
HotKeySet("+!d", "Wolf");Shift-Alt-d

While 1
    Sleep(100)
WEnd

Func Wolf()
    MouseMove(25, 25)
    MouseClick("left")
    MouseClick("left")
EndFunc ;==>Wolf

Func Terminate()
    Exit 0
EndFunc ;==>Terminate

what is it that you wanted this code to do?

hmm... I wonder which key is the any key :O

Link to comment
Share on other sites

what is it that you wanted this code to do?

It's basically just starting code. I'm just trying to learn the mechanics. However, the script is supposed to move the mouse up to a spot at 25,25 and double click. Basically the double click is supposed to automate a change on a skill I'm using. When I use it on my desktop it double clicks the top left icon. When I use it in game, it does absolutely nothing.
Link to comment
Share on other sites

It's basically just starting code. I'm just trying to learn the mechanics. However, the script is supposed to move the mouse up to a spot at 25,25 and double click. Basically the double click is supposed to automate a change on a skill I'm using. When I use it on my desktop it double clicks the top left icon. When I use it in game, it does absolutely nothing.

maybe the game is blocking it somehow... you might try changing the macro to a function key just to see if that might work.

hmm... I wonder which key is the any key :O

Link to comment
Share on other sites

Ok I tried f7. It didn't work. I tried the tilde key. That didn't work. Any other suggestions? Would using the _IfPressed function yield any different results?

It sounds like the game itself may be preventing your program from doing anything is it possible to minimize it ?

or is it a fullscreen application?

hmm... I wonder which key is the any key :O

Link to comment
Share on other sites

Two things...

Func Wolf()
    MouseClick("left", 25, 25, 2, 0)
EndFunc;==>Wolf

That code is just much simpler and does the same thing muttley

Also, have you tried this:

HotKeySet("{ESC}", "Terminate"); a way out of this
HotKeySet("{F7}", "Wolf");F7

While 1
    HotKeySet("{F7}", "Wolf");F7
WEnd

Func Wolf()
    MouseMove(25, 25)
    MouseClick("left")
    MouseClick("left")
EndFunc;==>Wolf

Func Terminate()
    Exit 0
EndFunc;==>Terminate

Edit: Not sure how this would affect performance... shouldn't be too bad

Edited by JFee

Regards,Josh

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...