Just a small question.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
NightWing91
Posts: 2
Joined: Tue Aug 09, 2011 2:44 am

Just a small question.

#1 Post by NightWing91 »

I would like to know which function I need to still look for a target and continue fighting instead of fighting back if you are attacked.
So it want this function: player:restrnd([probability [, minrest [, maxrest]]]); but instead of fighting back, I want it to look for a target during the rest and attack it.

Is that possible?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Just a small question.

#2 Post by rock5 »

You could start it in wander mode with a radius of '0' and I think it will just stand there and kill stuff. Haven't tried it though.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
NightWing91
Posts: 2
Joined: Tue Aug 09, 2011 2:44 am

Re: Just a small question.

#3 Post by NightWing91 »

Thanks for the reply, but its not really what i was looking for. I wanted to farm dog meat and have 4 waypoints that i use close to each other. But i dont want the bot to run in circles, the pauses should make it more realistic, but he must keep targeting and attacking the guard dogs.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Just a small question.

#4 Post by lisa »

You could probably do a check for the dog's and if not then have a yrest.
Thing is though if there is a dog in range you should attack it regardless of if you reach the waypoint coords or not.
If it was me I would go with the wander and radius 0. increase the max target distance and start the bot in the middle of where the dogs are. I'd also set the dogs in the "mobs" profile option so it doesn't bother to attack anything else.

If you set the distance properly then basically the bot will kill dogs anytime they appear and if no dogs to kill it will move to the same spot and wait for dogs.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Just a small question.

#5 Post by rock5 »

There's no option for that. You would have to use yout own code. Something like,

Code: Select all

function mobWait(_waitTime)
   local starttime = os.clock()
   repeat
      yrest(1000)
      local mob = player:findEnemy(false, nil, evalTargetDefault)
      if target then
         player:target(mob)
         player:update()
         player:fight()
         break
      end
   until os.clock() - starttime > _waitTime
end
Put this in the onLoad section of your waypoint file. At the waypoints add

Code: Select all

mobWait(10000)
This should wait 10 seconds for a mob, kill it then move to the next waypoint. Use whatever pause time you like. If you want it to continue waiting after killing the mob, remove the "break".

Note: This is untested.

Although what Lisa said is probably easier and should work.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: Just a small question.

#6 Post by silinky »

hi all, and rock5 :)

i used this function but for some reason on the second waypoint ( i am guessing where the mobwait occurs) just stands there not even fighting back to mobs.
can you tell my how can i fix this?
thanks!
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Just a small question.

#7 Post by rock5 »

There is a bug. I did say it was untested.

Code: Select all

      if target then
should be

Code: Select all

      if mob then
Also, I think '_waitTime' should be given in seconds not miliseconds. So '10' for 10 seconds.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: Just a small question.

#8 Post by silinky »

lol i should have seen it myself.

anyway, thanks for the helpful reply :)
Post Reply