RoM bot

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

Re: RoM bot

#1041 Post by Administrator »

I need people to test the code below. Make changes to bot.lua, ine ~227. Directly below this code:

Code: Select all

			local target = player:getTarget();
			if( settings.profile.options.ANTI_KS ) then
				if( target:haveTarget() and target:getTarget().Address ~= player.Address and (not player:isFriend(CPawn(target.TargetPtr))) ) then
					cprintf(cli.red, language[5], target.Name);
				else
					player:fight();
				end
			else
				player:fight();
			end
Add this:

Code: Select all

			local aggroWaitStart = os.time();
			while(player.Battling) do
				if( player:haveTarget() ) then
					break;
				end;

				if( os.difftime(aggroWaitStart, os.time()) > 3 ) then
					--cprintf(cli.red, language[34]);
					printf("Aggro wait time out\n");
					break;
				end;

				yrest(10);
				player:update();
			end
reloxx
Posts: 14
Joined: Sat Mar 21, 2009 5:00 am

Re: RoM bot

#1042 Post by reloxx »

the code works quite good, the charakter notice now if he is in combat, he w8 a few secs. and then he auto target it (cuz of ingame). So, its a good solve to target mobs which are behind the player, but it looks a lil bit botish :S


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

Re: RoM bot

#1043 Post by Administrator »

reloxx wrote:So, its a good solve to target mobs which are behind the player, but it looks a lil bit botish :S
I assume you are referring to the stopping, then slowly turning around and beginning to attack. This can be resolved easily. Open rom/classes/player.lua in notepad, and press go to line (CTRL+G) 250. You'll see this code:

Code: Select all

		while( angleDif > math.rad(15) ) do
			if( self.HP < 1 or self.Alive == false ) then
				return;
			end;

			if( os.difftime(os.time(), startTime) > 5 ) then
				printf(language[26]);
				break;
			end;

			correctingAngle = true;
			if( angleDifference(angle, self.Direction + 0.01) < angleDif ) then
				-- rotate left
				keyboardRelease( settings.hotkeys.ROTATE_RIGHT.key );
				keyboardHold( settings.hotkeys.ROTATE_LEFT.key );
			else
				-- rotate right
				keyboardRelease( settings.hotkeys.ROTATE_LEFT.key );
				keyboardHold( settings.hotkeys.ROTATE_RIGHT.key );
			end

			yrest(100);
			self:update();
			target:update();
			angle = math.atan2(target.Z - self.Z, target.X - self.X);
			angleDif = angleDifference(angle, self.Direction);
		end
Delete that code (and only the code shown above), and save it. This disables turning towards your target. This, however, only works if the user has click to move on. If they do not, then they must rotate towards the target before attacking.
reloxx
Posts: 14
Joined: Sat Mar 21, 2009 5:00 am

Re: RoM bot

#1044 Post by reloxx »

thats better now, thank you :)
kumpel100
Posts: 47
Joined: Sat May 09, 2009 11:12 am

Re: RoM bot

#1045 Post by kumpel100 »

is there a way to guard my second account wich is in follow with my Bot account?
my second account is the macro healer and buffbot he get sometimes aggro from mobs so my bot account should be guard it.
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1046 Post by Administrator »

kumpel100 wrote:is there a way to guard my second account wich is in follow with my Bot account?
my second account is the macro healer and buffbot he get sometimes aggro from mobs so my bot account should be guard it.
No. There is no way to check if another player is being attacked.
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1047 Post by Administrator »

Version 2.39 has been uploaded. You can also get it off SVN.
Version 2.39; Updated addresses; Added aggro wait; Improved melee response;
Lowered movement delays; Disabled "slow turn" when fighting (can be re-enabled
in settings.xml);
Bobert
Posts: 10
Joined: Sat May 16, 2009 7:27 pm

Re: RoM bot

#1048 Post by Bobert »

with rev 38: v2.39

Code: Select all

Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script> bot.lua
Opening bot.lua...
Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and low a new script.
-------------------------------------------------------------------------------
scripts\bot.lua:5: ...and Settings/Administrator/Desktop/micromacro/scripts/clas
ses/player.lua:240: unexpected symbol near '<'

But then again, I don't know if the SVN update worked correctly...
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1049 Post by Administrator »

Have you made any changes to your classes/player.lua? There isn't any '<' anywhere near that line. I would suggest deleting your player.lua and grabbing it off of SVN again. It might fix your problem.
Bobert
Posts: 10
Joined: Sat May 16, 2009 7:27 pm

Re: RoM bot

