Create a new AA script

Off-topic posts about whatever, including off-the-wall posts about being on walls.

Moderator: Moderators

Harry Dresden
Posts: 1395
Joined: Tue Feb 12, 2008 1:22 pm
Contact:

Create a new AA script

Postby Harry Dresden » Wed Jun 01, 2011 12:20 pm

Contest starts now and runs 1 month, or until someone creates a script that can do these things:

It is past time for a new autoadventure script, one that is not cobbled together with snarky comments and geared only toward the maker's wishes and wants. Especially with FF4 recently released. Therefore, I am offering a 5 star bounty for a new script that includes at least the features below:

- Basic features of current script; ability to set HP/PP levels for the script to operate within, list of most common attack types, easy to modify for people who want to change attack style.
- Option to store encounter data for spaders.
- Most of all, easy to remove "clutter" features that individual users don't want, i.e. dataplate decrypting. These additions to the later scripts always annoyed me because I didn't need them and they just made the screen too "busy".
- Coded to automatically pick an option on choice adventures, able to be easily adjusted if someone wants a different default option, and should automatically pick the 4th option for Intermission (Cube UR) and Two Roads (Triassic semi-rare).
- Also, it should work on both www.twilightheroes.com and twilightheroes.com

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script and get rich! - starting 6/6

Postby Cristiona » Wed Jun 01, 2011 5:29 pm

If you do this, it should also automatically pick an option on choice adventures, be able to be adjusted if someone wants a different default option, and should automatically pick the 4th option for Intermission (Cube UR) and Two Roads (Triassic semi-rare).

Also, it should work on both www.twilightheroes.com and twilightheroes.com
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"

zillow
Posts: 191
Joined: Thu Sep 04, 2008 5:33 pm
Contact:

Re: Create a new AA script

Postby zillow » Sun Jun 19, 2011 11:18 am

Automatically gets the 77 habits at level 5, if you have the quest done obviously.
Image

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Fri Jun 24, 2011 8:16 pm

Right now I'd settle for the existing one modified to work with FF5.

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

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Fri Jun 24, 2011 10:04 pm

Okay, seems 3.4 works with FF5. Off the top of my head, all that's missing are the Teeter and Yang non-combats and the new ones in the riot. I don't have Teeter and Yang on this computer, but here's the code for the riot, just add it with all the other non-combats (adjusting if you want different choices):

//nonComChoice["Holdin' Everything but the Caulfield"+"choice"] = "1"; //protester
//nonComChoice["Holdin' Everything but the Caulfield"+"choice"] = "2"; //officer
nonComChoice["Holdin' Everything but the Caulfield"+"choice"] = "3"; //free bonus
nonComChoice["Holdin' Everything but the Caulfield"+"submitvalue"] = "What do you do?";

//nonComChoice["Two Rioters Diverged in an Angry Protest"+"choice"] = "3"; //rioter
//nonComChoice["Two Rioters Diverged in an Angry Protest"+"choice"] = "5"; //dissident
nonComChoice["Two Rioters Diverged in an Angry Protest"+"choice"] = "6"; //free bonus
nonComChoice["Two Rioters Diverged in an Angry Protest"+"submitvalue"] = "What's your take?";

nonComChoice["An All-Encampassing Rage"+"choice"] = "1"; //student
//nonComChoice["An All-Encampassing Rage"+"choice"] = "2"; //raver
nonComChoice["An All-Encampassing Rage"+"submitvalue"] = "Go go hero defenses";
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"

Harry Dresden
Posts: 1395
Joined: Tue Feb 12, 2008 1:22 pm
Contact:

Re: Create a new AA script

Postby Harry Dresden » Wed Jul 20, 2011 7:36 pm

A big thanks to Zillow for coming up with a new script. Still a bit in the works, but it's almost exactly what I was looking for.

seventhcross
Posts: 107
Joined: Thu Nov 13, 2008 11:54 am
Contact:

Re: Create a new AA script

Postby seventhcross » Wed Jul 20, 2011 8:51 pm

Harry Dresden wrote:A big thanks to Zillow for coming up with a new script. Still a bit in the works, but it's almost exactly what I was looking for.

OOOH, I can't wait to see it. Where can I steal this script from?
Image

mara
Posts: 104
Joined: Thu Jan 20, 2011 8:04 pm
Contact:

Re: Create a new AA script

Postby mara » Thu Jul 21, 2011 12:49 pm

You, sir, are a scholar and a gentleman. I am very much looking forward to playing around with this when it is finished.

User avatar
Corrupt Shadow
Posts: 1234
Joined: Mon Dec 17, 2007 8:24 pm
Location: Baton Rouge, LA
Contact:

Re: Create a new AA script

Postby Corrupt Shadow » Mon Jul 25, 2011 2:25 pm

For some odd reason the AA scripts never work for me. :( *pout*
Image
I've won the 100k DD bet so many times, I should have the title "Mr. Luck"

zillow
Posts: 191
Joined: Thu Sep 04, 2008 5:33 pm
Contact:

Re: Create a new AA script

Postby zillow » Fri Aug 05, 2011 9:54 am

Here is your long awaited AA script:
http://userscripts.org/scripts/review/105495

There are 3 things you should change when you install it:
1. The options at the top for personalizing the script
2. The strategies for combat
3. The non-combat choices

Enjoy! :D

Edit: Questions/Comments/Concerns appreciated
Image

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Fri Aug 05, 2011 8:08 pm

//used for the non-combat in Teeter Street
var username = 'Zillow';


What's this variable used for? I'll be using this script across multiple accounts.
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"

zillow
Posts: 191
Joined: Thu Sep 04, 2008 5:33 pm
Contact:

Re: Create a new AA script

Postby zillow » Fri Aug 05, 2011 8:27 pm

Well I didn't want to do the work to grab your username for that one non-combat in Teeter Street, but I guess I should...
Image

chuwenhsuan
Posts: 4
Joined: Sun Feb 06, 2011 1:57 am
Contact:

Re: Create a new AA script

Postby chuwenhsuan » Fri Aug 05, 2011 8:28 pm

nonComChoice[username + " and the Chocolate Factory"+"choice"] = "1511"; //sour coating
//nonComChoice[username + " and the Chocolate Factory"+"choice"] = "1512"; //candy shell
//nonComChoice[username + " and the Chocolate Factory"+"choice"] = "1513"; //chocolate "chip"
//nonComChoice[username + " and the Chocolate Factory"+"choice"] = "870"; //razzberry sticker
nonComChoice[username + " and the Chocolate Factory"+"submitvalue"] = "Pick your prize";


Blame the Teeter Street non-combat.

EDIT: Ninja`d. :P

zillow
Posts: 191
Joined: Thu Sep 04, 2008 5:33 pm
Contact:

Re: Create a new AA script

Postby zillow » Fri Aug 05, 2011 9:36 pm

Ok, fixed it
Image

zillow
Posts: 191
Joined: Thu Sep 04, 2008 5:33 pm
Contact:

Re: Create a new AA script

Postby zillow » Sat Aug 06, 2011 4:51 pm

So, I just found out that I broke the hp checking in the script right before giving it to y'all. The fixed version is now up and it also has the update for the non-combat in Teeter Street so it will work for all characters using the script.
Image

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Sat Aug 06, 2011 7:49 pm

Now I gotta re-edit!
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Tue Aug 23, 2011 8:17 pm

New AA script (at least, version 3.5.1) is now confirmed to make the right choice for The Best Memory.

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

Harry Dresden
Posts: 1395
Joined: Tue Feb 12, 2008 1:22 pm
Contact:

Re: Create a new AA script

Postby Harry Dresden » Wed Aug 24, 2011 6:02 am

I thought I paid Zillow to not let you get any cool stuff. I want my stars back!

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Mon Aug 29, 2011 8:24 pm

Hey, considering how long it took, I earned it!

You sell:

1445 deterministic coins
1484 royal crowns
999 decorated jerkins
1408 snug breeches
1430 poofy skirts
1469 sturdy boots
1489 truepenny blades
1009 prabble crossbows
993 bodices
496 sleeping draughts
797 lover's locket, right halves
950 Scottish necklaces
138 fall's staves

... for a total profit of 1,642,150 chips.
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"

User avatar
Patojonas
Posts: 404
Joined: Mon Nov 16, 2009 11:48 am
Contact:

Re: Create a new AA script

Postby Patojonas » Thu Jan 26, 2012 9:27 am

Might want to add this as well to handle the Rooftops over WoDo noncombat ;)

Code: Select all

  //nonComChoice["What's That Over There?"+"choice"] = "1"; //hamock
  nonComChoice["What's That Over There?"+"choice"] = "2"; //box with talismans
  //nonComChoice["What's That Over There?"+"choice"] = "3"; //mat
  nonComChoice["What's That Over There?"+"submitvalue"] = "Choose";

Harry Dresden
Posts: 1395
Joined: Tue Feb 12, 2008 1:22 pm
Contact:

Re: Create a new AA script

Postby Harry Dresden » Fri May 11, 2012 6:47 am

Something seems to be screwing with the autoadventure script. On both my computers, it will run a turn but then at the end of the turn the script boxes disappear until I manually initiate the next turn. They're still there if I only set it to run a single turn, as painful as that is.

Happening with several of my combat options: just attacking, using throwing stars and then attacking, and using TNT then attacking.

Harry Dresden
Posts: 1395
Joined: Tue Feb 12, 2008 1:22 pm
Contact:

Re: Create a new AA script

Postby Harry Dresden » Fri May 11, 2012 8:41 am

The problem is caused by the latest version of Greasemonkey. You can either load up the older version, or the newest beta version (under Download Channel on the greasemonkey site) to solve the issue. Or wait until a newer version is released, which should be soon since so many people are having issues with add-ons since the new version came out.

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Fri May 11, 2012 8:11 pm

Or just tell Firefox that its autoupdates can go soak their head. Rawr.
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"

User avatar
Patojonas
Posts: 404
Joined: Mon Nov 16, 2009 11:48 am
Contact:

Re: Create a new AA script

Postby Patojonas » Sat Jun 16, 2012 2:58 pm

Currently the script can't handle the axe hero guitar options go/stay, is it possible to work it into the script?

here's an example of a page with the option:
Spoiler: show

Code: Select all

<BODY><table border=0 cellspacing=0 cellpadding=4 width='100%'><tr valign=top><td width='100%'>


<h1>Combat!</h1><font class='text'>You are fighting  Archduke Hans Enfransz.<P>

An anarch monarch? What's up with that? He used to be city hall, and now he fights it, along with anyone else who pushes their slimy rules onto him and his friends.At the start of the fight your axe strums the lines to the classic hero song, "Should I Fight or Should I Go?" It's so catchy your opponent can't help but sing along, looking at you meaningfully every time the chorus comes up. Clearly this indecision's bugging them, you'd better come on and let them know.<p><form action=fight.php method=post><input type=hidden name=choice value='axe-go'><input type=submit value="Go: There Will Be Trouble" /></form><form action=fight.php method=post><input type=hidden name=choice value='axe-fight'><input type=submit value="Stay: It Will Be Double" /></form></td><td align=center><img src='images/foes/archduke.jpg' height=200 width=200 border=3><BR><b id=enemy>Archduke Hans Enfransz</b></td></tr></table><script type='text/javascript'>top.nav.location='nav.php';</script>

</font>

</BODY>
</HTML>

Satan
Posts: 1855
Joined: Mon Nov 19, 2007 6:29 pm
Location: Florida
Contact:

Re: Create a new AA script

Postby Satan » Sat Jun 16, 2012 3:10 pm

I'm considering making a new alternative to the current AA script, which will be a bit more robust. As such it'll probably be a Java program like KoLMafia so we can have platform and browser independence, and overall more features. My main focus will be on a spading feature and a quest run mode, which haven't been included in the AA scripts because it's somewhat infeasible. No real ETA, as I'm also just starting graduate classes next week, but I'm hoping to get a beta up in 2 months. I'll make a new thread if I need alpha testers later on.
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!).

User avatar
Cristiona
Posts: 4950
Joined: Sun Apr 08, 2007 1:01 am
Location: the Conservatory with the lead pipe
Contact:

Re: Create a new AA script

Postby Cristiona » Sat Jun 16, 2012 7:47 pm

If you can still find it, you could probably use the old Mechapinata script as a base. For a CLI script, it worked pretty well.
Image
The churches are empty / The priest has gone home / And we are left standing / Together alone
--October Project: "Dark Time"

Satan
Posts: 1855
Joined: Mon Nov 19, 2007 6:29 pm
Location: Florida
Contact:

Re: Create a new AA script

Postby Satan » Sat Jun 16, 2012 8:14 pm

I thought Mechapinata was the Java GUI version bamse made after the perlbot? I no longer have the source code for that one though, need to start from scratch >.>
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!).

Harry Dresden
Posts: 1395
Joined: Tue Feb 12, 2008 1:22 pm
Contact:

Re: Create a new AA script

Postby Harry Dresden » Sat Oct 06, 2012 6:05 pm

Anyone know what's going on with Greasemonkey? It keeps telling me scripts have to be signed with such and such, and then a few days later all my scripts are reset to some old version and I have to go in and update them again.

Satan
Posts: 1855
Joined: Mon Nov 19, 2007 6:29 pm
Location: Florida
Contact:

Re: Create a new AA script

Postby Satan » Sat Oct 06, 2012 11:52 pm

I've had that same thing happening. Think it's just a bug.
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!).

User avatar
flesk
Posts: 5
Joined: Tue Apr 12, 2016 10:18 am
Contact:

Re: Create a new AA script

Postby flesk » Fri Apr 22, 2016 12:41 am

Satan wrote:I thought Mechapinata was the Java GUI version bamse made after the perlbot? I no longer have the source code for that one though, need to start from scratch >.>


I didn't come up with the name, but Mechapiñata was indeed the Java GUI version. I don't think I ever got very far with that one though, except for some convenience utility classes to handle web requests and parsing html (with regex *shudder*).

The Perl bot was internally called PFEBot, and though it mostly got its job done, it was jam-packed with poor coding practices, and is not something I would use as the basis for something more robust.

I still think it would be pretty neat to have something similar to KOL Mafia though, and I think it should be fairly easy to make with Python and GTK+. I still love Perl (and I'm much better at it now than I was then), but the reason I want to use Python is because I'm getting involved in an open-source project that will also use Python and GTK+. Plus, I also use Python almost daily in my current job.

User avatar
flesk
Posts: 5
Joined: Tue Apr 12, 2016 10:18 am
Contact:

Re: Create a new AA script

Postby flesk » Mon Sep 19, 2016 1:22 pm

This is by no means finished, but since I haven't had the time or energy to work on it since before the summer, I thought I'd share it in case anyone else wants to contribute:

https://github.com/fleskesvor/th-bot

My goal with this was to make something that can be as usable and flexible as KoLmafia, but since there will probably never be as many people contributing to this project, I needed to find another way to achieve that goal. I think that can be achieved by building a framework around easy to write user scripts with functions that are triggered by subscribing to certain pre-defined events. Here's a working example of a script that logs into and prints messages from chat:

Code: Select all

@receive_event("script.started")
def main():
    login(USER, PASS)

@receive_event("login.success")
def logged_in(message):
    chat = Chat()
    chat.run()

@receive_event("chat.receive")
def pretty_print(message, _type, text, channel, user, link):
    if _type in ["normal", "em"]:
        print "[%-8s] %s (#%s): %s" % (channel, user, link, text)
    elif _type == "note":
        print "! %s" % text
    elif _type == "pm":
        print "[~private] %s (#%s): %s" % (user, link, text)


Since I didn't want to create and parse a whole new custom language, this is just Python, but that also mean you're free to utilize everything that language has to offer. Plus you're free to create and call your own functions, meaning you can set up a function to start an adventure when the user is logged in, handle the result of an adventure in another function, and then write code to either call that first function to go on a new adventure, or do stuff like heal, depending on the outcome. That functionality is sorely lacking at the moment though, but there is code in place for it, and it's my next item on the TODO list, if I ever get around to it.

Another thing that's high up on the list is a module that loads configuration data from either a JSON file or another Python script and saves data back afterwards, so that you can add things like new choice encounters to it in code, and have that be available the next time you run the script. A longer term goal is to add a graphical front-end to it using GTK and Glade, and making standalone executables with py2exe for Windows and py2app for macOS. I'm on Linux, but I think the script would be much more usable to more people if using it was as simple as adding user scripts to a scripts/ folder, and then just choosing which script to load from an application, which also saved things like logins and displayed info about stats and loot.

So that's my combined pitch and lament over not being able to spend more time on this project. I don't want to see it die just yet though, so if anyone reading this is willing to help, either with code, inspiration or ideas, I'd be happy to help get you started.

EDIT: I should emphasize that I have prioritized usability over best practices, so there are several things in here you shouldn't do in your own project. If I can figure out a good way around it, I want to spare having the user load any modules. For chat and messages, I might solve that by starting their pollers if their respective receive events are subscribed to, which would mean that second function in my example wouldn't be necessary. Calling login() shouldn't be necessary either, since the credentials can be loaded from the config.py script or eventually be passed in as command line options or through a login window.


Return to “Off the Wall”

Who is online

Users browsing this forum: No registered users and 2 guests