Jump to content
  • 0
Mr SumBaXs Gamin

Can I Get Script @Autoattack For Rathena Latest Version 2020???


4 answers to this question

Recommended Posts

  • 0


On 4/22/2021 at 4:10 AM, hmwater001 said:

why when i type @autoattack its said unknown command?

@autoattack is custom source. its not included in the latest git.

Link to comment
Share on other sites

  • 0


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;
    ++struct autoattack_delay;  // autoattack timer
    //NOTE: When deciding to add a flag to state or special_state, take into consideration that state is preserved in
    //status_calc_pc, while special_state is recalculated in each call. [Skotlex]
    struct s_state {
        unsigned int active : 1; //Marks active player (not active is logging in/out, or changing map servers)
        unsigned int menu_or_input : 1;// if a script is waiting for feedback from the player
        unsigned int dead_sit : 2;
        unsigned int lr_flag : 3;//1: left h. weapon; 2: arrow

        unsigned int lesseffect : 1;
        unsigned int vending : 1;
        unsigned int noks : 3; // [Zeph Kill Steal Protection]
        ++unsigned autoattack : 1; // Keitenai
        unsigned int changemap : 1;
        unsigned int callshop : 1; // flag to indicate that a script used callshop; on a shop
    int invincible_timer;
    t_tick canlog_tick;
    t_tick canuseitem_tick;    // [Skotlex]
    t_tick canusecashfood_tick;
    t_tick canequip_tick;    // [Inkfish]
    t_tick cantalk_tick;
    t_tick canskill_tick; // used to prevent abuse from no-delay ACT files
    t_tick cansendmail_tick; // [Mail System Flood Protection]
    t_tick ks_floodprotect_tick; // [Kill Steal Protection]
    ++t_tick autoattack_delay;    // Keitenai
    t_tick equipswitch_tick; // Equip switch


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

        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 && !pc_isdead(sd) && sd->state.autoattack){

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

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

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

    nullpo_retr(-1, sd);
    if (sd->state.autoattack)
        sd->state.autoattack = 0;
        clif_displaymessage(fd, "Auto Attack has been deactivated.");
        sd->state.autoattack = 1;
        clif_displaymessage(fd, "Auto Attack activated.");
    return 0;

I already to the src modification and recompile the server.

But the result same as mention. unknown commands. maybe there are some step i missing?

Link to comment
Share on other sites

  • 0

You forgot to add this at atcommand.cpp

     AtCommandInfo atcommand_base[] = {
+        ACMD_DEF(autoattack),

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.

Answer this question...

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.