Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 38

Thread: Relay Task List (Programmable!)

  1. #1
    Senior Member
    Join Date
    Mar 2012
    Posts
    247

    Post Relay Task List (Programmable!)

    Relay Task List

    This is my newest relay override. It shows a task list at the bottom of main.php that shows stuff you still need to do. But unlike some other scripts that might be similar, this one is programmable using ASH.

    If you don't know anything about ASH programming, that's OK! The task list comes preprogrammed with all of the in-run main quests as well as some side quests and The Sea. It's quite functional even if you never touch the programmable aspect, and the tasks will auto-update as I create more of them. Here's a screenshot:

    QzlOX7W.png

    You can see the different tasks that show up are automatically checked off when they are complete. Task sections are collapsible by clicking on the triangle next to them. Optional tasks have a white triangle. The tasks are hidden until they are relevant.

    To install, run this svn command in the CLI:

    Code:
    svn checkout https://svn.code.sf.net/p/rlbond86-mafia-scripts/code/task_list/trunk
    How to program your own tasks is shown in the next post.

  2. #2
    Senior Member
    Join Date
    Mar 2012
    Posts
    247

    Default

    Programming your own tasks

    You can manage all of the tasks with the relay script in the dropdown box of your relay browser (click on TaskEditor).

    You'll be greeted with the main screen:

    xvVWj8L.png

    oyEAULP.png

    You can click on that check mark to enable or disable a task, or use the up and down arrows to rearrange tasks within sections (more on sections later).

    You can click the "edit" button next to a task to change its code, or at the bottom, click "new task" to create a new task. Either way, you'll see the task editor. Here is an example:

    RnGbeOm.png

    This is the code for the "Open my Guild" task. Tasks are written in ASH and are a simple function. The header is written for you (you can see it takes a map called data, more on that later). Just fill in between the braces. There are three possible return values, all strings:

    • if the function returns "HIDDEN", it will not show up in the task list.
    • if the function returns "DONE", it is crossed off and marked as complete.
    • if it returns "OPEN", it shows up as uncompleted.


    You can see this function is pretty simple. It uses the built-in ASH function guild_store_available() to see if you've opened your guild, and returns "DONE" if you have. If you are not one of the default six classes, the task is not shown. Otherwise, it is marked as "OPEN". That's all! The task shows up in the task list.

    You can also have dynamic messages if the task is OPEN. Just return "OPEN my dynamic message goes here"; and your task will look like "My Task (my dynamic message goes here)". You can use html as well: return "OPEN <html><b>Bold message</b>" will work. You can do this in the name of the task too. Here is an example of a task with a dynamic message:

    GyqnvW3.png

    You can also mark tasks as optional by prefixing their name with "Optional: ". They will show up with a white triangle/bullet.

    Creating sections

    Sometimes a single quest has multiple tasks. You can group them with a section. Just create a new section with the "add section" button at the bottom, and you'll see the section editor:

    3ShlMuG.png

    The sections have a name and a few options, including when to hide the section and what to do when all of its constituent tasks are hidden or done. After creating the section, you will need to assign tasks to it by using the "Assign tasks to section" button at the top of the main interface. You can also use the "change section order" button to rearrange your sections.

  3. #3
    Senior Member
    Join Date
    Mar 2012
    Posts
    247

    Default

    Sharing tasks (import/export)

    The import/export button allows you to share your tasks with other people! Just click that button and you will reach the import/export screen. Check the tasks/sections you want to export and click the export button, and you'll be given code that can be used by other people. Paste exported code in the import line to import it.

    5hv7tcz.png

    Other stuff

    The data map is a special map that is passed to every task's evalTask function. You can add your own keys and values to this map to pass information between tasks, but do not use keys that start with an underscore, those names are reserved for the task engine. The data map is not persistent; it is cleared every time that tasks are evaluated. Tasks are always evaluated in sequential order. A common paradigm for complicated quests is an initialization task, that stores a bunch of data into the data map and then returns HIDDEN; see the Me and my Nemesis quest or The Sea quest for examples.

    If you need to import a script, it must be done in the global imports editor. There you can insert import statements.

  4. #4
    Developer
    Join Date
    Apr 2010
    Posts
    4,543

    Default

    Sounds good. When I tried it I got a 404 displayed under main and the following in CLI :
    Unknown variable 'script' (task_display.ash, line 4)
    Server returned response code 404 for task_display.php

  5. #5
    Senior Member
    Join Date
    Mar 2012
    Posts
    247

    Default

    Doh! Try "svn update" now. Didn't commit the latest change, of course

    EDIT: actually, give me 10 min to fix something else :/

    EDIT2: Ok, that's fixed.

  6. #6
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,091

    Default

    Loaded for me, except the charpane image for Mojo Points shows as broken.

    That said, as a philosophy issue, I think I would like this more if it were an option that I could select from the Run (relay) Script list rather than an unconditional override that is always there.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  7. #7
    Senior Member
    Join Date
    Mar 2012
    Posts
    247

    Default

    Loaded for me, except the charpane image for Mojo Points shows as broken.
    Originally Posted by fronobulax View Post
    Let me look into that? I have CHIT so I haven't seen anything to that effect.

    That said, as a philosophy issue, I think I would like this more if it were an option that I could select from the Run (relay) Script list rather than an unconditional override that is always there.
    I could work on this I think.

  8. #8

    Default

    I'd also prefer this as a standalone relay script. But still it's a nice and useful script, thank you.
    Last edited by livercat; 12-02-2013 at 05:48 PM.

  9. #9

  10. #10
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,091

    Default

    I think the Mojo Points might just be you? I'm not seeing anything on my end.
    Originally Posted by rlbond86 View Post
    http://127.0.0.1:60080/images/itemimages/mp.gif "has errors" according to my web browser so it is my problem, not yours. You were just the canary.

    Edit: And clearing browser and KoLmafia caches seems to have resolved it.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

Similar Threads

  1. 13880: Remove palinshelves from list of built-in relay files.
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 03-16-2014, 10:52 PM
  2. Feature - Implemented Display improvement to relay interface drop-down list.
    By Bale in forum Bug Reports
    Replies: 4
    Last Post: 07-01-2012, 07:23 PM
  3. Jar issues with Task Scheduler
    By bordemstirs in forum Community Support
    Replies: 4
    Last Post: 06-11-2011, 04:06 PM
  4. Ant 1.8.1 and Jarbundler task
    By MCroft in forum Unofficial Builds
    Replies: 43
    Last Post: 11-03-2010, 04:08 PM
  5. Replies: 0
    Last Post: 02-02-2010, 06:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •