MikZ 5 Posted November 5, 2016 Good day Hercules. Requesting a script that will allow @autoattack plugin/command available or can be use in gold room only. Quote Share this post Link to post Share on other sites
1 Dastgir 1246 Posted November 8, 2016 ACMD(autoattack) { if (sd->bl.m != map->mapname2mapid("gold_room_map_name")) { clif->message(fd, "AutoAttack cannot be used on this map."); return false; } if (sd->sc.option & OPTION_AUTOATTACK) { sd->sc.option &= ~OPTION_AUTOATTACK; unit->stop_attack(&sd->bl); clif->message(fd, "Auto Attack OFF"); } else { sd->sc.option |= OPTION_AUTOATTACK; timer->add(timer->gettick()+200, autoattack_timer, sd->bl.id, 0); clif->message(fd, "Auto Attack ON"); } clif->changeoption(&sd->bl); return true; } 1 MikZ reacted to this Quote Share this post Link to post Share on other sites
0 MikZ 5 Posted November 6, 2016 care to help?Thank you! Quote Share this post Link to post Share on other sites
0 Nihad 24 Posted November 8, 2016 I assume you are using the plugin from here: https://github.com/dastgir/HPM-Plugins/tree/master/src/plugins Without needing to modify the plugin you could add a simple bindatcmd npc *bindatcmd("command", "<NPC object name>::<event label>"{, <group level>, <group level char>, <log>}) You can find more info in doc/script_commands.txt then when the player does @autoattack check their map using getmapxy. Then do an if statement checking if the map is the one you specified, if not then just end the script, if so then allow them to run the command using *atcommand("<command>") Otherwise someone who feels comfortable can offer advice how to modify the plugin, I am not confident enough to give that advice. Quote Share this post Link to post Share on other sites
0 Nihad 24 Posted November 8, 2016 Well there ya go Quote Share this post Link to post Share on other sites
0 MikZ 5 Posted November 16, 2016 thanks Dastgir! Quote Share this post Link to post Share on other sites
0 Chatterboy 8 Posted July 5, 2020 No new update for this? i download it i got error autoattack.c: In function ‘autoattack_motion’: autoattack.c:65:7: error: ‘struct unit_interface’ has no member named ‘walktoxy’ 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); Quote Share this post Link to post Share on other sites
0 Caspian 23 Posted July 9, 2020 Change walktoxy to walk_toxy. Quote Share this post Link to post Share on other sites
0 Coookie 1 Posted July 9, 2020 On 7/6/2020 at 1:42 AM, Chatterboy said: No new update for this? i download it i got error autoattack.c: In function ‘autoattack_motion’: autoattack.c:65:7: error: ‘struct unit_interface’ has no member named ‘walktoxy’ 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); autoattack.c: In function ‘autoattack_motion’: autoattack.c:65:7: error: ‘struct unit_interface’ has no member named ‘walktoxy’ 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); No more update on this one the only autoattack successfuly rebuilt is from levRO. Quote Share this post Link to post Share on other sites
Good day Hercules.
Requesting a script that will allow @autoattack plugin/command available or can be use in gold room only.
Share this post
Link to post
Share on other sites