Grand fantasia

You may request or share scripts for MicroMacro in this forum.
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Grand fantasia

#1 Post by lisa » Wed Nov 09, 2011 4:51 am

official game webby
http://grandfantasia.aeriagames.com/
Honestly no idea if this game is any good but I wanted to try starting a bot from scratch.


SVN instructions are same as for RoM bot except the address to use is.
create a folder inside the Micromacro/scripts folder ( I just udes gf1)
Then right click the new folder and click SVN Checkout...
for URL of depository use

Code: Select all

https://gf-bot.googlecode.com/svn/trunk
Make sure you check the Checkout Directory as for some reasons it keeps adding a folder gf-bot to the folder you want to add bot to.
So it should be the folder you created and without the gf-bot after it.


Revision 6

For now default is set to farm an area of 200X200 of the position where bot is started. The values are the same as the X Y values on screen (under minimap)
If you go outside of this area it will turn around and try to go back into the area. If it hasn't targeted any mobs for 5 seconds it will turn and try to find some.

Once you reach lvl 5 you will need to add a skill to actionbar 6 and maybe 7 for it to run smoothly.

For now it uses actionbar 6 until there are 5 skill charges and then it uses actionbar 7. If you are new to the game just place "attack" to both 6 and 7 until you learn the skills and how they work.

Also place mana pot in bar 8 and health pot in bar 9. default time to use potion needs to be changed to dynamic, at the moment it just takes a pot if health drops by X amount. You can change the amount for now in
functions.lua
function potions()

Todo:
Find a camera/player direction you are facing, then can finally add movement to bot, atm it only moves to get in range to kill mobs.
Setup a character profile.
Set up a time to farm for.
Implement looting, bag space is extremely low.

Long list so I'll just stop the list there lol
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#2 Post by lisa » Wed Nov 09, 2011 11:00 am

Well getting there.

I have it monitoring Hp/Mp and using potions as required.
I have it targeting mobs and attacking and also checking if target is dead.

So it basically attacks and pots and keeps killing.

Something I haven't worked out yet though is MM isn't attaching to the game, it does the key presses to any window so I must have something wrong in that respect.
So I start the lua for GF and then click the game to get focus, it then runs no worries.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#3 Post by lisa » Thu Nov 10, 2011 7:11 am

Found static address for character coords, works from map and is nothing like the X Y coords posted in the UI.
Ok map coords are 1/16th of coords from memory.
So I can use map coords still and adjust the coords from memory to suit.

Basically bottom left of map is 1,1
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#4 Post by lisa » Thu Nov 10, 2011 12:11 pm

I started to try to implement a waypoint system like that in RoMbot but I soon realised in order to get the movement according to coords I would also need the direction the camera is facing. So I decided to just put that on the back burner for now, I did make a createpath though so I can already create waypoint files.

What I decided to go with instead was a box area to farm within.
So I set the extremities of the X and Y axis and the bot stay within the boundaries and just continues to kill mobs.
Basically if it goes outside the box it turns approx 160 degrees and then hopefully heads back into the box.
I also implemented a time limit to not seeing any mobs and then also turning to try and find mobs to kill.

I let it run for a while just to do a print, looks like this.

Code: Select all

killed: 77      Time: 746       XP: 7744        Gold: 2214      Pots used: 0
killed: 78      Time: 755       XP: 7958        Gold: 2272      Pots used: 1
killed: 79      Time: 764       XP: 8065        Gold: 2301      Pots used: 1
killed: 80      Time: 773       XP: 8172        Gold: 2333      Pots used: 1
killed: 81      Time: 782       XP: 8279        Gold: 2361      Pots used: 1
killed: 82      Time: 796       XP: 8386        Gold: 2393      Pots used: 1
killed: 83      Time: 805       XP: 8493        Gold: 2425      Pots used: 1
No target for 5 seconds, turning to find more
killed: 84      Time: 824       XP: 8600        Gold: 2456      Pots used: 1
killed: 85      Time: 836       XP: 8707        Gold: 2484      Pots used: 1
killed: 86      Time: 844       XP: 8814        Gold: 2511      Pots used: 1
killed: 87      Time: 858       XP: 8921        Gold: 2538      Pots used: 1
killed: 88      Time: 863       XP: 9028        Gold: 2565      Pots used: 1
killed: 89      Time: 876       XP: 9135        Gold: 2593      Pots used: 1
We have moved outside the box limit, turning to try and go back into box
killed: 90      Time: 891       XP: 9242        Gold: 2623      Pots used: 1
killed: 91      Time: 904       XP: 9349        Gold: 2650      Pots used: 1
killed: 92      Time: 910       XP: 9456        Gold: 2681      Pots used: 1
killed 92 mobs
time is in seconds, so 15 mins.
gained gold is actually copper, the lowest currency but I just prefer to call it gold. so gained 26silver / 81copper.
Used 1 potion, which was a mana pot.

So for now the basics are there, it is all done within the same file so it is still very crude.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#5 Post by lisa » Sun Nov 13, 2011 1:51 am

Ok things are coming along nicely now.

At the moment I am still working on trying to get the mob details from memory.
I found a pointer at
7B2670 with offset 3FC
from that address the offsets are to mob names, possibly npc aswell, still testing

example is
7B2670 3FC 298 = mob name
7B2670 3FC E8 = mob name
7B2670 3FC 448 = mob name
7B2670 3FC 5f8 = mob name
7B2670 3FC 7a8 = mob name
I worked out a difference of 1B0 between the last offset and you do get mob names, still testing, Hopefully I can do a print of the offsets E8 + 1B0 until 7A8 and see what names it prints. Not every offset has a name though.
Spot 4 lots of 1B0 before 5F8.
I am hoping this will lead me to a table of tables to be used to get pawn information from memory.

Hmm no good, the addresses changed even though they were static, need to dig deeper it seems.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#6 Post by lisa » Sun Nov 13, 2011 12:08 pm

Made nice break through and found some addresses for target.
I can get target current hp.
At the same time I also found addresses for what appears to be the position of the target, X Y. I can't get my head around the values though, any help would be appreciated.
The values aren't exact so keep that in mind, the slightest movement changes the value at the address but the coords on UI doesn't change so quickly.

Code: Select all

100	1120436224
125	1123742882
150	1125537754
175	1127736934
200	1128797941
225	1135427256
250	1132085570
275	1133095860
300	1133909892
325	1134743753
350	1135548549
375	1136379217
400	1137192930
425	1138026419
450	1138833511
475	1139644269
500	1140462546
525	1141066990
550	1141475113
575	1141887795
600	1142423716
625	1142705479
650	1143117034

I tested it on different maps and it held true, so it isn't in relation to the world but to the current map.

There is a 3rd address which does change when the target moves but it only changes by a little amount, I just figured it was the height axis.

--=== Edit ===--

Figured it out, it was a float value NOT a 4byte decimal value. Float is same coords as UI on screen but with 1 decimal point. No wonder I couldn't work it out lol
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#7 Post by lisa » Mon Nov 14, 2011 12:02 am

Ok I have player and target coords all working nicely now, which of course gives distance.
Also have target name reliable, it was tough finding an address that wouldn't change when relogging.
Also target Current HP, not max yet as the pointer keeps changing so I am still looking for a reliable target maxhp.

Code: Select all

Press the (End) key to stop/pause the script.
You can resume with the (Delete) key.
Target HP: 2172 Target distance: 9.41   Target Name: Hard Skinned Cloned Beast
Target HP: 885  Target distance: 9.68   Target Name: Hard Skinned Cloned Beast
Target HP: 874  Target distance: 4.18   Target Name: Hard Skinned Cloned Beast
killed: 1       Time: 10        XP: 237         Gold: 47        Pots used: 1
Target HP: 1222 Target distance: 21.0   Target Name: Blood Spider
killed: 2       Time: 13        XP: 474         Gold: 47        Pots used: 2
Target HP: 1551 Target distance: 43.7   Target Name: Mutant Blood Spider
Paused.
Started.
Target HP: 2025 Target distance: 21.1   Target Name: Stub-Tail Cloned Beast
killed: 3       Time: 29        XP: 711         Gold: 136       Pots used: 2
Target HP: 2025 Target distance: 25.0   Target Name: Stub-Tail Cloned Beast
killed: 4       Time: 37        XP: 1095        Gold: 181       Pots used: 2
Target HP: 2025 Target distance: 40.3   Target Name: Stub-Tail Cloned Beast
Target HP: 729  Target distance: 24.1   Target Name: Stub-Tail Cloned Beast
killed: 5       Time: 50        XP: 1773        Gold: 265       Pots used: 3
Target HP: 2025 Target distance: 32.4   Target Name: Stub-Tail Cloned Beast
Target HP: 207  Target distance: 25.1   Target Name: Stub-Tail Cloned Beast
killed: 6       Time: 59        XP: 2598        Gold: 310       Pots used: 4
No idea why but the info for mobs isn't kept even close to the other values in memory.
current hp and mp might be at 1459099
name might be at B87B08
max Hp might be at 1399590
So it is tough for now to find a reliable pointer to everything. I am still looking for the mystical table of tables.

Updating first post with the SVN address and instructions.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#8 Post by lisa » Tue Nov 15, 2011 5:18 am

Ok finally made some headway with mob information.

Address = 0xA71B18,
offsets {0xA0, 0xF8, 0x4 }
3rd offset 0x4=hp // 0x8=mp // 0x18=lvl // 0x48=maxhp // 0x4C=maxmp
2nd offset start at F8 and increase by 0xF0 for the next mob.

As for how many times to add the increase, no idea.
3rd offset 0x0 always = decimal value 10202956
So I guess can do a check for the 0x0 3rd offset to = 10202956 and if so then add the info to a table. Not sure on the significance of that value but in hex it is 9BAF4C.

Next step I guess is to use the mob address for targeting.
I already know
address = A6C97C points to target address, so maybe use that and the address of mob to force game to target mob via memory.
offset =
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Grand fantasia

#9 Post by MiesterMan » Thu Nov 24, 2011 2:28 pm

This is a crude pattern matching for the player base address.

I've been looking through all the references to the address and none are quite as clean cut as the example admin provided in the tutorial so I went with a segment between two float executions. It finds the current player base address and offset fine but we won't know if it's any good until the next update.
getaddress.lua
(1.54 KiB) Downloaded 738 times

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#10 Post by lisa » Thu Nov 24, 2011 10:17 pm

Sounds good, I had been thinking of how to update addresses after patch, my usual method of using olly doesn't seem to work with this game.

Good to see someone else is also playing around with this game ;)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Grand fantasia

#11 Post by MiesterMan » Fri Nov 25, 2011 1:57 am

lisa wrote:Sounds good, I had been thinking of how to update addresses after patch, my usual method of using olly doesn't seem to work with this game.

Good to see someone else is also playing around with this game ;)
The graphics may leave much to be desired but the game isn't half bad. The crafting system is especially nice since it's not too hard and anyone can do it. The sprites are like a minigame with very nice bonuses for the main game so I can see this being a fun bot game.

Sadly though, I haven't been able to find functions that reference other base addresses like this one and my target pointers are quite rigid. I tried my best but couldn't associate an object with other players, monsters, and floaties in the game so using the same structure as the player object won't possible (might even be a flat out struct, lol).

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#12 Post by lisa » Fri Nov 25, 2011 6:07 am

Yeah one part I don't like is that mob information isn't kept together, it is spread out. There is no doubt something central which controls the info but to find it is a pain.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Grand fantasia

#13 Post by Administrator » Fri Nov 25, 2011 7:03 pm

If you continue to work on this and get something workable, I'll open up a new forum section for this game. Please continue to keep us informed of your changes.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#14 Post by lisa » Fri Nov 25, 2011 9:43 pm

I had a bit of a pause on the project, needed to work on some other things for a bit. I have ahad a few people PM me though about it so I might continue on it again soon.
At this stage I don't know enough about the game to make a really effective bot, for now it is like a really advanced autoIt because it also monitors hp/target/area to farm.

They seem to have put in a lot more double/tripple pointers in GF then they did in RoM so it is taking longer to get the addresses I want.
Also the not attaching to game is bothering me, not sure if I can fix that or not.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Grand fantasia

