Command for recording a song (wax record thing) help

I am trying to make a very simple script snippet that records a particular song for me as an AT. I don't need any robustness and am unsure about the command line needed.

Looking at the RecordSong.ash script, I have the following:

string output;
visit_url("volcanoisland.php?action=tuba&pwd");
visit_url("choice.php?whichchoice=409&option=1&pwd");
visit_url("choice.php?whichchoice=410&option=2&pwd");
visit_url("choice.php?whichchoice=412&option=3&pwd");
output = visit_url("choice.php?whichchoice=418&option=3&pwd");

This part is pretty straightforward, copied right from the script.
But then, the actual line that makes the recording is where I am stuck. He uses a Map and some funky match string to make it work. I want the easy translation of this.

skill [int] songs;
songs[0] = $skill["The Ballad of Richie Thingfinder"];
...
matcher m = create_matcher("\\\"(\\d*)\\\" >" + songs + " \\((\\d*)/(\\d*)\\)", output);
(what the heck!?!)
if (m.find()) {
... bunch of pricing stuff...

visit_url("choice.php?whichchoice=440&whicheffect=" + m.group(1) + "&times=" + casts + "&option=1&pwd");
(Ah, the GOLD!)

If all I care about is to do 1 recording of Thingfinder, what exactly should I replace the m.group(1) with? The rest is pretty straightforward setting &times=1 for 1 cast.

The matcher thing is what has me confused. I'd appreciate any assistance.

Finally, you would close the snippet with the 'leave' option:
visit_url("choice.php?whichchoice=440&option=2&pwd");
 

heeheehee

Developer
Staff member
Well, it's a regular expression. It'll be confusing. But let's see... it looks for a string that looks something like this:
"#">Song name (#/#), where # represents a number (probably different each time!), and Song name represents a song. My guess is that it's looking for the skill number, which would be $skill[The Ballad of Richie Thingfinder].to_int(). But if you have access to the HTML (since, well, you're probably an AT), you can confirm this for yourself.

Also, you have one of the visit_url()'s saved to output. Since the regular expression is parsing that particular page, if you're not going to use the regex, there's no need to save it as a variable. Just a pointer.
 
Last edited:

slyz

Developer
Or you could just remove the price checking part, and instead of using
PHP:
for i from 0 to 6
simply set i to the corresponding song in the songs map
 
Ah! I thought it took the name of the skill and did some finangling to it. All that to get a 0 thru 6. Thanks to the both of you. I look forward to testing it out later.
 

Bale

Minion
Ah! I thought it took the name of the skill and did some finangling to it. All that to get a 0 thru 6. Thanks to the both of you. I look forward to testing it out later.

It also finds the number of casts remaining for the day. That's very useful information in a fully automated script which doesn't know what you might have done already. It's just not terribly important for your purposes.
 

adeyke

Member
It seems the others have already explained most of it. I should note, though, that when you specify which song you want to record, you have to use the number for the effect, not the number for the skill. In the case of The Ballad of Richie Thingfinder, that would be 530.
 
Top