MM2 Bot-Framework a work in progress..

You may request or share scripts for MicroMacro in this forum.
Message
Author
User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#21 Post by BlubBlab » Sun Jul 12, 2015 1:32 pm

Ups I became aware that most was work was already done. CWaypointList:findPulledBeforeWaypoint() work for the most part exactly like I said only that it ignore Z parameter funny thing is I programmed the necessary getNearestSegmentPoint3D(...) a year ago :D .

I could only add _start _end and _plain as parameters to CWaypointList:findPulledBeforeWaypoint() but before I do that somebody should take look at this:
getNearestSegmentPoint3D:

Code: Select all

-- Returns the point that is nearest to (X,Z,Y) between segment (A,B,C) and (D,E,F)
function getNearestSegmentPoint3D(x, z, y, a, b, c, d ,e ,f)
	
	--y,c,f falling out
	if( not y or not c or not f)then
		return  getNearestSegmentPoint(x ,z ,a ,b ,d ,e)
	end
	if a == d and b == e and c == f then
		return CWaypoint(a, b, c)
	end

	local dx1 = x - a;
	local dz1 = z - b;
	local dy1 = y - c;
	
	local dx2 = d - a;
	local dz2 = e - b;
	local dy2 = f - c;

	local dot = dx1 * dx2 + dz1 * dz2 + dy1 * dy2;
	local len_sq = dx2 * dx2 + dz2 * dz2 + dy2 * dy2;
	local param = dot / len_sq;

	local nx, nz , ny;

	if( param < 0 ) then
		nx = a;
		nz = b;
		ny = c;
	elseif( param > 1 ) then
		nx = d;
		nz = e;
		ny = f;
	else
		nx = a + param * dx2;
		nz = b + param * dz2;
		ny = c + param * dy2;
	end

	return CWaypoint(nx, nz ,ny);
end
only one line changed in CWaypointList:findPulledBeforeWaypoint()

Code: Select all

local segpoint = getNearestSegmentPoint3D(player.X, player.Z, player.Y, towp.X, towp.Z, towp.Y, fromwp.X, fromwp.Z, fromwp.Y)
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM2 Bot-Framework a work in progress..

#22 Post by rock5 » Mon Jul 13, 2015 12:24 am

Were you suggesting we look at putting the 3d function in the current bot? What problems exactly does it help with?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#23 Post by BlubBlab » Mon Jul 13, 2015 3:44 am

You can do what you want :D but with this the bot will calculate the correct position when pulled a floor under. I only wanted somebody take a look if my maths is correct.
What I think to change is you take a undercut with the distance from 1000 but that doesn't stops the crossing problem.

What I did was using _start and _ende as optional parameters but what is really the point is:

Code: Select all

-- near_enough = 30
if tmpdist <= near_enough and not found then
	wpende = wptotest - 2;
	found = true;
end
With this I will simply cut the rest off only take a look to the next 2 to be save but I won't take a look any further and if I'm really any further away it doesn't hurt to take a look in the complete list.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM2 Bot-Framework a work in progress..

#24 Post by rock5 » Mon Jul 13, 2015 4:49 am

Oh, ok. Well, I would guess that, seeing as you just up scaled the existing function, it looks like it should work. Best would be to plug in some values where you know what to expect and see if you get what you expect.

Have you considered not making another function but extending the existing function? Eg.

Code: Select all

function getNearestSegmentPoint(x, z, y, a, b, c, d, e, f)

if e==nil and f==nil then -- 2D
  d=c
  c=b
  b=a
  a=y
  y=nil
  -- Then do existing code
else
  -- do your 3d code
end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#25 Post by BlubBlab » Mon Jul 13, 2015 12:12 pm

Yeah I thought about it but the problem is you have 3 different pattern from which the argument can be filled :
1.) All arguments are there
2.) the last 3 are missing (not with 3D)
3.) One or all of every 3th argument is missing.

It a bit difficult to make sure that all in order, so I skipped it at least for the moment.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM2 Bot-Framework a work in progress..

#26 Post by rock5 » Mon Jul 13, 2015 12:50 pm

Well it should theoretically work. If 2d then both e and f will be missing it will do the 2d part. If 3d but y values missing then e will still be there so it will still go to the 3d section where you check for the y values. If the y values are there then it does your 3d code.

Hm.. You know what I would do, I would make some sub functions for the 2d/ 3d sections then do the logic down the bottom. It will be easier to follow. Eg.

Code: Select all

function getNearestSegmentPoint(x, z, y, a, b, c, d, e, f)
    local function _2d(x, z, a, b, c, d)
        ...
    end
    local function _3d(x, z, y, a, b, c, d, e, f)
        ...
    end

    if e == nil and f == nil then
        return _2d(x, z, y, a, b, c)
    elseif y==nil and c==nil and f==nil then
        return _2d(x, z, a, b, d, e)
    else
        return _3d(x, z, y, a, b, c, d, e, f)
    end
end
Wow that makes it neat.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#27 Post by BlubBlab » Sat Jul 18, 2015 6:04 am

Okay I think I got it I think that I thought about something similar but hated the idea to but everything in one function.
Anyway I did that
My solution :

Code: Select all

	-- last 3 are missing assuming intended 2D calculation
	if e == nil and d == nil and f == nil then
        return _2d(x, z, y, a, b, c)
	-- one or more of every 3th argument missing(height), fall back to 2D
    elseif y == nil or c == nil or f == nil then
        return _2d(x, z, a, b, d, e)
    else
        return _3d(x, z, y, a, b, c, d, e, f)
    end
findPulledBeforeWaypoint(..) checks now the direction in which you run through the waypoint file, seems you forgot that.

Other thinks I changed is I added an attribute Virtual to the waypoints. Every waypoint in a waypoint file isn't Virtual but any new with the exception of clones isn't.
I added this because on ramps when the bot fight monsters the calculated segmentation point can be up in the air. So the my drop down recognition triggers without reason with this I can filter this out.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#28 Post by BlubBlab » Mon Jul 20, 2015 4:10 pm

Yesterday and today I got some thinks done but hit some design decisions which I'm not sure of:
1.)I thought about could I use this framework and MM2 in another environment ? Since it is a framework for a bot and I add abstractions layers I could in theory control a Mind Storm LEGO bot with it. If I'm choose a natural mapping I would end with 2 classes : (input)sensors.class.lua and (output)actuators.class.lua (in case of memories they would use addresses.lua) but I don't like it I would rather use 1 class because I will use it over and over. So I'm stuck with the question 1 or 2 ?

2.)Not so much a question but the thing with the lego mind storm stuff when I studied some other students programmed some bots(Lego MS) which let them find a way through a graph painted on the ground.(find the way out of the labyrinth) It very similar to was admin did with his path finding could we program a player:unstick() that use those principles ? (I will/could do that alone but priority is low)

3)The skill system of rombot is too unflexible I need to do something about it, major problem are mutation skills like the one the champion and in Blade of Souls all skills are mutative. Which mean 1 skill but n version of it depending on some states of the char.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#29 Post by BlubBlab » Tue Jul 21, 2015 6:48 pm

Okay I decided for one file ^^
I added to object.class and the objectList.class, objectqueue.class those layers, I will continue tomorrow or another time.
player.class is to 30-50% done but what gives me the most headache are still the skills it is possible I must go full to lua with this but which every route I take it will be big and large and complicate and can't be done without testing. I wrote something like that before and I also take a look at what Lisa did to find the most elegant way for this.

Profile is a bit similar but I can at least take settings.lua apart into multiply files. By the way this part of the bot looks like it was written by someone completely different than the rest?
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM2 Bot-Framework a work in progress..

#30 Post by rock5 » Wed Jul 22, 2015 12:20 am

I agree, skills are tricky. If I remember correctly that was one of the main thing that put me off completing my Aion bot.

The bot has bee contributed to by a lot of people. Even though I've 'touched' probably every part of the bot, there is still a lot of original code from other devs. I don't know if settings.lua was by a different person. It looks like it's been there from the very beginning.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#31 Post by BlubBlab » Sat Jul 25, 2015 3:47 pm

Like I said the problem with the skills itself I could solve. I'm currently at the Pawn.class.lua and I ask myself what is the deal with memoryReadRepeat I know it simply tries to read something more than 1 time(11) but is it really necessary?

EDIT: Something else why doesn't pawn inherit from object there are so many stuff which is double there hm?
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM2 Bot-Framework a work in progress..

#32 Post by rock5 » Sat Jul 25, 2015 11:46 pm

I think the idea of memoryReadRepeat is that at some point in the past we would get occasional miss reads which would stuff up the bot. So memoryReadRepeat was introduced and used where we need the read to succeed, or at least to try harder to succeed.

Whether it's needed now is debatable. Maybe micromacro has improved and the memory reading is more reliable. I have the feeling it has but you would have to ask Administrator about that. Keep in mind that if the read succeeds the first time then there should be no performance hit so it shouldn't hurt to use it.


Pawn inherits from object because pawns have the same attributes, ie. X, Z, Y, Type, Id and Name. I guess it could have been coded better. The problem is pawn was modified to have those mini update functions to improve performance but object didn't need those so we ended up with repetition.

There are 2 solutions. One is to have mini updates in object and call those in pawn. eg.

Code: Select all

function CObject:updateXYZ()
	self.X = memoryReadRepeat("float", getProc(), self.Address + addresses.pawnX_offset) or self.X;
	self.Y = memoryReadRepeat("float", getProc(), self.Address + addresses.pawnY_offset) or self.Y;
	self.Z = memoryReadRepeat("float", getProc(), self.Address + addresses.pawnZ_offset) or self.Z;
end

function CPawn:updateXYZ()
	CObject.updateXYZ(self)
end
No wait, if the functions are the same you don't need the function in pawn. So what we should have done is moved some of the functions to object, even though we wouldn't normally use them with object, such as updateXYZ, updateType, hasAddress, etc.

The other option is to forget about mini updates and just do the full updates and have pawn:update() call object:update() before doing the updates object doesn't cover. That's the way it used to be.

Maybe one day if I find myself doing some work on pawn or object class I'll fix it.

Either way you need to find a way to avoid repetition.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#33 Post by BlubBlab » Sun Jul 26, 2015 7:37 am

The problem I have is I don't know how the inheriting process works with this framework LUA.
I know what must done to inhert from another class:

Code: Select all

CInventoryItem = class(CItem,
	function( self, slotnumber )
but under normal circumstances you would simple forgot that it is there
and let say CObject has updateType()

you would then call in CPawn:update()

Code: Select all

self:updateType()
will that work? or must it be:

Code: Select all

CObject.updateType(self)
The other thing I saw is in update

Code: Select all

CItem.update(self)

Is something else it call the function from the class from which this object inherited which has the same name,
in Java you would write super.foo() inside foo to call it
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM2 Bot-Framework a work in progress..

#34 Post by rock5 » Sun Jul 26, 2015 10:34 am

It can get complex.

If there is a CObject:updateType() then a pawn will inherit that function so you don't need a CPawn:updateType() function. Unless of course you need to do some extra code in relation to pawns that don't apply to objects.

When it comes to a function such as update then normally the child class has to call the super class update. So for example

Code: Select all

CPawn:update()
    CObject.update(self)
   ....
That calls the object update function passing self as the object to update. You see normally when you run a class:update() function the object "class" is passed as the first argument as 'self'. It's the same as writing class.update(class). If you want to use that function on another object you pass it as the first argument, eg. class.update(otherclass). If you tried to use self:updateType() in the pawn class then it would run CPawn:updateType() if it exits.

Another thing to watch out for is the supers update running when creating the class object. Normally when you create an object at the end of the constructor you will have code something like

Code: Select all

if self.Address then
    self:update()
end
So when you create a child class object, eg. mob = CPawn(address), then when it creates the super object it will run the supers update. Then when it finishes creating the pawn it will also run the pawns update which will again run the supers update. So you have to disable the super update by disabling the constructor, creating the super object without an address so the update doesn't run, then run the child constructor then finally doing a child update which will run the super update.

Wow that's confusing. I'll try to give you an example with the basics

Code: Select all

CPawn = class(
	function (self, ptr)
		self.Address = ptr;
		if( self.Address ~= 0 and self.Address ~= nil ) then self:update(); end
	end
);
CPlayer = class(CPawn,
	function (self, ptr)
		CPawn.constructor(self) -- call pawn constructor manually without 'ptr' arg.
		self.Address = ptr;
		if( self.Address ~= 0 and self.Address ~= nil ) then self:update(); end
	end, false -- false = do not call pawn constructor
);
So what happens with player is, it inherits from pawn but because the constructor is followed by ,false it does not run pawns constructor. Then it runs pawns constructor but without the ptr. That means pawns update wont run because it doesn't have an address. Then the address is added and so it runs players update. In players update it will run pawns update.

Code: Select all

CPawn.update(self); -- run base function
Hope that helps. I think the wiki page for it is here. http://www.solarstrike.net/wiki/index.p ... ses_Module. It shows you other ways to do the constructor and what the arguments for class are.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#35 Post by BlubBlab » Sun Jul 26, 2015 11:45 am

Okay I know how that works my real question was more like how much does this framework support polymorphism

So I could built something like this
Image
:D

Yeah the general updates are a pain in the ass because you need to move them to the childs because there could be other new updates. Anyway I will first finish updating Pawn and make some test if the whole thing works like I think before I make such changes
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#36 Post by BlubBlab » Mon Jul 27, 2015 4:22 pm

I done that for the most part now only Player isn't and I forgot Nodes.class
Okay I should take my 5 minutes what I did and planned so far:

I took the game specific logic out of the bot and put it in the $Name.settings.lua in the meta-settings directory
Environment specific access to data streams is now a fix part of the CInputOutput .
New code can be added(or old overwritten) now in the specific files which implement the abstract classes :ugeek:

Basically this is what user needs to change I think I must add also some sort of directory pointer which tells the framework where the user has its version of the implementation. I think I can make more abstract like waypoint or waypointlist for a maximum on flexibility.

TODO: a lot of stuff next is the problem that I need to support multiple energy types for skills, some goes for multiple buffs and debuffs conditions
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#37 Post by BlubBlab » Wed Jul 29, 2015 1:39 pm

Maybe again I should write an update:

Done:
-changing skills for more multiple requirements like multiple buff/debuffs, energy, states
-upgraded directory structure
-added dyinclude in lib2 for framework use (need testing)
-added auto switch for 32 or 64 bit for the dlls (Thx to admin who thought of it)
-added abstract node
-added a simple prototype class for register events

Todo:
-next create keys for moveTo also take a look in register events class for keys and socket
-skills.class.lua canUse() still missing checks for states like in Blade and Souls in XML load and vars already there.
-testing skills XML load
-add profiles.lua and test XML load
-(re)write all the tasks based functions in player.class.lua like moveTo, fight, sleep
- export some helper function like facetoTarget
- write a potion class
- debug the whole thing->beta

Questions:
- Do we need multiply target requirements for the buffs of 1 skill ?
- Should I include party.lua ?
- Should I added some sort of abstract containers for Items / NPC so the start is a bit easier ?

EDIT: I still thinking about a algorithms for finding like finding paths, there is a lot of heavy stuff I could add like how to calculate rotation and translation with a 4x4 matrix
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#38 Post by BlubBlab » Fri Jul 31, 2015 3:20 am

okay since admin implemented those key hooks I don't need for implement anything for now.
Skill XML testing has started I need again overwork my XML validator (I thought so) . I will properly took the database.lua in smaller parts(it is just one huge function at the moment) and add getter and setter.

I also updated my UML2 picture:
Image
Yeah the inputoutput where the memory readings is done takes a visitor object. It is not exactly the visitor pattern but yeah something like that the fact that lua can return more than 1 value really helps to make things simpler.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: MM2 Bot-Framework a work in progress..

#39 Post by BlubBlab » Sun Aug 02, 2015 6:11 pm

Okay guys I think I have at least theoretically found a way to make a more systematically unstick() .


Like I said I think the best way to do it is to think that you are inside of a maze.

Okay first step make a grid of waypoints of 15x15 or 20x20 around you, the grid must have a good size so that you won't run out of waypoints.(Your target must be alignment with one of the waypoints somehow... this could be difficult because the start needs it also -> adjust the size)

Around and between each waypoint there are 8 directions (left, leftdown,leftup,up,right, rightdown,rightup, down).

First choose a direction if you can't move to the waypoint mark this direction between them as blocked ( the directions or segment points are basically hallways in our maze).
If you go through one direction you mark it passed.

Choosing you do like this: At best one in direction of your destination avoid , second best right-hand rule but avoid the one which have passed on them , if there isn't one which haven't the mark passed (which should be only 1 ) go through it and make it blocked behind you.

When your distance starts to increase to your target with the next WP start recording your path when the distance hit a certain value go back the path but don't forget to make all direction you went through blocked when you went back through them.

The function terminate is when either you found you target or you surrounded by blocked direction with no where to go. (don't forget to surround your grid with blocked directions/hallways/ segment points)

The 4 directions in the corners need extra care because it matter in axis you go through them, so you have to save passed or blocked for the axis of those.

In the end it is a mixture of right-hand rule, Gaston Tarry algorithms for maze solving and a bit of heuristic.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM2 Bot-Framework a work in progress..

#40 Post by rock5 » Sun Aug 02, 2015 10:24 pm

The problem with this is it could take you where you didn't want to go, for instance off a cliff or aggroing a mob you didn't intend to such as an elite or boss.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests