## RoM bot

Moderators: lisa, rock5

Message
Author
Posts: 4861
Joined: Sat Jan 05, 2008 4:21 pm

### Re: RoM bot

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.

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

### Re: RoM bot

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>``````

Posts: 4861
Joined: Sat Jan 05, 2008 4:21 pm

### Re: RoM bot

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.

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

### Re: RoM bot

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.
Then I have to use

Code: Select all

``````	<!-- #  2 --><waypoint x="-15816" z="4749">
yrest(300);
yrest(300);
yrest(300);
</waypoint>``````
right?

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

### Re: RoM bot

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

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

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

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
end;

if( player.Level > 4 ) then
end;

if( player.Level > 8 ) then
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

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
elseif( player.Level > 4 ) then
elseif( player.Level > 8 ) then
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

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

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 -->

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

### Re: RoM bot

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!

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

### Re: RoM bot

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
end;

if( player.Level > 4 ) then
end;

if( player.Level > 8 ) then
end;
``````

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

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

Hi,

the onLoad feature works now, thanks

but i have now another problem:

my code:

Code: Select all

``````<onLoad>

if( player.Level > 35 ) then

elseif( player.Level > 30 ) then

end;

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?

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

### Re: RoM bot

tips for what? you got it running.. o_O

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

### Re: RoM bot

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

elseif( player.Level > 0 ) then

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

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

### Re: RoM bot

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

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

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!

### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests