Page 53 of 111

Re: RoM bot

Posted: Sat May 23, 2009 11:07 am
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

Re: RoM bot

Posted: Sun May 24, 2009 4:54 am
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

Re: RoM bot

Posted: Sun May 24, 2009 8:44 am
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.

Re: RoM bot

Posted: Sun May 24, 2009 1:37 pm
by reloxx
thats better now, thank you :)

Re: RoM bot

Posted: Tue May 26, 2009 11:54 am
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.

Re: RoM bot

Posted: Tue May 26, 2009 11:59 am
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.

Re: RoM bot

Posted: Wed May 27, 2009 7:44 am
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);

Re: RoM bot

Posted: Wed May 27, 2009 8:07 am
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...

Re: RoM bot

Posted: Wed May 27, 2009 9:04 am
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.

Re: RoM bot

Posted: Wed May 27, 2009 9:13 am
by Bobert
player.lua and pawn.lua for some reason didn't update the first time. Thanks for the fix.

Re: RoM bot

Posted: Wed May 27, 2009 10:05 am
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?

Re: RoM bot

Posted: Wed May 27, 2009 10:35 am
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.

Re: RoM bot

Posted: Wed May 27, 2009 5:42 pm
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.

Re: RoM bot

Posted: Wed May 27, 2009 6:17 pm
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

Re: RoM bot

Posted: Wed May 27, 2009 6:33 pm
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.

Re: RoM bot

Posted: Wed May 27, 2009 7:23 pm
by danked_247
I shouldn't have to. I've never touched that file. Everything seems to be correct inside it.

Re: RoM bot

Posted: Wed May 27, 2009 8:56 pm
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.

Re: RoM bot

Posted: Thu May 28, 2009 1:14 pm
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?

Re: RoM bot

Posted: Thu May 28, 2009 1:36 pm
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.

Re: RoM bot

Posted: Thu May 28, 2009 1:48 pm
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