Programming Question

04/03/2009 04:58 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);