Page 1 of 1

Id of nomal attack

Posted: Sat Dec 01, 2012 6:09 am
by lolilol
Hi everyone,


I have a warmage and I search the ID for a normal attack, no skill use, just the "attack" that every class have.

Someone Know that Id ?

Thx for help and sorry for my English.

Re: Id of nomal attack

Posted: Sat Dec 01, 2012 7:04 am
by lisa
Honestly I have no idea what the ID of "attack" is, why would you need it?

Re: Id of nomal attack

Posted: Sat Dec 01, 2012 7:11 am
by rock5
I actually know that off by heart. I use it when I need to test GetIdName() function. It's 540000. But you can use the bot function

Code: Select all

Attack()
as well.

Re: Id of nomal attack

Posted: Sat Dec 01, 2012 7:33 am
by lolilol
Okay thx for answers but, In my waitpoint I do:

player:cast("WARRIOR_NAMEOFSKILL")

So I can make

player:cast("ATTACK")

or just

ATTACK() ?

Re: Id of nomal attack

Posted: Sat Dec 01, 2012 7:45 am
by rock5
Just

Code: Select all

Attack()
Of course the enemy needs to be targeted first.

Re: Id of nomal attack

Posted: Sat Dec 01, 2012 7:47 am
by lolilol
Okay thx, i'll try in few hours.

I'll be back to post the results.

Re: Id of nomal attack

Posted: Sat Dec 01, 2012 10:57 am
by lolilol
Well, I don't know if attack() really works because my bot was too far from boss so I added waypoint for the boss aggro.
Actually, I use bot from M4gm4 (http://www.solarstrike.net/phpBB3/viewt ... fir#p36386)
And with my warmage, I can't use the cristal. He doesn't want to press on the crystal and I don't know why.


I did that:

<!-- # 37 --><waypoint x="2065" z="1812" y="399">
lf = player:findNearestNameOrId(102623)
if lf then
player:target(lf)
Attack()
end
</waypoint>

And in my profile I add the code in <OnSkillCast>

Re: Id of nomal attack

Posted: Sat Dec 01, 2012 11:08 am
by rock5
If you want to attack the mob so you get aggro and then let the bot take over then you probably have to wait until it finishes walking over to the mob and attacks it. You could do a yrest() for the amount of time you think it will take to attack the mob or you could wait until you get aggro. Some thing like

Code: Select all

<!-- # 37 --><waypoint x="2065" z="1812" y="399">
lf = player:findNearestNameOrId(102623)
if lf then
    repeat
        player:target(lf)
        Attack()
        yrest(200)
        player:update()
    until player.Battling
end
</waypoint> 

Re: Id of nomal attack

Posted: Sun Dec 02, 2012 5:31 am
by lolilol
So I use your Code rock5 but, I have a message like "you are too close, back off" and I think that my bot can't use the cristal when he is too close because he is moving back always.

In my profil, the distance is 200, but when i run micromacro, it's change to 50. I don't find how he can't change that.

I will try an other method. And i'll post results.


EDIT : i added this line in skilldatabase :<skill name="WARRIOR_ATTACK" id="540000" type="damage" target="enemy" />
And in the waypoint I added :


lf = player:findNearestNameOrId(102623)
if lf then
player:target(lf)
player:cast("WARRIOR_ATTACK")
player:cast("WARRIOR_ATTACK")
player:cast("WARRIOR_ATTACK")
end

When I watch micromacro I don"t see the lines " player:cast("WARRIOR_ATTACK")" like in the original waypoint. And I have the same problem with distance.

Re: Id of nomal attack

Posted: Sun Dec 02, 2012 6:09 am
by rock5
If you want to use an item on the target, that is different. I'm guessing you want to attack the mob to get aggro then you want to use the "cristal" but you can't use it too close. So after you get aggro you have to back up and use the item.

Code: Select all

<!-- # 37 --><waypoint x="2065" z="1812" y="399">
lf = player:findNearestNameOrId(102623)
if lf then
    repeat
        player:target(lf)
        Attack()
        yrest(200)
        player:update()
    until player.Battling

    keyboardHold(settings.hotkeys.MOVE_BACKWARD.key) 
    yrest(1000) -- Change this until it moves the right distance back
    keyboardRelease(settings.hotkeys.MOVE_BACKWARD.key) 

    inventory:useItem("cristal") -- or whatever the item is called
end
</waypoint> 

Re: Id of nomal attack

Posted: Sun Dec 02, 2012 6:46 am
by lisa
you seem off your game tonight rock

Code: Select all

keyboardPress(settings.hotkeys.MOVE_BACKWARD.key) 
that should probably be Hold and not Press

Re: Id of nomal attack

Posted: Sun Dec 02, 2012 6:51 am
by rock5
lisa wrote:you seem off your game tonight rock
What do you mean? Isn't this usual for me? :mrgreen:

Re: Id of nomal attack

Posted: Wed Dec 05, 2012 2:15 pm
by lolilol
hey, i'm back.

I use the last code but my bot doesn't want use the item. I think that i'll wait some stuff for One Shoot the boss. Like that, no need use item.
Thx for your help :)

Best regards

Re: Id of nomal attack

Posted: Wed Dec 05, 2012 2:19 pm
by rock5
lolilol wrote: I use the last code but my bot doesn't want use the item
Did you change the name to the correct name? The name has to be the full correct name (or the id).

Re: Id of nomal attack

Posted: Wed Dec 05, 2012 2:48 pm
by lolilol
yep, I tried with the name and after with the ID, but he doesn"t use it.
With my other bot it's work perfectly.

Re: Id of nomal attack

Posted: Wed Dec 05, 2012 9:59 pm
by rock5
What other bot? Are you talking about a different script or different bot but same script?

Re: Id of nomal attack

Posted: Thu Dec 06, 2012 4:32 pm
by lolilol
same script, but when I'm front of the boss, the script is :
lf = player:findNearestNameOrId(102623)
if lf then

player:cast("ROGUE_PREMEDITATION")
player:target(lf)

player:cast("ROGUE_SHADOWSTAB")
player:cast("ROGUE_LOW_BLOW")
player:cast("ROGUE_WOUND_ATTACK")
player:cast("ROGUE_SHADOWSTAB")
player:cast("ROGUE_LOW_BLOW")

(*3)

end

My second bot is warmage, that why I would know the ID of normal attack but it's doesn't work.

Re: Id of nomal attack

Posted: Thu Dec 06, 2012 11:29 pm
by rock5
I'm surprised how many times you've posted code and not one has told you to use [ code] tags yet. Please, from now on, use [ code] tags when writing code. Just select the code and click the 'code' button at the top of the edit page.

If all you want to do is 'attack' use the Attack() function.

Code: Select all

lf = player:findNearestNameOrId(102623)
    if lf then
        Attack()
        Attack()
        Attack()
    end
end

Re: Id of nomal attack

Posted: Sun Dec 16, 2012 5:12 am
by lolilol
Oh sorry I will use the function code now.
Finally my mage is enought strong to kill the boss, and I can use the Item now .

Thx for four help and your time,

Best regards,