Page 2 of 2

Re: How to create a function for a elite skill

Posted: Mon Apr 07, 2014 11:27 am
by AngelDrago
kuripot wrote:i think it will help.. onpreskill of rock
http://www.solarstrike.net/phpBB3/viewt ... =21&t=5051
then use this waypoint

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
local afk = false
while (true) do
   player:checkSkills(true) -- self buff and heal
   if keyPressed(key.VK_U) then
      if afk == true then 
         afk = false 
         print("Please don't let me die as I am weak and won't defend myself") 
      else 
         afk = true 
         print("I will defend our honor while you go powder your nose") 
      end
   end
   player:update()
   if afk == true then
      if player.Battling then
         player:target(player:findEnemy(true, nil, evalTargetDefault, player.IgnoreTarget));
         if player:haveTarget() then
            player:fight()
         end
      end
   end
   if keyPressed(key.VK_F) then
      target = player:getTartget()
      if target then
         repeat
            player:checkSkills(true) -- self buff and heal
            player:cast("MAGE_FLAME")
            target:update()
         until 5 > target.HP/target.MaxHP*100
      end
   end
end
</onLoad>
</waypoints>
try it if it can help

I'm getting this error when i hit F key

The game client did not crash.
11:25am - [string "..."]:24: attempt to call method 'getTartget' (a nil value)

Re: How to create a function for a elite skill

Posted: Mon Apr 07, 2014 11:59 am
by rock5
Tartget? Isn't it obvious? In case it isn't, it's supposed to be

Code: Select all

target = player:getTarget()

Re: How to create a function for a elite skill

Posted: Thu Apr 10, 2014 3:02 pm
by AngelDrago
:roll: I fixed that problem now every time I'm using it it will start with a fireball but nothing else is working so i manually click on it and it waited till he buff where off and than resumed fire-ring

is their a better way to do this like a user function that you could use for example by pressing num 1 and than it goes and starts it sequence and maybe a check if its still on cool down....in a way like the Andor Training Ground

Re: How to create a function for a elite skill

Posted: Thu Apr 10, 2014 5:45 pm
by lisa

Code: Select all

         repeat
            player:checkSkills(true) -- self buff and heal
            player:cast("MAGE_FLAME")
            target:update()
         until 5 > target.HP/target.MaxHP*100
That code tells the bot to use heal/buff skills and flame ONLY until the mob is dead, it won't use any other damage skills because you haven't told it to.

If you want it to use flame only while you have the buff and then use normal skills then you need to tell it to do so. change the until to be that you don't have buff anymore. Then check mob is alive still and if so then do player:fight()

Re: How to create a function for a elite skill

Posted: Thu Oct 16, 2014 8:19 am
by noobbotter
I don't have a Mage/Warden but was curious about that Earth Core Barrier skill. Aside from removing all cast time of Flame, does it also allow you to ignore the global cooldown? So you could potentially cast a Flame as fast as the command can be issued? If that's the case I wonder if it would be possible to cast a flame once every 10 miliseconds. That would be 100 flames per second. Probably not. Maybe one every 100 miliseconds? That would be 10 per second, and 50 for the life of the buff. That's enough to do some major damage to a Boss. So looking at some of the previous posts, I threw this together but it's untested. Maybe this would work for encountering the boss or high level elite (in this example, anything over 1M HP:

Code: Select all

<preCodeOnElite><![CDATA[
		-- code to use before a boss or tough mob
		-- _arg1 is target pawn, _arg1.Name = target's name
		if _arg1.HP > 1000000 then -- will only do this for elites/bosses with over 1M HP.
			player:cast("MAGE_EARTH_MARKING")
			player:cast("MAGE_INTENSIFICATION")
			player:cast("MAGE_ELEMENTAL_CATALYSIS")
			player:cast("MAGE_EARTH_CORE_BARRIER");
			player:target(_arg1.Name)
			while player:hasBuff(623219) do
				--player:cast("MAGE_FLAME")
				-- Thinking to use macro vice bot's casting so you don't have to worry about the cast time setting of MAGE_FLAME
				sendMacro("/cast Flame")
				yrest(10)
			end
		end
	]]></preCodeOnElite>
That would go in the bot's profile. Like I said I haven't tested it. If anyone would want to test it and see how it works, feel free. I'm curious if it would work or not.