Page 1 of 1

Simple Phoenix Dynasty Bot

Posted: Fri May 16, 2008 6:26 am
by 3cmSailorfuku
It's a very basic bot for a point & click rpg (Like Conquer), made on a 1680*1050 Resolution, Windowed with a game resolution of 1024*768.
I'm suprised it works fast and well with the random seed.

The script should be pretty self explaining.

Only Problems are after my 2 hours testing (In the lv1-13 Zone);
- It can get stuck on cliffs. But will get unstuck after a minute or more, if the monster walks away.
- It will go where the hell it want, aslong there are enemies. Not a problem for me though lol.


Anyone want to improve it? :P

Re: Simple Phoenix Dynasty Bot

Posted: Mon May 19, 2008 1:17 pm
by Administrator
Can't believe nobody has replied to this yet. I couldn't really test it for you, seeing as Pheonix Destiny ran very poorly for me (1 FPS). Your code is very clean and well written though, so good job!

If I might, I'd like to offer a few suggestions.
  • Change "FW Client - Beta - Final : 7211.425.0001.0000" to "FW Client - Beta - Final : *" so you don't have to update the script with each minor game update.
    Use variables to hold the addresses, rather than plugging the address directly into memoryRead* functions.
Does 0x0094ABD0 contain true/false when your mouse hovers over an enemy?

Re: Simple Phoenix Dynasty Bot

Posted: Mon May 19, 2008 3:18 pm
by 3cmSailorfuku
elverion wrote: I couldn't really test it for you, seeing as Pheonix Destiny ran very poorly for me (1 FPS).
Perhaps you should try setting the affinity for fwclient.exe only to one CPU, that helps
me on most mmorpgs if they run poorly.
elverion wrote: If I might, I'd like to offer a few suggestions.
  • Change "FW Client - Beta - Final : 7211.425.0001.0000" to "FW Client - Beta - Final : *" so you don't have to update the script with each minor game update.
    Use variables to hold the addresses, rather than plugging the address directly into memoryRead* functions.
I'm not sure, but if I try to use memoryReadIntPtr more than once in a function with variables, it won't give me the right value's of the adresses.
More likely it will return the same value as the first adress does.
elverion wrote: Does 0x0094ABD0 contain true/false when your mouse hovers over an enemy?
Yup, didn't felt like looking for pixels. I think its possible in every game.

Thanks ;) Though I just wanted to use this bot for a few days, so no updates or improvements in the future :(

Re: Simple Phoenix Dynasty Bot

Posted: Mon May 19, 2008 4:06 pm
by Administrator
I'm not sure, but if I try to use memoryReadIntPtr more than once in a function with variables, it won't give me the right value's of the adresses.
More likely it will return the same value as the first adress does.
Can you provide a small segment of code that produces this result? If so, I can look into it. I don't see how I could cause a bug like that, but I've been known to create some pretty strange stuff without realizing it.

Re: Simple Phoenix Dynasty Bot

Posted: Mon May 19, 2008 5:17 pm
by 3cmSailorfuku
well I totally doubt its a problem of micromacro, as I've seen other scripts like this already and people didn't had problems:

Code: Select all

Target_adr = 0x0094ABD0;
Target_offset = 316;
TargetSelected_adr = 0x0094ABD4;
TargetSelected_offset = 316;

function CheckTarget()
    Target = memoryReadIntPtr(proc, Target_adr, Target_offset);
	if( Target == 1 and TargetSelected == 0 ) then
 	mouseRClick();
 	rest(10);
 	mouseSet(511, 440);
 	mouseSet(511, 270);
    end
    
    TargetSelected = memoryReadIntPtr(proc, TargetSelected_adr, TargetSelected_offset);
    if( TargetSelected == 1 ) then
    rest(100);
    end

    if( Target == 0 and TargetSelected == 0 ) then
    X = math.random(1000);
    Y = math.random(700);
    if( X > 400 and X < 565) then
	mouseSet(0,0);
    end
    if( Y > 285 and Y < 439 ) then
    mouseSet(0,0);
    end
    mouseSet(X, Y);
    rest(10);
    end
end


function main()
  attach( findWindow("FW Client - Beta - Final : *") );
  proc = openProcess( findProcess("FW Client - Beta - Final : *") );
  setPriority(PRIORITY_HIGH);

  while(true) do
  CheckTarget();
  rest(2);
  end
end

startMacro(main, true);
This will always return true on 'Target', eventhough the mouse points at a monster.
I had the same problems when I tried to make a bot for Age of Armor and AirRivals and couldnt figure out why, so I was limited only to use one memoryread.

Perhaps theres something wrong on my main routine? Because I've been using the same scheme the whole time now.