Relay Task List (Programmable!)

rlbond86

Member
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.
 
Last edited:

rlbond86

Member
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.
 
Last edited:

rlbond86

Member
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.
 
Last edited:

Darzil

Developer
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
 

rlbond86

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

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

EDIT2: Ok, that's fixed.
 
Last edited:

fronobulax

Developer
Staff member
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.
 

rlbond86

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

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.
 

livercat

Member
I'd also prefer this as a standalone relay script. But still it's a nice and useful script, thank you.
 
Last edited:

rlbond86

Member
By popular demand, there is now an option in the task editor to disable the main.php override. Also, the task editor can be accessed directly from the task list, and relay_TaskList can be used to check your current tasks.
 

livercat

Member
By popular demand, there is now an option in the task editor to disable the main.php override. Also, the task editor can be accessed directly from the task list, and relay_TaskList can be used to check your current tasks.

Thank you, works like a charm.
 

Bale

Minion
You two are cheaping out. We've still got almost another two weeks until Crimbo gets real! Ascend! Use this script!
 

fronobulax

Developer
Staff member
Never ascended character so definitely an edge case.

Explore Spookyraven Manor
• Unlock the second floor


appears but that is not the case. Bale's script does detect that the second floor is open so there is an opportunity here.

Also NS has been defeated so all of the tasks related to that are irrelevant but appear as to dos. Prism is correctly reported as unbroken, though.
 
Top