GW2 bot goals & ideas

http://www.guildwars2.com
Message
Author
BillDoorNZ
Posts: 446
Joined: Wed Aug 03, 2011 7:37 pm

Re: GW2 bot goals & ideas

#41 Post by BillDoorNZ » Tue Jul 31, 2012 5:09 am

havent had much of a loo at this stuff as yet, will post once i have...one thing did pop to mind tho:

debugging :)

this is going to be a little more complex to debug as you dont necessarily know the sequence of events which lead to an error. In some ways it will also be much easier tho :) smaller bits of code to debug...

I'd suggest that we look at something like a unit of work type pattern (not really a unit-ofwork pattern tho now that i think about it) where an event is fired but also contains a sequential log of things that occur during the event handling).

e.g. the main loop runs, updating the player information. It recognises that the player HP has changed so fires the onHPChanged event (which includes a logger session)...

so far the log would look like:

Code: Select all

20120731215600000 - main - Player HP changed from 100 to 35.
Now, lest say the current state is combatState so it has registered for the onHPChanged event and gets called:

Code: Select all

combatState:onEvent(event)
  base:onEvent(event);
  switch (event.Name)
  {
    case "onHPChanged":
      if (event.newHP < 70) then
        event.Log("Player hp < 70, URGENT HEALING REQUIRED!!!!!!");
        self.currentAction = STATE_URGENT_HEAL;
        return;
      end;
  }
end;

combatState:update()
  switch (self.currentAction)
  {
    case STATE_URGENT_HEAL:
      <somehow get a ref back to event here...have to think about this more>
      event.Log("Healing");
      player:heal();
      break;
    end;
  }
end;
so now the log looks like:

Code: Select all

20120731215600000 - main - Player HP changed from 100 to 35.
20120731215600010 - combatState - onEvent() called.
20120731215600011 - combatState - Player hp < 70, URGENT HEALING REQUIRED!!!!!!.
20120731215600015 - combatState - update() called;
20120731215600015 - combatState - Healing;

lastly!! :)

I'd suggest starting the the goals/requirements of the new bot and then working back from there to a phase1 bot that can move, phase2 that can work out how to get from a to b, phase3 that can fight....

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

Re: GW2 bot goals & ideas

#42 Post by lisa » Tue Jul 31, 2012 5:52 am

BillDoorNZ wrote:I'd suggest starting the the goals/requirements of the new bot and then working back from there to a phase1 bot that can move, phase2 that can work out how to get from a to b, phase3 that can fight....
I almost had it following a waypoint on the Beta weekend, was just an issue of me sucking at that math stuff.
I did find an address for if we have a target but I should be able to do better farely easily.
Combat is simple enough for now, keys 1-5 kill stuff, 6 heals you.
There will probably need to be a table of direct attack skills and target ground skills as I don't foresee us using target ground skills for atleast a few weeks. Although I did notice that double click a target ground skill did the skill at where the mouse was pointing and I did find addresses for mouse already.
So not going to be that hard really.

So I am pretty confident of having a killing bot in the first day(elementalist), even if just use tab targeting and if no damage then move closer.

I currently have my latest version (V10) running in RoM just tab target attack.
Set 1-5 keys with attack skills, 6 with heals and it is happily just killing things. I am working on the loot next.
Then the movement, can get away without movement for now as "attack" skill moves you to target.

I am keeping things very basic as using all the memory we have for RoM isn't going to be what we have first day of GW2. So far just using the types of addresses that I did find on the Beta weekend.

combat skill usage is like this

Code: Select all

	self.count2 = self.count2 + 1
	updatehp()
	if playertarget ~= 0 then
		if self.count2 == 1 then
		keyboardPress(key.VK_1)
		yrest(1000)
		elseif self.count2 == 2 then 
		keyboardPress(key.VK_2)
		yrest(1000)
		elseif self.count2 == 3 then
		keyboardPress(key.VK_3)
		yrest(1000)
		elseif self.count2 == 4 then
		keyboardPress(key.VK_4)
		yrest(1000)
		self.count2 = 0
		end
	end
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: GW2 bot goals & ideas

#43 Post by lisa » Wed Aug 01, 2012 12:37 am

lesson learned today.
I spent way to much time working on combat state, issue I had was I was just pushing the state when I initiated an attack but if the skill didn't hit the target then it wouldn't go into combat.
After spending far to much time on it I decided that was dumb, i shouldn't be pushing combat unless in actual combat.

So the kill (farm mobs) state should initiate the attack and the main loop will push combat state only when actually in combat, combat is only pushed by the main loop and nothing else.
Issue with this is that there will be 2 states that use attack skills, on a good note the autoattack doesn't need to be reapplied, so you could use just the autoattack in kill state and all of the skills in combat state.
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: GW2 bot goals & ideas

#44 Post by lisa » Wed Aug 01, 2012 1:45 am

not sure if I am going overboard but I find it much easier if I have more states.

Farm state -- looks for mobs to kill and targets 1, then pushes Firstattack state
Firstattack state, tries to damage the target, timer and pop after X time so farm can try again, obstructed or what ever.

Combat state initiates when actually in combat and from the main.lua check.

I was having a real issue with keeping track of timers and such in just 1 state for starting a fight because each time you come back to the state it continues on and doesn't refresh. So by adding in another state it is done fresh and pops itself.
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: GW2 bot goals & ideas

#45 Post by lisa » Wed Aug 01, 2012 8:34 pm

I think we still need to have some sort of profile for settings.
Just thinking on the %hp when to heal and it should be different for each character, I am sure there are many more settings that will need to be character specific.

Did you want to go the XML format same as RoM? or maybe do something different, something that requires less effort on the user end. Profiles for me are easy but people who arn't in to coding might find it harder to use.
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: 5259
Joined: Sat Jan 05, 2008 4:21 pm

Re: GW2 bot goals & ideas

#46 Post by Administrator » Thu Aug 02, 2012 2:07 am

Sure, we can have profiles. What I said before was just that we didn't need to have users configure their skills.

We could actually just do strait Lua-based profiles. Would be easier for both coding and end-users.

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

Re: GW2 bot goals & ideas

#47 Post by lisa » Thu Aug 02, 2012 2:40 am

I was thinking do it as a class and then just "include" the characters profile, might need a clear old profile and load new function but should be easy enough.

So you end up with variables like

profile = class()
self.heal = 60 -- hp% to use heal skill

Code: Select all

if profile.heal >= playerhp/playermaxhp*100 then -- use heal
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: GW2 bot goals & ideas

#48 Post by lisa » Sun Aug 05, 2012 8:50 pm

When game is released I will probably look at using elementalist first, should we start at making bot work with 1 class and then progress on to add others as things progress. Obviously when adding the first class we would need keep in mind to have the ability for other classes at a later stage, so code it accordingly.
I might make up a database for class skills, should be enough info on webby for it, so I am guessing a skills class but since the skills are set and not like in RoM no need for it to be userfriendly for additions, just set them up as tables in a skills.lua?
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: 5259
Joined: Sat Jan 05, 2008 4:21 pm

Re: GW2 bot goals & ideas

#49 Post by Administrator » Mon Aug 06, 2012 12:46 am

We could make it work for just one class, sure. Ranged classes are generally going to be easier to start with.

As for a skill database, I'm not really sure how we're going to do it. It would be great if we could just get it working entirely out of memory reading. That way, we wouldn't have to modify the database every patch.

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

Re: GW2 bot goals & ideas

#50 Post by lisa » Mon Aug 06, 2012 1:02 am

Administrator wrote: It would be great if we could just get it working entirely out of memory reading. That way, we wouldn't have to modify the database every patch.
It would be great but yeah still need to find the info in memory first ;)
I was thinking more of a basic differentiating between target mob and target ground, so that we can start it off with just using target mob skills and work on the target ground skills later on. cooldowns are also easy enough to add in at this stage.
I will probably just set up something simple for me for the first day so I can set bot off for a few hours lvling just killing mobs in an area, I'll more than likely be working at game launch. It will be easier if I have a char lvl 5+ when I actually start looking for things like skills and such in memory.

What I have today would basically just farm a spot without any hassle, it already does in my testing in RoM but yeah once I get the mob info from memory it will be much better.
I did find target Address so it should only take a couple hours tops before getting a table of objects in memory, hopefully 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

Gaylord
Posts: 3
Joined: Mon Aug 06, 2012 1:05 pm

Re: GW2 bot goals & ideas

#51 Post by Gaylord » Mon Aug 06, 2012 1:40 pm

Can't wait this bot to come out, I'm up for beta testing it when needed used rombot for years and loved it. GL with the bot!

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

Re: GW2 bot goals & ideas

#52 Post by lisa » Tue Aug 14, 2012 3:59 am

10 days to go and counting

1. Thoughts on the number of states to have? better to go more or try to keep less?
2. Want to use any injection for the game? (I got no clue for that, prob should learn though)
3. Did you want to wait for release before working on it or try to get it half sorted out before hand, I will be fine with what I have for release to be able to farm mobs for a few hours without hassle.
4. Going to use files like this? addresses.lua/profile.lua/functions.lua/.... or do you have other ideas?
5. Should we have a userfunction folder like RoM? or add it in later?
6. Am I asking to early? 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
Administrator
Site Admin
Posts: 5259
Joined: Sat Jan 05, 2008 4:21 pm

Re: GW2 bot goals & ideas

#53 Post by Administrator » Tue Aug 14, 2012 12:24 pm

lisa wrote: 1. Thoughts on the number of states to have? better to go more or try to keep less?
So long as things are grouped logically, it won't matter much. More is nice because 1) you can unload unnecessary stuff (not a big issue, but still), 2) we can reuse the smaller states more readily, reducing the amount of duplicate code we have laying around for minor variations of the same thing. We can't really say for sure what will go in different states until we experiment more and figure out how pieces will fit together.
2. Want to use any injection for the game? (I got no clue for that, prob should learn though)
I would be fine with that. We could just hook the send() and recv() functions if people want to help decode different packets. This would be a very effective method, and simple!

However, I did not check if the packets were encrypted or not. Hopefully, it will be like World of Warcraft and simple to decode all the necessary packets.
3. Did you want to wait for release before working on it or try to get it half sorted out before hand, I will be fine with what I have for release to be able to farm mobs for a few hours without hassle.
Other than getting ideas and experimenting with a few bits of code, there isn't much more we can do. Please try to just enjoy the game on release instead of stressing over getting a workable bot. Unless, you enjoy working on it. In that case, go ahead.
4. Going to use files like this? addresses.lua/profile.lua/functions.lua/.... or do you have other ideas?
addresses.lua will probably be about the same as RoM-bot. User profiles will, again, look more like addresses.lua (in that it is a table), but with extra class stuff (so users can easily override certain functions and stuff from there). functions.lua will probably be done away with as it is a very vague name; lets try to move that kind of stuff into better suited files where possible.
5. Should we have a userfunction folder like RoM? or add it in later?
Add it later, if necessary.
6. Am I asking to early? lol
Nope. Asking questions is good. Ask the right questions, and you make the rest of us consider different things, as well. Getting everybody on the right page would be an important first step to a successful bot.

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

Re: GW2 bot goals & ideas

#54 Post by lisa » Tue Aug 14, 2012 10:31 pm

Administrator wrote:Please try to just enjoy the game on release instead of stressing over getting a workable bot. Unless, you enjoy working on it. In that case, go ahead.
I guess I am just getting old or maybe I have changed but I just don't get the same satisfaction from actually playing games anymore. I enjoy challenges I guess and I just don't find games challenging, creating what is basically "ai" is far more challenging for me and so I guess that is the enjoyment I get now.

I am also more motivated with the actual making money that can be done in games now. I own my own business and the 2 weeks after D3 launched I made more money selling D3 gold then in my business. Of course it only lasted 2 weeks and then the price dropped quite a lot but if I can made good in those first 2 weeks of GW2 then the game pays for itself. After that I won't feel so bad if I don't enjoy the game.

Little of topic but I used to enjoy the game trials you would get on pc mags before actually buying a game, if I enjoyed the trial version then I would buy the game, if not then I wouldn't. You don't really get that anymore, you either pay up or you don't.


So yeah I will probably have something running for myself on launch day, I'll share the addresses and such to make it easier for the bot you want.
Then we can take our time to make the bot you invisage =)

I am just using RoM as the game for testing the code I am doing, only using addresses I know I can get from GW2 without hassle. It is working pretty well but yeah I do find myself wanting to make smaller states instead of just a bigger one to handle something.
I kind of feel like the states themselves are just small functions that get called when needed, I have maybe 278 userfunction functions in rom so yeah I do like to make lots of functions so it will probably work in my favour with the states =)
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: 5259
Joined: Sat Jan 05, 2008 4:21 pm

Re: GW2 bot goals & ideas

#55 Post by Administrator » Wed Aug 15, 2012 10:48 am

I figure, we can also add a diff/patch mod with the bot so that users are more easily able to distribute their changes. Of course, users that have SVN installed can already do this, so I'm not sure if it is worth the effort.

Eventually, I'll be adding this functionality directly to MicroMacro, but currently the C++ library requires Qt, which I'm trying to avoid as a dependency. The Lua library should work OK (but we may need to make some minor modifications).

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

Re: GW2 bot goals & ideas

#56 Post by lisa » Wed Aug 15, 2012 6:58 pm

had a quick loot at the diff/patch and yeah it looks similar to what SVN does.
I like the SVN compare difference better than the example on that page, might be because I am just used to the SVN though.

I think that the people who would use it would also be able to use SVN to do the same thing.
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: 5259
Joined: Sat Jan 05, 2008 4:21 pm

Re: GW2 bot goals & ideas

#57 Post by Administrator » Wed Aug 15, 2012 7:00 pm

It is the same thing. It uses the same format, at least. SVN is just the distribution and versioning of that system.

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

Re: GW2 bot goals & ideas

#58 Post by lisa » Fri Aug 24, 2012 5:31 pm

twiddles thumbs for the next 8hours 30 minutes, this could be painful 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: GW2 bot goals & ideas

#59 Post by lisa » Fri Aug 24, 2012 9:18 pm

there has been patches pretty much every hour, hope they are making it work nicely for launch, unlike D3 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

rfehr
Posts: 9
Joined: Thu Apr 29, 2010 6:48 am

Re: GW2 bot goals & ideas

#60 Post by rfehr » Wed Oct 17, 2012 6:54 am

Hello Guy's,

how can i use the GW2-Script Bot ?
I want to use it, als assisting script.

rfehr

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest