Spam attack and save servers

zarqon

Well-known member
I think a common case in CCS's is

Code:
1: consult script.ash
2: attack

Due to the "consult" in the first line, mafia is unable to auto-macrofy, even if the consult script does nothing. So, for these cases, I recommend changing that to

Code:
1: consult script.ash
2: consult spamattack.ash

It's the simplest thing ever -- it simply submits a macro that spams attack over and over. But it definitely speeds things along and is therefore an improvement over the previous!

Just thought I'd share this in the interest of saving server hits.
 

Attachments

  • spamattack.ash
    230 bytes · Views: 254

Rinn

Developer
Mafia should be able to figure out if the remaining commands in a ccs don't contain a script, and just send a macro for them at that point.
 

zarqon

Well-known member
My consult scripts at least are modular -- one handles initial actions, another handles stasis if it's appropriate. If I made FTF send this macro afterwards I'm fairly sure there would be a spate of enraged comments.

Rinn: agreed, that would be a nice feature.
 

Bale

Minion
PHP:
buffer spamact(string whattodo) {
   return visit_url("fight.php?action=macro&macrotext=mark mafiafinal\n"+whattodo+"\ngoto mafiafinal");
}

Minor criticism. To improve legibility and shorten the script by two characters, you can end a line in a macro with a semi-colon. Like this:

PHP:
buffer spamact(string whattodo) {
   return visit_url("fight.php?action=macro&macrotext=mark mafiafinal;"+whattodo+";goto mafiafinal");
}
 

zarqon

Well-known member
Haha, I just ganked the macro code straight from mafia's output when it auto-macrofies. I still haven't actually done more than peruse KoL's macro documentation. Thanks for chipping in. :)
 
Last edited:

Fluxxdog

Active member
I take it this is part of your work on your consult script suite? Already using it and it's working wonderfully ^^
 

Theraze

Active member
Yeah, used this last night and it was significantly faster on the weapon attacks. Thanks! :)
 

Winterbay

Active member
I've poked around a bit in my version of this and made it cast spells if you are a myst class. It generates a macro of up to 7 spells (entangling noodles, 5 dynamically generated spells followed by spaghetti spear or salsaballs depending on class) and executes that. It also makes sure that you have enough MP when you start casting for the planned spells. It does not take advantage of sauce synergy and the handling of elemental spell bonuses could be better, but since unless you tune your spells they are randomly choosen it's a bit more work than I have time for atm to fix.
 

xKiv

Active member
but since unless you tune your spells they are randomly choosen

At least pasta spells are never randomly the wrong element (unless the only correct element is physical, iirc).
And sauce spells don't tune with flavour anyway.
 

shazbot

Member
@Winterbay Whenever I run your spamattack as run_combat, I get the following
Code:
Expected ), found , (spamattack.ash, line 132)

Which leads me to wonder if it's actually working (I don't see any combat messages, but that may be an effect of running server side macros).
 

Winterbay

Active member
@Winterbay Whenever I run your spamattack as run_combat, I get the following
Code:
Expected ), found , (spamattack.ash, line 132)

Which leads me to wonder if it's actually working (I don't see any combat messages, but that may be an effect of running server side macros).

As Theraze said I've made some improvements to it since then. This is the current version and requires BatBrain to work. I should take a look at the new functions in batbrain as well but won't have time for a week or so, but this one seems to be working just fine at least, I've been running it myself for the last ascencion.
 

Theraze

Active member
Has there been any work on tweaking this? I've been playing with my own copy today to try to make it consider all of my skills, and it seems to be working, but if there's better out there... I have tweaked my will_attack to both consider how many rounds at left (30-initround) as well as trying to make it consider hitchance, which is why it decided to 3-hit them in the following quote, where it decided to 3-hit a bee. And succeeded in its goal.
[1794] Haunted Gallery
Encounter: Queen Bee
Strategy: ccs\default.ccs [default]
Round 0: Theraze wins initiative!
Monster value: 312.5
You will die in 8 rounds.
Your attack will kill the monster in 3 rounds.
Profit per round: Action Profit Damage Other base; Cuddlefish (0µ) 0µ -- 33.75% stun chance
SpamAttack: Monster HP is 134.0
SpamAttack: We are going to 3-shot with Lunging Thrust-Smack, Lunging Thrust-Smack and Clobber.
Round 1: Theraze executes a macro!
Round 1: Theraze casts LUNGING THRUST-SMACK!
Round 2: queen bee takes 50 damage.
Round 2: queen bee takes 2 damage.
You gain 4 hit points
Round 2: Grorg gives your opponent a biiiiiig hug, preventing her from attacking you.
Round 2: Theraze casts LUNGING THRUST-SMACK!
Round 3: queen bee takes 68 damage.
Round 3: queen bee takes 3 damage.
You gain 6 hit points
Round 3: queen bee takes 2 damage.
You lose 44 hit points
Round 3: Theraze casts CLOBBER!
Round 4: queen bee takes 10 damage.
Round 4: Theraze wins the fight!
You gain 17 Strongness
You gain 5 Wizardliness
You gain 10 Chutzpah

I did initially have to comment out sub_hp_restore because it errors out if you don't have any restore options, but think it's fixed up. This is still a work in progress, but... happy to implement any good tweaks to make it more flexible.
 

Attachments

  • spamattack.ash
    17.4 KB · Views: 106

Winterbay

Active member
My current version - attached - (which still doesn't do anything useful for muscle or moxie classes or even take their skills into account) is working very nicely. The latest improvement was to make sure that if it there is a cheaper way of killing the monster then it does that (I mean just becasue I can one shot the monster with a saucegeyser at level 3 doesn't mean that it's a good idea when 5 salsaballs does the trick...).

It also still isn't using the full predictive abilities of batbrain but it's moving closer to that...

Edit: Also, yeah the restore sub is wonky and in the attached version it doesn't really do anything even though the code is there. I might take a look at yours to see what it does :)
 
Last edited:

Theraze

Active member
Just a quick note... it still has legacy Bees Hate You code. You can probably save a bunch of meat by removing that. Unless you really love overkilling, in which case it's fine. :D
 

Winterbay

Active member
I just ran into a bee that batbrain considered to have a HP of 175. At level 2. Somehow its HP got set to 5 with my ML set to 5 which lead Batbrain to see "monster_hp() == monster_level_adjustment()" and adding 170. Setting ML to 0 after the fight gave a HP of 2 and resetting it to 5 gave a HP of 6 so I have no idea how that happened...
 

Theraze

Active member
It's the part in BatBrain where it does this sort of thing:
Code:
   if (m == $monster[none] || monster_attack(m) == 0 || monster_attack(m) == monster_level_adjustment())
If attack/defense/hp is ever set to the same as MCD, it decides that it must be because it's unknown, not because it's a scaling mob or whatever else might be causing it. Attack of 0 or attack of MCD, both mean the monster is unknown.

Problem is that defense should be calculated at ceil(MCD*.9) and hp should be done as ceil(MCD*.75) as the unknowns, since those are the standard modifications... That being said, I believe in the case of truly unknown monsters, the stats stay at 0 despite MCD. As is evidenced here:
> current_mcd

Returned: 10

> monster_attack dirty old

Returned: 0
Guess I should report that as a BatBrain bug for next update, eh? Though I should test it in battle as well as outside...

Yep, swarm of ghuol whelps:
> current_mcd

Returned: 10

> monster_attack

Returned: 0
 
Last edited:

Winterbay

Active member
Yes, I know the reason. The interesting thing is that despite that the monster should have (according to Mafia when prompted outside of battle) 2 and 6 HP at 0 and 5 MCD respectively it said 5 in battle which is odd.
But yes, since unkowns are now set to 0 and doesn't scale with ML we can (hopefully) safely assume that everything that isn't spaded will stay at 0 and remove that second check.
 
Top