#15 Post by MiesterMan » Sun Nov 27, 2011 9:07 am

I updated 3 files with more concrete pointers. A whole lot was changed but for the most part I was able to trace most back to a single base pointer with offsets. It's working but a very basic bot atm; it just kills and loots.

lisa, you had already found the target pointer ( :lol: ) which pointed to the info with similar offsets to player. I updated the addresses and functions with the new one.

I commented on all the sections I changed so please puruse and let me know what you think of the changes here.

(also, I couldn't get your checkwindows func to work, kept crashing the bot so I disabled it)
addresses.lua
lots of changes
(2.19 KiB) Downloaded 723 times
functions.lua
moderate changes
(9.02 KiB) Downloaded 756 times
bot.lua
1 line changed
(894 Bytes) Downloaded 752 times

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Grand fantasia

#16 Post by MiesterMan » Sun Nov 27, 2011 9:21 am

I wanted to slip this in, since I forgot to in that post I just made. I spent several (almost all the time I spent working on this) failing to find a function or address to change that would change the target and not just the address.

I think there is a table of "objects" in the first level of the target pointer but I was unable to identify a start and stop point. The region is definately reused over and over for the different monsters and such that load. Also, targetable objects have coords and such too (like boards and mailboxes) so finding that address that will let us change target will be greatly helpful.

Something I noticed, much like RoM, this game uses click to move. I think we can find another address (like the target one we haven't found yet) that will let us click to move to locations. This would be much more powerful as the autopathing in this game goes all the way the requested location.

Taking a break for now.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#17 Post by lisa » Sun Dec 04, 2011 3:18 am

Little update.

I have been busy with a project in RoM and haven't done any more work on GF.

I might get back into GF after new years, can't believe it's almost xmas already.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Grand fantasia

#18 Post by MiesterMan » Mon Dec 05, 2011 3:12 am

So, I think I found the objects list but I'm having trouble getting a report on it.

Can you tell me how this is an infinite loop?

Code: Select all

function getObjects()

	fromAddr = 0x0767D87C;
	toAddr = 0x0767E210;
	objOff = -0x50;
	proc = getProc();
	objList = {};
	
	function getTimeFragment()
		char1 = memoryReadRepeat("byte", proc, (memoryReadRepeat("int", proc, addresses.runtime_base)+2));
		char1 = 0 - char1;
		char1 = 0xFF - char1;
		--printf("%x \t",char1);
		char2 = memoryReadRepeat("byte", proc, (memoryReadRepeat("int", proc, addresses.runtime_base)+3));
--		char2 = 0 - char2;
--		char2 = 0xFF - char2;
		--printf("%x \n",char2);
		return string.char(0x0, 0x0, char1, char2);
	end
	
	function findObjects()
		theDiff = toAddr - fromAddr;
		while(theDiff > 0) do
			theAddr = findPatternInProcess(proc, getTimeFragment(), "??xx", fromAddr, theDiff);
			if theAddr then
				table.insert(objList,CPawn(memoryReadRepeat("int",proc,theAddr-0x50)));
				fromAddr = theAddr + 4;
				theDiff = toAddr - fromAddr;
			else
				theDiff = 0;
			end
		end
	end
	
	function printObjects()
		for i,v in pairs(objList) do
			printf(i.X .. "\t");
			printf(i.Y .. "\t");
			printf(i.Level .. "\t");
			printf(i.HP .. "\t");
			printf(i.Name .. "\t");
			printf(i.MP .. "\n");
		end
	end
	
	findObjects();
	
	printObjects();
	
	--return objList;
end
I don't know why but this function never ends. It's only over a region of 0x1000 so it's not THAT long. Where is my math leaving me in an infinite loop?

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Grand fantasia

#19 Post by MiesterMan » Mon Dec 05, 2011 3:48 am

I hate it when I do that. I had it working then I hit save and now it's broke again, lol.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Grand fantasia

#20 Post by lisa » Mon Dec 05, 2011 4:17 am

I usually add in prints for trouble shooting.

First print I would do is here

Code: Select all

            theDiff = toAddr - fromAddr;
print(theDiff)
         else

Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests