Page 1 of 1

Mouse Control

Posted: Tue Mar 30, 2010 6:42 pm
by el_dios85
mouseSet(100, 200);
mouseLClick();

I made the function with this, but at the 2st client it work. after I set to the 2nd client, it didnt work. I'm using v.0.99 because there are several error if I use the v.1.0.

Is there any change about Mouse control in 1.0?

Is the function above cant be use on multiclient?

Thank you

Re: Mouse Control

Posted: Tue Mar 30, 2010 6:49 pm
by Administrator
Yes, there are a lot of changes with keyboard and mouse input between 0.99 and 1.0. You should resolve the errors instead of ignoring them.

If you do not have input attached (ie. you used the attach() function), try attaching. If you are attached, try detatching and reattaching after the input, like this:

Code: Select all

detatch();
mouseLClick();
attach(win);
Remember that normal (non-attached) input only works when that window is on top.

Re: Mouse Control

Posted: Thu Apr 01, 2010 5:33 am
by el_dios85
I have try but cannot work with multiclient.
The problem is, after detach() it only work on the active window.
I use the latest micromacro (1.0) and the script is like this.

Code: Select all

function fight()
--I want to press a skill (ALT + 1) or press from skill bar (mouse coordinate 700, 740) on multiclient
--I have try keyboardPress( key.VK_1, key.VK_ALT ); but I didnt work 
--but keyboardPress( key.VK_V, key.VK_CONTROL ); work (can paste text I copy)
--I try using keyboardHold(key.VK_ALT) and keyboardPress(key.VK_1) it work on active window
--I try using mouse function, but it only work on active window, so anyone have an idea/trick
detach();
mouseSet(705, 750);
mouseLClick(); 
attach(win);
-----------------------------------------------------------------------------------------------
  while( have_target() ) do	
    keyboardPress(attack_key);
    if( (HP / MaxHP * 100) < HP_potion_use ) then use_hp_potion() end
    if( (MP / MaxMP * 100) < MP_potion_use ) then use_mp_potion() end
    yrest(100);
  end
  pickup_items();
end

function main()
  local original_name = getWindowName(win);
  attach(win);
  proc = openProcess( findProcessByWindow(win) );
  setPriority(PRIORITY_HIGH);

  local winname = original_name .. " [ID:" .. sprintf("%x",win) .. "]";
  if( string.find(original_name, " [ID:" .. sprintf("%x",win) .. "]", 1, true) == nil ) then
    setWindowName(win, winname);
  end
  setWindowName(getHwnd(), "MicroMacro - " .. "Perfect World Bot" .. " [ID:" .. sprintf("%x",win) .. "]");

  atExit(exit_callback);

  charptr_addr = memoryReadInt(proc, staticbase_ptr) + staticbase_offset;

  get_monster_list();

  printf("\nBOT STARTED\n");

  registerTimer("update_vars", 100, update_vars);
  registerBuffs();

  while(1) do
    if( have_target() == false ) then
      find_target(); 
    end

    if( have_target() ) then
      fight();
    end

    if( (HP / MaxHP * 100) < HP_potion_use and HP_potion_use > 0) then use_hp_potion() end
    if( (MP / MaxMP * 100) < MP_potion_use and MP_potion_use > 0) then use_mp_potion() end

    yrest(100);
  end
end

startMacro(main, true);
Thanks

Re: Mouse Control

Posted: Thu Apr 01, 2010 3:03 pm
by Administrator
I have try but cannot work with multiclient.
The problem is, after detach() it only work on the active window.
Yes, that's the problem with normal input. Attached mouse input usually doesn't work. In fact, the only game I can think of that it works for is Metin 2.

Isn't there some way you can just remap the key in-game so that you don't need to hold ALT?

Re: Mouse Control

Posted: Thu Apr 01, 2010 10:10 pm
by el_dios85
There is no other way, only ALT + 1 or click the skill.
Do you ever heard this situation.
After the patch, the monster which was targeted from bot, the char cant use skill, but when we click the monster with mouse, the char can use skill. I think is prevention to use bot on this game.

Thanks

Re: Mouse Control

Posted: Thu Apr 01, 2010 11:29 pm
by Administrator
I have not heard of that. If I get some time, I'll look into it. The ALT+<key> works everywhere else, though, so it's definitely something specific to this game.

Re: Mouse Control

Posted: Fri Apr 02, 2010 5:33 pm
by Administrator
Can you tell me exactly which copy of the game you have? I know they are all basically the same game with (slightly) different graphics, but initiating with skills seems to work fine with "Perfect World Internation: Rising Tides."

Re: Mouse Control

Posted: Tue Apr 06, 2010 6:47 pm
by el_dios85
I already test "Perfect World Internation: Rising Tides.", mine is "Perfect World Indonesia", I think it is the same.
Before the new patch, it work. But now, the monster which locked/targeted by the function "memoryWriteIntPtr(proc, charptr_addr, targetid_offset, monsterList);" My char cant cast skill, or must wait till the monster hit us first and the skill can be cast.