Sign in to follow this  
Followers 0
Hindsight

Trying to script a simple macro for a game

23 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Does Shift Alt D do anything in the game normally?


Regards,Josh

Share this post


Link to post
Share on other sites

Does Shift Alt D do anything in the game normally?

This may sound ridiculous but I've tried sticking F12 in there to no avail. :/ How do you use function keys?

Share this post


Link to post
Share on other sites

when you used the function key did you put it in braces?

hotkeyset("{F12}","Wolf")

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

As in you want to set the hotkey to be F12?

HotKeySet("{F12}", "Wolf");F12

Edit: Damn, you beat me muttley

Edited by JFee

Regards,Josh

Share this post


Link to post
Share on other sites

Yea it's wierd... It's not doing anything when I press F12.

Share this post


Link to post
Share on other sites

Ok it looks as though my F12 key is broken. muttley Brb.

Share this post


Link to post
Share on other sites

That key may also be reserved... i tried it on my desktop to no avail, but F2 seemed to work fine


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

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

It's full screen and unminimizable. muttley

Share this post


Link to post
Share on other sites

I guess what I'm confused about is why I could see the cursor application.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

It's full screen and unminimizable. muttley

what happens when you press alt tab? (in the game)

Edited by Aiakonai

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

Share this post


Link to post
Share on other sites

It flashes the taskbar and then returns to the game. The same goes for using the windows key.

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I tried that. It didn't work either. I think it may be blocking it. I'm just not sure how to get around it. I guess there is no way?

Share this post


Link to post
Share on other sites

I wonder what would happen if you gave the script a small GUI with the on top style.... it'd be silly but I'm curious


Regards,Josh

Share this post


Link to post
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
Sign in to follow this  
Followers 0