Twilight Forums

Idle chat for wannabe heroes
It is currently Mon Oct 20, 2014 7:12 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 118 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Fri Jul 01, 2011 12:25 am 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4565
Location: the Conservatory with the lead pipe
I was wondering if someone could add "Summon Fortune Cookie" to the existing script that batch-uses *ouch items.

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
PostPosted: Thu Oct 13, 2011 8:43 pm 
Offline

Joined: Thu Nov 13, 2008 11:54 am
Posts: 107
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?

_________________
Image


Top
 Profile  
 
PostPosted: Fri Oct 14, 2011 6:06 am 
Offline

Joined: Tue Feb 12, 2008 1:22 pm
Posts: 1359
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.


Top
 Profile  
 
PostPosted: Fri Oct 14, 2011 7:04 am 
Offline

Joined: Sat Jan 01, 2011 1:40 pm
Posts: 95
I changed the code for 'I' action to
Code:
      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:1766:1767:1768: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.


Top
 Profile  
 
PostPosted: Fri Oct 14, 2011 2:45 pm 
Offline

Joined: Thu Nov 13, 2008 11:54 am
Posts: 107
Thanks Kiv! that totally fixed my issues!

_________________
Image


Top
 Profile  
 
PostPosted: Mon Oct 17, 2011 7:40 am 
Offline

Joined: Tue Feb 12, 2008 1:22 pm
Posts: 1359
Where the heck do we put that code in? I'm not seeing the 'I' function anywhere.


Top
 Profile  
 
PostPosted: Mon Oct 17, 2011 10:19 am 
Offline

Joined: Sat Jan 01, 2011 1:40 pm
Posts: 95
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.


Top
 Profile  
 
PostPosted: Tue Oct 18, 2011 7:36 am 
Offline

Joined: Tue Feb 12, 2008 1:22 pm
Posts: 1359
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.


Top
 Profile  
 
PostPosted: Tue Oct 18, 2011 10:08 am 
Offline

Joined: Sat Jan 01, 2011 1:40 pm
Posts: 95
Did you also change your action (to I:1766:1767:1768: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?


Top
 Profile  
 
PostPosted: Tue Oct 18, 2011 11:59 am 
Offline

Joined: Tue Feb 12, 2008 1:22 pm
Posts: 1359
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.


Top
 Profile  
 
PostPosted: Mon Oct 24, 2011 8:42 pm 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4565
Location: the Conservatory with the lead pipe
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:
nextButton=find('.//input[@type="submit" and contains(@value,"Tame the Animal")]');


Go a few lines past that until you see:

Code:
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:
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:
stratList['Ecto, Star, then Attack To Death'] = 'I:1766:1767:1768:1769:1770:I:881;I:882:A'; //BH, Mag, attack


Works great.

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
PostPosted: Wed Oct 26, 2011 8:16 am 
Offline

Joined: Tue Feb 12, 2008 1:22 pm
Posts: 1359
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.


Top
 Profile  
 
PostPosted: Wed Oct 26, 2011 10:40 am 
Offline

Joined: Sat Jan 01, 2011 1:40 pm
Posts: 95
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:
    } 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)
{


Top
 Profile  
 
PostPosted: Thu Oct 27, 2011 7:51 am 
Offline

Joined: Tue Feb 12, 2008 1:22 pm
Posts: 1359
huh....I could have sworn I was making sure all the syntax was right. It's working now, though, so thanks!


Top
 Profile  
 
PostPosted: Sat Apr 07, 2012 5:03 pm 
Offline

Joined: Thu Sep 04, 2008 5:33 pm
Posts: 183
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;
}

_________________
Image


Top
 Profile  
 
PostPosted: Sat Apr 07, 2012 7:47 pm 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4565
Location: the Conservatory with the lead pipe
So, in context, it should look like this?

Code:
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(':');

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
PostPosted: Sat Apr 07, 2012 7:48 pm 
Offline

Joined: Thu Sep 04, 2008 5:33 pm
Posts: 183
Yep :)

_________________
Image


Top
 Profile  
 
PostPosted: Thu May 17, 2012 12:38 pm 
Offline
User avatar

Joined: Mon Dec 17, 2007 8:24 pm
Posts: 1234
Location: Baton Rouge, LA
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!

_________________
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"


Top
 Profile  
 
PostPosted: Thu May 17, 2012 6:11 pm 
Offline

Joined: Thu Jan 20, 2011 8:04 pm
Posts: 104
Corrupt Shadow wrote:
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!


Easiest way is to open up the AA script in a text editor, do a search for stratList, and insert something like this in the list:

Code:
stratList['Firestorm'] = 'IS:12';


That is an attack strategy that uses firestorm and nothing else. Hope that works for you!


Top
 Profile  
 
PostPosted: Fri May 18, 2012 8:20 am 
Offline
User avatar

Joined: Mon Dec 17, 2007 8:24 pm
Posts: 1234
Location: Baton Rouge, LA
That's it, mara! Thanks!

_________________
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"


Top
 Profile  
 
PostPosted: Sat Nov 10, 2012 2:33 pm 
Offline
User avatar

Joined: Wed Dec 29, 2010 4:10 pm
Posts: 45
Does anyone have an updated version of the Batch use *ouch items script that includes Professor Ouch's Satchel?


Top
 Profile  
 
PostPosted: Sat Nov 10, 2012 7:30 pm 
Offline

Joined: Mon Nov 19, 2007 6:29 pm
Posts: 1832
Location: Florida
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.

_________________
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!).


Top
 Profile  
 
PostPosted: Sun Nov 11, 2012 6:28 am 
Offline
User avatar

Joined: Wed Dec 29, 2010 4:10 pm
Posts: 45
Thanks Satan!


Top
 Profile  
 
PostPosted: Tue Nov 20, 2012 6:50 am 
Offline
User avatar

Joined: Mon Nov 16, 2009 11:48 am
Posts: 320
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:
'<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:
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>';


Top
 Profile  
 
PostPosted: Thu Mar 27, 2014 9:20 pm 
Offline

Joined: Sat Oct 26, 2013 5:21 am
Posts: 85
Nobody fancies making some sort of helper script for the Cube Theater do they? I always have to refer to the right choices on the wiki or just choose alphabetically every time!

_________________
Image


Top
 Profile  
 
PostPosted: Fri Mar 28, 2014 3:55 pm 
Offline

Joined: Tue Feb 12, 2008 1:22 pm
Posts: 1359
Do it a few dozen times, and you'll remember the choice groups so well that even after 4 months you get them right.


Top
 Profile  
 
PostPosted: Fri Mar 28, 2014 8:44 pm 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4565
Location: the Conservatory with the lead pipe
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.

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
PostPosted: Sun Jun 29, 2014 3:11 pm 
Offline

Joined: Thu Sep 04, 2008 5:33 pm
Posts: 183
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.

_________________
Image


Top
 Profile  
 
PostPosted: Sun Jun 29, 2014 8:08 pm 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4565
Location: the Conservatory with the lead pipe
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).

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
PostPosted: Mon Jun 30, 2014 12:02 am 
Offline

Joined: Thu Sep 04, 2008 5:33 pm
Posts: 183
You can still access everything at http://userscripts.org:8080/
But it does seem like the site might go down permanently.

_________________
Image


Top
 Profile  
 
PostPosted: Sat Jul 12, 2014 9:13 am 
Offline
User avatar

Joined: Mon Nov 16, 2009 11:48 am
Posts: 320
About UserScripts.org
Spoiler: show
http://userscripts.org:8080/ has been down for a few days now.

Here's a link to a page describing the whole situation and workarounds: https://docs.google.com/document/d/18R72FJFNEbLG-PjNybJDSsIC1Jh28nupyiqGBavh2Us/edit?pli=1

Long story short, for a while we'll be able to get everything from http://userscripts-mirror.org/
Problem? Search is disabled so if you have links to any gm script you'll have to manually edit the link to get where you want to go.

As for new websites to place stuff?

Looking at that list, I favour https://monkeyguts.com/about.php

Judging by the amount of scripts it's not leading the race to be the next userscripts hub, but I find it very user friendly.

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 :mrgreen:


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";


Top
 Profile  
 
PostPosted: Sat Jul 12, 2014 10:50 am 
Offline

Joined: Sat Jan 01, 2011 1:40 pm
Posts: 95
My openings support looks roughly like this:
Code:
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:

        } 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:
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;



Quote:
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


Top
 Profile  
 
PostPosted: Mon Jul 14, 2014 5:49 pm 
Offline

Joined: Sat Oct 26, 2013 5:21 am
Posts: 85
Patojonas wrote:
About UserScripts.org

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)


You and me both. How frustrating is it to have a buzzing swarm show up in the middle of your bovine charge skill attack! 1pt, 1pt, 1pt. oh crap.

_________________
Image


Top
 Profile  
 
PostPosted: Sun Jul 20, 2014 5:55 pm 
Offline

Joined: Thu Sep 04, 2008 5:33 pm
Posts: 183
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

_________________
Image


Top
 Profile  
 
PostPosted: Tue Jul 22, 2014 10:02 pm 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4565
Location: the Conservatory with the lead pipe
Seems "Stop, Drop, and Roll" isn't flagged right. While fighting pinatas I got a popup saying that opening was missing.

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
PostPosted: Wed Jul 23, 2014 7:44 am 
Offline

Joined: Thu Sep 04, 2008 5:33 pm
Posts: 183
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?

_________________
Image


Top
 Profile  
 
PostPosted: Wed Jul 23, 2014 9:23 pm 
Offline
User avatar

Joined: Sun Apr 08, 2007 1:01 am
Posts: 4565
Location: the Conservatory with the lead pipe
I think it was stop.drop.roll, but I'm not sure. I'll try to keep an eye out.

_________________
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"


Top
 Profile  
 
PostPosted: Tue Jul 29, 2014 12:10 pm 
Offline
User avatar

Joined: Mon Nov 16, 2009 11:48 am
Posts: 320
it'd be awesome if it could ignore the computer link when decrypting en masse.....


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 118 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 7 hours


Who is online

Users browsing this forum: Exabot [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group