[The Grinns Tale] Scripts in Grinns Tale

124 posts

Flag Post

If you’ve been in room one for Grinns Tale chat you might have heard us talking about making scripts in order to make some of the more repetitive parts of the game less painful to do.

I’ve had a lot of people ask what we are using and how they’d make something of their own so I created a basic script that we have used to lessen the annoyance of having to constantly drag/drop to fight.

First, you’d need to get and install a copy of AutoHotkey to run the scripts.

Next you’ll need to get the script from Pastebin making sure to save the file with .ahk as the file extension so that Autohotkey gets run when you use it.

Lastly, you’ll need a copy of the following pictures in the same directory as the script above:
– Should be named GTPramin.png
– Should be named GTPramin_LQ.png

These images are new to the updated version as they should fix a bug where the hotkeys would not detect the window. One of the pixels in the top left corner of the old image would turn on and off randomly. These do not include that pixel.

To run this script you will double-click the saved Script and you will get a little green H icon on the task bar. This show it is running and is where you can shut the script down when you are done.

The script itself has eight keys it adds. First if WindowsKey+Q to toggle the scripts on and off so you do not have them running the whole time. They start disabled.

Next are 1,2,3 on the keyboard without any other keys needed (not Ctrl-1). When you press one of these keys it will drag from your in game characters to the location where your mouse is. This means that you can simply hover over the enemy you want to attack and press 1 to make the back row person attack. You can also hover over the person in the back line you want to switch with an press it to switch positions.

Then Q,W,E are used to drag in the other direction. This is useful as it allows you to hover the mouse over an item in the food/potion bar and drag it to the correct player.

Lastly there is a single helper hotkey: WindowsKey + W. When you press this it will give you the coordinates of the mouse cursor relative to the upper left corner of the game. This can be used to fine tune the drag locations by changing the numbers at the top of the code.

Hero1_X := 171
Hero1_Y := 389

Hero2_X := 263
Hero2_Y := 388

Hero3_X := 353
Hero3_Y := 388

I’ve left the script decently commented to try and explain why certain things were done the way they were and make it easier to learn from my example. I will not claim this is the best way to make this script but it works and hopefully will help others learn.

Enjoy :)

 
Flag Post

This second script is the same as the top version except it has been changed to work in Full Screen.

The hero locations are different depending on what your screen resolution due to the stretching of the game area. However, I have not worked out a formula to determine how to adjust the default hero locations to account for the wide range of screen sizes so this one takes a bit more setup time.

First, you’ll need the actual script: GrinnKeysFS.ahk

The instructions are the same for this one as the non-full screen version above, except for the original setup.

What you will need to do is to take three Grinns into a fight where you will not die, such as the first Floor. Then after getting in Full Screen place the mouse around the center of the first Grinn and use the WindowsKey + W to get the coordinates and change the correct coordinates in the script. Repeat for the other two Grinns, save and reload the script and it should be ready to go. Each time you go to get the coordinates the box that shows up with the coordinates will force you out of Full Screen.

These set coordinates should work each time after so long as you do not change your screen resolution.

The default coordinates are set up to work with a 1400×1050 resolution as that was my test computer resolution.

 
Flag Post

Questions:

1) In Win7, how do I save that file as grinnkeys.ahk , my computer is set up to auto save. It saves the file as .txt , I can open it in note pad, but even if I add .ahk, it says it is still a text document.

 
Flag Post

To answer my own question, right click on the file and [open with].

Note to others that are using graphic reducers like Chrome FRQc, you need to remake the picture.

 
Flag Post

Solsund, you are amazing. This little script did miracles for the angst I was feeling towards farming wood. I’m more than excited to see what other scripts evolve out of this. Thank you :)

 
Flag Post

Works beautifully. Thanks a lot for making Grinn life a lot easier.

 
Flag Post

Very true Toimu, there’s nothing I can do to code around people having the game zoomed in/out or having the graphical settings changed. Zooming would break the coordinates but the quality change just means the picture needs to be recaptured and the script changed to suit it.

Edit Thanks for the tip on FRQc. I tried another quality changer and did not get any results from it. I figured GT was just setting the quality to high in the code so it was negating the effect of the extension. It’s nice to see boss battles running full speed (and decent quality when I’m on battery).

 
Flag Post

my first time attempting to use a script. You made it both painless and almost effortless. Thank you!

 
Flag Post

This is awesome!

May I suggest a Hotkey for moving food? Although I guess the original food location will vary depending on how many types you have.

 
Flag Post

Can’t wait for the next script. This one is awesome!

 
Flag Post

First of all great work! Got a problem using it though.
It worked the 1st time I tried to use it. But now, it won’t work.
The error message says “GTPramin.png was not found in the script directory” but I already have the pic in the folder.
Help me out a bit?
Oh and if it’s not too much to ask, is it possible to make this script work with the facebook version?
Thx.

 
Flag Post

Well bujibujiba, are you using Windows 7 and using the feature of the Start Menu where you run the script from the recent documents sidebar? It currently only looks in the Working Directory for the picture and if you run it in that way the Working Directory ends up wrong, for some reason. As long as the layout of the game itself isn’t too different on Facebook it should be simple to make it work with it. You would just need to change the two spots in the code that read “Play The Grinns Tale” to whatever the title on the Facebook page is. I have not tried this as I do not play on the Facebook version to see if the layout is the same.

Originally posted by lechat:

damn thats some nice coding man and props for the commenting. i always forget to leave decent comments and later have no idea what the code does :/

Ah, I normally do not comment like I did in this. I tend to leave myself comments for the real complicated parts of code, especially as I use the comments as a place to work out just what I need to do with the code.

I mainly put all the comments in there as a way to explain to those who were new to AHK how certain parts worked.

 
Flag Post

