TH Greasemonkey thread 2.0
Moderator: Moderators
- Cristiona
- Posts: 5118
- Joined: Sun Apr 08, 2007 1:01 am
- Location: the Conservatory with the lead pipe
- Contact:
Re: TH Greasemonkey thread 2.0
I was wondering if someone could add "Summon Fortune Cookie" to the existing script that batch-uses *ouch items.
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"
--October Project: "Dark Time"
-
- Posts: 107
- Joined: Thu Nov 13, 2008 11:54 am
- Contact:
Re: TH Greasemonkey thread 2.0
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?
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?
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
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.
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
I changed the code for 'I' action to
and then the action is 'I17671769: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.
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")]');
}
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.
-
- Posts: 107
- Joined: Thu Nov 13, 2008 11:54 am
- Contact:
Re: TH Greasemonkey thread 2.0
Thanks Kiv! that totally fixed my issues!
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
Where the heck do we put that code in? I'm not seeing the 'I' function anywhere.
Re: TH Greasemonkey thread 2.0
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.
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
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
Did you also change your action (to I17671769:1770)?
You *do* have one of the ecto items in your invetory, right?
And you are only trying to use it *once* per combat?
You *do* have one of the ecto items in your invetory, right?
And you are only trying to use it *once* per combat?
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
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.
- Cristiona
- Posts: 5118
- Joined: Sun Apr 08, 2007 1:01 am
- Location: the Conservatory with the lead pipe
- Contact:
Re: TH Greasemonkey thread 2.0
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:
Go a few lines past that until you see:
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:
Then, scroll up to the stratList lines to plug in your ecto usage. For mine, I have:
Works great.
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")]');
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;
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;
Code: Select all
stratList['Ecto, Star, then Attack To Death'] = 'I:1766:1767:1768:1769:1770:I:881;I:882:A'; //BH, Mag, attack
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"
--October Project: "Dark Time"
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
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
You are introducing a syntax error somewhere, probably by ending the cut/paste at the wrong curly brace.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.
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)
{
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
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
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;
}
replace it with:
if(round < 0)
{
GM_setValue('roundNumber', 0);
round = 0;
}
- Cristiona
- Posts: 5118
- Joined: Sun Apr 08, 2007 1:01 am
- Location: the Conservatory with the lead pipe
- Contact:
Re: TH Greasemonkey thread 2.0
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(':');
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"
--October Project: "Dark Time"
- Corrupt Shadow
- Posts: 1234
- Joined: Mon Dec 17, 2007 8:24 pm
- Location: Baton Rouge, LA
- Contact:
Re: TH Greasemonkey thread 2.0
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!
Can anyone help me out and tell me what code to put and where to put it?
Thanks in advance!
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"
- Corrupt Shadow
- Posts: 1234
- Joined: Mon Dec 17, 2007 8:24 pm
- Location: Baton Rouge, LA
- Contact:
Re: TH Greasemonkey thread 2.0
That's it, mara! Thanks!
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"
Re: TH Greasemonkey thread 2.0
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
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.Isladar wrote:Does anyone have an updated version of the Batch use *ouch items script that includes Professor Ouch's Satchel?
Leader of PFE league. If you wish to worship me, ask me about joining my secondary league Cult of Satan (the largest league in the game!).
Re: TH Greasemonkey thread 2.0
Thanks Satan!
Re: TH Greasemonkey thread 2.0
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:
IN this part of the code, as shown:
Code: Select all
'<span id="blanket"><br />Check your <a href=\"/use.php?filter=instant\">blanket</a>!</span> <br />' +
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>';
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
Do it a few dozen times, and you'll remember the choice groups so well that even after 4 months you get them right.
- Cristiona
- Posts: 5118
- Joined: Sun Apr 08, 2007 1:01 am
- Location: the Conservatory with the lead pipe
- Contact:
Re: TH Greasemonkey thread 2.0
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.
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.
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"
--October Project: "Dark Time"
Re: TH Greasemonkey thread 2.0
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.
- Cristiona
- Posts: 5118
- Joined: Sun Apr 08, 2007 1:01 am
- Location: the Conservatory with the lead pipe
- Contact:
Re: TH Greasemonkey thread 2.0
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).
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).
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"
--October Project: "Dark Time"
Re: TH Greasemonkey thread 2.0
You can still access everything at http://userscripts.org:8080/
But it does seem like the site might go down permanently.
But it does seem like the site might go down permanently.
Re: TH Greasemonkey thread 2.0
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";
Spoiler: show
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
My openings support looks roughly like this:
note that opening IDs seem to be strings, or at least were when I last tested this
then in processStrategy I have:
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.
ETA: I put my current version up at http://mascripty.wz.cz/th_autoadv_xkiv.zip
Code: Select all
stratList['FarmTAF'] = 'S:1024;S:153!throwawayfoe';
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')
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;
AFAIK, only the last item on strategy is spammed repeatedlyAlso 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?
ETA: I put my current version up at http://mascripty.wz.cz/th_autoadv_xkiv.zip
Re: TH Greasemonkey thread 2.0
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
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
- Cristiona
- Posts: 5118
- Joined: Sun Apr 08, 2007 1:01 am
- Location: the Conservatory with the lead pipe
- Contact:
Re: TH Greasemonkey thread 2.0
Seems "Stop, Drop, and Roll" isn't flagged right. While fighting pinatas I got a popup saying that opening was missing.
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"
--October Project: "Dark Time"
Re: TH Greasemonkey thread 2.0
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?
- Cristiona
- Posts: 5118
- Joined: Sun Apr 08, 2007 1:01 am
- Location: the Conservatory with the lead pipe
- Contact:
Re: TH Greasemonkey thread 2.0
I think it was stop.drop.roll, but I'm not sure. I'll try to keep an eye out.
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"
--October Project: "Dark Time"
Re: TH Greasemonkey thread 2.0
it'd be awesome if it could ignore the computer link when decrypting en masse.....
-
- Posts: 1395
- Joined: Tue Feb 12, 2008 1:22 pm
- Contact:
Re: TH Greasemonkey thread 2.0
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
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.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.
Who is online
Users browsing this forum: No registered users and 0 guests