RoM bot

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
Administrator
Site Admin
Posts: 5318
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#2121 Post by Administrator » Sun Oct 18, 2009 1:50 pm

No, camera:setRotation() takes radians. You can just use math.rad() to convert from degrees to radians. Of course, this sets the camera's raw direction. It does not rotate it that many degrees. To rotate it left or right just takes a bit of math. Remember, there are 2PI radians in a circle, so 90 degrees would be 1/2 PI. Therefor, we can just take the player's direction and add or subtract 1/2 PI from it and set this as the camera's direction.
Is there a possibility to make the rest-time shorter than one second?
yrest(); is in milisecs right?
In player:rest(), probably not. Once most people upgrade to MicroMacro 1.0 beta 7, we can start making changes to high-res timers which allow more control over timing things like this out. But yes, yrest() does accept milliseconds. However, be aware that attempting to yrest() for 1 millisecond does not mean exactly 1 millisecond will elapse. This is due to a number of things; code overhead, operating system timer resolution, and non-real-time-threading to name a few. You can expect up to ~15ms difference. That said, yrest() in beta 7 is much more accurate and will eliminate some wasted milliseconds.

User avatar
BlackGod
Posts: 53
Joined: Wed Jul 01, 2009 10:05 am

Re: RoM bot

#2122 Post by BlackGod » Sun Oct 18, 2009 2:24 pm

Administrator wrote:No, camera:setRotation() takes radians. You can just use math.rad() to convert from degrees to radians. Of course, this sets the camera's raw direction. It does not rotate it that many degrees. To rotate it left or right just takes a bit of math. Remember, there are 2PI radians in a circle, so 90 degrees would be 1/2 PI. Therefor, we can just take the player's direction and add or subtract 1/2 PI from it and set this as the camera's direction.
Is there a possibility to make the rest-time shorter than one second?
yrest(); is in milisecs right?
In player:rest(), probably not. Once most people upgrade to MicroMacro 1.0 beta 7, we can start making changes to high-res timers which allow more control over timing things like this out. But yes, yrest() does accept milliseconds. However, be aware that attempting to yrest() for 1 millisecond does not mean exactly 1 millisecond will elapse. This is due to a number of things; code overhead, operating system timer resolution, and non-real-time-threading to name a few. You can expect up to ~15ms difference. That said, yrest() in beta 7 is much more accurate and will eliminate some wasted milliseconds.
ok thank you for you explanations... ;)

This works really well!

Code: Select all

	<!-- # 42 --><waypoint x="-15493" z="4887">
		camera:setRotation(1,57);
		yrest(300);
		camera:setRotation(3,141);
		yrest(300);
		camera:setRotation(-1,57);
		yrest(300);
	</waypoint>

User avatar
Administrator
Site Admin
Posts: 5318
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#2123 Post by Administrator » Sun Oct 18, 2009 2:51 pm

I assume you come from a country where ',' can be used to show a decimal place. I'll never understand the logic between that. It makes it impossible to differentiate between one thousand one (1,001) and one and one millionth, for example. And people laugh at the American standard for measurement.

Anyways, that aside, you should use the dot (.). So use 1.57 instead of 1,57. Or, use math.rad(90) to use 90 degrees. 1,57 will pass two separate values: 1 and 57. This obviously isn't what you want.

User avatar
BlackGod
Posts: 53
Joined: Wed Jul 01, 2009 10:05 am

Re: RoM bot

#2124 Post by BlackGod » Sun Oct 18, 2009 4:44 pm

Administrator wrote:I assume you come from a country where ',' can be used to show a decimal place. I'll never understand the logic between that. It makes it impossible to differentiate between one thousand one (1,001) and one and one millionth, for example. And people laugh at the American standard for measurement.
Hehe, yes you are right!
I'm from Germany and that's the standard here... sorry I'm going to change this for you! ;)
I could explain you the logic between the "."- and the ","-separator (in a pm)... :)
Administrator wrote:Anyways, that aside, you should use the dot (.). So use 1.57 instead of 1,57. Or, use math.rad(90) to use 90 degrees. 1,57 will pass two separate values: 1 and 57. This obviously isn't what you want.
Thanks for your hint!
Then I have to use