Do you have a script for the “stop action animation”? Q, W, E would be nice.

EDIT* I misunderstood how the “stop action animation” worked. Thanks!

 
Flag Post
Originally posted by Solsund:

Very true Toimu, there’s nothing I can do to code around people having the game zoomed in/out or having the graphical settings changed. Zooming would break the coordinates but the quality change just means the picture needs to be recaptured and the script changed to suit it.

Edit Thanks for the tip on FRQc. I tried another quality changer and did not get any results from it. I figured GT was just setting the quality to high in the code so it was negating the effect of the extension. It’s nice to see boss battles running full speed (and decent quality when I’m on battery).

Thanks for sharing this script, seems like it could be a useful tool to change up the farming a bit.

I am using FRQc so I got the error that “Pramin image not found on screen”. I made a screen capture of my own, and renamed to GTPramin.png. Works now. But only for a while, sometimes it does not recognize the pramin even with the new picture. Happens when I scroll up and down a bit. Could be something to do with FRQc and the pramin picture changing slightly when scrolling.

 
Flag Post

Actually you can use this one for Stop Action Animation by simply pressing the right button for the player when it’s full. I was playing with it yesterday after the patch to help my mass farming of Thumpers to check for rare drops.

Mister, I every once and a while get that happening for no apparent reason even without FRQc but it happens more often with it. I’ve actually had to scroll my Chrome window to get it to come unstuck sometimes, which is extra confusing as that shouldn’t change the content in the Flash window at all.

So, I took a look at the Facebook version of the game and the Kong version is 1000 pixels wide while the FB one is 1093. This moves some of the numbers around and possibly stretches the Pramin image so it’s not just a simple change to get it working there. It probably would not be too hard to reget the right numbers and get it going.

 
Flag Post
Originally posted by Solsund:

Mister, I every once and a while get that happening for no apparent reason even without FRQc but it happens more often with it. I’ve actually had to scroll my Chrome window to get it to come unstuck sometimes, which is extra confusing as that shouldn’t change the content in the Flash window at all.

So, I took a look at the Facebook version of the game and the Kong version is 1000 pixels wide while the FB one is 1093. This moves some of the numbers around and possibly stretches the Pramin image so it’s not just a simple change to get it working there. It probably would not be too hard to reget the right numbers and get it going.

Ok, I can’t get it to work/start the script with any greater success due to this. Works best if I take a new screenshot and saves that image without scrolling :P Too much work. I’m playing here on kong, so that shouldn’t be the case. Sadly I can’t play without FRQc without geting an aneurysm ;) I’ll post here if I find a better solution.

 
Flag Post

Not working , hotkeys don’t do anything

 
Flag Post

This Script needs to be added badly. I Play the grinns tale on 2 or 3 computers each day and I don’t want the hassle of downloading the script. But I do want the Easy Hotkeys really badly.
It would also help with more fast paced fighting. and add “Space” to go to the next dungeon.

 
Flag Post

Awesome! it working!!
yo, replace “DragSpeed := 5” to “DragSpeed := 1” and try it, you will love this game….muhaaaaaaaaaaaaaaaa!!!
tanks Solsund. XD

 
Flag Post

Bumping this because it is great.

 
Flag Post

Thank you for this, it’s awesome !
And thanks to lechat who helped me to sort the script out (the hotkey 1 2 3) weren’t working.

edited:
I had a problem with heroes hitboxes, had to change DragToMouse coordinates to these:
135,430
235,430
335,430

It worked with the 3 different level of zoom (close, medium, far)

 
Flag Post

I have never used scripts, but this sounds very good! I was wondering though, you are all talking Windows this and Facebook that, does it work with Firefox running under Ubuntu? My guess would be that if it works in Firefox running under Windows, it should be pretty much the same thing in Ubuntu, but I thought I’d check :)

 
Flag Post

A little info concerning the quality: you can change the quality during game now (not only during loading screen) by right-clicking and choosing “Quality”. Before I believe you needed a GTPramin.png according to the game quality but now just start in “default” quality, turn on the hotkeys and switch to low and ta-daaa, the hotkeys are still working 100% :)

 
Flag Post

This script gave me some ideas: i’m no scripter at all but i’ll try to figure out if it’s possible to set hotkeys for feeding and healing/effect potions.

Like hotkey “q” would auto click on “food” tab, then autodrag slot 1 (or 2) item to hero 1, hotkey “z” to hero 2, “e” to 3rd. Do you think this is possible ? Same for healing potions.. And why not expand it to effect potions.. Like hotkey “k” to autoclick on “effect” tab and autodrag to mouse the de-shock potion in slot 3…

or even a shock potion hotkey autodrag to mouse for some situations..

It’s worth the try :D

 
Flag Post

I took Solsund’s original script and added some logic to allow easy croissant stuffing. This script adds hotkey 4 which will drag the croissant from your item bar up to your mouse (presumably hovering over one of your heros).
You’ll need this image called GTCroissant.png in the same place as the script (just like the pramin image above, which you will also still need).

The croissant search can take a few seconds to complete (which is why there’s a warning box) but will only occur when you turn the hotkeys on with Windows+Q. ::Important:: If your croissants move (for example you made some muffins so the croissant icon shifts to the right) you must turn off the hotkeys (Windows+Q) and turn them back on. Otherwise the script will not drag the correct item. The script stores the location of the croissant icon on the screen, so if the icon moves you won’t drag the croissants. In fact if you you hit the ‘Heal’ tab on the item bar you might find yourself wasting precious potions instead! So be careful, and pay attention.

Edit: I updated the image. Seems like the numbers indicating the item count get taller as the count goes up, which botched up my image search. The new image is shorter and should eliminate the problem. If it doesn’t work for you, try making your own icon by cutting the croissant out of a screenshot and turning the background black.