Jump to content

@AutoAttack


goddameit

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  06/24/18
  • Last Seen:  

Hi! I'm new to this kind of stuff. How do i install this?

I have no programming background, sorry.

can you give me a step-by-step instruction?

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  6
  • Reputation:   0
  • Joined:  02/07/18
  • Last Seen:  

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  09/08/18
  • Last Seen:  

I use Git to install but pop up error message with "The patch does not apply cleanly to D:/.......... and no version information is given. patching is not possible"

any one can help me on this?

Thanks

 

Link to comment
Share on other sites

  • 11 months later...

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   6
  • Joined:  07/01/12
  • Last Seen:  

It can kill the bots, why not let it kill monster in entire map? using @autoloot 

it will be very good!

 

is it possible?

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

How to apply this into newest rAthena?

 

I got this issue when trying to manually implement it:

atcommand.cpp: In function 'int autoattack_timer(int, unsigned int, int, intptr_t)':
atcommand.cpp:9270:28: error: invalid conversion from 'int (*)(int, unsigned int, int, intptr_t)' {aka  int (*)(int, unsigned int, int, long int)'} to 'TimerFunc' {aka 'int (*)(int, long int, int, long int)'} [-fpermissive]
   add_timer(gettick()+2000,autoattack_timer,sd->bl.id,0);
                            ^~~~~~~~~~~~~~~~
In file included from ../common/mmo.hpp:13,
                 from atcommand.hpp:8,
                 from atcommand.cpp:4:
../common/timer.hpp:54:38: note:   initializing argument 2 of 'int add_timer(t_tick, TimerFunc, int, intptr_t)'
 int add_timer(t_tick tick, TimerFunc func, int id, intptr_t data);


Any idea how can it be implemented in latest rAthena?

Link to comment
Share on other sites

  • 5 weeks later...

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  30
  • Reputation:   1
  • Joined:  03/18/15
  • Last Seen:  

On 10/28/2019 at 4:55 AM, OscarScorp said:

I got this issue when trying to manually implement it:


atcommand.cpp: In function 'int autoattack_timer(int, unsigned int, int, intptr_t)':
atcommand.cpp:9270:28: error: invalid conversion from 'int (*)(int, unsigned int, int, intptr_t)' {aka  int (*)(int, unsigned int, int, long int)'} to 'TimerFunc' {aka 'int (*)(int, long int, int, long int)'} [-fpermissive]
   add_timer(gettick()+2000,autoattack_timer,sd->bl.id,0);
                            ^~~~~~~~~~~~~~~~
In file included from ../common/mmo.hpp:13,
                 from atcommand.hpp:8,
                 from atcommand.cpp:4:
../common/timer.hpp:54:38: note:   initializing argument 2 of 'int add_timer(t_tick, TimerFunc, int, intptr_t)'
 int add_timer(t_tick tick, TimerFunc func, int id, intptr_t data);


Any idea how can it be implemented in latest rAthena?

I think it is not possible to latest revision nomore update to this post since 2013

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

On 10/28/2019 at 3:55 AM, OscarScorp said:

I got this issue when trying to manually implement it:


atcommand.cpp: In function 'int autoattack_timer(int, unsigned int, int, intptr_t)':
atcommand.cpp:9270:28: error: invalid conversion from 'int (*)(int, unsigned int, int, intptr_t)' {aka  int (*)(int, unsigned int, int, long int)'} to 'TimerFunc' {aka 'int (*)(int, long int, int, long int)'} [-fpermissive]
   add_timer(gettick()+2000,autoattack_timer,sd->bl.id,0);
                            ^~~~~~~~~~~~~~~~
In file included from ../common/mmo.hpp:13,
                 from atcommand.hpp:8,
                 from atcommand.cpp:4:
../common/timer.hpp:54:38: note:   initializing argument 2 of 'int add_timer(t_tick, TimerFunc, int, intptr_t)'
 int add_timer(t_tick tick, TimerFunc func, int id, intptr_t data);


Any idea how can it be implemented in latest rAthena?

Quote

// Auto Attack --- put before all command
static int buildin_autoattack_sub(struct block_list *bl,va_list ap)
{
    int *target_id=va_arg(ap,int *);
    *target_id = bl->id;
    return 1;
}
 
void autoattack_motion(struct map_session_data* sd)
{
    int i, target_id;
    if( pc_isdead(sd) || !sd->state.autoattack ) return;

    for(i=0;i<=9;i++)
    {
        target_id=0;
        map_foreachinarea(buildin_autoattack_sub, sd->bl.m, sd->bl.x-i, sd->bl.y-i, sd->bl.x+i, sd->bl.y+i, BL_MOB, &target_id);
        if(target_id){
            unit_attack(&sd->bl,target_id,1);
            break;
        }
        target_id=0;
    }
    if(!target_id && !pc_isdead(sd) && sd->state.autoattack){
        unit_walktoxy(&sd->bl,sd->bl.x+(rand()%2==0?-1:1)*(rand()%25),sd->bl.y+(rand()%2==0?-1:1)*(rand()%25),0);
    }
    return;
}

static TIMER_FUNC(autoattack_timer)
{
    struct map_session_data *sd=NULL;

    sd=map_id2sd(id);
    if(sd==NULL || pc_isdead(sd) || !sd->state.autoattack )
        return 0;

    if(sd->state.autoattack)
    {
        unit_stop_attack(&sd->bl);
        autoattack_motion(sd);
        if(DIFF_TICK(sd->autoattack_delay,gettick())> 0){
            clif_authfail_fd(sd->fd, 15);
            return 0;
        }
        else{
            add_timer(gettick()+1000,autoattack_timer,sd->bl.id,0);    // 1000 is delay
            sd->autoattack_delay = gettick() + 1000;    // 1000 is delay
        }
    }
    return 0;
}

ACMD_FUNC(autoattack)
{
    nullpo_retr(-1, sd);
    if (sd->state.autoattack)
    {
        sd->state.autoattack = 0;
        unit_stop_attack(&sd->bl);
        clif_displaymessage(fd, "Auto Attack has been deactivated.");
    }
    else
    {
        sd->state.autoattack = 1;
        add_timer(gettick()+1000,autoattack_timer,sd->bl.id,0);
        clif_displaymessage(fd, "Auto Attack activated.");
    }
    return 0;
}

try this

  • MVP 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

On 11/1/2019 at 6:14 PM, LearningRO said:

try this

Thank you @LearningRO ! It works!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  5
  • Reputation:   1
  • Joined:  05/28/17
  • Last Seen:  

nice dont forget to put in the variables in the pc.hpp -> struct map_session_data

 

struct map_session_data {
	struct block_list bl;
	struct unit_data ud;
	struct view_data vd;
	struct status_data base_status, battle_status;
	struct status_change sc;
	struct regen_data regen;
	struct regen_data_sub sregen, ssregen;
	unsigned int autoattack_delay;  // autoattack timer
		unsigned int killable : 1;
		unsigned int doridori : 1;
		unsigned int ignoreAll : 1;
		unsigned int autoattack : 1; // autoattack
		unsigned int debug_remove_map : 1; // temporary state to track double remove_map's [FlavioJS]
		unsigned int buyingstore : 1;
		unsigned int lesseffect : 1;
		unsigned int vending : 1;

 

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  01/20/20
  • Last Seen:  

where i should put this ?? 

 

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  03/13/20
  • Last Seen:  

 

Compile Error 

 

rAthena update new

 

 

Request a solution urgently

error.png

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   12
  • Joined:  03/18/20
  • Last Seen:  

still works on latest revision? 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

Hello, back to this old post again.
Now I seek to make it so users are able to autoattack a specific monster ID, as JulianChz suggested:

On 5/22/2017 at 8:24 AM, JuLiAnChz said:

 


static int buildin_autoattack_sub(struct block_list *bl, va_list ap) {
	int *target_id = va_arg(ap, int *);
	*target_id = bl->id;
	struct mob_data* *md2 = va_arg(ap, struct mob_data* *);
	*md2 = BL_CAST(BL_MOB, bl);
	return 1;
}

void autoattack_motion(struct map_session_data* sd, int mob_id){
	int i, target_id;
	struct mob_data* md2;
	
	for (i = 0;i <= 9;i++) {
		target_id = 0;
		map_foreachinarea(buildin_autoattack_sub, sd->bl.m, sd->bl.x - i, sd->bl.y - i, sd->bl.x + i, sd->bl.y + i, BL_MOB, &target_id, &md2);
		if (target_id) {
			if (mob_id != 0 && mob_id == md2->mob_id) {
				unit_attack(&sd->bl, target_id, 1);
			} else if (mob_id == 0) {
				unit_attack(&sd->bl, target_id, 1);
			} else {
				target_id = 0;
			}
			break;
		}
		target_id = 0;
	}
	if (!target_id) {
		unit_walktoxy(&sd->bl, sd->bl.x + (rand() % 2 == 0 ? -1 : 1)*(rand() % 10), sd->bl.y + (rand() % 2 == 0 ? -1 : 1)*(rand() % 10), 0);
	}
	return;
}

int autoattack_timer(int tid, unsigned int tick, int id, intptr_t data) {
	struct map_session_data *sd = NULL;
	int mob_id = (int *)data;
	sd = map_id2sd(id);

	if (sd == NULL)
		return 0;
	if (sd->sc.option & OPTION_AUTOATTACK) {
		autoattack_motion(sd, mob_id);
		add_timer(gettick() + 1000, autoattack_timer, sd->bl.id, (intptr_t)mob_id);
	}
	return 0;
}
ACMD_FUNC(autoattack) {
	nullpo_retr(-1, sd);
	int mob_id = 0;
	char monster[NAME_LENGTH];

	memset(monster, '\0', sizeof(monster));
	
	if (message || *message) {
		if (sscanf(message, "%23s", monster) > 0) {
			if ((mob_id = mobdb_searchname(monster)) == 0)
				mob_id = mobdb_checkid(atoi(monster));
			
			if (mob_id == 0) {
				clif_displaymessage(fd, msg_txt(sd, 40)); // Invalid monster ID or name.
				return -1;
			}
		}
	}

	if (sd->sc.option & OPTION_AUTOATTACK) {
		sd->sc.option &= ~OPTION_AUTOATTACK;
		unit_stop_attack(&sd->bl);
		clif_displaymessage(fd, "Has desactivado AutoAtaque");
	} else {
		sd->sc.option |= OPTION_AUTOATTACK;
		add_timer(gettick() + 200, autoattack_timer, sd->bl.id, (intptr_t)mob_id);
		clif_displaymessage(fd, "Has Activado AutoAtaque");
	}
	clif_changeoption(&sd->bl);
	return 0;
}

@autoattack - All
@autoattack poring - Only poring
@autoattack 1002 - Only poring

Problem is I can't make it work due to two different lines. My basic autoattack command (without specific mob ID) works like:

static TIMER_FUNC(autoattack_timer)
{
	struct map_session_data *sd=NULL;
	int mob_id = data;
	sd=map_id2sd(id);
	...

while Julian's is:

int autoattack_timer(int tid, unsigned int tick, int id, intptr_t data) {
	struct map_session_data *sd = NULL;
	int mob_id = (int *)data;
	sd = map_id2sd(id);
	...

If I change my code to int autoattack_timer(int tid, unsigned int tick, int id, intptr_t data), the code won't run in my rAthena, forcing me to use TIMER_FUNC as LearningRO suggested (works).

Is there any way to obtain the intptr_t data variable through a static TIMER_FUNC ?

Thanks in advance!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   6
  • Joined:  03/12/13
  • Last Seen:  

Hello,

Is there any possibilities for using @autoattack like @autotrade? Players will be logged out but character still on game and doing autoattack.

I've tried to put state.autotrade = 1; but the result was the character didn't walking for monsters. So, is there a code/variable to make the client only logged out but character still on the game?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  05/04/20
  • Last Seen:  

hello is there a step by step guide for this?

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.02
  • Content Count:  67
  • Reputation:   0
  • Joined:  10/22/19
  • Last Seen:  

Where put the diff ? help pls :c!!!

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

anyone still have diff autoattack for support latest git?

need it please share

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

2 hours ago, PapaZola said:

anyone still have diff autoattack for support latest git?

need it please share

see my pervious post
heree
 

Link to comment
Share on other sites

  • 5 weeks later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  10/21/13
  • Last Seen:  

On 6/4/2020 at 3:20 PM, LearningRO said:

see my pervious post
heree
 

Hi !  is there a step by step guide for this. PL

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   12
  • Joined:  06/22/13
  • Last Seen:  

On 11/2/2019 at 8:14 AM, LearningRO said:

try this

can this become a script like autopots?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

11 hours ago, zeek said:

can this become a script like autopots?

maybe you can combine it with script autopots search on forum

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  10/21/13
  • Last Seen:  

2 hours ago, LearningRO said:

maybe you can combine it with script autopots search on forum

image.thumb.png.fb216174cfcf89897d3ee05e01d93f56.png

Can't you help my. Pl

 

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   12
  • Joined:  06/22/13
  • Last Seen:  

Is it just me or I get kicked out of the server whenever I hit a wall. No errors on map server.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

any update for 2020 client? iff can anyone still make it know? really help for lowrate server

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  925
  • Reputation:   32
  • Joined:  12/05/11
  • Last Seen:  

On 4/28/2020 at 10:10 PM, Psyche said:

Hello,

Is there any possibilities for using @autoattack like @autotrade? Players will be logged out but character still on game and doing autoattack.

I've tried to put state.autotrade = 1; but the result was the character didn't walking for monsters. So, is there a code/variable to make the client only logged out but character still on the game?

same im looking this 1 also

after using @autoattack and then @afk also not working

the character stop attacking and walking anyone can help? to make char keep attacking and walking

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...