gCLI command to ENABLE auto-attack?

Question: Is there a gCLI command to select my Auto-Attack option (either to a "if you get the jump" skill, or to a Combat Macro)?


So, when I use a Spooky Putty monster, mafia disables my auto-attack. While I understand why this is happening (the use of any item that would cause an adventure to be used triggers mafia to disable your auto-attack, primarily for the purpose of saving a puttied monster from a one-hit kill), since I write my Combat Macros to deal with re-puttying, I have to manually use a Spooky Putty monster from the browser and then manually select my Combat Macro, and then reset my Auto-Attack option to use my Combat Macro. Sure, it's not the end of the world, but it's a pain.

So, to speed things up, I wrote a CCS to deal with the re-puttying (so I can use the gCLI command "use 5 spooky monster" instead of manually adventuring), but I'm still stuck with manually using the browser to reset my Combat Macro, since I've been completely unsuccessful at finding any gCLI command by which to do so.

Also, I can't find any (useful) documentation on defaultAutoAttack and setAutoAttack. And regardless of their values, they don't seem to actually have any impact impact anyway…
 

charon the hand

New member
Use the mini-browser to go to your account page and enable your autoattack from there. When the page loads, copy the url and paste it into the gCLI any time to set it after it was un-set. The url will look something like this except the whichattack number will be different. Alternately, if you know the skill number you want, just put it in this example, copy/paste and you're done.
Code:
 account.php?pwd&action=autoattack&whichattack=997912
 

slyz

Developer
Or you can use the autoattack CLI command, although you can't set it to a combat macro. You can use any combat skill, or the corresponding skill number (it has to be between 1000 and 7000):
Code:
> autoattack attack

Changing auto-attack: attack with weapon

> autoattack 2005

Changing auto-attack: shieldbutt

> autoattack entangling noodles

Changing auto-attack: entangling noodles

> autoattack disabled

Changing auto-attack: disabled

I didn't figure out how you could tell Mafia to set the autoattack to Pick Pocket, so you would have to use visit_url() too I guess.
 
I haven't had any problem with auto-attack since I stopped using it. :D
Wait, let me explain. In the Main Interface, Adventure tab, I always have Action set to "custom combat script." And this is my default CCS:
[ default ]
1: special action
2: try to steal an item
3: attack with weapon
[ empty suit of armor ]
1: skill disco face stab
2: attack with weapon

(I hate the empty suit of armor, and used to spend a lot more time leveling up in the Haunted Gallery than I do now. I included "special action" after a while because I use my Transcendent Olfaction with the auto-olfact function.)

The reason I switched to always-CCS was that I was really tired of KoLmafia changing, disabling, and enabling my auto-attack. I think that was maybe 2 years ago.
 

Sighy Pog

New member
I figured out a work around:

Code:
chat_clan(" /aa pick");
As a CLI command of course:
Code:
ash chat_clan(" /aa pick");

Sets autoattack to pick pocket. Also works with combat macro names. The ' ' between " and /aa is essential.
 
Code:
ash chat_clan(" /aa pick");

Does the same workaround allow one to talk into a different channel? If so I'd predict that this workaround will be fixed soon, since that's something the developers seem to want us not to be able to do.

EDIT: that's a yes. It does indeed.
 

lostcalpolydude

Developer
Staff member
My fix was to change mafia so it doesn't change my auto-attack, because being unable to rely on KoL settings is unacceptable I think. I'll have to code up a proper fix with an associated preference and post it.
 

Sighy Pog

New member
I wrote many KOL combat macros before using Mafia, and I really like being able to set and use these with Mafia, too. This includes switching the combat macros while running an ASH script.
 

Grotfang

Developer
Does the same workaround allow one to talk into a different channel? If so I'd predict that this workaround will be fixed soon, since that's something the developers seem to want us not to be able to do.

EDIT: that's a yes. It does indeed.

I am looking into this now. Do not depend on that earlier chat_clan suggestion.

r8922
 
Last edited:

Veracity

Developer
Staff member
My fix was to change mafia so it doesn't change my auto-attack, because being unable to rely on KoL settings is unacceptable I think. I'll have to code up a proper fix with an associated preference and post it.
Please do. This is a repeated cause of confusion, anguish, and grief, and it'd be nice to stop that - with somebody else's work. Yours. Thanks. ;)
 

holatuwol

Developer
I can remove it tomorrow night (I've got a commit queued up which removes most of the auto-attack switching, but retains the auto-attack removal in the tower guardian and shadow fights and keeps the auto-attack switching to Entangling Noodles enabled if you have 'autoEntangle" set to true ... I didn't see any where else where that preference was used, so I figured that's where it needed to be), if you don't get around to it first.

... Actually, I'd prefer you don't get around to it first because I don't want to figure out how to merge code I haven't seen in a long time. ^_~
 
Last edited:

Sighy Pog

New member
I don't really get what you guys are talking about. Is the consensus that KOL combat macros are bad and you want to prevent Mafia users from utilizing them? If that's the case then I wish I had never posted here.

Or does a ASH function exist which can set auto-attack to a combat macro? If so, then I haven't found it yet.
 
Last edited:

holatuwol

Developer
No, it's a consensus about removing functionality added a few years ago where KoLmafia automatically changed your auto attack when you had something other than CCS specified.
 

lostcalpolydude

Developer
Staff member
Auto-attack doesn't need to be turned off for fighting tower guardians and the shadow. Like all bosses, KoL ignores your auto-attack for those combats while leaving it set.

I had finished up some code a few days ago right before leaving for a trip (which I'm still on), it looks like I can probably throw it all out.
 

Theraze

Active member
Sighy, you should be able to use the new chat_macro( string ) command to do what you were doing with your " /aa" before. The point isn't that we want to take away your functionality... it's that doing it that way was a bug. Now you should be able to properly set your autoattack and not have mafia keep changing it away from what you wanted.
 

lostcalpolydude

Developer
Staff member
If the code you worked on gave the choice between the old behavior and a "Mafia never changes your auto-attack" option, don't throw it away just yet please ^^

I created a preference for it, then created a 2-parameter version of both setAutoAttack functions so that the CLI command could do something even if auto-attack changing was turned off. I also had some weird code to skip skill-checking in the function if you used a large number so that you could set a combat macro, but it was only useful if you viewed the page source first to figure out the number for that attack. I didn't have a chance to make sure it works, I only got as far as making sure it compiles.

Even if the functionality gets re-added, it probably makes more sense to work from the current code and reference 8930 for places to re-add the function call.
 
Top