Using MAGE_THUNDERSTORM

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Using MAGE_THUNDERSTORM

#1 Post by jduartedj »

Hi,

I don't know if anyone has ever found a way to do this, or at least a better way but I wanted to share this code I made to cast thunderstorm. It does require the window to be focused like harvesting used to to require.
So maybe there is a better way... If there is please tell me!

Code: Select all

<onSkillCast>
				-- Casts Thunderstorm at the player's window position
			if arg1.Name == "MAGE_THUNDERSTORM" then 
				printf("Casting: Thunderstorm - Focus on Window needed!\n"); --not really needed 
				addMessage("Casting: Thunderstorm");  --not really needed 
				-- gets windows Width and Height
				local hf_x, hf_y, hf_wide, hf_high = windowRect( getWin());
				-- clicks at about 1/3 of window Height which is about where the player always is
				player:mouseclickL(hf_wide/2,hf_high*2/3); 
				yrest(2500); --simulating casttime
			end;
</onSkillCast>
I tried to cast it at the position of the mob but could find any way to detect the mob's window position (not world position). Anyway maybe there is a way to say where to cast thunderstorm without an actual click!?

Any feedback on this will help, thanks.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Using MAGE_THUNDERSTORM

#2 Post by jduartedj »

I wrote: Any feedback on this will help, thanks.
C'mon people! Anything?
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: Using MAGE_THUNDERSTORM

#3 Post by Administrator »

Well, it works but it is, of course, not the best solution. Thanks for providing it. Would be nice if there was a RoM API function that would allow you to cast skills like that more easily.

I think doing all the math to convert 3D world coordinates to 2D screen coordinates would just be overkill.
User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Using MAGE_THUNDERSTORM

#4 Post by jduartedj »

Administrator wrote:I think doing all the math to convert 3D world coordinates to 2D screen coordinates would just be overkill.
yes, ofc. I didn't even thought of it, what i had in mind was in case there was already something that gave us those coordinates, the same way you can get mob.x and mob.y you could get mob.wx and mob.wy for window coordinates.

anyway I would prefer like you said an API function for that.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using MAGE_THUNDERSTORM

#5 Post by rock5 »

Administrator wrote:I think doing all the math to convert 3D world coordinates to 2D screen coordinates would just be overkill.
With the angle and zoom factor of the camera known and if you point the camera to the target so you'd know it would be in the middle, horizontally, you would just have to work out the virtical value. It might not be too difficult to calculate, i think. But the fact that the client has to be the active window to click makes it not worth the effort.
  • 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