Code: Select all

	<!-- #  2 --><waypoint x="-15816" z="4749">
		camera:setRotation(math.rad(90));
		yrest(300);
		camera:setRotation(math.rad(180));
		yrest(300);
		camera:setRotation(math.rad(270));
		yrest(300);
	</waypoint>
right?

Thanks for your help!

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#2125 Post by d003232 » Sun Oct 18, 2009 4:51 pm

Administrator wrote:I assume you come from a country where ',' can be used to show a decimal place. I'll never understand the logic between that. It makes it impossible to differentiate between one thousand one (1,001) and one and one millionth, for example. And people laugh at the American standard for measurement.
lol. I understand nothing. I'm totaly confused. :-)

And even with

Code: Select all

<!-- # 42 --><waypoint x="-15493" z="4887">
      camera:setRotation(1.57);
      yrest(300);
      camera:setRotation(3.141);
      yrest(300);
      camera:setRotation(-1.57);
      yrest(300);
   </waypoint>
You will only have a rotating camera at the place. That will not work. You have to leave the WP coding after one rotating/targeting combonation to fight the mob(s). And after the fight come back and look for further mobs. No so easy solution. I'm not sure if it will work. You could try something like

Code: Select all

camera:setRotation(math.rad(90));
if( not player.Battling) and  player:findTarget() ) then			-- find a new target
	__WPL:setWaypointIndex( __WPL.CurrentWaypoint - 1 );
	return;
end;
if( not player.Battling) and  player:findTarget() ) then			-- find a new target
	__WPL:setWaypointIndex( __WPL.CurrentWaypoint - 1 );
	return;
end;
if( not player.Battling) and  player:findTarget() ) then			-- find a new target
	__WPL:setWaypointIndex( __WPL.CurrentWaypoint - 1 );
	return;
end;
If you don't found a new target, the bot should go to the next waypoint, if you found one, he will target/fight that and come back to that WP coding again ... until everything is clear.
The RoM Bot Online Wiki needs your help!

akira2102
Posts: 51
Joined: Sat Jul 18, 2009 2:10 pm

Re: RoM bot

#2126 Post by akira2102 » Sun Oct 18, 2009 5:24 pm

Hello

I have a huge problem with my bot. When I start it on the first time it looks like everything is allright but when it has to heal itself then the bot tries to cast the skill but he dont target itself. So the Curser changes into the casting symbol and nothing happens.

Later I recognized that the TEST MACRO thing in the chat is not there anymore. I tried to delete the but and reinstalled it via svn but nothing.. I also tried to delete the Macro and make a new one but nothing... I deleted the Macro without making a new one and the bot even does not care about that o_O. It runs like usual but without targeting himself --> without healing. Shouldn't there be a error message without a makro placed at the first macro place?

I dont know what to do. So please HEELP ME ;_;

--> I changed my System into Windows 7 (dont know if that has something to do with this issue...)

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#2127 Post by d003232 » Sun Oct 18, 2009 5:34 pm

akira2102 wrote:Hello

I have a huge problem with my bot. When I start it on the first time it looks like everything is allright but when it has to heal itself then the bot tries to cast the skill but he dont target itself. So the Curser changes into the casting symbol and nothing happens.

Later I recognized that the TEST MACRO thing in the chat is not there anymore. I tried to delete the but and reinstalled it via svn but nothing.. I also tried to delete the Macro and make a new one but nothing... I deleted the Macro without making a new one and the bot even does not care about that o_O. It runs like usual but without targeting himself --> without healing. Shouldn't there be a error message without a makro placed at the first macro place?

I dont know what to do. So please HEELP ME ;_;

--> I changed my System into Windows 7 (dont know if that has something to do with this issue...)
Check if you turned on the ingame settings for 'selfcasting'. Try to delete your macro file in 'My Documents/Runde of Magic/<char_name>'.
The RoM Bot Online Wiki needs your help!

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: RoM bot

#2128 Post by raff » Mon Oct 19, 2009 1:27 am

hi,

i have a question, i want to make one waypoint file for all

i mean i want that the bot run this on startup:

Code: Select all

	 if( player.Level > 0 ) then
         loadPaths("wp1.xml");
       	 end;

	 if( player.Level > 4 ) then
         loadPaths("wp2.xml");
       	 end;

	 if( player.Level > 8 ) then
         loadPaths("wp3.xml");
       	 end;
etc.

So i tried it with blank waypoints, but the bot will always try to run to waypoint 0, then i saw in the profile file the <onLoad></onLoad> feature and tried to add the code in there, but i will get this error message:

Code: Select all

scripts\bot.lua:201: onLoad error: c:\mydir.......scripts\functions.lua:276: attempt to index global '__WPL' <a nil value>
is there a way to make a waypoint file to execute this lua code without going to a waypoint?

or is there a way to execute this lua code right with the onLoad feature?

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#2129 Post by d003232 » Mon Oct 19, 2009 3:00 am

raff wrote:is there a way to make a waypoint file to execute this lua code without going to a waypoint?

or is there a way to execute this lua code right with the onLoad feature?
I make some changes in SVN 365. You can now use loadPath() also in the onLoad event.

You should change your coding to

Code: Select all

if( player.Level > 0 ) then
	loadPaths("wp1.xml");
elseif( player.Level > 4 ) then
	loadPaths("wp2.xml");
elseif( player.Level > 8 ) then
	loadPaths("wp3.xml");
end;
to avoid to load all three path after each other.

But remember. If you load paths depending from your level, you also have to be at the right place to start the loaded WP file.
The RoM Bot Online Wiki needs your help!

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: RoM bot

#2130 Post by raff » Mon Oct 19, 2009 3:31 am

thanks for your fast answer and help :), i will try it out

akira2102
Posts: 51
Joined: Sat Jul 18, 2009 2:10 pm

Re: RoM bot

#2131 Post by akira2102 » Mon Oct 19, 2009 5:58 am

d003232 wrote:Check if you turned on the ingame settings for 'selfcasting'. Try to delete your macro file in 'My Documents/Runde of Magic/<char_name>'.

I think this self Casting crap was it but i dont really can try it.. because of a new problem... After I changed these things the bot itself crashes. See Artachment -->
Unbenannt.JPG

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#2132 Post by d003232 » Mon Oct 19, 2009 6:14 am

akira2102 wrote:
d003232 wrote: because of a new problem... After I changed these things the bot itself crashes. See Artachment -->
Hmm. Not really sure about that problem. The bot reads your client language with the MACRO function an get a nil value back. So it could be something with your clients language (what is it?) or you perhaps pressed a modifier key (SHIFT/ALT/CTRL) while that command was executed. So the bot/client missed that MACRO command. Please try it again. And if it still don't work please look ingame for the content of your macro at the first macro space ( what's the content? ).
The RoM Bot Online Wiki needs your help!

User avatar
BlackGod
Posts: 53
Joined: Wed Jul 01, 2009 10:05 am

Re: RoM bot

#2133 Post by BlackGod » Mon Oct 19, 2009 11:58 am

raff wrote:hi,

i have a question, i want to make one waypoint file for all

i mean i want that the bot run this on startup:

Code: Select all

	 if( player.Level > 0 ) then
         loadPaths("wp1.xml");
       	 end;

	 if( player.Level > 4 ) then
         loadPaths("wp2.xml");
       	 end;

	 if( player.Level > 8 ) then
         loadPaths("wp3.xml");
       	 end;
Instead of using loadPaths, try

Code: Select all

		__WPL:load(getExecutionPath() .. "/waypoints/HARVEST_logar_B.xml");

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#2134 Post by d003232 » Mon Oct 19, 2009 12:45 pm

BlackGod wrote:Instead of using loadPaths, try

Code: Select all

		__WPL:load(getExecutionPath() .. "/waypoints/HARVEST_logar_B.xml");
That will not work, because the __WPL object isn't registered at the time of the <onLoad> event. So you would have to do that also. 'loadPath' will do that for you, load the fitting returnpath if you have one with the suffix '_return', will automaticly use the return path if you restart the bot at the resurrection point, will set the closest WP number of the path, ... if you don't want to do that all by hand, use loadPaths for that case. :-)
The RoM Bot Online Wiki needs your help!

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: RoM bot

#2135 Post by raff » Mon Oct 19, 2009 5:51 pm

Hi,

the onLoad feature works now, thanks :)

but i have now another problem:

my code:

Code: Select all

<onLoad>

if( player.Level > 35 ) then
   loadPaths("wp1.xml");

elseif( player.Level > 30 ) then
   loadPaths("wp2.xml");

end;

</onLoad>
i have also wp1_return.xml and wp2_return.xml files in my waypoint dir.

i leave the waypoint option blank in my profil

Code: Select all

<option name="WAYPOINTS"		value="" />
i start the bot, it loads correctly wp1.xml or wp1_return.xml (which is nearer), when the bot start with the return path and he reach wp1.xml, it will switch to wp1.xml, but the bot will always go to Waypoint #0, (0, 0)



So i tried it without my code in onLoad and with:

Code: Select all

<option name="WAYPOINTS"		value="wp1.xml" />
result: the bot will correctly switch the waypoints and it works fine :/

any tipps?

User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

Re: RoM bot

#2136 Post by droppen » Mon Oct 19, 2009 6:32 pm

tips for what? you got it running.. o_O

raff
Posts: 96
Joined: Thu Jan 22, 2009 10:46 am

Re: RoM bot

#2137 Post by raff » Mon Oct 19, 2009 6:52 pm

droppen wrote:tips for what? you got it running.. o_O
When i use this in onLoad:
if( player.Level > 3 ) then
loadPaths("wp2.xml");

elseif( player.Level > 0 ) then
loadPaths("wp1.xml"");

end;
bot is level 5 so it will load wp2.xml

now the bot is near to wp2_return.xml so the bot will go for it

then the bot will load wp2.xml without errors, but the bot will only move to a empty waypoint, called waypoint #0 in console


when i put wp2.xml normal in the waypoint option in the profil file and without using the above code it will switch correctly from wp2_return.xml to wp2.xml without going to waypoint #0

sry for my english, hope you can understand it right

Image

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#2138 Post by d003232 » Tue Oct 20, 2009 12:31 am

raff wrote:
droppen wrote: then the bot will load wp2.xml without errors, but the bot will only move to a empty waypoint, called waypoint #0 in console


when i put wp2.xml normal in the waypoint option in the profil file and without using the above code it will switch correctly from wp2_return.xml to wp2.xml without going to waypoint #0
I will check that. It's new to completly load the WP files within the <onLoad> event. So I suppose there is still some 'bug' while doing that.
The RoM Bot Online Wiki needs your help!

phanisher
Posts: 28
Joined: Mon Oct 19, 2009 6:28 am

Re: RoM bot

#2139 Post by phanisher » Tue Oct 20, 2009 12:34 am

HI,

I just want to say, I love your work on the new revision. It rocks and doesnt require me to hit del all the time!

Keep up the good work and many thanks for this awesome product!

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: RoM bot

#2140 Post by d003232 » Tue Oct 20, 2009 4:57 am

raff wrote:bot is level 5 so it will load wp2.xml

now the bot is near to wp2_return.xml so the bot will go for it

then the bot will load wp2.xml without errors, but the bot will only move to a empty waypoint, called waypoint #0 in console


when i put wp2.xml normal in the waypoint option in the profil file and without using the above code it will switch correctly from wp2_return.xml to wp2.xml without going to waypoint #0
Now it should work. Update to SVN 368.
The RoM Bot Online Wiki needs your help!

Locked

Who is online

Users browsing this forum: No registered users and 1 guest