#1050 Post by Bobert »

player.lua and pawn.lua for some reason didn't update the first time. Thanks for the fix.
Kanzer
Posts: 2
Joined: Wed May 27, 2009 9:40 am

Re: RoM bot

#1051 Post by Kanzer »

After de Update (27/05/2009) the macro doesnt work anymore
I gor an error when i load the createpath.lua
There is something i have to do after all the updates?

Image

Warning:Failure Reading memory

And there is a wayto bot "rest" after takin some % of damage?
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1052 Post by Administrator »

Kanzer wrote:After de Update (27/05/2009) the macro doesnt work anymore
I gor an error when i load the createpath.lua
There is something i have to do after all the updates?

Image

Warning:Failure Reading memory

And there is a wayto bot "rest" after takin some % of damage?
Post your log.txt. It is impossible to see anything in that screenshot. How did you update? Did you download the zip pack from this website, or did you update off of SVN? Did you make sure you overwrote *all* files?

And no, resting is not a feature of this bot. Resting out of combat is useless beyond level 10, makes you look more like a bot, and leaves you vulnerable to aggressive monsters.
danked_247
Posts: 4
Joined: Sun May 24, 2009 11:07 pm

Re: RoM bot

#1053 Post by danked_247 »

The new version is no longer working for me. Every time I run it, even on new waypoint paths, the character will just strafe to either side (and never stop) but keep looking forward. He wont try to target mobs either.
Kanzer
Posts: 2
Joined: Wed May 27, 2009 9:40 am

Re: RoM bot

#1054 Post by Kanzer »

Hum solved the problem with the comand rom/update.lua thanks anyway for the concern ^^
i'm noob in the rom/micromacro but thanks, you did a great job in the rombot
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1055 Post by Administrator »

danked_247 wrote:The new version is no longer working for me. Every time I run it, even on new waypoint paths, the character will just strafe to either side (and never stop) but keep looking forward. He wont try to target mobs either.
Fix your settings in settings.xml.
danked_247
Posts: 4
Joined: Sun May 24, 2009 11:07 pm

Re: RoM bot

#1056 Post by danked_247 »

I shouldn't have to. I've never touched that file. Everything seems to be correct inside it.
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1057 Post by Administrator »

Then there is no reason your character should be strafing. The only thing that would cause what you described is if you mixed up your turn hotkeys with strafe hotkeys.
kumpel100
Posts: 47
Joined: Sat May 09, 2009 11:12 am

Re: RoM bot

#1058 Post by kumpel100 »

since Patch the bot follow waypoints perfect but he didnt target the mobs,

in settings.xml:
<hotkey description="TARGET" key="VK_TAB" modifier="" />

any idear?
User avatar
Administrator
Site Admin
Posts: 5340
Joined: Sat Jan 05, 2008 4:21 pm

Re: RoM bot

#1059 Post by Administrator »

kumpel100 wrote:since Patch the bot follow waypoints perfect but he didnt target the mobs,

in settings.xml:
<hotkey description="TARGET" key="VK_TAB" modifier="" />

any idear?
First, did you download the updated files from this site, or update off of SVN? Or did you only run update.lua?

Start by going to rom/classes/player.lua, and go to (CTRL+G in notepad) line 423. You'll see this code:

Code: Select all

		if( canTarget and (not ignoreCycleTargets) and (not self.Battling) ) then
			if(settings.hotkeys.TARGET.modifier) then
				keyboardHold(settings.hotkeys.TARGET.modifier);
			end
			keyboardPress(settings.hotkeys.TARGET.key);
			if(settings.hotkeys.TARGET.modifier) then
				keyboardRelease(settings.hotkeys.TARGET.modifier);
			end

			yrest(10);
		end
Below the yrest(10);, add this:

Code: Select all

printf("Tabbing to target\n");
Now run it and see if it displays that text ("Tabbing to target") while moving between waypoints. Let me know what happens.
kumpel100
Posts: 47
Joined: Sat May 09, 2009 11:12 am

Re: RoM bot

#1060 Post by kumpel100 »

Tabbing to Target..

i can read this in console, but if didnt hit TAB by myself the bot doesnt get a target he runs straight his waypoints.

Edit: it sounds stupit what i did now and it works

Settings.lua
TARGET = {key = _G.key.VK_0, modifier = nil},

Settings.xml
<hotkey description="TARGET" key="VK_0" modifier="" />

and use this macro ingame on hotkey 0
/script TargetNearestEnemy()

seems like the bot didnt like my TAB key
ingame is TAB still set us Next Enemy
Locked