Mouse Control

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Mouse Control

#1 Post by el_dios85 » Tue Mar 30, 2010 6:42 pm

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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse Control

#2 Post by Administrator » Tue Mar 30, 2010 6:49 pm

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.

el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Mouse Control

#3 Post by el_dios85 » Thu Apr 01, 2010 5:33 am

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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse Control

#4 Post by Administrator » Thu Apr 01, 2010 3:03 pm

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?

el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Mouse Control

#5 Post by el_dios85 » Thu Apr 01, 2010 10:10 pm

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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse Control

#6 Post by Administrator » Thu Apr 01, 2010 11:29 pm

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.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Mouse Control

#7 Post by Administrator » Fri Apr 02, 2010 5:33 pm

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."

el_dios85
Posts: 29
Joined: Tue Jul 07, 2009 8:43 pm

Re: Mouse Control

#8 Post by el_dios85 » Tue Apr 06, 2010 6:47 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests