Porting Code Help

04/03/2009 04:59 IKillBabies#1
Hey,

I have been trying to port some code into any language, and not having any luck at all. A user on here (Atheuz) gave me some old source to an old bot he used to use, but my knowledge is not far enough to fill in the blanks. I tried porting in C++, but had too much trouble.

I was wondering if anyone could try this for me, I would greatly appreciate it.
Basically it's a bot for Phoenix Dynasty Online, that simply right clicks monsters. The memory addresses will have to be adjusted too. But if you could just port it into whatever language you want, and post the code, that would be great. Don't worry about what the window name is and what not, I can adjust all that. I can even do the memory adresses. I think :P

Thanks so very much :)

Code:
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);
04/03/2009 12:41 Atheuz#2
You can run the script with this
[Only registered and activated users can see links. Click Here To Register...]

You need to adjust the Coordinates (Or run it in 800*600 Windowmode, on a 1680*1050 resolution. Need to drag the window on the top left) and Adresses too.

Target = is a boolean adress that will give you 1 if you hover with the mouse over an enemy. (To eliminate unecessary pixel checks)

TargetSelected = A boolean aswell, gives you 1 if you targetted a mob and 0 if you have no current target.

It's a silly bot though, I wouldn't recommend using it to level or farm items. Just to see how it works.
04/03/2009 15:15 IKillBabies#3
Quote:
Originally Posted by Atheuz View Post
You can run the script with this
[Only registered and activated users can see links. Click Here To Register...]

You need to adjust the Coordinates (Or run it in 800*600 Windowmode, on a 1680*1050 resolution. Need to drag the window on the top left) and Adresses too.

Target = is a boolean adress that will give you 1 if you hover with the mouse over an enemy. (To eliminate unecessary pixel checks)

TargetSelected = A boolean aswell, gives you 1 if you targetted a mob and 0 if you have no current target.

It's a silly bot though, I wouldn't recommend using it to level or farm items. Just to see how it works.
Ah, well very much thanks. :)