skills.php override -- train skills from the same page you use them

zarqon

Well-known member
Another simple relay script that I find quite handy, and suddenly felt like sharing.

This will add the "Train a Skill" section from your guild at the bottom of the skills page. Also, if you are in Bad Moon or a moxie sign, it will add a form to train the BM/gnomish skills you lack. (It does not check to make sure you have unlocked the gnomes though).

How to Use:
  • Download skills.ash to your relay directory.
  • Make sure you have enabled user-scripted overrides.
  • Enjoy!
 

Attachments

  • skills.ash
    2 KB · Views: 68
Last edited:

tOaDeR

Member
zarqon must share ALL his scripts, so he can spend all his time answering questions about them :p

actually, he should share them all because i'm sure they are all awesome. the reason why not, is stated above.
 

zarqon

Well-known member
Ha! Well, I semi-"officially" support the scripts I link to in my sig. The others I only support as the mood strikes me. Which tends to be often enough that people sometimes think I spend all my time answering questions about them.

And, I'm not actually so awesome that I would have some trove of unshared awesome scripts. The scripts I don't share are either a) clan-only, 2) unreleasable, or III) crappy little scrodged-together non-awesome scripts.
 

kain

Member
Ha! Well, I semi-"officially" support the scripts I link to in my sig. The others I only support as the mood strikes me. Which tends to be often enough that people sometimes think I spend all my time answering questions about them.

And, I'm not actually so awesome that I would have some trove of unshared awesome scripts. The scripts I don't share are either a) clan-only, 2) unreleasable, or III) crappy little scrodged-together non-awesome scripts.

I have a lot of that III group
 

Bale

Minion
Everyone has more of that III group just because it is so much easier to write inflexible scripts hardcoded to help a single character complete a goal in a specific way. Awesome scripts that would adjust automatically to the needs of any character are a lot harder to write. Hence many scripts don't get released.
 

Spiny

Member
Well.. I'm having a problem...

This works fine for my softcore AT and my softcore Sauceror. Both have unpurchased skills from the trainer and if I choose to, I believe I will be able to purchase them from the skills page thanks to your script. I haven't actually tested that part, but I do see them listed at least.

On my BM TT, I am neither seeing the available skills to purchase from trainer or the BM skills I haven't purchased yet.

Edit: Hrmm now my AT's skill page isn't showing your enhancements... I'll poke around and see if I botched something up somehow.

Edit again: Figured out how to fix the problem with my friend's help...

It appears that the little link that says "show unusable skills" or "hide unusable skills" is not anywhere on my skills.php page for my AT or my BM TT. I couldn't figure out where the link appeared from to begin with, I didn't change anything in account settings recently, so I have no idea how it could have been there, but isn't there now....

Anyhow, the fix:

Change line 39 from:
Code:
   results.replace_string("<br><a class=tiny href='skills.php?pwd", chunk+"<br><a class=tiny href='skills.php?pwd");

to

Code:
   results.replace_string("<form action=inv_use.php name=restorerform method=post>", chunk+"<form action=inv_use.php name=restorerform method=post>");
 
Last edited:

zarqon

Well-known member
I don't know that your fix will work for everyone either -- I'm pretty sure the restore form only appears if you have restore items in inventory! I guess I'll add this to my to-do list -- unless anyone feels like taking on a small scripting task? :)
 

zarqon

Well-known member
I still use it! Fixed version posted. Only tested with my main, but I think it should work for everyone.
 

Spiny

Member
Logging in with my aftercore TT with the updated version yielded the following error:

Code:
Begin index 4003 greater than end index 25 (skills.ash, line 35)
 

icon315

Member
do you already have all your skills bought?



i see the problem, this line
if (contains_text(page,"<b><u>Available skills:</u>"))

is made to check if you bought all your skill, but this shows up even if you bought the skills now......you have to find some difference in these pages in order for them to work
 
Last edited:

Spiny

Member
do you already have all your skills bought?



i see the problem, this line
if (contains_text(page,"<b><u>Available skills:</u>"))

is made to check if you bought all your skill, but this shows up even if you bought the skills now......you have to find some difference in these pages in order for them to work

I have not bought all the skills on this account, there are 3 skills I haven't gotten yet.
 

icon315

Member
hmmm well i found a fix for my problem....replacing line 34 with:
PHP:
if (contains_text(page,"(already trained)</font></td></tr></tbody>")) {
 

heeheehee

Developer
Staff member
The end index looks for " Meat)\"></td></tr></table>". Unless I'm looking at this all wrong, that should be " Meat)\"></td></form></tr>".

Edit: But for future reference, line 35 should read:
PHP:
chunk = substring(page,index_of(page,"<b><u>Available skills:</u>"),index_of(page," Meat)\"></td></form></tr>")+25);
 
Last edited:

zarqon

Well-known member
I copied that straight from the page text and it worked on my account. Either they made further tweaks since Day 1 or the text varies and needs further checking across classes / training levels. Also possibly noteworthy: I think some browsers "fix" page code that doesn't meet their standards -- which could effect scriptwriters viewing page source, but wouldn't affect operation of the script.

I'll change that to a last_index_of() and check it again with as many characters as I can to make sure it works for everyone.

EDIT: Looks like it's a form depending on whether or not you have the skill available to train, which makes lots of sense. Will post fix soon.
 
Last edited:

zarqon

Well-known member
Okay -- latest update should work for everyone. Further, it will now only show the skills you can actually train. Enjoy!
 
Top