Checking targets casting time?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Checking targets casting time?

#1 Post by gloover » Thu Nov 01, 2012 5:49 am

Hey experts.

I'm trying to make a script with a part checking the remaining time of targets cast?

To be exact, I want to check the cast of mechanical bug in ToSH, so if its spawning the small bugs, my mage should react with "Discharge". Has someone any idea?

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

Re: Checking targets casting time?

#2 Post by rock5 » Thu Nov 01, 2012 7:25 am

The only information we collect is whether the mob is casting or not. If you want to know how much time is remaining on their cast then you will have to read memory. I happen to know the offsets needed. Something like this should do it.

Code: Select all

casttime = memoryReadRepeat("float", getProc(), target.Address + 0x260)
elapsedtime = memoryReadRepeat("float", getProc(), target.Address + 0x264)
remaining = casttime-elapsedtime
  • 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
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Checking targets casting time?

#3 Post by Ego95 » Thu Nov 01, 2012 8:23 am

so if its spawning the small bugs, my mage should react with "Discharge". Has someone any idea?
Do you want to farm tp with the bot? oO

User avatar
gloover
Posts: 304
Joined: Wed Jul 07, 2010 4:31 am

Re: Checking targets casting time?

#4 Post by gloover » Thu Nov 01, 2012 12:02 pm

@ Ego, yes, that was my intention.

@ rock, your sugested code seems not to be working on the simple code

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
	changeProfileOption("MAX_TARGET_DIST", 400);
	
	
	player:target(106355) 
	while (true) do
		casttime = memoryReadRepeat("float", getProc(), target.Address + 0x260)
		elapsedtime = memoryReadRepeat("float", getProc(), target.Address + 0x264)
		remaining = casttime-elapsedtime
		printf(remaining)
		printf("\n")
	end

</onLoad>
</waypoints>
got this error
5:57pm - scripts\rom/bot.lua:505: onLoad error: [string "..."]:7: attempt to index global 'target' (a nil value)

have also try to read a "floatptr" instead of "float" - same errror :-(

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

Re: Checking targets casting time?

#5 Post by rock5 » Thu Nov 01, 2012 1:26 pm

That's because you don't define 'target'. Try

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
   changeProfileOption("MAX_TARGET_DIST", 400);
   
   
   local target = player:findNearestNameOrId(106355)
   if target then
      player:target(target)
      while player:hasTarget() do
         casttime = memoryReadRepeat("float", getProc(), target.Address + 0x260)
         elapsedtime = memoryReadRepeat("float", getProc(), target.Address + 0x264)
         remaining = casttime-elapsedtime
         printf(remaining)
         printf("\n")
      end
   end

</onLoad>
</waypoints>
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests