Page 3 of 4
Re: TH Greasemonkey thread 2.0
Posted: Fri Jul 01, 2011 12:25 am
by Cristiona
I was wondering if someone could add "Summon Fortune Cookie" to the existing script that batch-uses *ouch items.
Re: TH Greasemonkey thread 2.0
Posted: Thu Oct 13, 2011 8:43 pm
by seventhcross
Using the new Zillow improved auto-adventure script, I'm trying to code in a use ecto item, then star option.
Problem: each ecto item has a different item number. So when I plug them all in, it willl try to use each one, in order and if I don't have the item, it defaults to attack. Is there a way to get it coded so that it will just skip the item and move on to the next one in the list instead of switching to attack?
Re: TH Greasemonkey thread 2.0
Posted: Fri Oct 14, 2011 6:06 am
by Harry Dresden
I asked the same thing. Zillow said he'd have to adjust the coding when he has time.
Oddly enough, that was one of the good things Heather's old script would do. If you had it coded to use an item you didn't have, it would just bring up the "you're trying to use an item you don't have screen" and move on to the next.
Re: TH Greasemonkey thread 2.0
Posted: Fri Oct 14, 2011 7:04 am
by xKiv
I changed the code for 'I' action to
Code: Select all
nextButton=find('.//input[@type="submit" and contains(@value,"Item")]');
var ffound = false;
for (var fidx = 1; fidx < selectedAction.length && !ffound; fidx++)
{
if (Select_Value_Set_Name('pickwhich',qqq-1,selectedAction[fidx]))
{
ffound = true;
}
}
if(!ffound)
{
nextButton=find('.//input[@type="submit" and contains(@value,"Attack")]');
}
and then the action is 'I
1767
1769:1770'
I also tried to add in an action to 'Q'uit (stop autoattacking, basically by calling shutDown()), but most of the time, one attack still gets through for some reason.
Re: TH Greasemonkey thread 2.0
Posted: Fri Oct 14, 2011 2:45 pm
by seventhcross
Thanks Kiv! that totally fixed my issues!
Re: TH Greasemonkey thread 2.0
Posted: Mon Oct 17, 2011 7:40 am
by Harry Dresden
Where the heck do we put that code in? I'm not seeing the 'I' function anywhere.
Re: TH Greasemonkey thread 2.0
Posted: Mon Oct 17, 2011 10:19 am
by xKiv
It's not a function. It's where the current action (selectedAction[0]) is compared to the string 'I' (that's capital i), near the end of getNextButton.
Re: TH Greasemonkey thread 2.0
Posted: Tue Oct 18, 2011 7:36 am
by Harry Dresden
That didn't work for me at all. It still tries to attack when it's looking for an item that is not in my inventory.
Re: TH Greasemonkey thread 2.0
Posted: Tue Oct 18, 2011 10:08 am
by xKiv
Did you also change your action (to I
1767
1769:1770)?
You *do* have one of the ecto items in your invetory, right?
And you are only trying to use it *once* per combat?
Re: TH Greasemonkey thread 2.0
Posted: Tue Oct 18, 2011 11:59 am
by Harry Dresden
Yes, I have an ecto-item. I added the item numbers to the strategy I use, so that it listed all 5 ecto-items and then my throwing stars, and then finally attacking.
Re: TH Greasemonkey thread 2.0
Posted: Mon Oct 24, 2011 8:42 pm
by Cristiona
Okay, I got it to work. If you're still confused:
Scroll down past all your stratlists and your noncom choices. You'll see a lot of code, one that should pop out is:
Code: Select all
nextButton=find('.//input[@type="submit" and contains(@value,"Tame the Animal")]');
Go a few lines past that until you see:
Code: Select all
nextButton=find('.//input[@type="submit" and contains(@value,"Item")]');
if(!Select_Value_Set_Name('pickwhich',qqq-1,selectedAction[1]))
{
nextButton=find('.//input[@type="submit" and contains(@value,"Attack")]');
}
}
}
return nextButton;
Highlight xKiv's code down to the curly bracket right before the "@value,"Attack"" line, and paste it in. It should look like this when you're done:
Code: Select all
nextButton=find('.//input[@type="submit" and contains(@value,"Item")]');
var ffound = false;
for (var fidx = 1; fidx < selectedAction.length && !ffound; fidx++)
{
if (Select_Value_Set_Name('pickwhich',qqq-1,selectedAction[fidx]))
{
ffound = true;
}
}
if(!ffound)
{
nextButton=find('.//input[@type="submit" and contains(@value,"Attack")]');
}
}
}
return nextButton;
Then, scroll up to the stratList lines to plug in your ecto usage. For mine, I have:
Code: Select all
stratList['Ecto, Star, then Attack To Death'] = 'I:1766:1767:1768:1769:1770:I:881;I:882:A'; //BH, Mag, attack
Works great.
Re: TH Greasemonkey thread 2.0
Posted: Wed Oct 26, 2011 8:16 am
by Harry Dresden
Once I change the "Item" code, the stupid console for the script disappears from the page and I have to switch it back to the normal code for the script to be usable again.
Re: TH Greasemonkey thread 2.0
Posted: Wed Oct 26, 2011 10:40 am
by xKiv
Harry Dresden wrote:Once I change the "Item" code, the stupid console for the script disappears from the page and I have to switch it back to the normal code for the script to be usable again.
You are introducing a syntax error somewhere, probably by ending the cut/paste at the wrong curly brace.
Larger code sample - this is how it looks in my version; at least the first line and 5 last lines (from return nextButton) should be exatly the same as in the original (this means that the last } is the first thing on its line!):
Code: Select all
} else if(selectedAction[0]=='I')
{
nextButton=find('.//input[@type="submit" and contains(@value,"Item")]');
var ffound = false;
for (var fidx = 1; fidx < selectedAction.length && !ffound; fidx++)
{
if (Select_Value_Set_Name('pickwhich',qqq-1,selectedAction[fidx]))
{
ffound = true;
}
}
if(!ffound)
{
nextButton=find('.//input[@type="submit" and contains(@value,"Attack")]');
}
} else if (selectedAction[0]=='Q')
{
return null;
}
}
return nextButton;
}
function Select_Value_Set(SelectName, Value)
{
Re: TH Greasemonkey thread 2.0
Posted: Thu Oct 27, 2011 7:51 am
by Harry Dresden
huh....I could have sworn I was making sure all the syntax was right. It's working now, though, so thanks!
Re: TH Greasemonkey thread 2.0
Posted: Sat Apr 07, 2012 5:03 pm
by zillow
There's a small error with combat in the AA script when it sometimes tries to do an option twice. To fix it, at around line 310 you find: round=((round<=0)?0:round);
replace it with:
if(round < 0)
{
GM_setValue('roundNumber', 0);
round = 0;
}
Re: TH Greasemonkey thread 2.0
Posted: Sat Apr 07, 2012 7:47 pm
by Cristiona
So, in context, it should look like this?
Code: Select all
var round =(GM_getValue('roundNumber', 0)>=strategy.length?strategy.length-1:GM_getValue('roundNumber', 0));
//--round;
if(round < 0)
{
GM_setValue('roundNumber', 0);
round=0;
}
GM_log(round);
var selectedAction = strategy[round].split(':');
Re: TH Greasemonkey thread 2.0
Posted: Sat Apr 07, 2012 7:48 pm
by zillow
Yep
Re: TH Greasemonkey thread 2.0
Posted: Thu May 17, 2012 12:38 pm
by Corrupt Shadow
I updated my AA script and Greasemonkey in an effort to get it fixed, and I lost my portion of the code for an attack strategy of "Firestorm to Death".
Can anyone help me out and tell me what code to put and where to put it?
Thanks in advance!
Re: TH Greasemonkey thread 2.0
Posted: Fri May 18, 2012 8:20 am
by Corrupt Shadow
That's it, mara! Thanks!
Re: TH Greasemonkey thread 2.0
Posted: Sat Nov 10, 2012 2:33 pm
by Isladar
Does anyone have an updated version of the Batch use *ouch items script that includes Professor Ouch's Satchel?
Re: TH Greasemonkey thread 2.0
Posted: Sat Nov 10, 2012 7:30 pm
by Satan
Isladar wrote:Does anyone have an updated version of the Batch use *ouch items script that includes Professor Ouch's Satchel?
I did, but then it broke because greasemonkey had a terrible bug that continually would reset my scripts to older versions. Seems to have cleared up now, but it works out better to do the satchel individually at the moment so I can run it again for level 55 summon items. Anyways, just add ";1926" after the 254 on line 13.
Re: TH Greasemonkey thread 2.0
Posted: Sun Nov 11, 2012 6:28 am
by Isladar
Thanks Satan!
Re: TH Greasemonkey thread 2.0
Posted: Tue Nov 20, 2012 6:50 am
by Patojonas
I was trying to make the
early distant warning script check for a shot blanket, but I couldn't make it return the proper message when the short version is present so, if you just want to add a reminder to that box you just need to add:
Code: Select all
'<span id="blanket"><br />Check your <a href=\"/use.php?filter=instant\">blanket</a>!</span> <br />' +
IN this part of the code, as shown:
Code: Select all
mybox.innerHTML = '<div id="recon_warning_box" style="margin: 0 auto 0 auto; ' +
'width:300px; opacity: .75; filter: alpha(opacity=75); z-index:100; ' +
'margin: 5px; padding: 5px; overflow: hidden; height: auto; ' +
'font-size: 8pt; font-weight: bold; font-family: arial, sans-serif; background-color: #ccffcc; ' +
'color: #000000;"> ' +
'<span id="recycle">Loading Recylzer...</span> <br />' +
'<span id="digitizer">Loading Digitizer...</span> <br/> ' +
'<span id="pouch">Checking For Pouches...</span> <br />' +
'<span id="blanket"><br />Check your <a href=\"/use.php?filter=instant\">blanket</a>!</span> <br />' +
'<span id="computer">Checking For Computers...</span>' +
'</div>';
Re: TH Greasemonkey thread 2.0
Posted: Fri Mar 28, 2014 3:55 pm
by Harry Dresden
Do it a few dozen times, and you'll remember the choice groups so well that even after 4 months you get them right.
Re: TH Greasemonkey thread 2.0
Posted: Fri Mar 28, 2014 8:44 pm
by Cristiona
Yeah, it's easiest to just keep the five groups in mind:
1) Capulets (regardless of gender)
2) Montegues (regardless of gender)
3) Males
4) Females
5) Always wrong choices
Then it's (1 or 2) and (3 or 4). It's also worth keeping in mind that you can figure it out via the first two names: Bassanio is group 3 and Benvolio is group 2. If Bassanio is wrong, pick non-R&J females; otherwise non-R&J males. If Benvolio is wrong, pick Capulets; otherwise Montegues.
I suppose the logic is pretty basic, so it could be made into a script, I just don't know how to code. And, well, you're still stuck taking two blind guesses no matter what.
Re: TH Greasemonkey thread 2.0
Posted: Sun Jun 29, 2014 3:11 pm
by zillow
Thinking of adding openings support in the AA script, what features would people like? Current idea is super simple, if an opening is available use it.
Re: TH Greasemonkey thread 2.0
Posted: Sun Jun 29, 2014 8:08 pm
by Cristiona
Found a new host for it? Userscripts seems to have bit the big one.
As for openings, hm. That's a little tricky. I think it would be better if you could somehow have it be selectable, because you aren't always going to want to run any opening that pops up (I'm thinking specifically of the Iceberg and yo-yo openings).
Re: TH Greasemonkey thread 2.0
Posted: Mon Jun 30, 2014 12:02 am
by zillow
You can still access everything at
http://userscripts.org:8080/
But it does seem like the site might go down permanently.
Re: TH Greasemonkey thread 2.0
Posted: Sat Jul 12, 2014 9:13 am
by Patojonas
About UserScripts.org
As for Opening support:
Could you perhaps make it read the openings you want to be fired from a string users get to add/remove openings to/from?
Also as mention before I'd love to be able to have conditional strategies. Something like, if (condition) do this stuff, else do that stuff
The most basic condition I guess would be checking if the foe name was one we get to have on a list and thus it'd be a match foe function that'd check the foe variable.
Another useful condition would be a match for a string in the text. Like if the disco shoes message (or part of it) that allows me to get the -1minute is present I'd want to use a strategy alternative that made use of the disco demolition skill. (I currently use
this script to highlight part of that string for easier recognition)
Also I'm not really sure, but the way it works now if you set a strategy to use a skill and then an item it'll never use the item because it'll spam the skill forever right? Is it possible to make a tag to indicate we want to use an item or a skill only once (or x times)? Like, I set it to use kung fu once and then an atomic wedge twice and if the foe is alive after that the script doesn't proceed any further? I guess this would require some serious modifications to how the script works so my alts will give you 5 silver stars if you can accomplish this on top of my previous suggestions
Last but not lest, add this non-combat to the new version if it doesn't already have it:
//trillowatt computer in vincille
nonComChoice["Computer Graveyard"+"choice"] = "1"; //snag computer
//nonComChoice["Computer Graveyard"+"choice"] = "2"; //leave, no time cost
nonComChoice["Computer Graveyard"+"submitvalue"] = "Make your choice";
Re: TH Greasemonkey thread 2.0
Posted: Sat Jul 12, 2014 10:50 am
by xKiv
My openings support looks roughly like this:
Code: Select all
stratList['FarmTAF'] = 'S:1024;S:153!throwawayfoe';
note that opening IDs seem to be strings, or at least were when I last tested this
then in processStrategy I have:
Code: Select all
} else if(selectedAction[0] == 'S')
{
var found = false;
var skillPars = selectedAction[1].split('!');
if (skillPars.length > 1 && qqq > 2) {
if (Select_Value_Set_Name('pickwhich', qqq-3, skillPars[1]))
{
nextButton = find('.//input[@type="submit" and contains(@value,"Opening")]');
found = true;
}
}
if ((!found) && Select_Value_Set_Name('pickwhich', qqq-2, skillPars[0]))
{
nextButton = find('.//input[@type="submit" and contains(@value,"Skill")]');
found = true;
}
if (!found)
{
nextButton = find('.//input[@type="submit" and contains(@value,"Attack")]');
}
} else if(selectedAction[0] == 'IS')
That will only work for one specific opening, but it could be easily modified to loop through skillPars and pick the first that matches. Strategy would then look something like S:153!throwawayfoe!hammerithome!fantheflames
I don't like the idea of taking all openings as soon as they are available, because they tend to not be as useful as normal actions for me.
--
Conditional strategies: I don't have this yet, but I have thought avout it. I think what needs to be done there is just to make the strategy a function (of current combat state), and have the function return the string that should be used as strategy for current combat round.
Code: Select all
function funFun(round, foeName, openings, skills, items) {
if (round == 1) {
return 'S:1024';
} else if (round == 2) {
if (foeName == 'brundibar') {
if ('bzz' in openings) {
return 'S:0!bzz';
}
if (9 in skills) { // tornado
return 'S:9';
}
if (749 in items) { // space mead
return 'I:749';
}
}
return 'A';
}
return 'Q'; // give up
};
...
stratList['fun'] = funFun;
Also I'm not really sure, but the way it works now if you set a strategy to use a skill and then an item it'll never use the item because it'll spam the skill forever right?
AFAIK, only the last item on strategy is spammed repeatedly
ETA: I put my current version up at
http://mascripty.wz.cz/th_autoadv_xkiv.zip
Re: TH Greasemonkey thread 2.0
Posted: Sun Jul 20, 2014 5:55 pm
by zillow
Added opening support to the script, I'll be adding more features soon like use x item y times.
Also, while I was at it, fixed some issues the script was having with greasemonkey
But for now here it is with openings, let me know how you like it:
https://monkeyguts.com/code.php?id=324
Re: TH Greasemonkey thread 2.0
Posted: Tue Jul 22, 2014 10:02 pm
by Cristiona
Seems "Stop, Drop, and Roll" isn't flagged right. While fighting pinatas I got a popup saying that opening was missing.
Re: TH Greasemonkey thread 2.0
Posted: Wed Jul 23, 2014 7:44 am
by zillow
Ya... I had to guess what the flags for all of them were based on ones I knew, did you see what the actual flag was?
Re: TH Greasemonkey thread 2.0
Posted: Wed Jul 23, 2014 9:23 pm
by Cristiona
I think it was stop.drop.roll, but I'm not sure. I'll try to keep an eye out.
Re: TH Greasemonkey thread 2.0
Posted: Tue Jul 29, 2014 12:10 pm
by Patojonas
it'd be awesome if it could ignore the computer link when decrypting en masse.....
Re: TH Greasemonkey thread 2.0
Posted: Wed Dec 10, 2014 8:14 am
by Harry Dresden
Does anyone else have an issue with the new-ish AA script double using whatever it's set to use first? For instance, when I have it set to use all throwing stars and then attack, it tries to use the black hole twice before moving on to the second star in the list. Or if I use my option for a recognizer bot before attacking it uses the bot twice and then attacks.
Re: TH Greasemonkey thread 2.0
Posted: Thu Dec 11, 2014 4:51 am
by xKiv
Harry Dresden wrote:Does anyone else have an issue with the new-ish AA script double using whatever it's set to use first? For instance, when I have it set to use all throwing stars and then attack, it tries to use the black hole twice before moving on to the second star in the list. Or if I use my option for a recognizer bot before attacking it uses the bot twice and then attacks.
I remember trying to fix an issue with round numbers (as in, the script sometimes thought the first combat round is 1 and other times 0, and it was not advancing to second action until round number 2). I *think* I fixed it in my local version somehow, but I don't remember how, it's been a long time.