Jump to content
Eternal Lands Official Forums
ShadowX

GuardBot

Recommended Posts

Hey,

I was wondering, is it legal(not against ToS) to have something along the lines of an Ant Bot that follows you around?

It would not have to attack, just like an Ant bot basically...

Would this be allowed? ( yes i know, i have to get approval aswell ).

 

 

Thanks,

Leo

Share this post


Link to post
Share on other sites

http://www.eternal-lands.com/forum/index.php?showtopic=30163

 

*If it still exists*, you may wish to consider Learner's rent-an-ant service, so you have no possible way of breaking the game bot rules.

 

I remember when Ant_Slayton followed me every time I went on Isla Prima, it was very disconcerting, I thought I was imagining it at first until I was told I was being used as a Lab Rat (right there LabRat was entered into my subconscious, and not long after into the game itself)

Share this post


Link to post
Share on other sites

Thanks.

Also i was hopeing that you coud give me a hand,

Im using Jelc as a base to build my bot on,

And i was wondering if there is any way to detect the coordinate of a player?

 

Thanks,

Leo

Share this post


Link to post
Share on other sites

The player co-ordinates are sent by the server when the player comes in range. After that you need to keep the position updated whenever the server sends a move command for that character.

 

See the client source.

Share this post


Link to post
Share on other sites

From the EL client:

void add_command_to_actor(int actor_id, char command)
{
//int i=0;
int k=0;
//int have_actor=0;
//if ((actor_id==yourself)&&(command==enter_combat)) LOG_TO_CONSOLE(c_green2,"FIGHT!");
actor * act;
#ifdef EXTRA_DEBUG
ERR();
#endif
act= get_actor_ptr_from_id(actor_id);

if(!act){
	//Resync
	//if we got here, it means we don't have this actor, so get it from the server...
	LOG_ERROR("%s %d - %d\n", cant_add_command, command, actor_id);
} else {
	LOCK_ACTORS_LISTS();

	if(command==leave_combat||command==enter_combat||command==die1||command==die2){
		int j= 0;

		//Strip the queue for attack messages
		for(k=0; k<MAX_CMD_QUEUE; k++){
			switch(act->que[k]){
				case pain1:
				case pain2:
				case attack_up_1:
				case attack_up_2:
				case attack_up_3:
				case attack_up_4:
				case attack_down_1:
				case attack_down_2:
					act->que[k]= nothing;
					break;

				default:
					act->que[j]= act->que[k];
					j++;
					if(j<=k){
						act->que[k]= nothing;
					}
					break;
			}
		}

		if(act->last_command == nothing){
			//We may be on idle, update the actor so we can reduce the rendering lag
			CalModel_Update(act->calmodel, 5.0f);
		}
	}

	for(k=0;k<MAX_CMD_QUEUE;k++){
		if(act->que[k]==nothing){
			//if we are SEVERLY behind, just update all the actors in range
			if(k>MAX_CMD_QUEUE-2) break;
			else if(k>MAX_CMD_QUEUE-8){
				// is the front a sit/stand spam?
				if((act->que[0]==stand_up||act->que[0]==sit_down)
				   &&(act->que[1]==stand_up||act->que[1]==sit_down)){
					int j;
					//move que down with one command
					for(j=0;j<=k;j++){
						act->que[j]=act->que[j+1];
					}
					act->que[j]=nothing;
					//backup one entry
					k--;
				}

				// is the end a sit/stand spam?
				else if((command==stand_up||command==sit_down)
					 && (act->que[k-1]==stand_up||act->que[k-1]==sit_down)) {
					act->que[k-1]=command;
					break;
				}

			}

			act->que[k]=command;
			break;
		}
	}

#ifdef COUNTERS
	switch(command) {
	case enter_combat:
		act->async_fighting= 1;
		break;
	case leave_combat:
		act->async_fighting= 0;
		break;
	case move_n:
	case run_n:
		act->async_y_tile_pos++;
		act->async_z_rot= 0;
		break;
	case move_ne:
	case run_ne:
		act->async_x_tile_pos++;
		act->async_y_tile_pos++;
		act->async_z_rot= 45;
		break;
	case move_e:
	case run_e:
		act->async_x_tile_pos++;
		act->async_z_rot= 90;
		break;
	case move_se:
	case run_se:
		act->async_x_tile_pos++;
		act->async_y_tile_pos--;
		act->async_z_rot= 135;
		break;
	case move_s:
	case run_s:
		act->async_y_tile_pos--;
		act->async_z_rot= 180;
		break;
	case move_sw:
	case run_sw:
		act->async_x_tile_pos--;
		act->async_y_tile_pos--;
		act->async_z_rot= 225;
		break;
	case move_w:
	case run_w:
		act->async_x_tile_pos--;
		act->async_z_rot= 270;
		break;
	case move_nw:
	case run_nw:
		act->async_x_tile_pos--;
		act->async_y_tile_pos++;
		act->async_z_rot= 315;
		break;
	case turn_n:
	case turn_ne:
	case turn_e:
	case turn_se:
	case turn_s:
	case turn_sw:
	case turn_w:
	case turn_nw:
		 act->async_z_rot= (command-turn_n)*45;
		 break;
	}
#endif

	UNLOCK_ACTORS_LISTS();

	if(k>MAX_CMD_QUEUE-2){
		update_all_actors();
	}
}
}

Basically, once you get the add_actor or add_enhanced_actor, whenever an actor moves the server sends the actor ID and the movement (eg move_nw). It is just a case of adding or subtracting the north/south and east/west direction from the player's current location.

 

In java I don't have a clue, but it really is incredibly straightforward:

 

This is a *very* cut down example:

 

Server>Client:

Add new enhanced actor, ID 1533, name somename, x is 102, y is 313, wearing clothes.

 

Server>Client:

Add actor command, ID 1533, move southeast

 

so what we have to do is deduct 1 from Y (direction south), y is now 312 and add 1 to X (direction east), x is now 103.

 

Hope my (extremely cut down) example helps.

North: y=y+1

South: y=y-1

East: x=x+1

West: x=x-1

North East: y=y+1, x=x+1

South East: y=y-1, x=x+1

North West: y=y+1, x=x-1

South West: y=y-1, x=x-1

(I think :))

Share this post


Link to post
Share on other sites

Nah couldnt make anything of it, I might just try to rent-an-ant

BTW labrat, if you know any PHP codeing I'd like to attempt to recover k.bot with you,

and try to make a fully working bot out of it

BTW i'm really good at PHP ive been making websites for years with PHP+Photoshop

Edited by ShadowX

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×